Use aarch64_decode_insn in aarch64_displaced_step_copy_insn
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c1e7d6a8
AM
12015-11-03 Alan Modra <amodra@gmail.com>
2
3 * po/POTFILES.in: Regenerate.
4
26f187cd
NC
52015-10-30 Nick Clifton <nickc@redhat.com>
6
7 * po/zh_CN.po: New (simplified) Chinese translation.
8
41e83f2b
L
92015-10-29 H.J. Lu <hongjiu.lu@intel.com>
10
11 PR gold/19184
12 * incremental.cc (Got_plt_view_info): Add got_entry_size.
13 (Local_got_offset_visitor::visit): Replace got_entry_size_
14 with info_.got_entry_size.
15 (Local_got_offset_visitor::got_entry_size_): Removed.
16 (Global_got_offset_visitor::visit): Replace got_entry_size_
17 with info_.got_entry_size.
18 (Global_got_offset_visitor::got_entry_size_): Removed.
19 (Output_section_incremental_inputs::write_got_plt): Initialize
20 view_info.got_entry_size.
21 * target.h (Sized_target::got_entry_size): New virtual function.
22 * x86_64.cc (Target_x86_64::got_entry_size): New function.
23
238830c6
MK
242015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
25
26 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
27 * testsuite/script_test_12a.c: Likewise.
28 * testsuite/script_test_1a.cc: Likewise.
29 * testsuite/script_test_2.cc: Likewise.
30
bd890911
MK
312015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
32
33 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
34
a817ff49
MK
352015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
36
37 PR gold/18959
38 * stringpool.cc (Stringpool_template::new_key_offset): Align all
39 strings, even zero-length.
40 (Stringpool_template::set_string_offsets): Likewise.
41
e79a4bad
MK
422015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
43
44 * s390.cc: New file.
45 * Makefile.am (TARGETSOURCES): Add s390.cc.
46 (ALL_TARGETOBJS): Add s390.o.
47 * Makefile.in: Regenerate.
48 * configure.ac: Add s390 support.
49 * configure: Regenerate.
50 * configure.tgt: Add s390-*-* and s390x-*-*.
51 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
52 support.
53
6f97897d
MK
542015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
55
56 * archive.cc (Archive::sym64name): New const.
57 (Archive::setup): Add support for SYM64 armap.
58 (Archive::read_armap): Likewise.
59 (Archive::interpret_header): Likewise.
60 (Archive::const_iterator::read_next_header): Likewise.
61 * archive.h (Archive::sym64name): New const.
62 (Archive::read_armap): Add mapsize template parameter.
63
8d9743bd
MK
642015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
65
66 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
67 target-specific entry size.
68 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
69 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
70 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
71 hash_entry_size.
72 * target.h (Target::hash_entry_size): New method.
73 (Target::Target_info::hash_entry_size): New data member.
74
75 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
76 * arm.cc (Target_arm::arm_info): Likewise.
77 (Target_arm_nacl::arm_nacl_info): Likewise.
78 * i386.cc (Target_i386::i386_info): Likewise.
79 (Target_i386_nacl::i386_nacl_info): Likewise.
80 (Target_iamcu::iamcu_info): Likewise.
81 * mips.cc (Target_mips::mips_info): Likewise.
82 (Target_mips_nacl::mips_nacl_info): Likewise.
83 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
84 * sparc.cc (Target_sparc::sparc_info): Likewise.
85 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
86 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
87 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
88 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
89
3043c1ab
L
902015-10-28 H.J. Lu <hongjiu.lu@intel.com>
91
92 PR gold/19177
93 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
94 and R_386_GOT32X relocations without base register.
95
4d2f5d58
HS
962015-10.27 Han Shen <shenhan@google.com>
97
98 PR gold/19042 - unsupported reloc 311/312.
99
100 * aarch64.cc (Target_aarch64::Scan::local): Add support for
101 reloc 311/312.
102
2891b491
L
1032015-10-22 H.J. Lu <hongjiu.lu@intel.com>
104
105 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
106 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
107 as R_X86_64_GOTPCREL.
108 (Target_x86_64<size>::Scan::local): Likewise.
109 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
110 Likewise.
111 (Target_x86_64<size>::Scan::global): Likewise.
112 (Target_x86_64<size>::Relocate::relocate): Likewise.
113 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
114 Likewise.
115
493d4b48
L
1162015-10-22 H.J. Lu <hongjiu.lu@intel.com>
117
118 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
119 R_386_GOT32X the same as R_386_GOT32.
120 (Target_i386::Scan::local): Likewise.
121 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
122 (Target_i386::Scan::global): Likewise.
123 (Target_i386::Relocate::relocate): Likewise.
124 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
125 Likewise.
126
0fd15345
L
1272015-10-20 H.J. Lu <hongjiu.lu@intel.com>
128
129 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
130 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
131 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
132 x86_64_mov_to_lea1.o.
133 * testsuite/Makefile.in: Regenerated.
134
64571972
L
1352015-10-16 H.J. Lu <hongjiu.lu@intel.com>
136
137 PR gold/19119
138 * options.h (General_options): Remove "obsolete" from -m.
139 * parameters.cc (set_parameters_target): Check if input target
140 is compatible with output emulation set by "-m emulation".
141
01f573ad
L
1422015-10-13 H.J. Lu <hongjiu.lu@intel.com>
143
144 PR gold/19118
145 * i386.cc (Target_iamcu): New class.
146 (Target_selector_iamcu): Likewise.
147 (Target_iamcu::iamcu_info): New variable.
148 (target_selector_iamcu): Likewise.
149
3b0357da
AS
1502015-10-07 Andreas Schwab <schwab@suse.de>
151
152 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
153
9eacb935
CC
1542015-10-06 Cary Coutant <ccoutant@gmail.com>
155
156 PR gold/18855
157 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
158 parameter.
159 (Sparc_relocate_functions::gdop_lox10): Likewise.
160 (Target_sparc::Relocate::relocate): Use addend when computing
161 symbol value for R_SPARC_GOTDATA_OP*.
162
3d4fde69
CC
1632015-09-07 Cary Coutant <ccoutant@gmail.com>
164
165 PR gold/18930
166 PR gold/18886
167 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
168 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
169
358de988
L
1702015-09-02 H.J. Lu <hongjiu.lu@intel.com>
171
172 PR gold/18886
173 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
174 shared libraries into normal FUNC symbols.
175 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
176 symbols aren't from shared libraries.
177
d49044c7
AM
1782015-09-02 Alan Modra <amodra@gmail.com>
179
180 PR 18878
181 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
182 (Target_powerpc::Branch_info::make_stub): Determine whether long
183 branch stub is for save/restore function.
184 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
185 (Stub_table): Add need_save_res_.
186 (Stub_table:clear_stubs): Clear need_save_res_.
187 (Stub_table:set_address_and_size): Add save/restore section size.
188 (Stub_table::add_long_branch_entry): Add save_res param. Set
189 need_save_res_, but don't add space for save/restore stubs.
190 (Stub_table::find_long_branch_entry): Return offset to local copy
191 of save/restore func.
192 (Stub_table::do_write): Don't output save/restore stubs. Instead
193 copy the save/restore functions.
194 (Output_data_save_res:contents): New accessor.
195 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
196
7c61d651
CC
1972015-08-25 Cary Coutant <ccoutant@gmail.com>
198
199 PR gold/18847
200 * script-sections.cc (Memory_region::set_address): New method.
201 (Script_sections::find_memory_region): Add explicit_only parameter.
202 (Output_section_definition::set_section_addresses): Handle case where
203 script specifies both address and vma region.
204 * script-sections.h (Script_sections::find_memory_region): Add
205 explicit_only parameter.
206
4bfacfd3
CC
2072015-08-25 Cary Coutant <ccoutant@gmail.com>
208
209 PR gold/18859
210 * object.cc (Input_objects::add_object): Store objects in a map,
211 indexed by soname; update as-needed flag when necessary.
212 * object.h (Object::clear_as_needed): New method.
213 (Input_objects::so_names_): Change from set to map.
214
1757d35c
CC
2152015-08-25 Cary Coutant <ccoutant@gmail.com>
216
217 PR gold/14746
218 * expression.cc (Expression::Expression_eval_info): Add
219 is_valid_pointer field.
220 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
221 Adjust all callers.
222 (Addr_expression::value_from_output_section): Check whether address
223 is valid.
224 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
225 if evaluation failed due to address that is not yet valid.
226 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
227 parameter.
228
3ac0a36c
CC
2292015-08-25 Cary Coutant <ccoutant@gmail.com>
230
231 PR gold/18866
232 PR gold/18703
233 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
234
9215b98b
AM
2352015-08-20 Alan Modra <amodra@gmail.com>
236
237 PR gold/18846
238 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
239 Subtract os->address() from addend.
240 * powerpc.cc (relocate_relocs): Likewise.
241
40fc1451
SD
2422015-08-12 Simon Dardis <simon.dardis@imgtec.com>
243
244 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
245 lazy_stub_normal_1, lazy_stub_normal_1_n64,
246 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
247 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
248 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
249 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
250 of 'addu/daddu'.
251
37a42ee9
L
2522015-07-27 H.J. Lu <hongjiu.lu@intel.com>
253
254 * configure: Regenerated.
255
ab3b14b0
DK
2562015-07-26 Doug Kwan <dougkwan@google.com>
257
258 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
259 disassembler output format.
260
cdb06167
HS
2612015-07-23 Ian Coolidge <icoolidge@google.com>
262 Plumb --pic-veneer option for gold.
263
264 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
265 generation.
266 * options.h (General_options): Add --pic-veneer option.
267
5b2af7dd
L
2682015-07-22 H.J. Lu <hongjiu.lu@intel.com>
269
270 PR gold/18663
271 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
272 script_test_1a.cc script_test_1b.cc.
273 (script_test_11_r.o): Replace script_test_11.o with
274 script_test_11a.o script_test_11b.o.
275 (script_test_11.o): Removed.
276 (script_test_11a.o): New.
277 (script_test_11b.o): Likewise.
278 * testsuite/Makefile.in: Regenerated.
279 * testsuite/script_test_1.h: New file.
280 * testsuite/script_test_1b.cc: Likewise.
281 * testsuite/script_test_11.h: Likewise.
282 * testsuite/script_test_11b.c: Likewise.
283 * testsuite/script_test_1.cc: Renamed to ...
284 * testsuite/script_test_1a.cc: This.
285 Include "script_test_1.h".
286 (main): Call check_int and check_ptr.
287 * testsuite/script_test_11.c: Renamed to ...
288 * testsuite/script_test_11a.c: This.
289 Include "script_test_11.h".
290 (main): Call ptr_equal.
291
cd78ea77
L
2922015-07-22 H.J. Lu <hongjiu.lu@intel.com>
293
294 PR gold/18628
295 * testsuite/ifuncdep2.c (global): Change protected to hidden.
296 * testsuite/ifuncmod1.c (global): Likewise.
297 * testsuite/ifuncmod5.c (global): Likewise.
298
f945ba50
AM
2992015-07-22 Alan Modra <amodra@gmail.com>
300
301 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
302
5417c94d
CC
3032015-07-21 Cary Coutant <ccoutant@gmail.com>
304
305 PR gold/18548
306 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
307 forced local symbol even when oldsym != NULL.
308 (Symbol_table::do_define_in_output_segment): Likewise.
309 (Symbol_table::do_define_as_constant): Likewise.
310
cb5cf5e2
CC
3112015-07-21 Cary Coutant <ccoutant@gmail.com>
312
b8c6c5ef 313 PR gold/18698
cb5cf5e2
CC
314 * archive.cc (Library_base::should_include_member): Don't use entry
315 point for relocatable links, or if target is not yet valid.
316 * parameters.cc (Parameters::entry): Check target_valid().
317
0ef3814f
HS
3182015-07-20 Han Shen <shenhan@google.com>
319
320 Optimize erratum 843419 fix.
321
322 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
323 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
324 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
325 (E843419_stub): New sub-class of Erratum_stub.
326 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
327 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
328 (AArch64_relobj::create_erratum_stub): Add 1 argument.
329 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
330
2bca0377
HS
3312015-07-20 Han Shen <shenhan@google.com>
332
333 Fix arm elf header flags wrt hardfp bit.
334
335 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
336
f54f5e31
L
3372015-07-20 H.J. Lu <hongjiu.lu@intel.com>
338
339 PR gold/18689
340 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
341 from input group section for relocatable link.
342 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
343 (check_DATA): Add pr18689.stdout.
344 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
345 (pr18689.stdout): New rule.
346 (pr18689a.o): Likewise.
347 (pr18689b.o): Likewise.
348 (pr18689.o): Likewise.
349 * testsuite/pr18689.c: New file.
350 * testsuite/pr18689.sh: Likewise.
351 * testsuite/Makefile.in: Regenerated.
352
c20ceeb2
YW
3532015-07-20 Yiran Wang <yiran@google.com>
354 Cary Coutant <ccoutant@gmail.com>
355
356 PR gold/15574
357 * resolve.cc (Symbol_table): Remove warning about references
358 from shared objects to hidden symbols.
359 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
360 * testsuite/Makefile.in: Regenerate.
361 * testsuite/hidden_test.sh: Check dynamic symbol table; update
362 expected error messages.
363
19a7fe52
L
3642015-07-14 H.J. Lu <hongjiu.lu@intel.com>
365
366 * compressed_output.cc (Output_compressed_section::set_final_data_size):
367 Make --compress-debug-sections=zlib the same as
368 --compress-debug-sections=zlib-gabi.
369 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
370 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
371 ".zdebug_".
372 * testsuite/Makefile.in: Regenerated.
373
fb8b9dbc
L
3742015-07-12 H.J. Lu <hongjiu.lu@intel.com>
375
376 PR gold/18322
377 * compressed_output.cc (zlib_compress): Add argument for
378 compression header size. Set header size to compression header
379 size if it isn't 0. Don't write out the zlib header here.
380 (Output_compressed_section::set_final_data_size): Support
381 zlib-gnu and zlib-gabi compressions. Pass compression header
382 size to zlib_compress and write out compression header. Set
383 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
384 clear the SHF_COMPRESSED bit
385 * options.h (compress_debug_sections): Add zlib-gnu and
386 zlib-gabi.
387 * output.h (Output_section::set_flags): New.
388 * testsuite/Makefile.am (check_PROGRAMS): Add
389 flagstest_compress_debug_sections_none,
390 flagstest_compress_debug_sections_gnu and
391 flagstest_compress_debug_sections_gabi.
392 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
393 flagstest_compress_debug_sections.stdout,
394 flagstest_compress_debug_sections.cmp,
395 flagstest_compress_debug_sections.check,
396 flagstest_compress_debug_sections_gnu.stdout,
397 flagstest_compress_debug_sections_gnu.cmp,
398 flagstest_compress_debug_sections_gnu.check,
399 flagstest_compress_debug_sections_gabi.stdout,
400 flagstest_compress_debug_sections_gabi.cmp and
401 flagstest_compress_debug_sections_gabi.check.
402 (flagstest_compress_debug_sections_none): New.
403 (flagstest_compress_debug_sections_none.stdout): Likewise.
404 (flagstest_compress_debug_sections.stdout): Likewise.
405 (flagstest_compress_debug_sections.check): Likewise.
406 (flagstest_compress_debug_sections.cmp): Likewise.
407 (flagstest_compress_debug_sections_gnu): Likewise.
408 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
409 (flagstest_compress_debug_sections_gnu.check): Likewise.
410 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
411 (flagstest_compress_debug_sections_gabi): Likewise.
412 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
413 (flagstest_compress_debug_sections_gnu.check): Likewise.
414 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
415 * testsuite/Makefile.in: Regenerated.
416
48058663
L
4172015-07-12 H.J. Lu <hongjiu.lu@intel.com>
418
419 PR gold/18321
420 * compressed_output.h (decompress_input_section): Add arguments
421 for ELF class, big endian and sh_flags.
422 * compressed_output.cc (decompress_input_section): Likewise.
423 Support the SHF_COMPRESSED section.
424 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
425 functions.
426 * plugin.h (Pluginobj): Likewise.
427 * layout.cc (Layout::get_output_section_flags): Also clear the
428 SHF_COMPRESSED bit.
429 * object.h (Compressed_section_info): Add flag to store sh_flags.
430 (Object): Add pure virtual elfsize and is_big_endian member
431 functions.
432 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
433 prefix here.
434 (build_compressed_section_map): Check SHF_COMPRESSED for
435 uncompressed size. Store sh_flags in Compressed_section_info.
436 Pass size, big_endian and sh_flags to decompress_input_section.
437 Skip the ".debug"/".zdebug" prefix when passing section name to
438 need_decompressed_section.
439 (Sized_relobj_file<size, big_endian>::do_find_special_section):
440 Don't check ".zdebug_*" sections.
441 (Object::decompressed_section_contents): Pass ELF class, big
442 endian and sh_flags to decompress_input_section.
443 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
444 Likewise.
445 * testsuite/Makefile.am (check_DATA): Add
446 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
447 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
448 gdb_index_test_2_gabi.stdout.
449 (debug_msg_cdebug_gabi.o): New.
450 (odr_violation1_cdebug_gabi.o): Likewise.
451 (odr_violation2_cdebug_gabi.o): Likewise.
452 (debug_msg_cdebug_gabi.err): Likewise.
453 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
454 (gdb_index_test_cdebug_gabi.o): Likewise.
455 (gdb_index_test_2_gabi): Likewise.
456 (gdb_index_test_2_gabi.stdout): Likewise.
457 * testsuite/gdb_index_test_2_gabi.sh: New file.
458 * testsuite/Makefile.in: Regenerated.
459
73854cdd
HS
4602015-07-09 Han Shen <shenhan@google.com>
461
462 Use "gold_info" instead of "gold_warning" for erratum fix.
463
464 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
465 'gold_info'.
466 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
467
61163dfa
HS
4682015-07-09 Han Shen <shenhan@google.com>
469
470 Drop missing symbol warning for arm/aarch64.
471
472 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
473 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
474 symbol warning.
475
b91deca9
HS
4762015-07-07 Han Shen <shenhan@google.com>
477
478 Make gold aarch64 accept long form of mapping symbols.
479
480 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
481 of mapping symbols.
482
15162bef
DK
4832015-06-29 Doug Kwan <dougkwan@google.com>
484
485 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
486 at address expected by test.
487 * testsuite/arm_cortex_a8_b.s: Ditto.
488 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
489 * testsuite/arm_cortex_a8_bl.s: Ditto.
490 * testsuite/arm_cortex_a8_blx.s: Ditto.
491 * testsuite/arm_cortex_a8_local.s: Ditto.
492 * testsuite/arm_fix_v4bx.s: Ditto.
493 * testsuite/arm_unaligned_reloc.s: Ditto.
494 * testsuite/thumb_bl_out_of_range.s: Ditto.
495 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
496 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 497
56b06706
HS
4982015-06-29 Han Shen <shenhan@google.com>
499
500 Patch for erratum 843419 internal error.
501
72f4393d
L
502 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
503 (Erratum_stub::update_erratum_insn): New method.
504 (Stub_table::relocate_stubs): Modified to place relocated insn.
505 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 506
2f0c79aa
HS
5072015-06-12 Han Shen <shenhan@google.com>
508
509 Fix erratum 835769.
510
72f4393d
L
511 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
512 defintion outside class definition.
513 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
514 (AArch64_insn_utilities::aarch64_op31): New member.
515 (AArch64_insn_utilities::aarch64_ra): New member.
516 (AArch64_insn_utilities::aarch64_mac): New member.
517 (AArch64_insn_utilities::aarch64_mlxl): New member.
518 (ST_E_835769): New global enum member.
519 (Stub_table::relocate_stubs): Add 835769 handler.
520 (Stub_template_repertoire::Stub_template_repertoire): Install new
521 stub type.
522 (AArch64_relobj::scan_errata): This func is renamed from
523 scan_erratum_843419.
524 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
525 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
526 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
527 (Target_aarch64::scan_erratum_835769_span): New method.
528 (Target_aarch64::create_erratum_stub): New method.
529 (Target_aarch64::is_erratum_835769_sequence): New method.
530 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
531 code into create_erratum_stub.
532 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 533
5d7908e0
CC
5342015-06-11 Cary Coutant <ccoutant@gmail.com>
535
536 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
537 outside class body.
538 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
539
dd68f8fa
CC
5402015-06-11 Cary Coutant <ccoutant@gmail.com>
541
542 PR gold/17731
543 * layout.cc (corresponding_uncompressed_section_name): New function.
544 (Layout::choose_output_section): Call it.
545 * layout.h (corresponding_uncompressed_section_name): New function.
546 * script-sections.cc (Input_section_info::set_section_name): Check
547 for compressed debug section (.zdebug style).
548
a3a0c391
JY
5492015-06-11 Jing Yu <jingyu@google.com>
550
551 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
552 * testsuite/Makefile.in: Regenerate.
553
970cdef2
DI
5542015-06-11 Davide Italiano <dccitaliano@gmail.com>
555
556 * gold.h (is_cident): Correct typo.
557
a48d0c12
HS
5582015-06-10 Han Shen <shenhan@google.com>
559 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
560
561 Now fixing for 843419 is fully functional.
562
563 The first part of the erratum fix CL is here -
564 https://sourceware.org/ml/binutils/2015-04/msg00229.html
565
566 * aarch64.cc(global enum): New constants representing stub types.
567 (Stub_template): New POD struct.
568 (Stub_template_repertoire): New class.
569 (Stub_base): New class.
570 (Erratum_stub): New class.
571 (Reloc_stub): Refactored to be a subclass of Stub_base.
572 (Reloc_stub::Stub_type): Removed.
573 (Reloc_stub::offset): Moved to Stub_base.
574 (Reloc_stub::set_offset): Moved to Stub_base.
575 (Reloc_stub::destination_address): Moved to Stub_base.
576 (Reloc_stub::set_destination_address): Moved to Stub_base.
577 (Reloc_stub::reset_destination_address): Moved to Stub_base.
578 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
579 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
580 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
581 (Reloc_stub::write): Moved to Stub_base.
582 (Reloc_stub::invalid_offset): Moved to Stub_base.
583 (Reloc_stub::invalid_address): Moved to Stub_base.
584 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
585 (Reloc_stub::stub_insns_): Moved to Stub_base.
586 (Reloc_stub::offset_): Moved to Stub_base.
587 (Reloc_stub::destination_address_): Moved to Stub_base.
588 (Stub_table::The_aarch64_relobj): New typedef.
589 (Stub_table::The_erratum_stub): New typedef.
590 (Stub_table::The_erratum_stub_less): New typedef.
591 (Stub_table::The_erratum_stub_set): New typedef.
592 (Stub_table::The_erratum_stub_set_iter): New typedef.
593 (Stub_table::empty): Added emptiness testing for erratum stubs.
594 (Stub_table::add_erratum_stub): New method to add an erratum stub.
595 (Stub_table::find_erratum_stub): New method.
596 (Stub_table::find_erratum_stubs_for_input_section): New method.
597 (Stub_table::erratum_stub_address): New method.
598 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
599 (Stub_table::do_addralign): Modified to handle erratum stubs.
600 (Stub_table::erratum_stubs_): New member.
601 (Stub_table::erratum_stub_size_): New member.
602 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
603 (Stub_table::do_write): Modified to handle erratum stubs.
604 (AArch64_relobj::The_erratum_stub): New typedef.
605 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
606 (AArch64_relobj::fix_errata): New method.
607 (Target_aarch64::The_reloc_stub_type): Removed.
608 (Target_aarch64::The_erratum_stub): New typede.
609 (AArch64_relocate_functions::construct_b): New method.
610
1e1b2efc
NC
6112015-06-08 Nick Clifton <nickc@redhat.com>
612
613 * po/fr.po: New French Translation.
614
b8cf5075
CC
6152015-06-07 Cary Coutant <ccoutant@gmail.com>
616
617 PR gold/18288
618 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
619 callers. Don't use STT_COMMON to check for common symbols.
620 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
621 symbol that's not in a common section.
622 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
623 common symbols.
624
bdd2d2b7
CC
6252015-06-04 Cary Coutant <ccoutant@gmail.com>
626
627 PR gold/18200
628 * Makefile.am (diststuff): Add target.
629 * Makefile.in: Regenerate.
630
cd3c333f
CC
6312015-06-04 Cary Coutant <ccoutant@gmail.com>
632
633 PR gold/17498
634 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
635 temporary locals in merge sections.
636 * options.cc (General_options::parse_discard_all): New method.
637 (General_options::parse_discard_locals): New method.
638 (General_options::parse_discard_none): New method.
639 (General_options::General_options): Initialize discard_locals_.
640 * options.h (--discard-all): Convert to special option.
641 (--discard-locals): Likewise.
642 (--discard-none): New option.
643 (General_options::discard_all): New method.
644 (General_options::discard_locals): New method.
645 (General_options::discard_sec_merge): New method.
646 (General_options::Discard_locals): New enum.
647 (General_options::discard_locals_): New data member.
648
8086551f
CC
6492015-06-03 Cary Coutant <cary@google.com>
650
651 * script-sections.cc (Script_sections::Script_sections): Initialize
652 segments_created_.
653 (Script_sections::create_note_and_tls_segments): Set flag when
654 segments are created.
655 (Script_sections::expected_segment_count): Count PT_INTERP.
656 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
657 segments are created.
658 * script-sections.h (Script_sections::segments_created_): New data
659 member.
660
374082df
CC
6612015-06-03 Cary Coutant <ccoutant@gmail.com>
662
663 PR gold/15370
664 * script-sections.cc
665 (Output_section_element_input::set_section_addresses): When there
666 are several patterns with no sort spec, put all sections in the same
667 bin.
668 * testsuite/Makefile.am (script_test_12): New testcase.
669 (script_test_12i): New testcase.
670 * testsuite/Makefile.in: Regenerate.
671 * testsuite/script_test_12.t: New test linker script.
672 * testsuite/script_test_12i.t: New test linker script.
673 * testsuite/script_test_12a.c: New test source file.
674 * testsuite/script_test_12b.c: New test source file.
675
775ed62e
CC
6762015-06-02 Cary Coutant <ccoutant@gmail.com>
677
678 * nacl.h (Sniff_file): Switch parameters to get_view to get an
679 aligned view.
680
9c7fe3c5
CC
6812015-06-03 Cary Coutant <ccoutant@gmail.com>
682
72f4393d
L
683 PR gold/17819
684 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
685 separate task to schedule the build id computation.
686 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
687 add Output_file and offset.
688 (Hash_task::run): Get and release the input views.
689 (Hash_task::is_runnable): Always return NULL (always runnable).
690 (Layout::queue_build_id_tasks): Remove.
691 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
692 parameters; use them instead of class members.
693 (Build_id_task_runner::run): New function.
694 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
695 to write_build_id.
696 * layout.h (Layout::queue_build_id_tasks): Remove.
697 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
698 parameters.
699 (Layout::array_of_hashes_): Remove.
700 (Layout::size_of_array_of_hashes_): Remove.
701 (Layout::input_view_): Remove.
702 (Build_id_task_runner): New class.
703 (Close_task_runner::Close_task_runner): Add array_of_hashes and
704 size_of_hashes parameters.
705 (Close_task_runner::array_of_hashes_): New data member.
706 (Close_task_runner::size_of_hashes_): New data member.
707 * testsuite/Makefile.am
708 (flagstest_compress_debug_sections_and_build_id_tree): New test.
709 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 710
400f8944
RÁE
7112015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
712
713 * merge.cc (get_input_merge_map): Update for data structure change.
714 (get_or_make_input_merge_map): Update for data structure change.
715 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
716 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
717
bbec1a5d
AM
7182015-05-16 Alan Modra <amodra@gmail.com>
719
720 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
721 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
722 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
723 (lis_0): Rename from lis_0_0.
724
efc6fa12
CC
7252015-04-29 Cary Coutant <cary@google.com>
726 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
727
728 * gc.h (Garbage_collection::is_section_garbage): Change Object*
729 to Relobj*.
730 (Garbage_collection::add_reference): Likewise.
731 (Garbage_collection::gc_process_relocs): Likewise. Don't push
732 object/shndx pair onto *secvec for dynamic objects. Don't follow
733 relocations pointing to dynamic objects for GC.
734 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
735 (Icf::unfold_section): Likewise.
736 (Icf::is_section_folded): Likewise.
737 (Icf::get_folded_section): Likewise.
738 * icf.h: (Icf::get_folded_section): Likewise.
739 (Icf::unfold_section): Likewise.
740 (Icf::is_section_folded): Likewise.
741 (Icf::section_has_function_pointers): Likewise.
742 (Icf::set_section_has_function_pointers): Likewise.
743 * object.h (Section_id): Likewise.
744 (Const_section_id): Likewise.
745 * output.cc (Output_section::update_section_layout): Likewise.
746 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
747 Likewise.
748 * plugin.cc (update_section_order): Likewise.
749 (unique_segment_for_sections): Likewise.
750 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
751 (Target_powerpc::do_gc_add_reference): Likewise.
752 (Target_powerpc::gc_process_relocs): Likewise.
753 (Target_powerpc::do_gc_add_reference): Likewise.
754 * symtab.cc (Symbol_table::is_section_folded): Likewise.
755 (Symbol_table::gc_mark_symbol): Likewise.
756 * symtab.h: (Symbol_table::is_section_folded): Likewise.
757 * target.h: (Sized_target::gc_add_reference): Likewise.
758 (Sized_target::do_gc_add_reference): Likewise.
759
f9d3ecaa
NC
7602015-04-29 Nick Clifton <nickc@redhat.com>
761
762 * po/fi.po: Updated Finnish translation.
763
faa2211d
AM
7642015-04-28 Alan Modra <amodra@gmail.com>
765
766 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
767 than unsigned int for find_global_entry result temp. Compare
768 against invalid_address.
769 (Target_powerpc::do_plt_address_for_global): Likewise.
770 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
771 on plt call stub existence for debug info. Do assert for plt
772 and global entry stub existence if an alloc section.
773
6ec65f28
AM
7742015-04-28 Alan Modra <amodra@gmail.com>
775
776 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
777 on missing global entry stub due to bogus debug info.
778
7a2a1c79
HS
7792015-04-27 Han Shen <shenhan@google.com>
780
781 * options.h (--fix-cortex-a53-843419): Rename option.
782 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
783 option.
784 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
785
cfbf0e3c
RÁE
7862015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
787
788 PR gold/18327
789 * output.cc (Output_section::is_input_address_mapped): Assume a missing
790 entry is mapped.
791 * testsuite/Makefile.am: Add the eh_test test.
792 * testsuite/Makefile.in: Regenerate.
793 * testsuite/eh_test_a.cc: New test.
794 * testsuite/eh_test_b.cc: New test.
795
6ec65f28
AM
7962015-04-23 Sriraman Tallam <tmsriram@google.com>
797
a100d66f
ST
798 * options.h (--weak-unresolved-symbols): New option.
799 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
800 binding to weak with new option.
801 * symtab.h (is_weak_undefined): Check for new option.
802 (is_strong_undefined): Check for new option.
803 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
804 * testsuite/Makefile.in: Regenerate.
805 * testsuite/weak_unresolved_symbols_test.cc: New file.
806
4b889c30
IC
8072015-04-20 Ian Coolidge <icoolidge@google.com>
808
809 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
810 GNU_UNIQUE.
811
4277535c
RÁE
8122015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
813
814 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
815 push_back.
816 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
817 * object.cc (Sized_relobj_file::do_layout): Use push_back.
818 * powerpc.cc (process_gc_mark): Use push_back.
819 (Target_powerpc::do_gc_mark_symbol): Use push_back.
820 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
821
7a2a1c79 8222015-04-16 Han Shen <shenhan@google.com>
5019d64a 823
6ec65f28
AM
824 * aarch64.cc (AArch64_insn_utilities): New utility class.
825 (AArch64_relobj::Mapping_symbol_position): New struct.
826 (AArch64_relobj::Mapping_symbol_info): New typedef.
827 (AArch64_relobj::do_count_local_symbols): New function overriding
828 parent's implementation.
829 (AArch64_relobj::mapping_symbol_info_): New member
830 (AArch64_relobj::scan_erratum_843419): New method.
831 (Target_aarch64::scan_erratum_843419_span): New method.
832 (Target_aarch64::is_erratum_843419_sequence): New method.
833 * options.h (fix_cortex_a53): New option.
5019d64a 834
a6a17750
CC
8352015-04-09 Cary Coutant <ccoutant@google.com>
836
837 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
838 in a PIE link.
839 * testsuite/Makefile.am (tls_pie_test.sh): New test.
840 * testsuite/Makefile.in: Regenerate.
841 * testsuite/tls_pie_test.sh: New.
842
437ddf0c
CC
8432015-04-09 Cary Coutant <ccoutant@google.com>
844
845 * debug.h (DEBUG_LOCATION): New.
846 (DEBUG_ALL): Include DEBUG_LOCATION.
847 (debug_string_to_enum): Add DEBUG_LOCATION.
848 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
849 output to print correct context.
850 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
851 up to 4 more locations at the beginning of the function.
852 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
853 result before sorting list of line numbers.
854 * testsuite/debug_msg.sh: Allow range of line numbers for
855 canonical results on optimized code.
856
24491327
HS
8572015-04-07 HC Yen <hc.yen@mediatek.com>
858
859 Add AArch32 support for gold linker.
860 gold/
861 * arm.cc: Add V8 arch combine table.
862
7fa5525f
RÁE
8632015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
864
865 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
866
5368dcf2
RÁE
8672015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
868
869 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
870 to find by using the return value of insert.
871
9dbb4b02
RÁE
8722015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
873
874 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
875 constructor call.
876
1fa29f10
IT
8772015-04-06 Ilya Tocar <ilya.tocar@intel.com>
878
879 PR gold/17641
880 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
881 (Target_x86_64::Scan::local): Don't create GOT entry, when we
882 can convert mov to lea.
883 (Target_x86_64::Scan::global): Ditto.
884 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
885 %reg to lea foo(%rip), %reg if possible.
886 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
887 * testsuite/x86_64_mov_to_lea1.s: New.
888 * testsuite/x86_64_mov_to_lea2.s: Ditto.
889 * testsuite/x86_64_mov_to_lea3.s: Ditto.
890 * testsuite/x86_64_mov_to_lea4.s: Ditto.
891 * testsuite/x86_64_mov_to_lea.sh: Ditto.
892
39f3de7c
L
8932015-04-02 H.J. Lu <hongjiu.lu@intel.com>
894
895 * configure: Regenerated.
896
c4fc4724
IT
8972015-04-01 Ilya Tocar <ilya.tocar@intel.com>
898
899 PR gold/17640
900 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
901 (Target_i386::Scan::local): Don't create GOT entry, when we
902 can convert GOT to GOTOFF.
903 (Target_i386::Scan::global): Ditto.
904 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
905 lea foo@GOTOFF(%reg), %reg if possible.
906 * testsuite/Makefile.am (i386_mov_to_lea): New test.
907 * testsuite/i386_mov_to_lea1.s: New.
908 * testsuite/i386_mov_to_lea2.s: Ditto.
909 * testsuite/i386_mov_to_lea3.s: Ditto.
910 * testsuite/i386_mov_to_lea4.s: Ditto.
911 * testsuite/i386_mov_to_lea5.s: Ditto.
912 * testsuite/i386_mov_to_lea.sh: Ditto.
913
918357b9
L
9142015-04-01 H.J. Lu <hongjiu.lu@intel.com>
915
916 * Makefile.am (ZLIB): New.
917 (ZLIBINC): Likewise.
918 (AM_CFLAGS): Add $(ZLIBINC).
919 (AM_CXXFLAGS): Likewise.
920 (ldadd_varldadd_var): Add $(ZLIB).
921 (incremental_dump_LDADD): Likewise.
922 (dwp_LDADD): Likewise.
923 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
924 <zlib.h>.
925 (zlib_compress): Don't check HAVE_ZLIB_H.
926 (zlib_decompress): Likewise.
927 * options.h (compress_debug_sections): Likewise.
928 * configure.ac (AM_CONDITIONAL): Removed.
929 * testsuite/Makefile.am (ZLIB): New.
930 (LDADD): Add $(ZLIB).
931 Don't check HAVE_ZLIB.
932 * Makefile.in: Regenerated.
933 * config.in: Likewise.
934 * configure: Likewise.
935 * testsuite/Makefile.in: Likewise.
936
6b0ad2eb
JY
9372015-03-30 Jing Yu <jingyu@google.com>
938
939 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
940 TLSLD_ADD_DTPREL_LO12_NC.
941 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
942 _TLS_MODULE_BASE_ point to the start of tls segment.
943 (Target_aarch64::optimize_tls_reloc): Add cases for
944 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
945 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
946 (Target_aarch64::Scan::local): Likewise.
947 (Target_aarch64::Scan::global): Likewise.
948 (Target_aarch64::Relocate::relocate): Likewise.
949 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
950 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
951 relocations.
952
0916f9e7
RÁE
9532015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
954
955 * merge.cc (Object_merge_map::add_mapping): call
956 Object_merge_map::Input_merge_map::add_mapping.
957 (Object_merge_map::Input_merge_map::add_mapping): New.
958 (Output_merge_data::do_add_input_section): Call
959 get_or_make_input_merge_map before a loop.
960 (Output_merge_string<Char_type>::finalize_merged_data): Call
961 get_or_make_input_merge_map before a loop.
962 * merge.h (Object_merge_map): Make Input_merge_map public.
963 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
964 (Relobj::get_or_create_merge_map): New.
965 * object.h (Relobj::get_or_create_merge_map): New.
966
282c9750
AM
9672015-03-24 Alan Modra <amodra@gmail.com>
968
969 PR 18147
970 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
971 relocation errors for branches to strong undefined symbols.
972
67f95b96
RÁE
9732015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
974
975 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
976 (Object_merge_map::is_merge_section_for): Remove.
977 (Object_merge_map::find_merge_section): New.
978 * merge.h (Object_merge_map::is_merge_section_for): Remove.
979 (Object_merge_map::find_merge_section): New.
980 (Object_merge_map::get_input_merge_map): Add a const version.
981 * object.cc (Relobj::is_merge_section_for): Remove.
982 (Relobj::find_merge_section): New.
983 * object.h (Relobj::is_merge_section_for): Remove.
984 (Relobj::find_merge_section): New.
985 * output.cc
986 (Output_section::Input_section::is_merge_section_for): Remove.
987 (Output_section::add_merge_input_section): Don't call
988 add_merge_input_section.
989 (Output_section::find_merge_section): Return const. Use
990 object->find_merge_section.
991 (Output_section::build_lookup_maps): Don't build a map for
992 merge sections.
993 (Output_section::is_input_address_mapped): Return false if
994 section is not found.
995 (Output_section::find_starting_output_address): Use
996 find_merge_section instead of is_merge_section_for.
997 (Output_section::add_script_input_section): Don't build a map for
998 merge sections.
999 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1000 (Output_section_lookup_maps::find_merge_section): Remove.
1001 (Output_section_lookup_maps::add_merge_input_section) Remove.
1002 (Output_section::find_merge_section): Return const.
1003
152f7024
CC
10042015-03-22 Cary Coutant <cary@google.com>
1005
1006 PR gold/18106
1007 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1008 non-SIB form of lea, with nop after the call.
1009
bccffdfd
CC
10102015-03-21 Cary Coutant <cary@google.com>
1011
1012 PR gold/14217
1013 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1014 .tdata section.
1015 (Output_segment::set_section_addresses): Don't align size of relro
1016 segment for .tbss.
1017
1c582fe7
CC
10182015-03-21 Cary Coutant <cary@google.com>
1019
1020 PR gold/18010
1021 * stringpool.cc (Stringpool_template): Don't optimize if section
1022 alignment is greater than sizeof(char).
1023
410da591
CC
10242015-03-21 Cary Coutant <cary@google.com>
1025
1026 PR gold/18048
1027 * script-c.h (script_include_directive): Add first_token parameter.
1028 * script.cc (script_include_directive): Add first_token parameter, and
1029 pass it to read_script_file.
1030 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1031 (PARSING_MEMORY_DEF): New tokens.
1032 (top): Add new productions for INCLUDE files.
1033 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1034 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1035 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1036 (section_cmd): Pass PARSING_SECTION_CMDS.
1037 (file_or_sections_cmd): Remove.
1038 (memory_def): Pass PARSING_MEMORY_DEF.
1039 * testsuite/Makefile.am (memory_test_2): New test.
1040 * testsuite/Makefile.in: Regenerate.
1041 * testsuite/memory_test_inc.t: New script file.
1042 * testsuite/memory_test_inc_1.t.src: New script file.
1043 * testsuite/memory_test_inc_2.t.src: New script file.
1044 * testsuite/memory_test_inc_3.t.src: New script file.
1045
0d5bbdb0
CC
10462015-03-21 Cary Coutant <cary@google.com>
1047
1048 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1049 (Sized_relobj_dwo::setup): Build compressed section map.
1050 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1051 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1052 section map.
1053 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1054 compressed_sections_ field.
1055 (build_compressed_section_map): Take Object instead of
1056 Sized_relobj_file parameter; add decompress_if_needed parameter.
1057 (Sized_relobj_file::do_find_special_sections): Store compressed
1058 section map in parent Object.
1059 (Sized_relobj_file::do_decompressed_section_contents): Move
1060 implementation to Object::decompressed_section_contents.
1061 (Sized_relobj_file::do_discard_decompressed_sections): Move
1062 implementation to Object::discard_decompressed_sections.
1063 * object.h (build_compressed_section_map): Declare.
1064 (Object::Object): Add compressed_sections_ field.
1065 (Object::section_is_compressed): Move implementation here.
1066 (Object::decompressed_section_contents): De-virtualize.
1067 (Object::discard_decompressed_sections): De-virtualize.
1068 (Object::do_section_is_compressed): Delete.
1069 (Object::do_decompressed_section_contents): Delete.
1070 (Object::set_compressed_sections): New method.
1071 (Object::compressed_sections): New method.
1072 (Object::compressed_sections_): New data member.
1073 (Compressed_section_info, Compressed_section_map): Move to top of file.
1074 (Sized_relobj_file::do_section_is_compressed): Delete.
1075 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1076 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1077 (Sized_relobj_file::compressed_sections_): Move to Object class.
1078
bd9e0d46
CC
10792015-03-21 Cary Coutant <ccoutant@google.com>
1080
1081 PR gold/18152
1082 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1083 deferred objects.
1084
943c8b43
CC
10852015-03-11 Cary Coutant <ccoutant@google.com>
1086
1087 * options.cc (General_options::finalize): Don't allow -z relro
1088 with incremental linking.
1089 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1090 (incremental_test_2): Likewise.
1091 (incremental_test_3): Likewise.
1092 (incremental_test_4): Likewise.
1093 (incremental_test_5): Likewise.
1094 (incremental_test_6): Likewise.
1095 (incremental_copy_test): Likewise.
1096 (incremental_common_test_1): Likewise.
1097 (incremental_comdat_test_1): Likewise.
1098 * testsuite/Makefile.in: Regenerate.
1099
e1663197
CC
11002015-03-09 Cary Coutant <ccoutant@google.com>
1101
1102 PR gold/14675
1103 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1104 return enum indicating whether .eh_frame section is empty, optimizable,
1105 unrecognized, or an end marker. Adjust explicit instantiations.
1106 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1107 (Eh_frame::add_ehframe_input_section): Change return type.
1108 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1109 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1110 to the .eh_frame output section until we see the end marker.
1111 (Layout::finalize_eh_frame_section): New.
1112 * layout.h: (Layout::finalize_eh_frame_section): New.
1113
beb8418f
L
11142015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1115
1116 * output.cc (Relobj::initialize_input_to_output_map<size>):
1117 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1118
48c73428
CC
11192015-03-04 Cary Coutant <ccoutant@google.com>
1120
1121 * parameters.cc (Parameters::set_target_once): Call
1122 Target::select_as_default_target just once from here...
1123 (set_parameters_target): ...instead of from here.
1124
11252015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1126
1127 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1128 Output_section_data instead of a Merge_map.
1129 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1130 (Eh_frame::read_cie): Use add_merge_mapping instead of
1131 Merge_map::add_mapping.
1132 (Eh_frame::read_fde): Ditto.
1133 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1134 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1135 merge_map_->get_output_offset.
1136 (Eh_frame::do_is_merge_section_for): Delete.
1137 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1138 instead of a Merge_map.
1139 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1140 Merge_map.
1141 (Eh_frame::do_is_merge_section_for): Delete.
1142 (Eh_frame::merge_map_): Delete.
1143 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1144 and use a Output_section_data instead of a Merge_map.
1145 (Object_merge_map::add_mapping): Ditto.
1146 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1147 (Object_merge_map::is_merge_section_for): Pass in and use a
1148 Output_section_data instead of a Merge_map.
1149 (Merge_map): Delete.
1150 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1151 of merge_map_.get_output_offset.
1152 (Output_merge_base::do_is_merge_section_for): Delete.
1153 (Output_merge_data::do_add_input_section): Use
1154 object->add_merge_mapping instead of add_mapping.
1155 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1156 * merge.h (Merge_map): Delete forward declaration.
1157 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1158 instead of a Merge_map.
1159 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1160 (Object_merge_map::is_merge_section_for): Pass in and use a
1161 Output_section_data instead of a Merge_map.
1162 (Input_merge_map::Object_merge_map::merge_map): Replace with
1163 output_data.
1164 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1165 Output_section_data instead of a Merge_map.
1166 (Merge_map): Delete.
1167 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1168 (Output_merge_base::do_is_merge_section_for): Delete.
1169 (Output_merge_base::add_mapping): Delete.
1170 (Output_merge_base::merge_map_): Delete.
1171 * object.cc (Relobj::initialize_input_to_output_map): New.
1172 (Relobj::initialize_input_to_output_map): New.
1173 (Relobj::merge_output_offset): New.
1174 (Relobj::is_merge_section_for): New.
1175 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1176 bits.
1177 * object.h (Relobj::merge_map): Delete.
1178 (initialize_input_to_output_map): New.
1179 (set_merge_map): Delete.
1180 (add_merge_mapping): New.
1181 (merge_output_offset): New.
1182 (is_merge_section_for): New.
1183 * output.cc (Output_section::Input_section::is_merge_section_for):
1184 Use object->is_merge_section_for.
1185 * output.h (Output_section_data::is_merge_section_for): Delete.
1186 (Output_section_data::do_is_merge_section_for): Delete.
1187 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1188 Use object->initialize_input_to_output_map.
1189 (Merged_symbol_value<size>::value_from_output_section): Use
1190 object->merge_output_offset.
1191
48c73428 11922015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1193 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1194
1195 * output.cc (Output_section::add_merge_input_section): Do not
1196 attempt to merge sections with an entsize of 0.
1197
48c73428 11982015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1199
1200 * attributes.h (class Output_attributes_section_data ): Add
1201 do_print_to_mapfile function.
1202
ec86f434
AM
12032015-02-24 Alan Modra <amodra@gmail.com>
1204
1205 PR 18010
1206 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1207 complain if value is not a multiple of four.
1208 (Target_powerpc::Relocate::relocate): Correct handling of
1209 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1210
be66981e
L
12112015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1212
1213 * configure.ac (default_size): Set to 32 for x32.
1214 * configure: Regenerated.
1215
e3ee8ed4
AM
12162015-02-18 Alan Modra <amodra@gmail.com>
1217
1218 PR 17954
1219 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1220 visibility.
1221
3a935c6c
RÁE
12222015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1223
1224 * gc.h (Garbage_collection::add_reference): Don't use find.
1225
e0a1e121
RÁE
12262015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1227
1228 * object.cc (write_local_symbols): avoid std::vector copy.
1229
45a4fb1a
RÁE
12302015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1231
1232 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1233
2d9afefe
MW
12342015-02-09 Mark Wielaard <mjw@redhat.com>
1235
1236 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1237 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1238
e9c1bdad
CC
12392015-02-16 Cary Coutant <ccoutant@google.com>
1240
1241 PR gold/13577
1242 PR gold/16992
1243 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1244 DF_SYMBOLIC if --dynamic-list option is used.
1245 * options.cc (General_options::finalize): --dynamic-list is not
1246 mutually exclusive with -Bsymbolic.
1247 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1248 listed in --dynamic-list.
1249 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1250 -Bsymbolic-functions.
1251 * testsuite/Makefile.in: Regenerate.
1252
0ed4b0bf
CC
12532015-02-16 Cary Coutant <ccoutant@google.com>
1254
1255 PR gold/17971
1256 * incremental.cc: Remove redundant include of "output.h".
1257
1a920511
JY
12582015-02-12 Jing Yu <jingyu@google.com>
1259
1260 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1261 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1262 New relocation.
1263 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1264 TLSLE_MOVW_* relocations.
1265 (Target_aarch64::Scan::global): Likewise.
1266 (Target_aarch64::Relocate::relocate): Likewise.
1267 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1268 for new TLSLE_MOVW_* relocations.
1269
07f107f3
WN
12702015-02-11 Will Newton <will.newton@linaro.org>
1271
1272 PR gold/13321
1273 * arm.cc (Target_arm::make_plt_section): Create an ARM
1274 state mapping symbol at the start of the PLT.
1275
e051a5b5
L
12762015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1277
1278 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1279 Replace two_file_shared_2.so with two_file_shared_1.so.
1280 * testsuite/Makefile.in: Regenerated.
1281
dddcc5b9
AM
12822015-02-09 Alan Modra <amodra@gmail.com>
1283
1284 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1285 plugin_test_thin.a and defsym_test.
1286 * testsuite/Makefile.in: Regenerate.
1287
b39b8b9d
RÁE
12882015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1289
1290 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1291 body.
1292
b66d1c52
CC
12932015-02-04 Peter Collingbourne <pcc@google.com>
1294
1295 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1296 forwarding symbols when computing symbol resolution info for plugins.
1297 * plugin.h (Plugin_manager::symtab): New method.
1298 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1299
23081de0
CC
13002015-02-03 Cary Coutant <ccoutant@google.com>
1301 Peter Collingbourne <pcc@google.com>
1302
1303 PR gold/15660
1304 * archive.cc (Thin_archive_object_unlocker): New class.
1305 (Archive::include_member): Unlock external members of thin archives.
1306 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1307 (plugin_test_2): Likewise.
1308 (plugin_test_3): Likewise.
1309 (plugin_test_4): Likewise.
1310 (plugin_test_5): Likewise.
1311 (plugin_test_6): Likewise.
1312 (plugin_test_7): Likewise.
1313 (plugin_test_8): Likewise.
1314 (plugin_test_9): Likewise.
1315 (plugin_test_10): Likewise.
1316 (plugin_test_11): New test case.
1317 * testsuite/Makefile.in: Regenerate.
1318 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1319 file to decide whether to claim file.
1320 (all_symbols_read_hook): Likewise.
1321 * testsuite/plugin_test_1.sh: Adjust expected output.
1322 * testsuite/plugin_test_2.sh: Likewise.
1323 * testsuite/plugin_test_3.sh: Likewise.
1324 * testsuite/plugin_test_6.sh: Likewise.
1325 * testsuite/plugin_test_tls.sh: Likewise.
1326 * testsuite/plugin_test_11.sh: New testcase.
1327
13282015-02-03 Cary Coutant <ccoutant@google.com>
1329
1330 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1331 file descriptors when debugging enabled. Add debug output.
1332 (Descriptors::release): Add debug output.
1333 (Descriptors::close_some_descriptor): Likewise.
1334 (Descriptors::close_all): Likewise.
1335 * fileread.cc (File_read::lock): Likewise.
1336 (File_read::unlock): Likewise.
1337
24dd5808
CC
13382015-02-02 Cary Coutant <ccoutant@google.com>
1339
1340 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1341 executable output file.
1342
fa89cc82
HS
13432015-01-22 Han Shen <shenhan@google.com>
1344
1345 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1346 (Target_arm::do_plt_address_for_global): New method.
1347 (Target_arm::do_plt_address_for_local): New method.
1348 (Target_arm::rel_irelative_section): New method.
1349 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1350 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1351 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1352 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1353 (Target_arm::Scan::check_non_pic): Add ifunc support.
1354 (Target_arm::Scan::local): Add ifunc support.
1355 (Target_arm::Scan::global): Add ifunc support.
1356 (Target_arm::make_plt_section): New method.
1357 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1358 (Target_arm::make_local_ifunc_plt_entry): New method.
1359 (Target_arm::got_irelative_): New member.
1360 (Target_arm::rel_irelative_): New member.
1361 (Target_arm::got_section): Add creation for got_irelative_.
1362 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1363 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1364 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1365 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1366 (Output_data_plt_arm::IRelative_data): New type.
1367 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1368 (Output_data_plt_arm::add_entry): Add more parameters.
1369 (Output_data_plt_arm::add_relocation): New method.
1370 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1371 (Output_data_plt_arm::rel_irelative): New method.
1372 (Output_data_plt_arm::entry_count): Modified.
1373 (Output_data_plt_arm::address_for_global): New method.
1374 (Output_data_plt_arm::address_for_local): New method.
23081de0 1375gold/
fa89cc82
HS
1376 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1377 (Output_data_plt_arm::insert_irelative_data): New method.
1378 (Output_data_plt_arm::irelative_rel_): New member.
1379 (Output_data_plt_arm::got_): New member.
1380 (Output_data_plt_arm::got_irelative_): New member.
1381 (Output_data_plt_arm::irelative_count_): New member.
1382 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1383 (Output_data_plt_arm::irelative_data_vec_): New member.
1384 (Output_data_plt_arm::do_write): Write out irelative entries.
1385 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1386 more parameters to ctor.
1387 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1388 more parameters to ctor.
1389 * output.h (Output_data_reloc::add_local_relative): New method.
1390 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1391
0f81d3f0
AM
13922015-01-29 Alan Modra <amodra@gmail.com>
1393
1394 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1395 and GOT_TLSGD to LE optimization.
1396
65d92137
CC
13972015-01-28 Cary Coutant <ccoutant@google.com>
1398
1399 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1400 for undef TLS symbols.
1401 (Target_x86_64::Relocate::relocate_tls): Likewise.
1402 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1403
5485698a
CC
14042015-01-25 Cary Coutant <ccoutant@google.com>
1405
1406 * output.cc (Output_segment::set_section_addresses): Fix calculation
1407 of size of relro segment.
1408
b01a4b04
AM
14092015-01-22 Alan Modra <amodra@gmail.com>
1410
1411 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1412 condition for need of ifunc plt entry.
1413 (Target_powerpc::Scan::global <got relocs>): Likewise.
1414
3d0064a9
CC
14152015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1416
1417 * mips.cc (reloc_high): Add r_sym.
1418 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1419 reloc_high constructor.
1420 (Mips_relocate_functions::relgot16_local): Likewise.
1421 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1422 r_type to decide whether LO16 matches HI16.
1423 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1424 rello16 and relgot16_local.
1425
a5cd8f05
CC
14262015-01-09 Cary Coutant <ccoutant@google.com>
1427
1428 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1429 unless alignment is larger than page size.
1430
4fc1b9d4
L
14312015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1432 Cary Coutant <ccoutant@google.com>
1433
1434 PR gold/17729
1435 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1436 (DEFAULT_TARGET_X32): Set for x32.
1437 * x86_64.cc (cmp_insn_32): New.
1438 (lea_r10_insn_32): Likewise.
1439 (lea_r11_insn_32): Likewise.
1440 (cmp_insn_64): Likewise.
1441 (lea_r10_insn_64): Likewise.
1442 (lea_r11_insn_64): Likewise.
1443 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1444 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1445 (check_DATA): Add split_x32 files.
1446 (split_x32_[1234n].o): New targets.
1447 (split_x32_[124]): New targets.
1448 (split_x32_[1234r].stdout): New targets.
1449 * testsuite/split_x32.sh: New file.
1450 * testsuite/split_x32_1.s: Likewise.
1451 * testsuite/split_x32_2.s: Likewise.
1452 * testsuite/split_x32_3.s: Likewise.
1453 * testsuite/split_x32_4.s: Likewise.
1454 * testsuite/split_x32_n.s: Likewise.
1455 * configure: Regenerated.
1456 * testsuite/Makefile.in: Likewise.
1457
e749cab8
L
14582015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1459
1460 PR gold/17809
1461 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1462 x32.
1463
af759df0
AM
14642015-01-02 Alan Modra <amodra@gmail.com>
1465
1466 * version.cc (print_version): Just print current year.
1467 * dwp.cc (print_version): Likewise.
1468
b90efa5b
AM
14692015-01-01 Alan Modra <amodra@gmail.com>
1470
1471 Update year range in copyright notice of all files.
1472
f12d1e8a
AM
14732014-12-25 Alan Modra <amodra@gmail.com>
1474
1475 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1476 new enums.
1477 (Target_arm::merge_object_attributes, ): Likewise.
1478
5c294fee
TG
14792014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1480
1481 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1482 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1483 AEABI_VFP_args_vfp to check that.
1484 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1485 value and replace hardcoded values by enum values.
1486
e30880c2
CC
14872014-12-22 Cary Coutant <ccoutant@google.com>
1488
1489 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1490
bd040da1
L
14912014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1492
1493 PR gold/14608
1494 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1495 to "return i * i * 3;".
1496
e02a4046
CC
14972014-12-16 Cary Coutant <ccoutant@google.com>
1498
1499 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1500 (Mapfile::print_output_data): Use current_data_size() to avoid
1501 assert for sections requiring postprocessing; if address is not valid,
1502 print 0.
1503 (Mapfile::print_output_section): Use current_data_size(); print note
1504 that addresses and sizes are before compression.
1505
add6016b
L
15062014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1507
1508 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1509 Cast current_group_size to unsigned long when reporting error.
1510
0bf32ea9
JY
15112014-12-10 Jing Yu <jingyu@google.com>
1512
1513 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1514 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1515 Update error message.
1516 (Target_aarch64::do_relax): Use absolute value of option
1517 stub_group_size. Replace local variable with class member
1518 stub_group_size_.
1519
cbcb23fa
AM
15202014-12-04 Alan Modra <amodra@gmail.com>
1521
1522 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1523 addend of PLTREL24 reloc when not generating a plt stub. Make
1524 max_branch_offset an "Address".
fbad6518 1525 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1526 (Target_powerpc::Relocate::relocate): Likewise.
1527
1611bc4a
AM
15282014-12-04 Alan Modra <amodra@gmail.com>
1529
1530 PR 17670
1531 * symtab.cc (Symbol::set_undefined): Remove assertion.
1532 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1533 on symbols defined in discarded sections, instead return false.
1534 Rearrange params, update all callers.
1535 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1536 branches to syms in discarded sections.
1537 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1538 undefined and flag as discarded.
1539 (Target_powerpc::Relocate::relocate): Localize variable.
1540
4759c34e
L
15412014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1542
1543 PR gold/17675
1544 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1545 * testsuite/Makefile.in: Regenerated.
1546
1f98a074
AM
15472014-12-03 Alan Modra <amodra@gmail.com>
1548
1549 PR 17566
1550 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1551 when adding dynamic relocations against section symbols.
1552
fb257835
DI
15532014-12-01 Dimitry Ivanov <dimitry@google.com>
1554
1555 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1556 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1557 * options.h (General_options): New -z option (global).
1558
d8e60314
CC
15592014-12-01 Cary Coutant <ccoutant@google.com>
1560
1561 PR gold/17578
1562 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1563 is given.
1564 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1565 given but some inputs require executable stack.
1566
982bbd97
CC
15672014-11-26 Cary Coutant <ccoutant@google.com>
1568
1569 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1570 .debug_str_offsets; strip .debug_gnu_pubnames and
1571 .debug_gnu_pubtypes.
1572 (lines_only_debug_sections): Strip all four new sections.
1573
bb779192
HS
15742014-11-26 Jing Yu <jingyu@google.com>
1575
1576 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1577 register to be x0 when to relax TLSDESC_LD64_LO12.
1578
a3e60ddb
AM
15792014-11-26 Alan Modra <amodra@gmail.com>
1580
1581 * powerpc.cc (struct Stub_table_owner): New.
1582 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1583 unsigned int vector. Update all references.
1584 (powerpc_relobj::set_stub_table): Take an unsigned int param
1585 rather than a Stub_table. Update callers.
1586 (Powerpc_relobj::clear_stub_table): New function.
1587 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1588 stub_group_size_ vars.
1589 (Target_powerpc::new_stub_table): Delete.
1590 (max_branch_delta): New function, extracted from..
1591 (Target_powerpc::Relocate::relocate): ..here..
1592 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1593 status on whether stub created successfully.
1594 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1595 default sizing to..
1596 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1597 reduce on relax failure.
1598 (Target_powerpc::group_sections): Add "no_size_errors" param.
1599 Use stub_group_size_. Set up group info in a temp vector,
1600 before building Stub_table vector. Account for input sections
1601 possibly already converted to relaxed sections.
1602 (Stub_table::init): Delete. Merge into..
1603 (Stub_table::Stub_table): ..here.
1604 (Stub_table::can_reach_stub): New function.
1605 (Stub_table::add_plt_call_entry): Add "from" parameter and
1606 return true iff stub could be reached.
1607 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1608 param too.
1609 (Stub_table::clear_stubs): Add "all" param.
1610
a20605cf
AM
16112014-11-26 Alan Modra <amodra@gmail.com>
1612
1613 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1614 (Target_powerpc::group_sections): Use it.
1615
43b64deb
CC
16162014-11-25 Cary Coutant <ccoutant@google.com>
1617
1618 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1619 (Binary_to_elf::write_symbol): Add st_size parameter.
1620 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1621
c924eb67
CC
16222014-11-25 Cary Coutant <ccoutant@google.com>
1623
1624 PR gold/17639
1625 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1626 (Sized_relobj_file::do_layout): Handle deferred sections properly
1627 during GC pass 1. Don't add reloc sections to deferred list twice.
1628 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1629 (Sized_relobj_file::is_deferred_layout_): New data member.
1630
9d585188
L
16312014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1632
1633 PR gold/17619
1634 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1635 Check PC-relative offset overflow in PLT entry.
1636
3ffaac20
AM
16372014-11-21 Alan Modra <amodra@gmail.com>
1638
1639 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1640 for undefined weaks.
1641
0cfb0717
AM
16422014-11-20 Alan Modra <amodra@gmail.com>
1643
1644 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1645 from --stub-group-size parameter divided by 1024.
1646 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1647 template parameter. Update all uses.
1648 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1649 has_stub_value. Set for long branches. Don't report overflow for
1650 branch to undefined weak symbols. Print info message on
1651 overflowing branch to stub.
1652
f9dffbf0
AM
16532014-11-20 Alan Modra <amodra@gmail.com>
1654
1655 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1656
e88ba8d5
L
16572014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1658
1659 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1660 entry for R_X86_64_GOTPLT64.
1661 (Target_x86_64<size>::Relocate::relocate): Update comments for
1662 R_X86_64_GOTPLT64.
1663
d37ffe25
ED
16642014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1665
1666 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1667 * plugin.h: add lock definition
1668
9726c3c1
HS
16692014-10-29 Han Shen <shenhan@google.com>
1670 Jing Yu <jingyu@google.com>
1671
1672 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1673 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1674 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1675 Symbol::TLS_REF.
1676 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1677 method.
1678 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1679 (Target_aarch64::tls_ld_to_le): New method.
1680 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1681 for 64bit targets.
1682 (Output_data_plt_aarch64::irelative_rel_): New data member.
1683 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1684 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1685 (Output_data_plt_aarch64::add_relocation): New method.
1686 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1687 offset. Add got_irelative size to got size.
1688 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1689 type string with the new typename.
1690 (AArch64_relocate_functions::update_adr): Replace parameter x with
1691 immed.
1692 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1693 (AArch64_relocate_functions::reloc_common): New method.
1694 (AArch64_relocate_funcsions::rela_general): Extract common part out
1695 into reloc_common method.
1696 (AArch64_relocate_functions::rela_general): Likewise.
1697 (AArch64_relocate_functions::pcrela_general): Likewise.
1698 (AArch64_relocate_functions::adr): New method.
1699 (AArch64_relocate_functions::adrp): Calculate immed before calling
1700 update_adr.
1701 (AArch64_relocate_functions::adrp): Likewise.
1702 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1703 comparing x to 0. Calculate immed from ~x when x < 0.
1704 (Target_aarch64::optimize_tls_reloc): Add new cases for
1705 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1706 TLSLD_MOVW_DTPREL_G0_NC.
1707 (Target_aarch64::possible_function_pointer_reloc): Implement this
1708 method.
1709 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1710 comment.
1711 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1712 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1713 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1714 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1715 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1716 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1717 (Target_aarch64::make_plt_entry): Call add_entry with two more
1718 parameters.
1719 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1720 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1721 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1722 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1723 (Target_aarch64::Relocate::relocate_tls): Add cases for
1724 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1725 TLSLD_MOVW_DTPREL_G0_NC.
1726 * testsuite/icf_safe_so_test.cc: Correct test comment.
1727 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1728
80272b8c
AM
17292014-10-22 Alan Modra <amodra@gmail.com>
1730
1731 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1732 thread_starter.
1733
998a69f4
AS
17342014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1735
1736 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1737
aed56ec5
CC
17382014-10-17 Cary Coutant <ccoutant@google.com>
1739
1740 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1741 Add "typename" keyword.
1742
bb779192 17432014-10-15 Han Shen <shenhan@google.com>
72f4393d 1744 Jing Yu <jingyu@google.com>
83a01957
HS
1745
1746 Patch for gold aarch64 backend to support relaxation.
1747 * aarch64-reloc.def: Change format.
1748 * aarch64.cc (class Reloc_stub): New class.
1749 (class Stub_table): New class.
1750 (class AArch64_relobj): New class.
1751 (class AArch64_input_section): New class.
1752 (class AArch64_output_section): New class.
1753 (Target_aarch64::new_stub_table): New method.
1754 (Target_aarch64::new_aarch64_input_section): New method.
1755 (Target_aarch64::find_aarch64_input_section): New method.
1756 (Target_aarch64::scan_section_for_stubs): New method.
1757 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1758 (Target_aarch64::relocate_stub): New method.
1759 (Target_aarch64::current_target): New method.
1760 (Target_aarch64::do_make_elf_object): New method.
1761 (Target_aarch64::do_may_relax): New method.
1762 (Target_aarch64::do_relax): New method.
1763 (Target_aarch64::group_sections): New method.
1764 (Target_aarch64::scan_reloc_for_stub): New method.
1765 (Target_aarch64::do_make_output_section): New method.
1766 (Target_aarch64::stub_tables_): New data member.
1767 (Target_aarch64::aarch64_input_section_map_): New data member.
1768 (AArch64_relocate_functions::maybe_apply_stub): New method.
1769
db4c9594
CC
17702014-09-30 Cary Coutant <ccoutant@google.com>
1771
1772 PR gold/17432
1773 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1774
cd6da036
KC
17752014-09-30 Kito Cheng <kito@0xlab.org>
1776
1777 PR gold/13597
1778 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1779 hash table before sysv-style hash table.
1780
5f772412
ST
17812014-09-29 Sriraman Tallam <tmsriram@google.com>
1782
1783 * options.h (--pic-executable): Add negative to alias to -no-pie.
1784
5efeedf6
CC
17852014-09-26 Cary Coutant <ccoutant@google.com>
1786
1787 PR gold/16773
1788 * object.cc (Sized_relobj_file): Compute value of section symbols
1789 for TLS sections the same as TLS symbols.
1790
1707f183
CC
17912014-09-25 Cary Coutant <ccoutant@google.com>
1792
1793 PR gold/17432
1794 * resolve.cc (Symbol_table::resolve): Override common placeholder
1795 symbols, but adjust sizes.
1796 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1797 symbols to common lists.
1798
00cac886
AM
17992014-09-24 Alan Modra <amodra@gmail.com>
1800
1801 * po/POTFILES.in: Regenerate.
1802
635aa30e 18032014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1804 Cary Coutant <ccoutant@google.com>
635aa30e 1805
71b9b91b 1806 PR gold/14860
635aa30e
CC
1807 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1808 on input_sections_blocker.
1809 * layout.cc (Write_sections_task::locks): Unblock
1810 input_sections_blocker_.
1811 * layout.h (Write_sections_task::Write_sections_task): Add
1812 input_sections_blocker.
1813 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1814 to DEPENDENCIES.
1815 * testsuite/Makefile.in: Regenerate.
1816
c0c71592
RÁE
18172014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1818
1819 * testsuite/Makefile.am (plugin_test_10): New test.
1820 * testsuite/Makefile.in: Regenerate
1821 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1822 * testsuite/plugin_test_10.sh: New file.
1823
6168c2a1
RÁE
18242014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1825
1826 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1827 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1828 during the replacement phase.
1829
3a531937
JY
18302014-09-17 Han Shen <shenhan@google.com>
1831 Jing Yu <jingyu@google.com>
1832
1833 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1834 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1835 * aarch64.cc (Target_aarch64): Add data members
1836 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1837 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1838 constructor.
1839 (Target_aarch64::do_reloc_symbol_index): New method.
1840 (Target_aarch64::do_reloc_addend): New method.
1841 (Target_aarch64::add_tlsdesc_info): New method.
1842 (Target_aarch64::do_dynsym_value): New method.
1843 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1844 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1845 (Target_aarch64::make_data_plt): Add new parameters: got,
1846 got_irelative. Pass them to do_make_data_plt.
1847 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1848 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1849 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1850 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1851 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1852 (Target_aarch64::got_tlsdesc_section): New method.
1853 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1854 (Target_aarch64::define_tls_base_symbol): New method.
1855 (Target_aarch64::reserve_tlsdesc_entries): New method.
1856 (Target_aarch64::got_mod_index_entry): New method.
1857 (Target_aarch64::rela_tlsdesc_section): New method.
1858 (Target_aarch64::rela_irelative_section): New method.
1859 (Target_aarch64::Tlsdesc_info): New struct.
1860 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1861 relocations and tlsdesc relocations.
1862 (Target_aarch64::optimize_tls_reloc): Implement method.
1863 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1864 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1865 in constructor.
1866 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1867 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1868 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1869 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1870 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1871 (Output_data_plt_aarch64::rela_irelative): New method.
1872 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1873 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1874 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1875 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1876 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1877 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1878 (Output_data_plt_aarch64_standard): New member variables:
1879 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1880 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1881 New parameter: got, got_irelative.
1882 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1883 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1884 (Output_data_plt_aarch64::do_write): Replace got_address with
1885 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1886 (AArch64_relocate_functions::update_movnz): New method.
1887 (AArch64_relocate_functions): Correct format.
1888 (AArch64_relocate_functions::movnz): New method.
1889 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1890 before the switch. Add new cases to switch.
00cac886 1891 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1892 tlsgd tlsdesc cases.
1893 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1894 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1895 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1896 Call reloc_name_in_error_message to print unsupported reloc.
1897 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1898 make_data_plt.
1899 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1900 relocs. Fill in some more dynamic tags.
1901 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1902 Skip call tls_get_addr when tlsgd is relaxed.
1903 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1904 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1905 tlsdesc->ie relaxation.
1906
62661c93
SS
19072014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1908
1909 * mips.cc (Target_mips_nacl): New class.
1910 (Target_selector_mips_nacl): New class.
1911 (target_selector_mips32): Rename from target_selector_mips32be and use
1912 Target_selector_mips_nacl instead of Target_selector_mips.
1913 (target_selector_mips32el): Rename from target_selector_mips32 and use
1914 Target_selector_mips_nacl instead of Target_selector_mips.
1915 (target_selector_mips64): Rename from target_selector_mips64be and use
1916 Target_selector_mips_nacl instead of Target_selector_mips.
1917 (target_selector_mips64el): Rename from target_selector_mips64 and use
1918 Target_selector_mips_nacl instead of Target_selector_mips.
1919 (Target_mips::mips_info): Add const attribute.
1920
54674d38
CC
19212014-09-02 Cary Coutant <ccoutant@google.com>
1922
1923 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1924 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1925 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1926 (Sized_incr_dynobj::do_section_name): Likewise.
1927 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1928 (Sized_incr_dynobj::do_section_name): Likewise.
1929 * object.h (Object::section_name): Likewise.
1930 (Object::do_section_name): Likewise.
1931 (Sized_relobj_file::do_section_name): Likewise.
1932 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1933 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1934
9860cbcf
CC
19352014-09-02 Cary Coutant <ccoutant@google.com>
1936
1937 PR gold/17005
1938 * ehframe.cc (Fde::write): Add output_offset parameter.
1939 (Cie::write): Likewise.
1940 (Eh_frame::set_final_data_size): Account for offset within output
1941 section.
1942 (Eh_frame::do_sized_write): Likewise.
1943 * ehframe.h (Fde::write): Add output_offset parameter.
1944 (Cie::write): Likewise.
1945 * output.cc (Output_section::Input_section_sort_entry): Remove
1946 section_has_name_; add output_section_name parameter. Use
1947 output section name for non-input sections.
1948 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1949 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1950 (Output_section::Input_section_sort_compare): Remove logic for
1951 sections without names.
1952 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1953 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1954 Likewise.
1955 (Output_section::Input_section_sort_section_name_compare): Likewise.
1956
8e33481e
HS
19572014-08-29 Han Shen <shenhan@google.com>
1958 Jing Yu <jingyu@google.com>
1959
1960 * aarch64-reloc-property.cc
1961 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1962 reference reloc property in the table.
1963 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1964 3 other entries.
1965 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1966 2 new overloaded methods.
1967 (Output_data_got_aarch64::do_write): Add code to write out
1968 static relocs.
1969 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1970 static relocs.
1971 (Output_data_got_aarch64::static_relocs): New vector to
1972 hold static relocs.
1973 (Target_aarch64::TCB_SIZE): New const static memeber.
1974 (Target_aarch64::tcb_size): New method.
1975 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1976 (Target_aarch64::Relocate::relocate_tls): New method.
1977 (Target_aarch64::Scan::local): Add code handling new reloc types.
1978 (Target_aarch64::Scan::global): Add code handling new reloc types.
1979
81233653
ST
19802014-08-13 Sriraman Tallam <tmsriram@google.com>
1981
1982 * options.h (-no-pie): Add option.
1983
9363c7c3
JY
19842014-08-08 Jing Yu <jingyu@google.com>
1985 Han Shen <shenhan@google.com>
1986
1987 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1988 (DEFFILES): add aarch64-reloc.def.
1989 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1990 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1991 * Makefile.in: Regenerate.
1992 * aarch64-reloc-property.cc: New file.
1993 * aarch64-reloc-property.h: New file.
1994 * aarch64-reloc.def: New file.
1995 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1996 with tab to make the format consistent.
1997 (Output_data_got_aarch64::symbol_table_): New method.
1998 (Target_aarch64::do_plt_address_for_global): New method.
1999 (Target_aarch64::do_plt_address_for_local): New method.
2000 (Target_aarch64::do_select_as_default_target): New method.
2001 (Target_aarch64::do_make_data_plt): New method.
2002 (Target_aarch64::make_data_plt): New method.
2003 (Output_data_plt_aarch64::has_irelative_section): New method.
2004 (Output_data_plt_aarch64::address_for_global): New method.
2005 (Output_data_plt_aarch64::address_for_local): New method.
2006 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2007 (Output_data_plt_aarch64::add_entry): Implement contents.
2008 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2009 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2010 the got_pov entry to plt0.
2011 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2012 Implement contents.
2013 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2014 (AArch64_howto): New struct.
2015 (aarch64_howto[]): New static const array.
2016 (AArch64_relocate_functions): New class.
2017 (Target_aarch64::Scan::get_reference_flags): Remove method.
2018 (Target_aarch64::Scan::local): Implement to support a few relocations.
2019 (Target_aarch64::Scan::global): Implement to support a few relocations.
2020 (Target_aarch64::make_plt_section): Implement contents.
2021 (Target_aarch64::make_plt_entry): Implement contents.
2022 (Target_aarch64::do_finalize_sections): Implement contents.
2023 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2024 (Target_aarch64::relocate_section): Implement contents.
2025
ad9fe6c1
AM
20262014-08-06 Alan Modra <amodra@gmail.com>
2027
2028 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2029
7cd4e5b7
AM
20302014-08-06 Alan Modra <amodra@gmail.com>
2031
2032 PR 13227
2033 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2034
5ad9b0a7
ST
20352014-07-21 Sriraman Tallam <tmsriram@google.com>
2036
2037 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2038 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2039
e051745c
CC
20402014-07-08 Cary Coutant <ccoutant@google.com>
2041
2042 * expression.cc (struct Expression::Expression_eval_info): Add
2043 new fields type_pointer, vis_pointer, and nonvis_pointer.
2044 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2045 nonvis_pointer parameters. Adjust all calls.
2046 (Symbol_expression::value): Update type, visibility, and nonvis bits
2047 in caller.
2048 * script.cc (Symbol_assignment::sized_finalize): Update type,
2049 visibility, and remaining st_other bits for new symbol.
2050 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2051 vis_pointer, and nonvis_pointer parameters.
2052 * symtab.h (Symbol::set_type): New method.
2053
2054 * testsuite/Makefile.am (defsym_test): New test.
2055 * testsuite/Makefile.in: Regenerate.
2056 * testsuite/defsym_test.c: New file.
2057 * testsuite/defsym_test.sh: New file.
2058
f35c4853
CC
20592014-07-08 Cary Coutant <ccoutant@google.com>
2060
2061 PR gold/15639
2062 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2063 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2064 (Sized_dynobj::base_read_symbols): ...new method.
2065 * object.h (Sized_relobj_file::base_read_symbols): New method.
2066 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2067 (Sized_relobj_file::base_read_symbols): ...new method.
2068 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2069 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2070 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2071
2900af2d
AM
20722014-07-04 Alan Modra <amodra@gmail.com>
2073
2074 * po/POTFILES.in: Regenerate.
2075
053a4d68
JY
20762014-07-02 Jing Yu <jingyu@google.com>
2077
2078 * aarch64.cc: New file
2079 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2080 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2081 * Makefile.in: Regenerate.
2082 * configure.tgt: Add entries for aarch64*.
2083 * configure.ac: Likewise.
2084 * configure: Likewise.
2085
7b549045
AM
20862014-06-27 Alan Modra <amodra@gmail.com>
2087
2088 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2089
cb818dbf
CC
20902014-06-24 Cary Coutant <ccoutant@google.com>
2091
2092 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2093 sections.
2094 (Dwo_file::sized_read_unit_index): Likewise.
2095
9810d34d
SS
20962014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2097
2098 * mips.cc: New file.
2099 * Makefile.am (TARGETSOURCES): Add mips.cc
2100 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2101 * configure.tgt: Add entries for mips*.
2102 * configure.ac: Likewise.
2103 * Makefile.in: Regenerate.
2104 * configure: Likewise.
2105
9baa787b
CC
21062014-06-09 Cary Coutant <ccoutant@google.com>
2107
2108 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2109 unit_length is within section bounds.
2110
8f89af0a
CC
21112014-06-09 Cary Coutant <ccoutant@google.com>
2112
2113 PR gold/16980
2114 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2115 map.
2116
a47622ac
AM
21172014-06-07 Alan Modra <amodra@gmail.com>
2118
2119 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2120
4320c691
CC
21212014-06-06 Cary Coutant <ccoutant@google.com>
2122
2123 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2124 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2125 (Dwarf_pubnames_table::read_header): Likewise.
2126 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2127 .debug_gnu_pubtypes.
2128
270c9937
JB
21292014-06-05 Joel Brobecker <brobecker@adacore.com>
2130
2131 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2132 * Makefile.in, configure: Regenerate.
2133
397998fc
AM
21342014-06-03 Alan Modra <amodra@gmail.com>
2135
2136 * powerpc.cc (addis_12_2): Define.
2137 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2138
61f5c66f
AM
21392014-06-03 Alan Modra <amodra@gmail.com>
2140
2141 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2142 st_other output.
2143
f6971787
AM
21442014-06-02 Alan Modra <amodra@gmail.com>
2145
2146 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2147 Only ignore relocs on ELFv1.
2148 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2149
f6fb8322
CC
21502014-05-30 Cary Coutant <ccoutant@google.com>
2151
2152 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2153 * testsuite/Makefile.in: Regenerate.
2154 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2155
c23dd342
L
21562014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2157
2158 PR gold/16945
2159 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2160 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2161
5fe7ffdc
AM
21622014-05-15 Alan Modra <amodra@gmail.com>
2163
2164 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2165 Compare FDE contents with DW_CFA_nop rather than 0.
2166
a82bef93
ST
21672014-05-13 Sriraman Tallam <tmsriram@google.com>
2168
2169 * symtab.h (may_need_copy_reloc): Remove check for position independent
2170 code.
2171 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2172 position independence before pc absolute may_need_copy_reloc call.
2173 Add check for executable output befor pc relative may_need_copy_reloc
2174 call.
2175 * i386.cc: Ditto.
2176 * arm.cc: Ditto.
2177 * sparc.cc: Ditto.
2178 * tilegx.cc: Ditto.
2179 * powerpc.cc: Add check for no position independence before
2180 may_need_copy_reloc calls.
2181 * testsuite/pie_copyrelocs_test.cc: New file.
2182 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2183 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2184 * Makefile.in: Regenerate.
a82bef93 2185
53c66605
ML
21862014-05-08 Martin Liška <mliska@suse.cz>
2187
2188 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2189
57b2284c
CC
21902014-05-06 Cary Coutant <ccoutant@google.com>
2191
2192 PR gold/16900
2193 * i386.cc (Output_data_got_plt_i386): New class.
2194 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2195 parameter. Change all callers.
2196 (Output_data_plt_i386::layout_): Remove.
2197 (Output_data_plt_i386::got_plt_): Change type.
2198 (Target_i386::got_plt_): Change type. Change all references.
2199 (Target_i386::got_section): Create instance of new class.
2200 (Output_data_got_plt_i386::do_write): New function.
2201 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2202 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2203 parameter. Change all callers.
2204 (Output_data_plt_x86_64::layout_): Remove.
2205 (Output_data_plt_x86_64::got_plt_): Change type.
2206 (Target_x86_64::got_plt_): Change type. Change all references.
2207 (Target_x86_64::got_section): Create instance of new class.
2208 (Output_data_got_plt_x86_64::do_write): New function.
2209 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2210 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2211 class.
2212
6b97515d 22132014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2214
6b97515d
CC
2215 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2216 if we have pubnames/pubtypes.
2217
d1bddd3c
CC
22182014-05-02 Cary Coutant <ccoutant@google.com>
2219
5fe7ffdc
AM
2220 * defstd.cc (in_segment): Define __ehdr_start here...
2221 * layout.cc (Layout::finalize): ...Instead of here. Set the
2222 output segment when known.
2223 * resolve.cc (Symbol::override_base_with_special): Remember
2224 the original binding.
2225 * symtab.cc (Symbol::set_output_segment): New function.
2226 (Symbol::set_undefined): New function.
2227 * symtab.h (Symbol::is_weak_undefined): Check original undef
2228 binding.
2229 (Symbol::is_strong_undefined): New function.
2230 (Symbol::set_output_segment): New function.
2231 (Symbol::set_undefined): New function.
2232 * target-reloc.h (is_strong_undefined): Remove.
2233 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2234 Check for hidden undefs.
2235 (relocate_section): Call Symbol::is_strong_undefined.
2236
2237 * testsuite/Makefile.am (ehdr_start_test_1)
2238 (ehdr_start_test_2, ehdr_start_test_3)
2239 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2240 * testsuite/Makefile.in: Regenerate.
2241 * testsuite/ehdr_start_def.cc: New source file.
2242 * testsuite/ehdr_start_test.cc: New source file.
2243 * testsuite/ehdr_start_test.t: New linker script.
2244 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2245
7849f6d8
CC
22462014-04-23 Cary Coutant <ccoutant@google.com>
2247
bf2cc635 2248 PR gold/16870
7849f6d8
CC
2249 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2250
99fd8cff
CC
22512014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2252
2253 * layout.cc (Layout::include_section): Allow a target to decide
2254 whether to include a section.
2255 * target.h (Target::should_include_section): New function.
2256 (Target::do_should_include_section): New function.
2257
91f43acd
CC
22582014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2259
2260 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2261 inline into ...
2262 (Copy_relocs::emit): ... here.
2263 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2264 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2265 (Copy_reloc_entry::entries_): Change from private to protected.
2266
c4eb27e1
ST
22672014-04-02 Sriraman Tallam <tmsriram@google.com>
2268
2269 * icf.cc (get_section_contents): Replace copies of reloc
2270 vectors with const references.
2271
ae447ddd
CC
22722014-04-02 Cary Coutant <ccoutant@google.com>
2273
2274 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2275 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2276 * configure: Regenerate.
2277 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2278 -fno-use-linker-plugin.
2279 (LINK1, CXXLINK1): Add it to the link command.
2280 * testsuite/Makefile.in: Regenerate.
2281
fa47fa92
AM
22822014-03-12 Alan Modra <amodra@gmail.com>
2283
2284 * Makefile.in: Regenerate.
2285
9b12c500
CC
22862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2287
2288 * symtab.h (Symbol::set_nonvis): New function.
2289
beacaa96
CC
22902014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2291
2292 * symtab.cc (Sized_symbol<32>::init_output_data):
2293 Instantiate the template.
2294 (Sized_symbol<64>::init_output_data): Likewise.
2295
800d9823
CC
22962014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2297
2298 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2299 adjust dynamic symbol value.
2300 * target.h (Target::adjust_dyn_symbol): New function.
2301 (Target::do_adjust_dyn_symbol): New function.
2302
918fc1f8 23032014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2304
918fc1f8
CC
2305 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2306 Get the value of DYNAMIC_CUSTOM dynamic entry.
2307 * output.h (Output_data_dynamic::add_custom): New function.
2308 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2309 dynamic entry.
2310 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2311 * target.h (Target::dynamic_tag_custom_value): New function.
2312 (Target::do_dynamic_tag_custom_value): New function.
2313
98ff9231
CC
23142014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2315
2316 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2317 dynsym indexes.
2318 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2319 (Target::do_has_custom_set_dynsym_indexes): New function.
2320 (Target::set_dynsym_indexes): New function.
2321 (Target::do_set_dynsym_indexes): New function.
2322
b80eed39
AM
23232014-03-07 Alan Modra <amodra@gmail.com>
2324
2325 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2326 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2327 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2328 (Powerpc_relocate_functions::has_overflow_bitfield,
2329 overflowed): Use the above.
2330 (Target_powerpc::Relocate::relocate): Correct overflow checking
2331 for a number of relocations. Modify overflow test for 16-bit
2332 fields in instructions to signed/unsigned according to whether
2333 the field takes a signed or unsigned value.
2334
4b95cf5c
AM
23352014-03-05 Alan Modra <amodra@gmail.com>
2336
2337 Update copyright years.
2338
45965137
AM
23392014-03-05 Alan Modra <amodra@gmail.com>
2340
2341 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2342 R_PPC64_ADDR64_LOCAL.
2343 (Target_powerpc::Relocate::relocate): Likewise.
2344
2c80b753
AM
23452014-03-03 Alan Modra <amodra@gmail.com>
2346
2347 * dwp.cc (print_version): Update copyright year to current.
2348
c1c69e83
AM
23492014-02-10 Alan Modra <amodra@gmail.com>
2350
2351 * po/gold.pot: Regenerate.
2352
dd0c4e70
CC
23532014-02-06 Cary Coutant <ccoutant@google.com>
2354
2355 Fix problem where -u is ignored when a weak undef is seen.
2356
2357 * archive.cc (Library_base::should_include_member): Reorder
2358 code to check for -u option if a weak undef has already been seen.
2359 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2360 * testsuite/Makefile.in: Regenerate.
2361 * testsuite/weak_undef_file3.cc: New file.
2362 * testsuite/weak_undef_file4.cc: New file.
2363 * testsuite/weak_undef_test_2.cc: New file.
2364
1a221d3d
CC
23652014-02-05 Cary Coutant <ccoutant@google.com>
2366
2367 Fix issues with gold undefined symbol diagnostics.
2368
2369 PR binutils/15435
2370 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2371 check to here.
2372 * target-reloc.h (is_strong_undefined): New function.
2373 (relocate_section): Move undef vtable symbol check from here.
2374 Check for is_strong_undefined.
2375
e889f0a4 23762014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2377
e889f0a4
CC
2378 Fix problems with the --dynamic-list option.
2379
2380 PR gold/13577
2381 * options.cc (General_options::parse_dynamic_list):
2382 Set have_dynamic_list_.
2383 (General_options::General_options): Initialize have_dynamic_list_.
2384 (General_options::finalize): Turn off -Bsymbolic and
2385 -Bsymbolic-functions if --dynamic-list provided.
2386 * options.h (General_options::have_dynamic_list): New function.
2387 (General_options::have_dynamic_list_): New data member.
2388 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2389 correctly.
5fe7ffdc 2390
e889f0a4
CC
2391 PR gold/16530
2392 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2393 in --dynamic-list, mark it.
5fe7ffdc 2394
e889f0a4
CC
2395 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2396 (dynamic_list_2): New test case.
2397 * testsuite/Makefile.in: Regenerate.
2398 * testsuite/dynamic_list_2.cc: New file.
2399 * testsuite/dynamic_list_2.t: New file.
2400 * testsuite/dynamic_list_lib1.cc: New file.
2401 * testsuite/dynamic_list_lib2.cc: New file.
2402 * testsuite/gc_dynamic_list_test.c: New file.
2403 * testsuite/gc_dynamic_list_test.sh: New file.
2404 * testsuite/gc_dynamic_list_test.t: New file.
2405
ec673e64
CC
24062014-01-28 Cary Coutant <ccoutant@google.com>
2407
2408 Add .gdb_index version 7 support.
2409
2410 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2411 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2412 debug sections.
2413 (Dwarf_ranges_table::read_ranges_table): Likewise.
2414 (Dwarf_pubnames_table::read_section): Check for GNU-style
2415 sections, and for compressed debug sections.
2416 (Dwarf_pubnames_table::read_header): Compute end address of table.
2417 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2418 for end of list by offset, not by offset == 0.
2419 (Dwarf_info_reader::do_read_string_table): Check for compressed
2420 debug sections.
2421 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2422 Initialize new data members.
2423 (Dwarf_pubnames_table::next_name): return flag_byte.
2424 (Dwarf_pubnames_table::end_of_table_): New data member.
2425 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2426 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2427 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2428 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2429 read skeleton type unit DIEs.
2430 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2431 (Gdb_index::do_write): Write flag_byte.
2432 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2433 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2434 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2435 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2436
221fd5d5
L
24372014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2438
2439 * version.cc (print_version): Update copyright year to 2014.
2440
6c09fb0b
ILT
24412013-12-19 Dimitry Andric <dimitry@andric.com>
2442
2443 * stringpool.cc (Stringpool_template::reserve): Add
2444 HAVE_UNORDERED_MAP case.
2445 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2446
8356f2d0
CC
24472013-12-18 Cary Coutant <ccoutant@google.com>
2448
2449 * configure.ac: Check for <unordered_set> and <unordered_map>.
2450 * config.in: Regenerate.
2451 * configure: Regenerate.
2452 * system.h: Use <unordered_set> and <unordered_map> if available.
2453
f2c7d7ee
RM
24542013-12-10 Roland McGrath <mcgrathr@google.com>
2455
2456 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2457 with $(INSTALL_PROGRAM_ENV).
2458 * Makefile.in: Regenerate.
2459
6632e8cc
CC
24602013-11-22 Cary Coutant <ccoutant@google.com>
2461
2462 * configure.ac: Add check for which library is needed for
2463 dlopen.
2464 * configure: Regenerate.
2465
0c075858
CC
24662013-11-22 Cary Coutant <ccoutant@google.com>
2467
2468 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2469 assembler.
2470 * testsuite/Makefile.in: Regenerate.
2471
f49fe902
L
24722013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2473
2474 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2475 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2476 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2477 (Target_x86_64<size>::Scan::local): Likewise.
2478 (Target_x86_64<size>::Scan::global): Likewise.
2479 (Target_x86_64<size>::Relocate::relocate): Likewise.
2480 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2481 Likewise.
2482 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2483 R_X86_64_PC32_BND.
2484
2485 * testsuite/Makefile.am (check_PROGRAMS): Add
2486 exception_x86_64_bnd_test.
2487 (exception_x86_64_bnd_test_SOURCES): New macro.
2488 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2489 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2490 (exception_x86_64_bnd_test_LDADD): Likewise.
2491 (exception_x86_64_bnd_1.o): New rule.
2492 (exception_x86_64_bnd_2.o): Likewise.
2493 * testsuite/Makefile.in: Regenerated.
2494
9055360d
AM
24952013-11-15 Alan Modra <amodra@gmail.com>
2496
2497 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2498 accessor.
2499 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2500 Only call ppc64_local_entry_offset for 64-bit. Restrict
2501 symval_for_branch lookup to ELFv1.
2502 (Stub_table::add_plt_call_entry): Use unsigned int off.
2503 (Output_data_glink::Address, invalid_address): New.
2504 (Output_data_glink::add_eh_frame): Move out of line. Add
2505 support for ELFv2.
2506 (Output_data_glink::add_global_entry, find_global_entry,
2507 global_entry_address): New functions.
2508 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2509 ge_size): New variables.
2510 (Output_data_glink::set_final_data_size): Add global entry
2511 stub sizing.
2512 (Output_data_glink::do_write): Write global entry stubs.
2513 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2514 parameter. Return true for ELFv2. Adjust callers.
2515 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2516 ELFv1. Similarly for ifunc and dynamic relocation processing
2517 specific to ELFv1. Recognize that symbols are defined on
2518 their plt entries for ELFv2.
2519 (Target_powerpc::symval_for_branch): Assert if called for
2520 ELFv2 or ppc32.
2521 (Target_powerpc::Relocate::relocate): Use global entry plt
2522 stub for symbol value if such exists on ELFv2.
2523 (Target_powerpc::Relocate::relocate): Don't call
2524 symval_for_branch when ELFv2. Do adjust for local entry
2525 offset when ELFv2.
2526 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2527 plt stub for ELFv2.
2528 (Target_powerpc::do_plt_address_for_global): Similarly.
2529
cafdd569
CC
25302013-11-14 Cary Coutant <ccoutant@google.com>
2531
2532 Revert patch -- this did not fix the problem, and there is
2533 no race there.
2534
2535 2013-11-14 Cary Coutant <ccoutant@google.com>
2536
2537 PR gold/14860
2538 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2539 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2540 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2541 updating fde_offsets_.
2542 (Eh_frame_hdr::lock_): New data member.
2543
94e49e16
CC
25442013-11-14 Cary Coutant <ccoutant@google.com>
2545
2546 * dwp.cc (Dwo_file_entry): New type.
2547 (File_list): Use Dwo_file_entry.
2548 (Dwo_file::verify): New function.
2549 (Dwo_file::verify_dwo_list): New function.
2550 (Dwo_file::sized_verify_dwo_list): New function.
2551 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2552 list.
2553 (Dwp_options): New enum type.
2554 (dwp_options): Add --verify-only.
2555 (usage): Likewise.
2556 (main): Likewise.
2557 * dwp.h (gold_info): Add declaration.
2558
7cdd7d57
CC
25592013-11-14 Cary Coutant <ccoutant@google.com>
2560
2561 PR gold/14860
2562 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2563 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2564 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2565 updating fde_offsets_.
2566 (Eh_frame_hdr::lock_): New data member.
2567
1d946cb3
CC
25682013-11-06 Cary Coutant <ccoutant@google.com>
2569
2570 PR gold/15758
2571 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2572 before reloc sections.
2573
4f65b40e
AM
25742013-11-04 Alan Modra <amodra@gmail.com>
2575
2576 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2577 (Symbol::needs_dynamic_reloc): Test new flag.
2578 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2579 (Target_powerpc::Scan::get_reference_flags): Add target param.
2580 Return FUNC_DESC_ABI for 64-bit ELFv1.
2581 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2582 call.
2583 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2584 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2585
908794a9
CC
25862013-10-31 Cary Coutant <ccoutant@google.com>
2587
2588 Restore support for dwp v2 DWARF package file format.
2589
2590 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2591 tu_length parameter. Adjust all callers.
2592 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2593 * dwp.cc: Include dwarf.h.
2594 (Section_bounds): New struct type.
2595 (Unit_set): New struct type.
2596 (Dwo_file::Dwo_file): Initialize new data member.
2597 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2598 Combine and rename to...
2599 (Dwo_file::read_unit_index): ...this.
2600 (Dwo_file::sized_read_compunit_index)
2601 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2602 (Dwo_file::sized_read_unit_index): ...this.
2603 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2604 parameters; add section_id parameter.
2605 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2606 (Dwo_file::add_unit_set): ...this.
2607 (Dwo_file::shndx_map_): Remove.
2608 (Dwo_file::sect_offsets_): New data member.
2609 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2610 (Dwp_output_file::add_section): Rename to...
2611 (Dwp_output_file::add_contribution): ...this.
2612 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2613 (Dwp_output_file::add_tu_set): Likewise.
2614 (Dwp_output_file::Contribution): New type.
2615 (Dwp_output_file::Section::contributions): New data member.
2616 (Dwp_output_file::Cu_or_tu_set): Remove.
2617 (Dwp_output_file::Section::Section): New ctor.
2618 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2619 (Dwp_output_file::Dwp_index::Section_table): New type.
2620 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2621 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2622 parameter.
2623 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2624 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2625 (Dwp_output_file::Dwp_index::section_table): New member function.
2626 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2627 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2628 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2629 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2630 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2631 (Dwp_output_file::Dwp_index::section_table_): New data member.
2632 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2633 (Dwp_output_file::add_output_section): New member function.
2634 (Dwp_output_file::write_new_section): New member function.
2635 (Dwp_output_file::write_contributions): New member function.
2636 (Dwp_output_file::section_id_map_): New data member.
2637 (class Dwo_id_info_reader): Remove.
2638 (class Unit_reader): New class.
2639 (get_dwarf_section_name): New function.
2640 (Dwo_file::read_executable): Adjust initializations of class data.
2641 (Dwo_file::read): Add support for v2 package file format.
2642 (Dwo_file::read_unit_index): Likewise.
2643 (Dwo_file::sized_read_unit_index): Likewise.
2644 (Dwo_file::copy_section): Likewise.
2645 (Dwo_file::add_unit_set): Likewise.
2646 (Dwp_output_file::add_output_section): Likewise.
2647 (Dwp_output_file::add_contribution): Likewise.
2648 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2649 for empty slot.
2650 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2651 file format.
2652 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2653 slot.
2654 (Dwp_output_file::initialize): Remove unused function.
2655 (Dwp_output_file::finalize): Add support for v2 package file format.
2656 (Dwp_output_file::write_index): Likewise.
2657 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2658 function prototype.
2659
2500c017
CC
26602013-10-31 Cary Coutant <ccoutant@google.com>
2661
2662 * configure.ac: Fix check for -fmerge-constants.
2663 * configure.ac: Regenerate.
2664
dd0845d7
RM
26652013-10-30 Roland McGrath <mcgrathr@google.com>
2666
2667 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2668 Correct 9-byte nop sequence to match what the assembler generates.
2669
b4f7960d
AM
26702013-10-30 Alan Modra <amodra@gmail.com>
2671
2672 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2673 ppc64_local_entry_offset, ppc64_local_entry_offset,
2674 do_read_symbols): New functions.
2675 (Powerpc_relobj::e_flags_, st_other_): New vars.
2676 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2677 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2678 (Powerpc_relobj::e_flags_): New var.
2679 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2680 and adjust for ELFv2.
2681 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2682 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2683 (Powerpc_dynobj::do_find_special_sections): Likewise.
2684 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2685 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2686 to ELFv2 local entry.
2687 (Target_powerpc::do_relax): No thread safe barriers needed for
2688 ELFv2.
2689 (Output_data_plt_powerpc::initial_plt_entry_size_,
2690 plt_entry_size): Delete. Replace all uses with
2691 first_plt_entry_offset() and plt_entry_size().
2692 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2693 reserved_size parm. Update callers.
2694 (Output_data_plt_powerpc::entry_count): Update.
2695 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2696 and use Target_powerpc::first_plt_entry_offset().
2697 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2698 rename to plt_entry_size.
2699 (Output_data_plt_powerpc::add_ifunc_entry,
2700 add_local_ifunc_entry): Adjust reloc for ELFv2.
2701 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2702 (glink_eh_frame_fde_64v2): New.
2703 (Stub_table::plt_call_size): Support ELFv2 sizing.
2704 (Output_data_glink::add_eh_frame): Use the new FDE.
2705 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2706 (Stub_table::do_write): Write ELFv2 stubs and glink.
2707 (Target_powerpc::Relocate::relocate): Replaces nop after call
2708 with ld 2,24(1) and adjust local offset destination for ELFv2.
2709
f9c6b907
AM
27102013-10-30 Alan Modra <amodra@gmail.com>
2711
2712 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2713 (Target_powerpc::Scan::global, local): Likewise.
2714 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2715 on all ppc64 @h and @ha relocs.
2716
e84fe78f
AM
27172013-10-14 Alan Modra <amodra@gmail.com>
2718
2719 * output.h (Output_data_got::add_constant): Tidy.
2720 (Output_data_got::add_constant_pair): New function.
2721 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2722 methods used so as to first call reserve_ent().
2723
679e4abf
RM
27242013-10-11 Roland McGrath <mcgrathr@google.com>
2725
44dcb735
RM
2726 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2727 add_got_entry and add_got_entry_pair.
2728
13323c49
RM
2729 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2730 (HAVE_PUBNAMES): Likewise.
2731 * configure: Regenerate.
2732
1496b446
RM
2733 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2734 * testsuite/Makefile.in: Regenerate.
2735
cc84c10b
RM
2736 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2737 Remove const from declaration.
2738 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2739 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2740 * output.h (Output_file_header): Remove const from member target_
2741 and corresponding constructor argument.
2742 * output.cc (Output_file_header::Output_file_header): Update prototype.
2743 (Output_file_header::do_sized_write): Use this->target_ in place
2744 of parameters()->target().
2745
52f66a2c
RM
2746 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2747
2b64b551
RM
2748 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2749 * configure: Regenerate.
2750 * Makefile.in: Regenerate.
2751 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2752 * testsuite/merge_string_literals_2.c: Likewise.
2753 * testsuite/Makefile.am
2754 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2755 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2756 literal -fmerge-constants.
2757 * testsuite/Makefile.in: Regenerate.
2758
43819297
RM
2759 * i386.cc (Target_i386): Remove unused member dynbss_.
2760 * arm.cc (Target_arm): Likewise.
2761 * powerpc.cc (Target_powerpc): Likewise.
2762 * sparc.cc (Target_sparc): Likewise.
2763 * tilegx.cc (Target_tilegx): Likewise.
2764 * x86_64.cc (Target_x86_64): Likewise.
2765 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2766 type_signature_, type_offset_.
2767 * plugin.h (Plugin_hook): Remove unused member layout_.
2768 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2769 mapfile_.
2770 (Read_member): Remove unused members input_objects_, symtab_,
2771 mapfile_, layout_.
2772 (Check_library): Remove unused member symtab_.
2773 * archive.h (Lib_group): Remove unused member lib_.
2774 * archive.cc (Lib_group::Lib_group): Update initializer.
2775 * incremental.h (Incremental_binary): Remove unused member target_.
2776 (Incremental_script_entry): Removed unused member script_.
2777 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2778 * icf.h (Icf): Remove unused member num_tracked_relocs.
2779
39d9ead7
RM
2780 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2781 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2782 its only use.
2783 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2784
679e4abf
RM
2785 * archive.h: Use struct rather than class for forward declaration
2786 of Read_symbols_data.
2787
54de2ea6
CC
27882013-10-07 Cary Coutant <ccoutant@google.com>
2789
2790 PR gold/16010
2791 * testsuite/Makefile.am (icf_test): Fix dependencies.
2792 (icf_safe_test): Likewise.
2793 (icf_safe_so_test): Likewise.
2794 (large_symbol_alignment): Add empty _LDADD rule.
2795 * testsuite/Makefile.in: Regenerate.
2796
b14016f0
L
27972013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2798
2799 PR gold/15927
2800 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2801 relocation for R_X86_64_32 on x32.
2802
eb426534
RM
28032013-08-27 Roland McGrath <mcgrathr@google.com>
2804
2805 * output.cc (Output_segment::set_section_addresses): Take new
2806 Target* argument. If target->isolate_execinstr() and the segment
2807 is executable and starts at a target->abi_pagesize() boundary,
2808 pad its end out to a target->abi_pagesize() boundary with code fill.
2809 * output.h (Output_segment::set_section_addresses): Update decl.
2810 * layout.h (Layout::check_output_data_for_reset_values): Take new
2811 argument RELAX_OUTPUTS.
2812 (Layout): New member relax_output_list_.
2813 (Layout::add_relax_output): New method.
2814 * layout.cc (Layout::Layout): Update constructor.
2815 (Layout::reset_relax_output): New method.
2816 (Layout::clean_up_after_relaxation): Call it.
2817 (Layout::prepare_for_relaxation): Update caller.
2818 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2819 Call reset_relax_output before re-processing segments for
2820 isolate_execinstr case.
2821 (Layout::write_data): Handle relax_output_list_.
2822 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2823 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2824
9aff4b7a
NC
28252013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2826
2827 PR binutils/15834
2828 * object.h: Fix typos.
2829
93f8221c
RM
28302013-08-16 Roland McGrath <mcgrathr@google.com>
2831
2832 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2833 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2834
e44c3715
CC
28352013-08-07 Cary Coutant <ccoutant@google.com>
2836
2837 Revert support for v2 DWP files:
2838
2839 2013-03-01 Cary Coutant <ccoutant@google.com>
2840
2841 Add dwp support for v2 DWARF package file format.
2842 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2843 tu_length parameter. Adjust all callers.
2844 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2845 * dwp.cc: Include dwarf.h.
2846 (Section_bounds): New struct type.
2847 (Unit_set): New struct type.
2848 (Dwo_file::Dwo_file): Initialize new data member.
2849 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2850 Combine and rename to...
2851 (Dwo_file::read_unit_index): ...this.
2852 (Dwo_file::sized_read_compunit_index)
2853 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2854 (Dwo_file::sized_read_unit_index): ...this.
2855 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2856 parameters; add section_id parameter.
2857 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2858 (Dwo_file::add_unit_set): ...this.
2859 (Dwo_file::shndx_map_): Remove.
2860 (Dwo_file::sect_offsets_): New data member.
2861 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2862 (Dwp_output_file::add_section): Rename to...
2863 (Dwp_output_file::add_contribution): ...this.
2864 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2865 (Dwp_output_file::add_tu_set): Likewise.
2866 (Dwp_output_file::Contribution): New type.
2867 (Dwp_output_file::Section::contributions): New data member.
2868 (Dwp_output_file::Cu_or_tu_set): Remove.
2869 (Dwp_output_file::Section::Section): New ctor.
2870 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2871 (Dwp_output_file::Dwp_index::Section_table): New type.
2872 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2873 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2874 parameter.
2875 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2876 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2877 (Dwp_output_file::Dwp_index::section_table): New member function.
2878 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2879 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2880 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2881 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2882 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2883 (Dwp_output_file::Dwp_index::section_table_): New data member.
2884 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2885 (Dwp_output_file::add_output_section): New member function.
2886 (Dwp_output_file::write_new_section): New member function.
2887 (Dwp_output_file::write_contributions): New member function.
2888 (Dwp_output_file::section_id_map_): New data member.
2889 (class Dwo_id_info_reader): Remove.
2890 (class Unit_reader): New class.
2891 (get_dwarf_section_name): New function.
2892 (Dwo_file::read_executable): Adjust initializations of class data.
2893 (Dwo_file::read): Add support for v2 package file format.
2894 (Dwo_file::read_unit_index): Likewise.
2895 (Dwo_file::sized_read_unit_index): Likewise.
2896 (Dwo_file::copy_section): Likewise.
2897 (Dwo_file::add_unit_set): Likewise.
2898 (Dwp_output_file::add_output_section): Likewise.
2899 (Dwp_output_file::add_contribution): Likewise.
2900 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2901 for empty slot.
2902 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2903 file format.
2904 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2905 slot.
2906 (Dwp_output_file::initialize): Remove unused function.
2907 (Dwp_output_file::finalize): Add support for v2 package file format.
2908 (Dwp_output_file::write_index): Likewise.
2909 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2910 function prototype.
2911
c6905c28
CC
29122013-07-31 Cary Coutant <ccoutant@google.com>
2913
2914 * object.cc (Sized_relobj::do_output_section_address): New function.
2915 (Sized_relobj): Instantiate explicitly.
2916 * object.h (Object::output_section_address): New function.
2917 (Object::do_output_section_address): New function.
2918 (Sized_relobj::do_output_section_address): New function.
2919 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2920
29212013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2922 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2923
2924 * parameters.cc (Parameters::entry): Return target-specific entry
2925 symbol name.
2926 * target.h (Target::entry_symbol_name): New function.
2927 (Target_info::entry_symbol_name): New data member.
2928
2929 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2930 * i386.cc (Target_i386::i386_info): Likewise.
2931 (Target_i386_nacl::i386_nacl_info): Likewise.
2932 * sparc.cc (Target_sparc::sparc_info): Likewise.
2933 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2934 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2935 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2936 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2937
234d4ab8
SA
29382013-07-22 Sterling Augustine <saugustine@google.com>
2939
2940 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2941 Convert parameter shndx to local variable. Add parameters symtab
2942 and symtab_size. Scan over section names. Find relocation
2943 section corresponding to current section. Create and initialize
2944 reloc_mapper_ and reloc_type_.
2945 (Dwarf_pubnames_table::read_header): Add assertion. Change
2946 unit_length to off_t. Initialize member unit_length_. Fill in field
2947 cu_offset_.
2948 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2949 Initialize new fields unit_length_ and cu_offset_.
2950 (Dwarf_pubnames_table::read_section): Update prototype.
2951 (Dwarf_pubnames_table::cu_offset): New member function.
2952 (Dwarf_pubnames_table::subsection_size): Likewise.
2953 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2954 New fields.
2955 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2956 member functions public.
2957 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2958 Update comment. Rework logic. Move repeated parts to...
2959 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2960 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2961 pubtypes_table_, and stmt_list_offset.
2962 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2963 Gdb_index::find_pubtype_offset,
2964 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2965 (Gdb_index::pubnames_read): Update prototype and rework logic.
2966 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2967 Forward declare.
2968 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2969 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2970 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2971 Gdb_index::map_pubtable_to_dies):
2972 Declare functions.
2973 (Gdb_index::pubnames_read): Update declaration.
2974 (Gdb_index::Pubname_offset_map): New type.
2975 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2976 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2977 Gdb_index::stmt_list_offset): Declare.
2978 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2979 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2980 Gdb_index::pubtypes_offset_): Remove.
2981
a3ed37d8
RM
29822013-07-19 Roland McGrath <mcgrathr@google.com>
2983
2984 * options.h (General_options): Add -Trodata-segment option.
2985 * parameters.cc (Parameters::check_rodata_segment): New function.
2986 (Parameters::set_target_once): Call it.
2987 * parameters.h (Parameters): Declare it (private member function).
2988 * layout.cc (load_seg_unusable_for_headers): New function, broken
2989 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2990 then validate rodata segment rather than text segment.
2991 (relaxation_loop_body): Call that.
2992 (is_text_segment): New function. Don't admit a non-executable
2993 segment if TARGET->isolate_execinstr().
2994 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2995
eb5b4ded
CC
29962013-07-15 Shawn Landden <shawnlandden@gmail.com>
2997
2998 PR gold/15070
2999 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3000 * nacl.h (Sniff_file::View::View): Request aligned view.
3001
4d5effb9
CC
30022013-07-11 Cary Coutant <ccoutant@google.com>
3003
3004 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3005 correct BRLT entry size.
3006
ba8ca3e7
AM
30072013-07-03 Alan Modra <amodra@gmail.com>
3008
3009 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3010 comment.
3011
267257d2
CC
30122013-07-01 Cary Coutant <ccoutant@google.com>
3013
3014 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3015 reloc_type_.
3016 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3017 (Dwarf_ranges_table::lookup_reloc): New function.
3018 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3019 reloc_type_.
3020 (Dwarf_ranges_table::lookup_reloc): New function.
3021 (Dwarf_ranges_table::reloc_type_): New data member.
3022
06f30c9d
CC
30232013-06-27 Jing Yu <jingyu@google.com>
3024
3025 PR gold/15662
3026 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3027 function.
3028 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3029 (Target_powerpc::do_relax): Call the above.
3030
a2d7bf59
AM
30312013-06-27 Cary Coutant <ccoutant@google.com>
3032
3033 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3034 on garbage collected .opd section.
3035
30362013-06-27 Alan Modra <amodra@gmail.com>
3037
3038 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3039 is non-zero.
3040 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3041 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3042
32364e50
CC
30432013-06-14 Cary Coutant <ccoutant@google.com>
3044
3045 * resolve.cc (Symbol::override_base): Don't override st_type
3046 from plugin placeholder symbols.
3047 (Symbol_table::resolve): Likewise.
3048 (Symbol_table::should_override): Don't complain about TLS mismatch
3049 if the TO symbol is a plugin placeholder.
3050 * testsuite/Makefile.am (plugin_test_tls): New test.
3051 * testsuite/Makefile.in: Regenerate.
3052 * testsuite/plugin_test_tls.sh: New test script.
3053 * testsuite/two_file_test_2_tls.cc: New test source.
3054 * testsuite/two_file_test_tls.cc: New test source.
3055
7fb47cc9
CC
30562013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3057
3058 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3059 the maximum segment alignment is larger than the page size.
3060 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3061 correctly aligns the symbols with large alignemnt.
3062 * testsuite/Makefile.in: Regenerate.
3063 * testsuite/large_symbol_alignment.cc: New file.
3064
6934001a
CC
30652013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3066 Sriraman Tallam <tmsriram@google.com>
3067
3068 * options.h (sort_section): New option.
3069 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3070 Rename from Input_section_sort_section_name_special_ordering_compare.
3071 (Input_section_sort_section_name_compare): New struct.
3072 * output.cc (Output_section::Input_section_sort_section_name_compare::
3073 operator()): New function.
3074 (Output_section::sort_attached_input_sections): Use new sort function
3075 for .text if --sort-section=name is specified.
3076 * layout.cc (Layout::make_output_section):
3077 Add sorting by name when --sort-section=name is specified.
3078 * testsuite/Makefile.am (text_section_grouping): Test option
3079 --sort-section=name.
3080 * testsuite/Makefile.in: Regenerate.
3081 * testsuite/section_sorting_name.cc: New file.
3082 * testsuite/section_sorting_name.sh: New file.
3083
93acabad
CC
30842013-05-21 Cary Coutant <ccoutant@google.com>
3085
3086 * symtab.h (Symbol::is_cxx_vtable): New function.
3087 * target-reloc.h (relocate_section): Check for vtable symbol.
3088 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3089 * testsuite/Makefile.in: Regenerate.
3090 * testsuite/missing_key_func.cc: New test source.
3091 * testsuite/missing_key_func.sh: New test script.
3092
60e8b3fc
CC
30932013-05-21 Cary Coutant <ccoutant@google.com>
3094
2b64b551
RM
3095 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3096 type of enclosing symbol.
3097 (Relocate_info::location): Check symbol type when describing symbol.
3098 * object.h (Symbol_location_info): Remove unused line_number;
3099 add enclosing_symbol_type.
3100 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3101
9df9de2c
CC
31022013-05-13 Cary Coutant <ccoutant@google.com>
3103
2b64b551
RM
3104 * configure.ac: Export DEFAULT_TARGET.
3105 * configure: Regenerate.
3106 * Makefile.in: Regenerate.
3107 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3108 * testsuite/Makefile.in: Regenerate.
3109 * testsuite/debug_msg.sh: Delete duplicate tests.
3110 Don't check undef_int error message match for powerpc where the
3111 source file and line number aren't available.
9df9de2c 3112
bbc5ae17
RM
31132013-05-10 Roland McGrath <mcgrathr@google.com>
3114
3115 * options.h (General_options): Add --rosegment-gap option.
3116 * options.cc (finalize): --rosegment-gap implies --rosegment.
3117 * layout.cc (set_segment_offsets): Let user option override
3118 target->rosegment_gap().
3119
0c6e6c39
RM
31202013-05-10 Roland McGrath <mcgrathr@google.com>
3121
3122 * options.h (General_options): Remove leading space from help
3123 messages for -nostdlib and --rosegment.
3124
cde7cb01
MR
31252013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3126
3127 PR ld/15365
3128 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3129
f31ae5b8
AM
31302013-05-03 Alan Modra <amodra@gmail.com>
3131
3132 * merge.cc (Output_merge_string::do_add_input_section): Correct
3133 scan for number of strings. Rename vars to avoid shadowing.
3134 Include missing terminator in input_size_.
3135
d3a7cd45
L
31362013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3137
3138 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3139 Restore empty string handling.
3140
6ad3daba
CC
31412013-05-01 Cary Coutant <ccoutant@google.com>
3142
3143 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3144 uninitialized warning.
3145
e31908b6
CC
31462013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3147
3148 * output.cc (Output_section::add_merge_input_section): Allow
3149 to merge sections if the alignment is more than character size.
3150 * merge.h (Output_merge_string::Output_merge_string): Remove
3151 assert.
3152 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3153 only not-null strings. Check the alignment of strings.
3154 * stringpool.h
3155 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3156 alignment as the argument.
3157 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3158 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3159 Align non-zero length strings according to the addralign_.
3160 (Stringpool_template<Stringpool_char>::set_string_offsets):
3161 Updating offsets according to the given alignment.
3162 * testsuite/Makefile.am (text_section_grouping): Test if string
3163 literals are getting merged.
3164 * testsuite/Makefile.in: Regenerate.
3165 * testsuite/merge_string_literals_1.c: New file.
3166 * testsuite/merge_string_literals_2.c: Ditto.
3167 * testsuite/merge_string_literals.sh: Ditto.
3168
0e804863
ILT
31692013-04-26 Ian Lance Taylor <iant@google.com>
3170
3171 * target-reloc.h (relocate_section): If the reloc offset is out of
3172 range, pass VIEW as NULL to relocate.relocate.
3173 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3174 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3175 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3176 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3177 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3178 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3179
e7c5ea40
CC
31802013-04-26 Geoff Pike <gpike@chromium.org>
3181
3182 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3183 * layout.cc (Hash_task): New class.
3184 (Layout::queue_build_id_tasks): New function.
3185 (Layout::write_build_id): Handle single-thread portion of build ID
3186 computation. (In some cases, all of it is single-threaded.) Replace
3187 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3188 functionality in fewer lines of code.
3189 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3190 * options.h (General_options): make "--build-id" default to tree
3191 rather than sha1. Add two new options related to --build-id=tree:
3192 --build-id-chunk-size-for-treehash and
3193 --build-id-min-file-size-for-treehash.
3194 * Makefile.am: add testing of --build-id=tree and related new options
3195 (these tests will be invoked by "make check").
3196 * Makefile.in: Regenerate.
3197
49926cd0
AM
31982013-04-25 Alan Modra <amodra@gmail.com>
3199
3200 * configure.tgt: Add powerpcle and powerpc64le.
3201
a4034750
AM
32022013-04-22 Alan Modra <amodra@gmail.com>
3203
3204 PR gold/15355
3205 * layout.cc (Layout::segment_precedes): Allow more than one
3206 segment with the same type and flags.
3207
e79c84aa
CC
32082013-04-15 Cary Coutant <ccoutant@google.com>
3209
3210 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3211 allocate space in file for BSS sections.
3212
2199fbe7
CC
32132013-04-15 Cary Coutant <ccoutant@google.com>
3214
3215 * script-sections.cc (Orphan_output_section): Reset address
3216 to zero after each orphaned section for relocatable links.
3217
502e8a84
CC
32182013-04-15 Cary Coutant <ccoutant@google.com>
3219
a4034750
AM
3220 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3221 section starting address for relocatable link.
3222 * testsuite/Makefile.am (script_test_11): New test.
3223 * testsuite/Makefile.in: Regenerate.
3224 * testsuite/script_test_11.c: New source file.
3225 * testsuite/script_test_11.t: New linker script.
502e8a84 3226
0cfdc767
AM
32272013-04-13 Alan Modra <amodra@gmail.com>
3228
3229 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3230 owner when sections are not adjacent and exceed group size.
3231 (Target_powerpc::group_sections): Handle corner case.
3232 (Target_powerpc::Branch_info::make_stub): Handle case where
3233 stub table doesn't exist due to branches in non-exec sections.
3234 (Target_powerpc::Relocate::relocate): Likewise.
3235
6830ee24
AM
32362013-04-11 Alan Modra <amodra@gmail.com>
3237
3238 PR gold/15354
3239 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3240 .branch_lt to match bfd ld. Adjust comments throughout file.
3241
54a3d865
ILT
32422013-04-04 Ian Lance Taylor <iant@google.com>
3243
3244 GCC PR c++/56840
3245 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3246 sections before checking whether they are included in the link.
3247
9993ba11
ST
32482013-03-29 Sriraman Tallam <tmsriram@google.com>
3249
3250 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3251 object before calling the plugin claim_file handler. Pass the elf
3252 object of the archive to the plugin. Delete the elf object if the
3253 plugin claims the file.
3254
ebacd51e
AM
32552013-03-21 Alan Modra <amodra@gmail.com>
3256
3257 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3258 segment when omagic.
3259
117be58f
AM
32602013-03-21 Alan Modra <amodra@gmail.com>
3261
3262 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3263 comparison warning.
3264 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3265 uninitialized" warning.
3266
32e2b61d
AM
32672013-03-20 Alan Modra <amodra@gmail.com>
3268
3269 * symtab.h (Symbol::clear_version): New function.
3270 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3271 is_needed by weak references. Clear version for symbols defined
3272 in as-needed objects that are not needed.
3273
b3ccdeb5
AM
32742013-03-15 Alan Modra <amodra@gmail.com>
3275
3276 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3277 static and public. Add report_err param. Return false for data refs.
3278 (Target_powerpc::rela_dyn_section): New overloaded function.
3279 (Target_powerpc::plt_, iplt_): Elucidate.
3280 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3281 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3282 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3283 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3284 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3285 push_branch and make_plt_entry for ifunc syms when
3286 reloc_needs_plt_for_ifunc.
3287 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3288 for ifunc unless reloc_needs_plt_for_ifunc.
3289
ad3d8a2f
AM
32902013-03-15 Alan Modra <amodra@gmail.com>
3291
3292 * gc.h (gc_process_relocs): Don't look through function descriptors.
3293 * icf.cc (get_section_contents): Do so here instead.
3294
4d9aa155
AM
32952013-03-13 Alan Modra <amodra@gmail.com>
3296
3297 * powerpc.cc (is_branch_reloc): Forward declare.
3298 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3299 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3300 false for 64-bit, true for 32-bit non-branch relocs.
3301 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3302 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3303 nm output.
3304 (icf_safe_test): Generate linker map file as well as nm output.
3305 (icf_safe_so_test): Likewise.
3306 * testsuite/Makefile.in: Regenerate.
3307 * testsuite/icf_test.sh: Parse linker map file to determine
3308 section folding.
3309 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3310 * testsuite/icf_safe_so_test.sh: Likewise.
3311 (X86_32_or_ARM_specific_safe_fold): Merge into..
3312 (arch_specific_safe_fold): ..this.
3313 (X86_64_specific_safe_fold): Delete unused function.
3314
57420c20
AM
33152013-03-12 Alan Modra <amodra@gmail.com>
3316
3317 * gc.h (gc_process_relocs): Look through function descriptors
3318 to determine shndx, symvalue and addend used by ICF. Tidy
3319 variable duplication.
3320
dc3714f3
AM
33212013-03-11 Alan Modra <amodra@gmail.com>
3322
3323 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3324 * layout.cc (Layout_task_runner::run): ..to here.
3325 * symtab.h (struct Symbol_location): Extract from..
3326 (class Symbol_table): ..here.
3327 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3328 * target.h (class Target): Add function_location and
3329 do_function_location functions.
3330 (class Sized_target): Add do_function_location.
3331 * object.h (class Sized_relobj_file): Move find_shdr..
3332 (class Object): ..to here.
3333 * object.cc: Likewise. Update to suit. Instantiate.
3334 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3335 * powerpc.cc (class Powerpc_dynobj): New.
3336 (Target_powerpc::do_function_location): New function.
3337 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3338 (Powerpc_dynobj::do_read_symbols): New function.
3339 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3340
956b03bb
ILT
33412013-03-08 Ian Lance Taylor <iant@google.com>
3342
3343 * options.cc (General_options::string_to_object_format): Accept
3344 "default".
3345
4bead2d5
AM
33462013-03-08 Alan Modra <amodra@gmail.com>
3347
3348 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3349 pointer to Post_fde.
3350 (struct Post_fde): Move definition to here..
3351 * ehframe.cc (struct Post_fde): ..from here.
3352 (Cie::write): Don't alloc Post_fde.
3353 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3354
02e60bf7
AM
33552013-03-07 Alan Modra <amodra@gmail.com>
3356
3357 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3358 relocation referencing .LC0.
3359 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3360
8343f03a
AM
33612013-03-07 Alan Modra <amodra@gmail.com>
3362
3363 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3364 always_inline. Add assembly for powerpc to avoid GOT.
3365
3366d57c
AM
33662013-03-07 Alan Modra <amodra@gmail.com>
3367
3368 * testsuite/script_test_10.sh: Don't test .bss section
3369 header number.
3370
6c77229c
AM
33712013-03-06 Alan Modra <amodra@gmail.com>
3372
3373 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3374 (Target_powerpc::symval_for_branch): Add symtab param. Update
3375 all callers. Handle folded sections.
3376 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3377 to Powerpc_relobj.
3378 (Global_symbol_visitor_opd::operator()): Likewise.
3379
a39e4af6
AM
33802013-03-04 Alan Modra <amodra@gmail.com>
3381
3382 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3383 * testsuite/Makefile.in: Regenerate.
3384
d5834edb
CC
33852013-03-01 Cary Coutant <ccoutant@google.com>
3386
3387 Add dwp support for v2 DWARF package file format.
3388 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3389 tu_length parameter. Adjust all callers.
3390 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3391 * dwp.cc: Include dwarf.h.
3392 (Section_bounds): New struct type.
3393 (Unit_set): New struct type.
3394 (Dwo_file::Dwo_file): Initialize new data member.
3395 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3396 Combine and rename to...
3397 (Dwo_file::read_unit_index): ...this.
3398 (Dwo_file::sized_read_compunit_index)
3399 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3400 (Dwo_file::sized_read_unit_index): ...this.
3401 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3402 parameters; add section_id parameter.
3403 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3404 (Dwo_file::add_unit_set): ...this.
3405 (Dwo_file::shndx_map_): Remove.
3406 (Dwo_file::sect_offsets_): New data member.
3407 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3408 (Dwp_output_file::add_section): Rename to...
3409 (Dwp_output_file::add_contribution): ...this.
3410 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3411 (Dwp_output_file::add_tu_set): Likewise.
3412 (Dwp_output_file::Contribution): New type.
3413 (Dwp_output_file::Section::contributions): New data member.
3414 (Dwp_output_file::Cu_or_tu_set): Remove.
3415 (Dwp_output_file::Section::Section): New ctor.
3416 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3417 (Dwp_output_file::Dwp_index::Section_table): New type.
3418 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3419 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3420 parameter.
3421 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3422 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3423 (Dwp_output_file::Dwp_index::section_table): New member function.
3424 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3425 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3426 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3427 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3428 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3429 (Dwp_output_file::Dwp_index::section_table_): New data member.
3430 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3431 (Dwp_output_file::add_output_section): New member function.
3432 (Dwp_output_file::write_new_section): New member function.
3433 (Dwp_output_file::write_contributions): New member function.
3434 (Dwp_output_file::section_id_map_): New data member.
3435 (class Dwo_id_info_reader): Remove.
3436 (class Unit_reader): New class.
3437 (get_dwarf_section_name): New function.
3438 (Dwo_file::read_executable): Adjust initializations of class data.
3439 (Dwo_file::read): Add support for v2 package file format.
3440 (Dwo_file::read_unit_index): Likewise.
3441 (Dwo_file::sized_read_unit_index): Likewise.
3442 (Dwo_file::copy_section): Likewise.
3443 (Dwo_file::add_unit_set): Likewise.
3444 (Dwp_output_file::add_output_section): Likewise.
3445 (Dwp_output_file::add_contribution): Likewise.
3446 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3447 for empty slot.
3448 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3449 file format.
3450 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3451 slot.
3452 (Dwp_output_file::initialize): Remove unused function.
3453 (Dwp_output_file::finalize): Add support for v2 package file format.
3454 (Dwp_output_file::write_index): Likewise.
3455 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3456 function prototype.
3457
a68a081d
CC
34582013-03-01 Cary Coutant <ccoutant@google.com>
3459
3460 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3461 function into class definition in header file.
3462 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3463 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3464 New function.
3465 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3466
9d5781f8
AM
34672013-02-28 Alan Modra <amodra@gmail.com>
3468
3469 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3470 * target.cc (Target::do_plt_fde_location): New function.
3471 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3472 accessor function, and constructor param.
3473 (struct Post_fde, Post_fdes): Declare.
3474 (Cie::write): Add post_fdes param.
3475 * ehframe.cc (Fde::write): Use plt_fde_location.
3476 (struct Post_fde): Define.
3477 (Cie::write): Stash FDEs added post merge mapping.
3478 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3479 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3480 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3481 other FDEs.
3482 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3483 (Target_powerpc::has_glink): New function.
3484 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3485 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3486 glink_eh_frame_fde_32, default_fde): New data.
3487 (Stub_table::eh_frame_added_): New var.
3488 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3489 Make const.
3490 (Stub_table::add_eh_frame): New function.
3491 (Output_data_glink::add_eh_frame): New function.
3492 (Target_powerpc::make_glink_section): Call add_eh_frame.
3493
214383dd
ILT
34942013-02-15 Ian Lance Taylor <iant@google.com>
3495
3496 * options.h (DEFINE_uint64_alias): Define.
3497 (class General_options): Add -Ttext-segment as an alias for
3498 -Ttext.
3499
91c2b899
AM
35002013-02-15 Alan Modra <amodra@gmail.com>
3501
3502 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3503 (Stub_table::do_write): ..here, two places.
3504 (Stub_table::plt_call_size): Use it here too.
3505
20e2a8aa
ILT
35062013-02-11 Ian Lance Taylor <iant@google.com>
3507
3508 * descriptors.cc (Descriptors::close_all): New function.
3509 * descriptors.h (class Descriptors): Declare close_all.
3510 (close_all_descriptors): New inline function.
3511 * plugin.cc: Include "descriptors.h".
3512 (Plugin_manager::cleanup): Call close_all_descriptors.
3513
8952bc69
AM
35142013-02-06 Alan Modra <amodra@gmail.com>
3515
3516 * README: Update coding style link.
3517
29bd8b6b
CC
35182013-01-28 Cary Coutant <ccoutant@google.com>
3519
a4034750
AM
3520 * dwp.cc (File_list): New typedef.
3521 (Dwo_name_info_reader): New class.
3522 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3523 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3524 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3525 (Dwo_file::read_executable): New function.
3526 (Dwo_file::read): Move common setup code to ...
3527 (Dwo_file::make_object): ... here.
3528 (dwp_options): Add --exec/-e.
3529 (usage): Likewise.
3530 (main): Likewise.
29bd8b6b 3531
c6ac678d
ST
35322013-01-24 Sriraman Tallam <tmsriram@google.com>
3533
3534 * layout.cc (Layout::layout): Check for option text_reorder.
3535 (Layout::make_output_section): Ditto.
3536 * options.h (text_reorder): New option.
3537 * output.cc (Input_section_sort_compare): Remove special ordering
3538 of section names.
3539 (Output_section::
3540 Input_section_sort_section_name_special_ordering_compare::
3541 operator()): New function.
3542 (Output_section::sort_attached_input_sections): Use new sort function
3543 for .text.
3544 * output.h (Input_section_sort_section_name_special_ordering_compare):
3545 New struct.
3546 * testsuite/Makefile.am (text_section_grouping): Test option
3547 --no-text-reorder
3548 * testsuite/Makefile.in: Regenerate.
3549 * testsuite/text_section_grouping.sh: Check order of functions without
3550 default text reordering.
3551
50701cc1
MF
35522013-01-18 Mike Frysinger <vapier@gentoo.org>
3553
3554 * options.h (General_options): Change default to true for new_dtags.
3555
b1b00fcc
MF
35562013-01-18 Mike Frysinger <vapier@gentoo.org>
3557
3558 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3559 when enable_new_dtags is false. Only add DT_RUNPATH when
3560 enable_new_dtags is true.
3561
ec5b8187
AM
35622013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3563
3564 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3565 used in declaration and definition consistent.
3566 (Target_powerpc::symval_for_branch): Ditto.
3567
a880d4c4
ST
35682013-01-16 Sriraman Tallam <tmsriram@google.com>
3569
3570 * testsuite/plugin_final_layout.cc: Fix comment.
3571
7c381248
ST
35722013-01-16 Sriraman Tallam <tmsriram@google.com>
3573
3574 * layout.cc (Layout::layout): Do not do default sorting for
3575 text sections when section ordering is specified.
3576 (make_output_section): Ditto.
3577 * testsuite/plugin_final_layout.cc: Name the function sections
3578 to catch reordering issues.
3579
e2458743
AM
35802013-01-15 Alan Modra <amodra@gmail.com>
3581
3582 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3583 plt-thread-safe.
3584
431ed302
AM
35852013-01-15 Alan Modra <amodra@gmail.com>
3586
3587 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3588 * testsuite/Makefile.in: Regenerate.
3589
0ec6429b
AM
35902013-01-14 Alan Modra <amodra@gmail.com>
3591
3592 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3593 * testsuite/Makefile.in: Regenerate.
3594
0bf402d5
ILT
35952013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3596
36af3926 3597 PR bfd/14430
0bf402d5
ILT
3598 Fix mingw gold build with plugins enabled
3599 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3600 * configure.ac: Export DLOPEN_LIBS and add headers check.
3601 * plugin.cc: Handle non-dlfcn case.
3602 * Makefile.in: Regenerate.
3603 * config.in: Regenerate.
3604 * configure: Regenerate.
3605 * testsuite/Makefile.in: Regenerate.
3606
9e9143bc
ST
36072013-01-09 Sriraman Tallam <tmsriram@google.com>
3608
3609 * output.h (sort_attached_input_sections): Change to be public.
3610 * script-sections.cc
3611 (Output_section_definition::set_section_addresses): Sort
3612 attached input sections according to section order before linker
3613 script assigns section addresses.
3614 (Orphan_output_section::set_section_addresses): Sort
3615 attached input sections according to section order before linker
3616 script assigns section addresses.
3617 * Makefile.am (final_layout.sh): Use a simple linker script to
3618 check if section ordering still works.
3619 * Makefile.in: Regenerate.
3620
679af368
ILT
36212013-01-09 Ben Cheng <bccheng@google.com>
3622
3623 * arm.cc (Target_arm::attributes_accept_div): New function.
3624 (Target_arm::attributes_forbid_div): New function.
3625 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3626 attribute using the same new functions as what bfd/elf32_arm.c
3627 does.
3628
3136a00e
CC
36292013-01-07 Cary Coutant <ccoutant@google.com>
3630
3631 PR gold/14993
3632 * output.cc (Output_section::add_input_section): For incremental
3633 updates, don't track input sections that are allocated from patch
3634 space.
3635
f2a6224b
L
36362013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3637 Ian Lance Taylor <iant@google.com>
3638
3639 PR gold/14897
3640 * configure.ac (--enable-ld): Removed.
3641 (install_as_default): Set to yes only for --enable-gold=default
3642 or --disable-ld.
3643 * configure: Regenerated.
3644
4f46f626
L
36452013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3646
3647 * options.h (General_options): Add -fuse-ld= for GCC linker
3648 option compatibility.
3649
26e4ef59
CC
36502013-01-04 Cary Coutant <ccoutant@google.com>
3651
3652 * configure.ac: Fix typo restoring CXXFLAGS.
3653 * configure: Regenerate.
3654
3d587466
CC
36552013-01-04 Cary Coutant <ccoutant@google.com>
3656
4f46f626
L
3657 * testsuite/Makefile.am (CXXLINK_S): New macro.
3658 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3659 * testsuite/Makefile.in: Regenerate.
3d587466 3660
44db6695
L
36612013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3662
3663 * version.cc (print_version): Update copyright year to 2013.
3664
edcac0c1
ILT
36652012-12-20 Ian Lance Taylor <iant@google.com>
3666
3667 * layout.cc (Layout::special_ordering_of_input_section): New
3668 function.
3669 (Layout::layout): If input section requires special ordering, must
3670 sort input sections.
3671 (Layout::make_output_section): May sort .text input sections.
3672 (Layout::is_section_name_prefix_grouped): Remove.
3673 * layout.h (class Layout): Declare
3674 special_ordering_of_input_section. Don't declare
3675 is_section_name_prefix_grouped.
3676 * output.cc (Output_section::add_input_section): Revert last
3677 change.
3678 (Output_section::Input_section_sort::match_file_name): Don't crash
3679 if called on output section data.
3680 (Output_section::Input_section_sort_compare): Sort based on
3681 special ordering.
3682 (Output_section::Input_section_sort_section_order_index_compare):
3683 Revert last patch.
3684 (Output_section::sort_attached_input_sections): Likewise.
3685
28f2a4ac
ST
36862012-12-18 Sriraman Tallam <tmsriram@google.com>
3687
edcac0c1 3688 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3689 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3690 * output.cc (Output_section::add_input_section): Check if section
3691 name contains special prefix. Keep input sections to sort such
3692 sections.
3693 (Output_section::Input_section_sort_section_order_index_compare
3694 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3695 (Output_section::sort_attached_input_sections): Add condition to
3696 Input_section_entry constructor call.
28f2a4ac
ST
3697 * testsuite/Makefile.am (text_section_grouping): New test.
3698 * testsuite/Makefile.in: Regenerate.
3699 * testsuite/text_section_grouping.cc: New file.
3700 * testsuite/text_section_grouping.sh: New file.
3701
5bf135a7
NC
37022012-12-17 Nick Clifton <nickc@redhat.com>
3703
3704 * Makefile.am: Add copyright notice.
3705 * NEWS: Likewise.
3706 * README: Likewise.
3707 * configure.ac: Likewise.
3708 * ftruncate.c: Likewise.
3709 * Makefile.in: Regenerate.
3710
59965708
CC
37112012-12-14 Cary Coutant <ccoutant@google.com>
3712
a4034750
AM
3713 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3714 --no-as-needed flag.
3715 (exception_separate_shared_12_test): Likewise.
3716 (incremental_copy_test): Likewise.
3717 * testsuite/Makefile.in: Regenerate.
59965708 3718
2a77e2ab
CC
37192012-12-14 Cary Coutant <ccoutant@google.com>
3720
3721 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3722 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3723
e3deeb9c
AM
37242012-12-12 Alan Modra <amodra@gmail.com>
3725
3726 * powerpc.cc (class Track_tls): New.
3727 (class Relocate, class Scan): Inherit Track_tls.
3728 (Target_powerpc::Scan::local, global): Track tls optimization
3729 and avoid creating plt entry for __tls_get_addr if all uses
3730 are optimized away.
3731 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3732
d8f5a274
AM
37332012-12-12 Alan Modra <amodra@gmail.com>
3734
3735 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3736 Replace no_toc_optimize with toc_optimize.
3737 * output.h (Output_section::input_sections): Provide non-const variant.
3738 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3739 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3740 accessors.
3741 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3742 (class Sort_toc_sections): New.
3743 (Target_powerpc::do_finalize_sections): Sort toc sections.
3744 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3745
4c8a1de1
RM
37462012-12-10 Roland McGrath <mcgrathr@google.com>
3747
3748 * testsuite/binary_unittest.cc (read_all): New function.
3749 (Sized_binary_test): Use it instead of ::read.
3750 * fileread.cc (do_read): Don't assume pread always reads the whole
3751 amount in a single call.
3752
edc27beb
AM
37532012-12-10 Alan Modra <amodra@gmail.com>
3754
3755 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3756 Set EM_PPC64 or EM_PPC here.
3757 (Target_selector_powerpc::do_recognize): Delete.
3758
906b9150
AM
37592012-12-10 Alan Modra <amodra@gmail.com>
3760
3761 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3762 stub_table_.
3763 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3764
418c15ae
RM
37652012-12-07 Roland McGrath <mcgrathr@google.com>
3766
3767 * testsuite/binary_unittest.cc (Sized_binary_test):
3768 Use open_descriptor rather than ::open.
3769
decdd3bc
AM
37702012-12-07 Alan Modra <amodra@gmail.com>
3771
3772 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3773 typedef and invalid_address constant.
3774 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3775 instantiate constants.
3776
db399005
ILT
37772012-12-06 Roland McGrath <mcgrathr@google.com>
3778
3779 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3780 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3781 * aclocal.m4: Regenerate.
3782 * configure: Regenerate.
3783 * Makefile.in: Regenerate.
3784 * testsuite/Makefile.in: Regenerate.
3785
aba6bc71
AM
37862012-12-07 Alan Modra <amodra@gmail.com>
3787
3788 * options.h (General_options): Add no_toc_optimize.
3789 * powerpc.cc (ok_lo_toc_insn): New function.
3790 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3791
9e69ed50
AM
37922012-12-06 Alan Modra <amodra@gmail.com>
3793
3794 * options.h (General_options): Add plt_align, plt_static_chain,
3795 plt_thread_safe. Update stub_group_size help text.
3796 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3797 for new plt_thread_safe_ var.
3798 (use_plt_offset): Correct comments.
3799 (Target_powerpc::do_relax): Look for thread creation symbols to
3800 determine default plt_thread_safe value. Clear plt call stubs
3801 as well as branch stubs each iteration.
3802 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3803 insn constants.
3804 (l, hi, ha, write_insn): Move earlier.
3805 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3806 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3807 plt stubs too.
3808 (Stub_table::update_size): Adjust.
3809 (Stub_table::prev_size, set_prev_size): Delete.
3810 (Stub_table::stub_align): Let --plt-align affect result.
3811 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3812 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3813 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3814 (Stub_table::do_write): Support more stub variants.
3815
f43ba157
AM
38162012-12-04 Alan Modra <amodra@gmail.com>
3817
3818 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3819 (Target_powerpc::do_define_standard_symbols): New function.
3820
34171bc5
AM
38212012-12-03 Alan Modra <amodra@gmail.com>
3822
3823 * output.h: Formatting, whitespace.
3824
dc9589e9 38252012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3826
3827 * layout.h (Layout::get_executable_sections): Declare.
3828 * layout.cc (Layout::get_executable_sections): New function.
3829 * arm.cc (Target_arm::group_sections): Use it.
3830 (Arm_output_section::group_sections): Delete now redundant test.
3831 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3832 param to handle relative relocs.
3833 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3834 (Output_data_reloc::add_absolute): Adjust.
3835 (Output_data_reloc::add_relative): New function.
3836 (Output_data::reset_data_size): New function.
3837 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3838 (Output_section::set_addralign): New function.
3839 (Output_section::checkpoint_set_addralign): New function.
3840 (Output_section::clear_section_offsets_need_adjustment): New function.
3841 (Output_section::input_sections): Make public.
3842 * powerpc.cc (class Output_data_brlt_powerpc): New.
3843 (class Stub_table, class Stub_control): New.
3844 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3845 stub_table_, set_stub_table, stub_table): New vectors and accessor
3846 functions.
3847 (Target_powerpc::do_may_relax, do_relax, push_branch,
3848 new_stub_table, stub_tables, brlt_section, group_sections,
3849 add_branch_lookup_table, find_branch_lookup_table,
3850 write_branch_lookup_table, make_brlt_section): New functions.
3851 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3852 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3853 branch_info_): New vars.
3854 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3855 make call stubs here.
3856 (Output_data_glink): Remove all call stub handling from this class.
3857 (Target_powerpc::Scan::local, global): Save interesting branch
3858 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3859 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3860 functions on final link.
3861 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3862 Handle long branch destinations too.
3863 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3864 do_plt_address_for_local): Adjust lookup of plt call stubs.
3865
627b30b7
AM
38662012-11-30 Alan Modra <amodra@gmail.com>
3867
3868 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3869 relocs against protected symbols when building 32-bit shared libs.
3870
40b469d7
AM
38712012-11-30 Alan Modra <amodra@gmail.com>
3872
3873 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3874 param. Call got_section() to make .got. Update all callers
3875 and their callers and so on.
3876
bb66a627
AM
38772012-11-30 Alan Modra <amodra@gmail.com>
3878
3879 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3880 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3881 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3882 value if it already exists.
3883
d2cf1c6c
L
38842012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3885
3886 PR gold/14858
3887 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3888
edccdf7c
RM
38892012-11-14 Roland McGrath <mcgrathr@google.com>
3890
3891 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3892 than bfc instruction for data sandboxing.
3893
6febeb74
AM
38942012-11-08 Alan Modra <amodra@gmail.com>
3895
3896 * po/POTFILES.in: Regenerate.
3897
0a6f1bf2
AM
38982012-11-05 Alan Modra <amodra@gmail.com>
3899
3900 * configure.ac: Apply 2012-09-10 change to config.in here.
3901 * configure: Regenerate.
3902
26a4e9cb
AM
39032012-11-05 Alan Modra <amodra@gmail.com>
3904
3905 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3906 (struct Opd_ent): Use "Address" rather than "Offset".
3907 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3908 (Target_powerpc::got_section): Make public.
3909 (Target_powerpc::scan_relocs): Move code setting symbols..
3910 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3911 Create _SDA_BASE_ only when referenced.
3912
cc928013
RM
39132012-11-02 Roland McGrath <mcgrathr@google.com>
3914
3915 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3916 from last change.
3917
50ed5eb1
RM
39182012-11-01 Roland McGrath <mcgrathr@google.com>
3919
62fe925a
RM
3920 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3921 for offset_in_output_section parameter.
3922 (Sized_target::relocate_special_relocatable): Likewise.
3923 * arm.cc (Target_arm::relocate_relocs): Likewise.
3924 (Target_arm::relocate_special_relocatable): Likewise.
3925 * i386.cc (Target_i386::relocate_relocs): Likewise.
3926 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3927 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3928 * target-reloc.h (relocate_relocs): Likewise.
3929 * testsuite/testfile.cc (Target_test): Likewise.
3930 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3931 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3932
3933 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3934 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3935
3936 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3937 parameter, which is unused in the [!F_SETFD] case.
3938
50ed5eb1
RM
3939 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3940 SYMNDX to off_t before comparing it to this->data_size().
3941 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3942 * incremental.cc (Output_section_incremental_inputs::do_write):
3943 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3944
2cadc0bf
RM
3945 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3946
3bfcb652
NC
39472012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3948
3949 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3950 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3951 in EABI_VER5.
3952
c1a8d56e
CC
39532012-10-29 Cary Coutant <ccoutant@google.com>
3954
3955 * dwp.cc (usage): Add file and exit status parameters;
3956 add --help and --version options.
3957 (print_version): New function.
3958 (main): Add --help and --version options.
3959
b2490a7b
L
39602012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3961
3962 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3963 final_layout_sequence.txt.
3964 * testsuite/Makefile.in: Regenerated.
3965
aa543512
L
39662012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3967
3968 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3969 COMPILE generated by automake.
3970 (LINK1): Likewise.
3971 (CXXCOMPILE1): Likewise.
3972 (CXXLINK1): Likewise.
3973 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3974 (LINK): Likewise.
3975 (CXXCOMPILE): Likewise.
3976 (CXXLINK): Likewise.
3977 * testsuite/Makefile.in: Regenerated.
3978
d361fafb
L
39792012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3980
3981 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3982 on bad fwrite return.
3983
598c7410
L
39842012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3985
3986 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3987 on val.
3988
35c813e2
CC
39892012-10-23 Cary Coutant <ccoutant@google.com>
3990
3991 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3992 * testsuite/Makefile.in: Regenerate.
3993 * testsuite/dwp_test.h: New source file.
3994 * testsuite/dwp_test_1.cc: New source file.
3995 * testsuite/dwp_test_1.s: New source file.
3996 * testsuite/dwp_test_1.sh: New source file.
3997 * testsuite/dwp_test_1b.cc: New source file.
3998 * testsuite/dwp_test_1b.s: New source file.
3999 * testsuite/dwp_test_2.cc: New source file.
4000 * testsuite/dwp_test_2.s: New source file.
4001 * testsuite/dwp_test_2.sh: New source file.
4002 * testsuite/dwp_test_main.cc: New source file.
4003 * testsuite/dwp_test_main.s: New source file.
4004
77429909
CC
40052012-10-23 Cary Coutant <ccoutant@google.com>
4006
4007 * dwp.h: New header file.
4008 * dwp.cc: New source file.
4009 * gold.h: Move shared declarations to system.h.
4010 * system.h: New header file.
4011 * Makefile.am: Add dwp.
4012 * Makefile.in: Regenerate.
4013
ed5d6712
CC
40142012-10-23 Cary Coutant <ccoutant@google.com>
4015
4016 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4017 Dwarf_info_reader::read_from_pointer.
4018 (Dwarf_pubnames_table::read_header): Likewise.
4019 (Dwarf_pubnames_table::next_name): Likewise.
4020 (Dwarf_die::read_attributes): Likewise.
4021 (Dwarf_die::skip_attributes): Likewise.
4022 (Dwarf_info_reader::read_from_pointer): New function template.
4023 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4024 (Dwarf_pubnames_table): Likewise.
4025 (Dwarf_info_reader::read_from_pointer): New function template.
4026 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4027 Dwarf_pubnames_table ctor.
4028
8787852d
CC
40292012-10-23 Cary Coutant <ccoutant@google.com>
4030
4031 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4032 abbrev_shndx.
4033 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4034 abbrev_shndx_.
4035 (Dwarf_info_reader::set_abbrev_shndx): New method.
4036 (Dwarf_info_reader::abbrev_shndx_): New data member.
4037
9fc236f3
CC
40382012-10-23 Cary Coutant <ccoutant@google.com>
4039
4040 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4041 from object, not parameters.
4042 (Dwarf_info_reader::parse): Likewise.
4043 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4044 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4045 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4046 methods.
4047
effe8365
CC
40482012-10-23 Cary Coutant <ccoutant@google.com>
4049
4050 * fileread.cc (Input_file::Input_file): New constructor.
4051 * fileread.h (class Input_file): Add new constructor.
4052
1698990d
AM
40532012-10-18 Alan Modra <amodra@gmail.com>
4054
4055 PR gold/14727
4056 * object.cc (Relobj::is_section_name_included): Also match
4057 .sdata personality section.
4058
168a4726
AM
40592012-10-18 Alan Modra <amodra@gmail.com>
4060
4061 * target-reloc.h (class Default_comdat_behavior): New, package up..
4062 (get_comdat_behaviour): ..this.
4063 (relocate_section): Add Relocate_comdat_behavior template arg,
4064 adjust code to suit.
4065 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4066 (Target_arm::scan_reloc_section): Likewise.
4067 * i386.cc (Target_i386::relocate_section): Likewise.
4068 * sparc.cc (Target_sparc::relocate_section): Likewise.
4069 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4070 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4071 * powerpc.cc (class Relocate_comdat_behavior): New.
4072 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4073 gold::relocate_section with new template arg.
4074
acc276d8
AM
40752012-10-18 Alan Modra <amodra@gmail.com>
4076
4077 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4078 dynamic relocs for GOT_TPREL got entries, without symbol if
4079 resolving locally.
4080 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4081 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4082 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4083
e10f9870
AM
40842012-10-17 Alan Modra <amodra@gmail.com>
4085
4086 PR gold/14726
4087 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4088
ae034989
ST
40892012-10-16 Sriraman Tallam <tmsriram@google.com>
4090
4091 * layout.cc (Layout::include_section): Keep sections marked
4092 SHF_EXCLUDE when doing relocatable links.
4093
f3a0ed29
AM
40942012-10-16 Alan Modra <amodra@gmail.com>
4095
4096 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4097 (Target_powerpc::do_finalize_sections): Call it.
4098 (Output_data_save_res): New class and supporting functions.
4099 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4100 normal symbols defined in object files.
4101
c6de8ed4
AM
41022012-10-12 Alan Modra <amodra@gmail.com>
4103
4104 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4105 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4106 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4107 section if scan_opd_relocs not yet called.
4108 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4109
03e25981
AM
41102012-10-12 Alan Modra <amodra@gmail.com>
4111
4112 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4113 add_local_ifunc_entry): Revert last change.
4114 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4115
c9824451
AM
41162012-10-05 Alan Modra <amodra@gmail.com>
4117
4118 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4119 do_plt_address_for_global): New functions.
4120 (Output_data_got_powerpc::do_write): Don't segfault when linking
4121 statically.
4122 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4123 add_local_ifunc_entry): Return true on adding entry..
4124 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4125 glink->add_entry call. Remove unused symtab param. Adjust calls.
4126 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4127 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4128 set up symbols here.
4129 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4130 syms here. Do so even when no .iplt. Don't segfault when linking
4131 statically.
4132 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4133 new variants without reloc param.
4134 (Glink_sym_ent::Glink_sym_ent): Likewise.
4135 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4136 reloc when refs will resolve to plt call stub.
4137 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4138 R_PPC_PLTREL24 to resolve locally.
4139 (Target_powerpc::Scan::global): Correct ifunc handling.
4140 (Target_powerpc::Relocate::relocate): Correct local sym glink
4141 lookup. Don't destroy "value" when we have a plt call stub,
4142 and when checking plt call validity.
4143 (Target_powerpc::do_dynsym_value): Simplify.
4144
19fec8c1
AM
41452012-10-05 Alan Modra <amodra@gmail.com>
4146
4147 * i386.cc (Output_data_plt_i386::address_for_global,
4148 address_for_local): Add plt offset to returned value. Adjust uses.
4149 * sparc.cc (Output_data_plt_sparc::address_for_global,
4150 address_for_local): Likewise.
4151 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4152 address_for_local): Likewise.
4153 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4154 address_for_local): Likewise.
4155 * target.h (Target::plt_address_for_global, plt_address_for_local):
4156 Update comment.
4157 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4158 (Output_data_got::Got_entry::write): Nor here.
4159 * output.h: Comment fix.
4160
e867b647
WL
41612012-10-02 Jiong Wang <jiwang@tilera.com>
4162
4163 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4164 global_offset_table_ value for larget got.
4165 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4166
e5d5f5ed
AM
41672012-09-29 Alan Modra <amodra@gmail.com>
4168
4169 * powerpc.cc (Target_powerpc::iplt_): New output section.
4170 (Target_powerpc::iplt_section, make_iplt_section,
4171 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4172 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4173 Target_powerpc::plt_entry_count): Count iplt entries too.
4174 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4175 reloc section in constructor. New params.
4176 (Target_powerpc::make_plt_section): Create reloc section here instead.
4177 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4178 functions.
4179 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4180 (Output_data_glink::add_entry, find_entry): New functions to
4181 deal with local syms.
4182 (Glink_sym_ent): Add support for local syms.
4183 (Output_data_glink::do_write): Handle ifunc plt entries.
4184 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4185 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4186 (Target_powerpc::Relocate::relocate): Likewise.
4187 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4188
ec4dbad3
AM
41892012-09-25 Alan Modra <amodra@gmail.com>
4190
4191 * object.h (Sized_relobj_file::adjust_local_symbol,
4192 do_adjust_local_symbol): New functions.
4193 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4194 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4195 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4196 and irregular opd entry spacing.
4197 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4198 (Global_symbol_visitor_opd): New functor.
4199 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4200 on deleted opd entries.
4201
5c0b3823
WL
42022012-09-15 Jiong Wang <jiwang@tilera.com>
4203
4204 * tilegx.cc: New file.
4205 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4206 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4207 * configure.tgt: Add entries for tilegx*.
4208 * configure.ac: Likewise.
4209 * Makefile.in: Rebuild.
4210 * configure: Likewise.
4211 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4212 tilegx.
4213
bfdfa4cd
AM
42142012-09-13 Alan Modra <amodra@gmail.com>
4215
4216 * target-reloc.h (scan_relocs): Call scan.local for relocs
4217 against symbols in discarded sections. Pass is_discarded
4218 param.
4219 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4220 Add is_discarded param.
4221 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4222 is_discarded to flag opd entry as discarded. Don't emit dyn
4223 relocs on such entries.
4224 (Target_powerpc::Scan::global): Similarly detect and handle
4225 such opd entries.
4226 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4227 opd_ent_. Update all uses.
4228 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4229 (Target_powerpc::relocate_section): Zero out discarded opd
4230 entry relocs.
4231
d77a0555
ILT
42322012-09-12 Ian Lance Taylor <iant@google.com>
4233
4234 PR gold/14570
4235 * output.cc: Rename Output_data_got template parameter from size
4236 to got_size for all functions. Compile all variants of
4237 Output_data_got.
4238 (Output_data_got::Got_entry::write): Correct use of size for
4239 symbol value. Use local_is_tls rather than casting to
4240 Sized_relobj_file.
4241 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4242 (class Sized_relobj_file): Add do_local_is_tls.
4243 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4244
815a1205
AM
42452012-09-11 Alan Modra <amodra@gmail.com>
4246
4247 PR gold/14566
4248 * layout.cc (Layout::set_segment_offsets): When using
4249 common-page-size alignment, ensure we are on a new max-page-size
4250 page.
4251 * output.cc (Output_segment::set_section_addresses): Use
4252 abi_pagesize, not common_pagesize for relro boundary.
4253 (Output_segment::set_offset): Likewise.
4254
bd73a62d
AM
42552012-09-11 Alan Modra <amodra@gmail.com>
4256
4257 * output.h (Output_data_got::add_global_tls, add_local_tls,
4258 add_local_tls_pair): New functions.
4259 (Output_data_got::add_local_pair_with_rel): Remove second
4260 reloc param. Expand comment.
4261 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4262 use_plt_or_tls_offset_, similarly for constructor param.
4263 (Output_data_got::Got_entry::write): Add got_index param.
4264 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4265 add_local_tls_pair): New functions.
4266 (Output_data_got::Got_entry::write): Handle tls symbols
4267 with use_plt_or_tls_offset_ set specially.
4268 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4269 (Output_data_got::do_write): Replace iterator with index, pass
4270 index to entry write function.
4271 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4272 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4273 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4274 call.
4275 * i386.cc (Target_i386::Scan::local): Likewise.
4276 * sparc.cc (Target_sparc::Scan::local): Likewise.
4277 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4278 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4279 do_tls_offset_for_global): New functions.
4280 (Target_powerpc::Scan::local): Correct TLS relocations and got
4281 entry values.
4282 (Target_powerpc::Scan::global): Don't emit unnecessary
4283 dynamic relocations on TLS GOT entries.
4284
00716ab1
AM
42852012-09-10 Matthias Klose <doko@ubuntu.com>
4286
4287 * config.in: Disable sanity check for kfreebsd.
4288
c891b3f9
SA
42892012-09-10 Sterling Augustine <saugustine@google.com>
4290
4291 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4292 (Gdb_index::pubtypes_read): New parameter.
4293 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4294 to calls.
4295 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4296 pubtypes_object_.
4297
e81fea4d
AM
42982012-09-09 Alan Modra <amodra@gmail.com>
4299
4300 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4301 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4302 * gc.h (gc_process_relocs): Call target gc_add_reference.
4303 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4304 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4305 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4306 unnecessary cast.
4307 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4308 to cater for when we don't need code offset. Update use.
4309 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4310 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4311 set_opd_valid): New functions.
4312 (Target_powerpc::do_gc_add_reference): New function.
4313 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4314 stashed refs.
4315 (Target_powerpc::do_gc_mark_symbol): New function.
4316
d2d60eef
CC
43172012-09-06 Cary Coutant <ccoutant@google.com>
4318
4319 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4320 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4321 (Dwarf_die::skip_attributes): Likewise.
4322 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4323 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4324 (main): Call it.
4325 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4326
32ed4573
L
43272012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4328
4329 * testsuite/script_test_3.t: Add .got.plt output section
4330 statement.
4331 * testsuite/script_test_4.t: Likewise.
4332
f4baf0d4
AM
43332012-09-05 Alan Modra <amodra@gmail.com>
4334
4335 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4336 update all uses and lose "enum" when using type.
4337
864a1b56
AM
43382012-09-05 Alan Modra <amodra@gmail.com>
4339
4340 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4341 * configure: Regenerate.
4342 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4343 (plugin_final_layout.stdout): Likewise.
4344 (memory_test): Set page sizes to 0x1000.
4345 * testsuite/Makefile.in: Regenerate.
4346 * testsuite/discard_locals_test.sh: Add FIXME comment.
4347 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4348 * testsuite/pr14265.t: Add .got output section statement.
4349 * testsuite/script_test_2.t: Likewise.
4350 * testsuite/script_test_3.t: Likewise.
4351 * testsuite/script_test_4.t: Likewise.
4352 * testsuite/script_test_5.t: Likewise.
4353 * testsuite/script_test_6.t: Likewise.
4354 * testsuite/script_test_7.t: Likewise.
4355 * testsuite/script_test_9.t: Likewise.
4356
3ea0a085
AM
43572012-09-05 Alan Modra <amodra@gmail.com>
4358
4359 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4360 (Powerpc_relocate_functions::Status): New typedef.
4361 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4362 (Target_powerpc::Scan::local): Handle REL64.
4363 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4364 for REL32 and REL64.
4365 (Target_powerpc::symval_for_branch): New function, extracted from..
4366 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4367 checks. Report overflow errors.
4368
7404fe1b
AM
43692012-09-05 Alan Modra <amodra@gmail.com>
4370
4371 * object.h (Sized_relobj_file::emit_relocs): Delete.
4372 (Sized_relobj_file::emit_relocs_reltype): Delete.
4373 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4374 relocate_relocs for --emit-relocs.
4375 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4376 * output.h: Update comment.
4377 (Output_segment::first_section): New function.
4378 (Output_segment::first_section_load_address): Use first_section.
4379 * output.cc (Output_segment::first_section): New function extracted..
4380 (Output_segment::first_section_load_address): ..from here. Delete.
4381 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4382 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4383 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4384 adjust call to target.h function.
4385 * i386.cc (Target_i386): Likewise.
4386 * sparc.cc (Target_sparc): Likewise.
4387 * x86_64.cc (Target_x86_64): Likewise.
4388 * powerpc.cc (Target_powerpc): Likewise.
4389 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4390 first tls section has section symbol for optimised local dynamic
4391 output relocs.
4392 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4393 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4394 optimised tls code.
4395 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4396 Rename to relocate_relocs. Update error message.
4397
957564c9
AS
43982012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4399
4400 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4401 --just-symbols.
4402
dd93cd0a
AM
44032012-08-31 Alan Modra <amodra@gmail.com>
4404
4405 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4406 (Powerpc_relobj::toc_base_offset): New stub function.
4407 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4408 got_mod_index_offset to tlsld_got_offset. Update all refs.
4409 (Target_powerpc::Relocate::enum skip_tls): New.
4410 (Target_powerpc::call_tls_get_addr_): New var.
4411 (Target_powerpc::is_branch_reloc): Move to file scope.
4412 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4413 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4414 New functions.
4415 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4416 (powerpc_info): Correct common_pagesize for ppc64.
4417 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4418 (Powerpc_relocate_functions): Add overflow check enums and functions.
4419 Add non-shift version of rela, rela_ua. Delete all rel public
4420 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4421 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4422 addr16_ha3, addr14 functions.
4423 (Output_data_got_powerpc::add_constant_pair): New function.
4424 (Output_data_got_powerpc::got_base_offset): Likewise.
4425 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4426 (instruction constants): Sort, add some more.
4427 (Output_data_glink::do_write): Add and use Address typedef. Use
4428 object->toc_base_offset() stub for 64-bit.
4429 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4430 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4431 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4432 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4433 Always treat .opd relocs as against locally defined symbol.
4434 Correct condition for RELATIVE relocs.
4435 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4436 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4437 for 32-bit syms with a plt entry. Correct ppc64 toc base
4438 calculations. Handle TLS relocs, and more. Add overflow
4439 checking and adjust for Powerpc_relocate_functions changes.
4440 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4441 Reinstate --emit-relocs code with FIXME.
4442
a1373b60
AM
44432012-08-30 Alan Modra <amodra@gmail.com>
4444
4445 * layout.cc (Layout::set_segment_offsets): Set p_align to
4446 abi_pagesize, not common_pagesize.
4447 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4448 to determine whether file header can go in segment.
4449
703d02da
AM
44502012-08-30 Alan Modra <amodra@gmail.com>
4451
4452 * output.h (Output_reloc::Output_reloc <output section>): Add
4453 is_relative param. Adjust calls.
4454 (Output_reloc::add_output_section_relative): New functions.
4455 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4456 is_relative.
4457 (Output_reloc::symbol_value): Handle SECTION_CODE.
4458
16164a6b
ST
44592012-08-24 Sriraman Tallam <tmsriram@google.com>
4460
4461 * gold.cc (queue_middle_tasks): Call layout again when unique
4462 segments for sections is desired.
4463 * layout.cc (Layout::Layout): Initialize new members.
4464 (Layout::get_output_section_flags): New function.
4465 (Layout::choose_output_section): Call get_output_section_flags.
4466 (Layout::layout): Make output section for mapping to a unique segment.
4467 (Layout::insert_section_segment_map): New function.
4468 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4469 output sections marked so.
16164a6b
ST
4470 (Layout::segment_precedes): Check for unique segments when sorting.
4471 * layout.h (Layout::Unique_segment_info): New struct.
4472 (Layout::Section_segment_map): New typedef.
4473 (Layout::insert_section_segment_map): New function.
4474 (Layout::get_output_section_flags): New function.
4475 (Layout::is_unique_segment_for_sections_specified): New function.
4476 (Layout::set_unique_segment_for_sections_specified): New function.
4477 (Layout::unique_segment_for_sections_specified_): New member.
4478 (Layout::section_segment_map_): New member.
4479 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4480 Rename is_gc_pass_one to is_pass_one.
4481 Rename is_gc_pass_two to is_pass_two.
4482 Rename is_gc_or_icf to is_two_pass.
4483 Check for which pass based on whether symbols data is present.
4484 Make it two pass when unique segments for sections is desired.
4485 * output.cc (Output_section::Output_section): Initialize new
4486 members.
4487 * output.h (Output_section::is_unique_segment): New function.
4488 (Output_section::set_is_unique_segment): New function.
4489 (Output_section::is_unique_segment_): New member.
4490 (Output_section::extra_segment_flags): New function.
4491 (Output_section::set_extra_segment_flags): New function.
4492 (Output_section::extra_segment_flags_): New member.
4493 (Output_section::segment_alignment): New function.
4494 (Output_section::set_segment_alignment): New function.
4495 (Output_section::segment_alignment_): New member.
4496 (Output_segment::Output_segment): Initialize is_unique_segment_.
4497 (Output_segment::is_unique_segment): New function.
4498 (Output_segment::set_is_unique_segment): New function.
4499 (Output_segment::is_unique_segment_): New member.
4500 * plugin.cc (allow_unique_segment_for_sections): New function.
4501 (unique_segment_for_sections): New function.
4502 (Plugin::load): Add new functions to transfer vector.
4503 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4504 * Makefile.in: Regenerate.
4505 * testsuite/plugin_final_layout.sh: Check if unique segment
4506 functionality works.
4507 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4508 are available.
4509 (allow_unique_segment_for_sections): New global.
4510 (unique_segment_for_sections): New global.
4511 (claim_file_hook): Call allow_unique_segment_for_sections.
4512 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4513
1e2bee4f
CC
45142012-08-22 Cary Coutant <ccoutant@google.com>
4515
4516 * layout.cc (Layout::include_section): Don't assert on GROUP
4517 sections with --emit-relocs.
4518
1d5dfe78
CC
45192012-08-21 Cary Coutant <ccoutant@google.com>
4520
4521 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4522 if --export-dynamic-symbol names an undef symbol.
4523
c9269dff
AM
45242012-08-18 Alan Modra <amodra@gmail.com>
4525
4526 * powerpc.cc: Formatting and white space.
4527 (Powerpc_relobj): Rename got2_section_ to special_.
4528 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4529 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4530 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4531 (Target_powerpc): Add Address typedef and invalid_address. Use
4532 throughout.
4533 (Target_powerpc::is_branch_reloc): New function.
4534 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4535 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4536 for dst_mask, value and addend.
4537 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4538 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4539 (Output_data_glink::do_write): Correct toc base. Don't try to use
4540 uint16_t for 24-bit offset. Use get_output_section_offset and
4541 check return.
4542 (Target_powerpc::Scan::local): Handle more relocs.
4543 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4544 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4545 Plug in toc restoring insn after plt calls. Translate branches
4546 to function descriptor symbols to corresponding entry point.
4547 (Target_powerpc::relocate_for_relocatable): Check return from
4548 get_output_section_offset.
4549 * symtab.h: Comment typo.
4550
b1759dce
ILT
45512012-08-14 Ian Lance Taylor <iant@google.com>
4552
4553 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4554 unsupported_relocal_local to call unsupported_reloc_global.
4555
b9b2ae8b
NC
45562012-08-14 Nick Clifton <nickc@redhat.com>
4557
4558 PR ld/14265
4559 * script-sections.cc (Sections_element::output_section_name): Add
4560 keep return parameter.
4561 (Output_section_element::match_name): Add keep return parameter.
4562 Return the value of the keep_ member.
4563 * script-sections.h (class Output_section): Update
4564 output_section_name prototype.
4565 * layout.cc (Layout::keep_input_section): New public member
4566 function.
4567 (Layout::choose_output_section): Pass keep parameter to
4568 output_section_name.
4569 * layout.h (class Layout): Add keep_input_section.
4570 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4571 sections.
4572 * testsuite/Makefile.am: Add a test.
4573 * testsuite/Makefile.in: Regenerate.
4574 * testsuite/pr14265.c: Source file for the test.
4575 * testsuite/pr14265.t: Linker script for the test.
4576 * testsuite/pr14265.sh: Shell script for the test.
4577
921b5322
AM
45782012-08-14 Alan Modra <amodra@gmail.com>
4579
4580 * target.h (Target::output_section_name): New function.
4581 (Target::do_output_section_name): New function.
4582 * layout.cc (Layout::choose_output_section): Call the above.
4583 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4584
6ce78956
AM
45852012-08-14 Alan Modra <amodra@gmail.com>
4586
4587 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4588 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4589 for replace_constant call.
4590 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4591 (Output_data_glink::do_print_to_mapfile): New function.
4592 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4593 (Target_powerpc::Relocate::relocate): Likewise.
4594
d1a8cabd
AM
45952012-08-14 Alan Modra <amodra@gmail.com>
4596
4597 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4598 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4599 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4600 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4601 all references to shndx_. Handle special case for R_PPC_PLTREL24
4602 here.
4603 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4604 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4605 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4606 here.
4607 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4608 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4609
d83ce4e3
AM
46102012-08-12 Alan Modra <amodra@gmail.com>
4611
4612 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4613 (glink insn constants): Use uint32_t.
4614 (Output_data_glink::add_entry): Use insert, not [] operator.
4615
cf43a2fe
AM
46162012-08-11 Alan Modra <amodra@gmail.com>
4617
4618 * object.h (Sized_relobj_file::find_shdr): New function.
4619 (Sized_relobj_file::find_special_sections): New function.
4620 * object.cc (Sized_relobj_file::find_shdr): New function.
4621 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4622 (Sized_relobj_file::find_special_sections): New function, split out..
4623 (Sized_relobj_file::do_read_symbols): ..from here.
4624 * output.h (Output_data_got::replace_constant): New function.
4625 (Output_data_got::num_entries): New function.
4626 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4627 (Output_data_got::got_offset): Protected rather than private.
4628 (Output_data_got::replace_got_entry): New function.
4629 * output.cc (Output_data_got::replace_got_entry): New function.
4630 * powerpc.cc (class Powerpc_relobj): New.
4631 (class Powerpc_relocate_functions): Delete all psymval variants or
4632 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4633 Implement _ha functions using corresponding _hi function.
4634 (Powerpc_relobj::find_special_sections): New function.
4635 (Target_powerpc::do_make_elf_object): New function.
4636 (class Output_data_got_powerpc): New.
4637 (class Output_data_glink): New.
4638 (class Powerpc_scan_relocatable_reloc): New.
4639 Many more changes througout file.
4640
3c892704
NC
46412012-08-09 Nick Clifton <nickc@redhat.com>
4642
4643 * po/vi.po: Updated Vietnamese translation.
4644
82435b3b
ILT
46452012-08-07 Ian Lance Taylor <iant@google.com>
4646
4647 * layout.cc (Layout::add_target_dynamic_tags): If
4648 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4649 plt_rel.
4650
a6dc81d2
NC
46512012-07-30 Nick Clifton <nickc@redhat.com>
4652
4653 * po/gold.pot: Updated template.
4654 * po/es.po: Updated Spanish translation.
4655
f1415016
CC
46562012-07-18 Cary Coutant <ccoutant@google.com>
4657
4658 PR gold/14344
4659 * configure.ac: Add check for -gpubnames support.
4660 * configure: Regenerate.
4661 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4662 support; force -gno-pubnames.
4663 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4664 support.
4665 (gdb_index_test_4): New test.
4666 * testsuite/Makefile.in: Regenerate.
4667 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4668 * testsuite/gdb_index_test_2.sh: Likewise.
4669 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4670 * testsuite/gdb_index_test_4.sh: New script.
4671 * testsuite/gdb_index_test_comm.sh: New script with common code;
4672 don't look for space after colon.
4673
b7fd7c37
ST
46742012-07-16 Sriraman Tallam <tmsriram@google.com>
4675
4676 * gold.cc (queue_middle_tasks): Update function order only after
4677 deferred objects due to plugins are processed.
4678
1f3212db
ILT
46792012-07-11 Ian Lance Taylor <iant@google.com>
4680
4681 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4682 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4683 (Target_arm::scan_reloc_for_stub): Likewise.
4684 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4685 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4686 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4687 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4688 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4689
81c82a68
ILT
46902012-07-10 Dodji Seketeli <dodji@redhat.com>
4691 Ian Lance Taylor <iant@google.com>
4692
4693 PR gold/14309
4694 * configure.ac: Test whether std::tr1::hash<off_t> works.
4695 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4696 needed.
4697 * output.h (class Output_fill): Add virtual destructor.
4698 * configure, config.in: Rebuild.
4699
eabc84f4
RM
47002012-06-22 Roland McGrath <mcgrathr@google.com>
4701
4702 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4703
370e30b6
RÁE
47042012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4705
4706 * plugin.cc (Plugin::load): Handle position independent executables.
4707
fb1b895d
CC
47082012-06-06 Cary Coutant <ccoutant@google.com>
4709
4710 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4711 add .debug_macro.
4712 (lines_only_debug_sections): Likewise.
4713 (gdb_fast_lookup_sections): New static array.
4714 (is_gdb_debug_section): Rename formal parameter.
4715 (is_lines_only_debug_section): Likewise.
4716 (is_gdb_fast_lookup_section): New function.
4717 (Layout::include_section): Check for ".zdebug_" prefix; pass
4718 section name suffix to is_gdb_debug_section, et al.; check for
4719 fast-lookup sections when building .gdb_index.
4720 * options.h (--strip-debug-gdb): Update GDB version number.
4721
7c0640fa
CC
47222012-06-06 Cary Coutant <ccoutant@google.com>
4723
4724 * configure.ac: Add check for fallocate.
4725 * configure: Regenerate.
4726 * config.in: Regenerate.
4727
4728 * options.h (class General_options): Add --mmap-output-file and
4729 --posix-fallocate options.
4730 * output.cc: (posix_fallocate): Remove; replace with...
4731 (gold_fallocate): New function.
4732 (Output_file::map_no_anonymous): Call gold_fallocate.
4733 (Output_file::map): Check --mmap-output-file option.
4734
2a49eb69
DK
47352012-06-05 Jing Yu <jingyu@google.com>
4736
4737 * gold.h (textdomain): Add do {} to empty while(0).
4738 (bindtextdomain): Likewise.
4739
fad072ac
CC
47402012-06-04 Cary Coutant <ccoutant@google.com>
4741
4742 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4743 has_dynsym_index.
4744
8cc69fb6
ST
47452012-05-25 Sriraman Tallam <tmsriram@google.com>
4746
4747 * symtab.cc (Symbol_table::define_special_symbol):
4748 Initialize *poldsym to prevent uninitialized variable errors.
4749
1be75daa
CC
47502012-05-23 Cary Coutant <ccoutant@google.com>
4751
4752 * layout.cc (Layout::section_name_mapping): Add rules to handle
4753 exact match on .data.rel.ro.local or .data.rel.ro.
4754 (Layout::output_section_name): Check for exact matches.
4755
9b689de0
CC
47562012-05-23 Cary Coutant <ccoutant@google.com>
4757
4758 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4759 more carefully.
4760
b24fdbf5
CC
47612012-05-22 Cary Coutant <ccoutant@google.com>
4762
4763 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4764 object before exporting symbol.
4765
e550e1a2
L
47662012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4767
4768 * testsuite/tls_test.cc: Include "config.h" first.
4769 * testsuite/tls_test_c.c: Likewise.
4770
df7b86aa
NC
47712012-05-17 Daniel Richard G. <skunk@iskunk.org>
4772 Nick Clifton <nickc@redhat.com>
4773
4774 PR 14072
4775 * configure.in: Add check that sysdep.h has been included before
4776 any system header files.
4777 * configure: Regenerate.
4778 * config.in: Regenerate.
4779
1007b503
CC
47802012-05-14 Cary Coutant <ccoutant@google.com>
4781
4782 * layout.cc (Layout::make_output_section): Mark .tdata section
4783 as RELRO.
4784 * testsuite/relro_test.cc: Add a TLS variable.
4785
fd885f3a
L
47862012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4787
4788 PR gold/14091
4789 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4790 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4791 R_X86_64_64.
4792
80f5885c
CC
47932012-05-08 Cary Coutant <ccoutant@google.com>
4794
4795 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4796 (lines_only_debug_sections): Likewise.
4797
2e702c99
RM
47982012-05-02 Roland McGrath <mcgrathr@google.com>
4799
4800 * nacl.cc: New file.
4801 * nacl.h: New file.
4802 * Makefile.am (CCFILES, HFILES): Add them.
4803 * Makefile.in: Regenerate.
4804 * i386.cc (Output_data_plt_i386_nacl): New class.
4805 (Output_data_plt_i386_nacl_exec): New class.
4806 (Output_data_plt_i386_nacl_dyn): New class.
4807 (Target_i386_nacl): New class.
4808 (Target_selector_i386_nacl): New class.
4809 (target_selector_i386): Use it instead of Target_selector_i386.
4810 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4811 (Target_x86_64_nacl): New class.
4812 (Target_selector_x86_64_nacl): New class.
4813 (target_selector_x86_64, target_selector_x32): Use it instead of
4814 Target_selector_x86_64.
4815 * arm.cc (Output_data_plt_arm_nacl): New class.
4816 (Target_arm_nacl): New class.
4817 (Target_selector_arm_nacl): New class.
4818 (target_selector_arm, target_selector_armbe): Use it instead of
4819 Target_selector_arm.
4820
4821 * target-select.cc (select_target): Take new Input_file* and off_t
4822 arguments, pass them on to recognize method of selector.
4823 * object.cc (make_elf_sized_object): Update caller.
4824 * parameters.cc (parameters_force_valid_target): Likewise.
4825 * incremental.cc (make_sized_incremental_binary): Likewise.
4826 * target-select.h: Update decl.
4827 (Target_selector::recognize): Take new Input_file* argument,
4828 pass it on to do_recognize.
4829 (Target_selector::do_recognize): Take new Input_file* argument.
4830 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4831 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4832 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4833 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4834
4835 * target.h (Target::Target_info): New members isolate_execinstr
4836 and rosegment_gap.
4837 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4838 * arm.cc (Target_arm::arm_info): Update initializer.
4839 * i386.cc (Target_i386::i386_info): Likewise.
4840 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4841 * sparc.cc (Target_sparc::sparc_info): Likewise.
4842 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4843 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4844 * layout.cc (Layout::attach_allocated_section_to_segment):
4845 Take new const Target* argument. If target->isolate_execinstr(), act
4846 like --rosegment.
4847 (Layout::find_first_load_seg): Take new const Target* argument;
4848 if target->isolate_execinstr(), reject PF_X segments.
4849 (Layout::relaxation_loop_body): Update caller.
4850 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4851 reset file offset to zero when we hit LOAD_SEG, and then do a second
4852 loop over the segments before LOAD_SEG to reassign offsets after
4853 addresses have been determined. Handle target->rosegment_gap().
4854 (Layout::attach_section_to_segment): Take new const Target* argument;
4855 pass it to attach_allocated_section_to_segment.
4856 (Layout::make_output_section): Update caller.
4857 (Layout::attach_sections_to_segments): Take new const Target* argument;
4858 pass it to attach_section_to_segment.
4859 * gold.cc (queue_middle_tasks): Update caller.
4860 * layout.h (Layout): Update method decls with new arguments.
4861
4862 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4863 Target_info pointer to use.
4864 (Target_arm::do_make_data_plt): New virtual method.
4865 (Target_arm::make_data_plt): New method that calls it.
4866 (Target_arm::make_plt_entry): Use it.
4867 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4868 for the section alignment.
4869 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4870 method.
4871 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4872 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4873 method.
4874 (Output_data_plt_arm::get_plt_entry_size): Call it.
4875 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4876 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4877 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4878 method.
4879 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4880 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4881 method instead of sizeof(plt_entry).
4882 (Output_data_plt_arm::add_entry): Likewise.
4883 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4884 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4885 than static method.
4886 (Target_arm::plt_entry_size): Likewise.
4887 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4888 Move to ...
4889 (Output_data_plt_arm_standard): ... here, new class.
4890 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4891 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4892 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4893
4894 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4895 Take additional argument for the PLT entry size.
4896 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4897 Use get_plt_entry_size method rather than plt_entry_size variable.
4898 (Output_data_plt_x86_64::reserve_slot): Likewise.
4899 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4900 (Output_data_plt_x86_64::add_entry): Likewise.
4901 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4902 (Output_data_plt_x86_64::address_for_global): Likewise.
4903 (Output_data_plt_x86_64::address_for_local): Likewise.
4904 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4905 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4906 Make method non-static.
4907 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4908 method.
4909 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4910 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4911 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4912 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4913 virtual method.
4914 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4915 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4916 virtual method.
4917 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4918 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4919 virtual method.
4920 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4921 (Output_data_plt_x86_64::plt_entry_size)
4922 (Output_data_plt_x86_64::first_plt_entry)
4923 (Output_data_plt_x86_64::plt_entry)
4924 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4925 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4926 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4927 (Output_data_plt_x86_64_standard): ... here, new class.
4928 (Target_x86_64::Target_x86_64): Take optional argument for the
4929 Target_info pointer to use.
4930 (Target_x86_64::do_make_data_plt): New virtual method.
4931 (Target_x86_64::make_data_plt): New method to call it.
4932 (Target_x86_64::init_got_plt_for_update): Use that.
4933 Call this->plt_->add_eh_frame method here.
4934 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4935 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4936 rather than static method.
4937 (Target_x86_64::plt_entry_size): Likewise.
4938 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4939 rather than plt_entry_size variable. Move guts of PLT filling to...
4940 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4941 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4942 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4943
4944 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4945 additional argument for the section alignment.
4946 Don't do add_eh_frame_for_plt here.
4947 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4948 non-static. Use get_plt_entry_size method rather than plt_entry_size
4949 variable.
4950 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4951 method.
4952 (Output_data_plt_i386::get_plt_entry_size): Call it.
4953 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4954 (Output_data_plt_i386::add_eh_frame): New method to call it.
4955 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4956 method.
4957 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4958 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4959 method.
4960 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4961 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4962 method instead of plt_entry_size.
4963 (Output_data_plt_i386::plt_entry_size)
4964 (Output_data_plt_i386::plt_eh_frame_fde_size)
4965 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4966 (Output_data_plt_i386_standard): ... here, new class.
4967 (Output_data_plt_i386_exec): New class.
4968 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4969 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4970 (Output_data_plt_i386::exec_plt_entry): Move to ...
4971 (Output_data_plt_i386_exec::plt_entry): ... here.
4972 (Output_data_plt_i386_dyn): New class.
4973 (Output_data_plt_i386::first_plt_entry): Move to ...
4974 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4975 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4976 (Output_data_plt_i386_dyn::plt_entry): ... here.
4977 (Target_i386::Target_i386): Take optional argument for the Target_info
4978 pointer to use.
4979 (Target_i386::do_make_data_plt): New virtual method.
4980 (Target_i386::make_data_plt): New method to call it.
4981 (Target_i386::make_plt_section): Use that.
4982 Call this->plt_->add_eh_frame method here.
4983 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4984 rather than plt_entry_size variable.
4985 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4986 (Output_data_plt_i386::address_for_local): Likewise.
4987 (Output_data_plt_i386::do_write): Likewise.
4988 Move guts of PLT filling to...
4989 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4990 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4991 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4992 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4993
b9b9f2ee
CC
49942012-05-01 Cary Coutant <ccoutant@google.com>
4995
4996 * dwarf_reader.cc (Dwarf_die::read_attributes)
4997 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4998 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4999 * reduced_debug_output.cc
5000 (Output_reduced_debug_info_section::get_die_end): Remove
5001 DW_FORM_GNU_ref_index. Add default case.
5002
57923f48
MW
50032012-04-26 Mark Wielaard <mjw@redhat.com>
5004
5005 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5006 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5007 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5008 DW_AT_high_pc as offset from DW_AT_low_pc.
5009
5010 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5011 * testsuite/Makefile.in: Regenerate.
5012 * testsuite/gdb_index_test_3.c: New test source file.
5013 * testsuite/gdb_index_test_3.sh: New test source file.
5014
2c54b4f4
ILT
50152012-04-25 Ian Lance Taylor <iant@google.com>
5016
5017 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5018 pointer.
5019 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5020 as a class, not a struct.
5021 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5022 (Target_arm::apply_cortex_a8_workaround): Likewise.
5023 * gc.h: Declare Reloc_types as a struct, not a class.
5024 * object.h: Declare Symbols_data as a struct.
5025 * reloc.h: Declare Read_relocs_data as a struct.
5026 * target.h: Declare Relocate_info as a struct.
5027
a5a5f7a3
DM
50282012-04-24 David S. Miller <davem@davemloft.net>
5029
5030 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5031 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5032 and R_SPARC_WPLT30.
5033
f038d496
CC
50342012-04-24 Cary Coutant <ccoutant@google.com>
5035
5036 * incremental-dump.cc (find_input_containing_global): Replace
5037 magic number with symbolic constant.
5038 (dump_incremental_inputs): Update version number.
5039 * incremental.cc (Output_section_incremental_inputs): Update version
5040 number; import symbolic constants from Incremental_inputs_reader.
5041 (Incremental_inputs::create_data_sections): Align relocations
5042 section correctly for 64-bit targets.
5043 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5044 constants; add padding.
5045 (Output_section_incremental_inputs::write_header): Add assert for
5046 header_size.
5047 (Output_section_incremental_inputs::write_input_files): Add assert
5048 for input_entry_size.
5049 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5050 add assert for object_info_size, input_section_entry_size,
5051 global_sym_entry_size.
5052 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5053 for data structure sizes; use them.
5054 (Incremental_input_entry_reader): Import symbolic constants from
5055 Incremental_inputs_reader; use them.
5056
a4d85145
DM
50572012-04-23 David S. Miller <davem@davemloft.net>
5058
5059 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5060 and elf_flags_set_.
5061 (Target_sparc::Target_sparc): Initialize new fields.
5062 (Target_sparc::do_make_elf_object): New function.
5063 (Target_sparc::do_adjust_elf_header): New function.
5064
1d509098
CC
50652012-04-23 Cary Coutant <ccoutant@google.com>
5066
5067 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5068 CU range table of gdb index.
5069
7ebeff7f
DM
50702012-04-20 David S. Miller <davem@davemloft.net>
5071
5072 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5073 instead of false.
5074
13cf9988
DM
50752012-04-16 David S. Miller <davem@davemloft.net>
5076
2a1079e8
DM
5077 * sparc.cc (Target_sparc::got_address): New function.
5078 (Sparc_relocate_functions::gdop_hix22): New function.
5079 (Sparc_relocate_functions::gdop_lox10): New function.
5080 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5081 relocs.
5082 (Target_sparc::Scan::local): Likewise if the global symbol is not
5083 preemptible and is not IFUNC.
5084 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5085 transformations for local and non-preemptible non-IFUNC global
5086 symbols.
5087
0bc964fc
DM
5088 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5089 writing out 64-bit part of ranges.
5090
661d7a80
DM
5091 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5092 -fpic and -fpie respectively.
5093 * Makefile.in: Regenerate.
5094
8c2bf391
DM
5095 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5096 (Target_sparc::Target_sparc): Initialize new field.
5097 (Target_sparc::do_plt_section_for_global): New function.
5098 (Target_sparc::do_plt_section_for_local): New function.
5099 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5100 (Target_sparc::make_plt_section): New function, broken out of
5101 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5102 (Target_sparc::make_plt_entry): Call make_plt_section.
5103 (Target_sparc::make_local_ifunc_plt_entry): New function.
5104 (Target_sparc::rela_ifunc_section): New function.
5105 (Target_sparc::plt_section): Remove const.
5106 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5107 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5108 and ifunc_count_ fields.
5109 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5110 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5111 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5112 (Output_data_plt_sparc::rela_ifunc): New function.
5113 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5114 (Output_data_plt_sparc::has_ifunc_section): New function.
5115 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5116 (Output_data_plt_sparc::address_for_global): New function.
5117 (Output_data_plt_sparc::address_for_local): New function.
5118 (Output_data_plt_sparc::plt_index_to_offset): New function.
5119 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5120 and entry_count.
5121 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5122 entry_count.
5123 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5124 R_SPARC_JMP_IREL to switch.
5125 (Target_sparc::Scan::check_non_pic): Likewise.
5126 (Target_sparc::Scan::local): Handle IFUNC symbols.
5127 (Target_sparc::Scan::local): Likewise.
5128 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5129 and plt_address_for_local.
5130 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5131 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5132
13cf9988
DM
5133 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5134 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5135 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5136 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5137 global relocs too.
5138 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5139 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5140 calls.
5141 * sparc.cc (Target_sparc::Scan::global): Likewise.
5142 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5143
31821be0
CC
51442012-04-16 Cary Coutant <ccoutant@google.com>
5145
5146 * archive.cc (Library_base::should_include_member): Check for
5147 --export-dynamic-symbol.
5148 * options.h (class General_options): Add --export-dynamic-symbol.
5149 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5150 --export-dynamic-symbol.
5151 (Symbol_table::gc_mark_undef_symbols): Likewise.
5152 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5153
2615994e
DM
51542012-04-12 David S. Miller <davem@davemloft.net>
5155
5156 * sparc.cc (Reloc::wdisp10): New relocation method.
5157 (Reloc::h34): Likewise.
5158 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5159 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5160 R_SPARC_WDISP10.
5161 (Target_sparc::Scan::local): Likewise.
5162 (Target_sparc::Scan::global): Likewise.
5163 (Target_sparc::Relocate::relocate): Likewise.
5164
6782735d
CC
51652012-04-09 Cary Coutant <ccoutant@google.com>
5166
5167 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5168 low_pc == 0.
5169
8c7a0b00
ILT
51702012-04-06 Ian Lance Taylor <iant@google.com>
5171
5172 * timer.cc: #include <unistd.h>.
5173
58797674
RM
51742012-04-06 Roland McGrath <mcgrathr@google.com>
5175
5176 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5177 * config.in: Regenerate.
5178 * configure: Regenerate.
5179
44350750
NC
51802012-04-05 Nick Clifton <nickc@redhat.com>
5181
5182 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5183 (AM_LC_MESSAGES): Add.
5184 * aclocal.m4: Regenerate.
5185 * config.in: Regenerate.
5186 * configure: Regenerate.
5187
c1027032
CC
51882012-03-21 Cary Coutant <ccoutant@google.com>
5189
5190 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5191 * Makefile.in: Regenerate.
5192 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5193 (Sized_elf_reloc_mapper::symbol_section): New function.
5194 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5195 (make_elf_reloc_mapper): New function.
5196 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5197 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5198 (Dwarf_abbrev_table::do_get_abbrev): New function.
5199 (Dwarf_ranges_table::read_ranges_table): New function.
5200 (Dwarf_ranges_table::read_range_list): New function.
5201 (Dwarf_pubnames_table::read_section): New function.
5202 (Dwarf_pubnames_table::read_header): New function.
5203 (Dwarf_pubnames_table::next_name): New function.
5204 (Dwarf_die::Dwarf_die): New function.
5205 (Dwarf_die::read_attributes): New function.
5206 (Dwarf_die::skip_attributes): New function.
5207 (Dwarf_die::set_name): New function.
5208 (Dwarf_die::set_linkage_name): New function.
5209 (Dwarf_die::attribute): New function.
5210 (Dwarf_die::string_attribute): New function.
5211 (Dwarf_die::int_attribute): New function.
5212 (Dwarf_die::uint_attribute): New function.
5213 (Dwarf_die::ref_attribute): New function.
5214 (Dwarf_die::child_offset): New function.
5215 (Dwarf_die::sibling_offset): New function.
5216 (Dwarf_info_reader::check_buffer): New function.
5217 (Dwarf_info_reader::parse): New function.
5218 (Dwarf_info_reader::do_parse): New function.
5219 (Dwarf_info_reader::do_read_string_table): New function.
5220 (Dwarf_info_reader::lookup_reloc): New function.
5221 (Dwarf_info_reader::get_string): New function.
5222 (Dwarf_info_reader::visit_compilation_unit): New function.
5223 (Dwarf_info_reader::visit_type_unit): New function.
5224 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5225 Sized_elf_reloc_mapper.
5226 (Sized_dwarf_line_info::symbol_section): Remove function.
5227 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5228 (Sized_dwarf_line_info::read_line_mappings): Remove object
5229 parameter, adjust callers.
5230 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5231 * dwarf_reader.h: Include <sys/types.h>.
5232 (class Track_relocs): Remove forward declaration.
5233 (class Elf_reloc_mapper): New class.
5234 (class Sized_elf_reloc_mapper): New class.
5235 (class Dwarf_abbrev_table): New class.
5236 (class Dwarf_range_list): New class.
5237 (class Dwarf_ranges_table): New class.
5238 (class Dwarf_pubnames_table): New class.
5239 (class Dwarf_die): New class.
5240 (class Dwarf_info_reader): New class.
5241 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5242 (Sized_dwarf_line_info::symbol_section): Remove member function.
5243 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5244 base class.
5245 * gdb-index.cc: New source file.
5246 * gdb-index.h: New source file.
5247 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5248 and .debug_types sections, call Layout::add_to_gdb_index.
5249 (Sized_relobj_incr::do_section_name): Implement.
5250 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5251 return type; Implement.
5252 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5253 return type.
5254 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5255 parameter list and return type.
5256 (Sized_incr_dynobj::do_section_contents): Likewise.
5257 * layout.cc: Include gdb-index.h.
5258 (Layout::Layout): Initialize gdb_index_data_.
5259 (Layout::init_fixed_output_section): Check for .gdb_index section.
5260 (Layout::add_to_gdb_index): New function. Instantiate.
5261 * layout.h: Add forward declaration for class Gdb_index.
5262 (Layout::add_to_gdb_index): New member function.
5263 (Layout::gdb_index_data_): New data member.
5264 * main.cc: Include gdb-index.h.
5265 (main): Print statistics for gdb index.
5266 * object.cc (Object::section_contents): Move code into
5267 do_section_contents.
5268 (need_decompressed_section): Check for sections needed when building
5269 gdb index.
5270 (build_compressed_section_map): Likewise.
5271 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5272 gdb index.
5273 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5274 sections; call Layout::add_to_gdb_index.
5275 (Sized_relobj_file::do_decompressed_section_contents): Call
5276 do_section_contents directly.
5277 * object.h (Object::do_section_contents): Adjust parameter list and
5278 return type.
5279 (Object::do_decompressed_section_contents): Call do_section_contents
5280 directly.
5281 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5282 return type.
5283 * options.h (class General_options): Add --gdb-index option.
5284 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5285 list and return type.
5286 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5287 * reloc.h (Track_relocs::checkpoint): New function.
5288 (Track_relocs::reset): New function.
5289
5290 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5291 New test cases.
5292 * testsuite/Makefile.in: Regenerate.
5293 * testsuite/gdb_index_test.cc: New test source file.
5294 * testsuite/gdb_index_test_1.sh: New test source file.
5295 * testsuite/gdb_index_test_2.sh: New test source file.
5296
647f1574
DK
52972012-03-19 Doug Kwan <dougkwan@google.com>
5298
5299 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5300 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5301 __exidx_start and __exidx_end. Make symbol table parameter
5302 anonymous as it is not used.
5303 * gold.cc (queue_middle_tasks): Call target hook to define any
5304 target-specific symbols.
5305 * target.h (Target::define_standard_symbols): New method.
5306 (Target::do_define_standard_symbols): Same.
5307 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5308 * testsuite/Makefile.in: Regenerate.
5309 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5310 and __exidx_end.
5311 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5312 relocations are generated for __exidx_start and __exidx_end.
5313
7c6109da
DK
53142012-03-16 Doug Kwan <dougkwan@google.com>
5315
5316 * testsuite/Makefile.am: Disable test initpri3b.
5317 * testsuite/Makefile.in: Regenerate.
5318
7b8957f8
DK
53192012-03-15 Doug Kwan <dougkwan@google.com>
5320
5321 * arm.cc (Target_arm::got_section): Make .got section read-only
5322 if -z now is given.
5323
14dc9ef7
ILT
53242012-03-15 Ian Lance Taylor <iant@google.com>
5325
5326 PR gold/13850
5327 * layout.cc (Layout::make_output_section): Correctly mark
5328 SHT_INIT_ARRAY, et. al., as relro.
5329
fa40b62a
DK
53302012-03-14 Doug Kwan <dougkwan@google.com>
5331
5332 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5333 dynamic relocations for protected symbols in shared objects.
5334
fd325007
ILT
53352012-03-13 Ian Lance Taylor <iant@google.com>
5336
5337 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5338 keep the larger alignment.
5339
e8dd54e1
CC
53402012-03-12 Cary Coutant <ccoutant@google.com>
5341
5342 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5343 handling of DW_LNE_define_file.
5344
feb5f3b0
CC
53452012-03-12 Cary Coutant <ccoutant@google.com>
5346
5347 * reduced_debug_output.cc
5348 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5349 codes to switch.
5350
a1fb4256
CC
53512012-02-29 Cary Coutant <ccoutant@google.com>
5352
5353 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5354
5dd8762a
CC
53552012-02-29 Cary Coutant <ccoutant@google.com>
5356
5357 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5358 Call Object::decompressed_section_contents.
5359 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5360 New dtor.
5361 (Sized_dwarf_line_info::buffer_start_): New data member.
5362 * merge.cc (Output_merge_data::do_add_input_section): Call
5363 Object::decompressed_section_contents.
5364 (Output_merge_string::do_add_input_section): Likewise.
5365 * object.cc (need_decompressed_section): New function.
5366 (build_compressed_section_map): Decompress sections needed later.
5367 (Sized_relobj_file::do_decompressed_section_contents): New function.
5368 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5369 * object.h (Object::decompressed_section_contents): New function.
5370 (Object::discard_decompressed_sections): New function.
5371 (Object::do_decompressed_section_contents): New function.
5372 (Object::do_discard_decompressed_sections): New function.
5373 (Compressed_section_info): New type.
5374 (Compressed_section_map): Include decompressed section contents.
5375 (Sized_relobj_file::do_decompressed_section_contents): New function.
5376 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5377
7b5de7ee
CC
53782012-02-16 Cary Coutant <ccoutant@google.com>
5379
5380 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5381 * testsuite/Makefile.in: Regenerate.
5382
f9fa4a63
CC
53832012-02-14 Cary Coutant <ccoutant@google.com>
5384
5385 * options.cc (General_options::finalize): Disallow -pie and -static.
5386
2c175ebc
DK
53872012-02-03 Doug Kwan <dougkwan@google.com>
5388
5389 * arm.cc (Arm_relocate_functions::abs8,
5390 Arm_relocate_functions::abs16): Use
5391 Bits::has_signed_unsigned_overflow32.
5392 (Arm_relocate_functions::thm_abs8): Correct range of
5393 overflow check.
5394 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5395 in assertions.
5396
90cff06f
DK
53972012-02-02 Doug Kwan <dougkwan@google.com>
5398
5399 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5400 position independent outputs, not just shared objects.
5401
63887f3d
L
54022012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5403
5404 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5405 * configure: Regenerated.
5406
bef2b434
ILT
54072012-01-27 Ian Lance Taylor <iant@google.com>
5408
5409 * reloc.h (Bits): New class with static functions, copied from
5410 namespace utils in arm.cc.
5411 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5412 instead.
5413
c335b55d
L
54142012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5415
5416 * incremental.cc (write_info_blocks): Correct relocation offset.
5417
41194d9f
L
54182012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5419
5420 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5421 (Relocate::tls_gd_to_le): Likewise.
5422
1bae613c
L
54232012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5424
5425 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5426
24482ca0
L
54272012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5428
5429 * configure.ac: Check if -mcmodel=medium works.
5430 * configure: Regenerated.
5431
c2c7840a
CC
54322012-01-24 Cary Coutant <ccoutant@google.com>
5433
5434 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5435 definition and ...
5436 (read_unsigned_LEB_128_x): ... this new function.
5437 (read_signed_LEB_128): Replaced with inline definition and ...
5438 (read_signed_LEB_128_x): ... this new function.
5439 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5440 (read_unsigned_LEB_128): Add inline definition.
5441 (read_signed_LEB_128_x): New function.
5442 (read_signed_LEB_128): Add inline definition.
5443 * testsuite/Makefile.am (leb128_unittest): New unit test.
5444 * testsuite/Makefile.in: Regenerate.
5445 * testsuite/leb128_unittest.cc: New unit test.
5446
833de760 54472012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5448
5449 PR gold/13617
5450 * i386.cc (Target_i386::do_code_fill): When using a jmp
5451 instruction, pad with nop instructions.
5452 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5453
618d6666
L
54542012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5455
5456 * x86_64.cc (gc_process_relocs): Add typename on types used in
5457 template.
5458 (scan_relocs): Likewise.
5459 (relocate_section): Likewise.
5460 (apply_relocation): Likewise.
5461
3660ff06
L
54622012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5463
5464 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5465 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5466 under x32.
5467
fc51264f
L
54682012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5469
5470 * x86_64.cc: Initial support for x32.
5471
dd74ae06
CC
54722012-01-03 Cary Coutant <ccoutant@google.com>
5473
5474 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5475 Use abstract base class for GOT.
5476 * gold/output.h (class Output_data_got_base): New abstract base class.
5477 (class Output_data_got): Derive from new base class, adjust ctors.
5478 (Output_data_got::reserve_slot): Make virtual; rename to
5479 do_reserve_slot; Adjust callers.
5480 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5481 pointer to abstract base class.
5482 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5483
83896202
ILT
54842011-12-18 Ian Lance Taylor <iant@google.com>
5485
5486 * object.h (Relobj::local_symbol_value): New function.
5487 (Relobj::local_plt_offset): New function.
5488 (Relobj::local_has_got_offset): New function.
5489 (Relobj::local_got_offset): New function.
5490 (Relobj::set_local_got_offset): New function.
5491 (Relobj::do_local_symbol_value): New pure virtual function.
5492 (Relobj::do_local_plt_offset): Likewise.
5493 (Relobj::do_local_has_got_offset): Likewise.
5494 (Relobj::do_local_got_offset): Likewise.
5495 (Relobj::do_set_local_got_offset): Likewise.
5496 (Sized_relobj::do_local_has_got_offset): Rename from
5497 local_has_got_offset.
5498 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5499 (Sized_relobj::do_set_local_got_offset): Rename from
5500 set_local_got_offset.
5501 (Sized_relobj_file::do_local_plt_offset): Rename from
5502 local_plt_offset.
5503 (Sized_relobj_file::do_local_symbol_value): New function.
5504 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5505 local_plt_offset.
5506 * output.cc (Output_data_got::Got_entry::write): Change object to
5507 Relobj. Use local_symbol_value.
5508 (Output_data_got::add_global_with_rel): Change rel_dyn to
5509 Output_data_reloc_generic*. Use add_global_generic.
5510 (Output_data_got::add_global_with_rela): Remove. Change all
5511 callers to use add_global_with_rel.
5512 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5513 Output_data_reloc_generic*. Use add_global_generic.
5514 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5515 callers to use add_global_pair_with_rel.
5516 (Output_data_got::add_local): Change object to Relobj*.
5517 (Output_data_got::add_local_plt): Likewise.
5518 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5519 change rel_dyn to Output_data_reloc_generic*. Use
5520 add_local_generic.
5521 (Output_data_got::add_local_with_rela): Remove. Change all
5522 callers to use all_local_with_rel.
5523 (Output_data_got::add_local_pair_with_rel): Change object to
5524 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5525 add_output_section_generic.
5526 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5527 callers to use add_local_pair_with_rel.
5528 (Output_data_got::reserve_local): Change object to Relobj*.
5529 * output.h: (class Output_data_reloc_generic): Add pure virtual
5530 declarations for add_global_generic, add_local_generic,
5531 add_output_section_generic.
5532 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5533 functions for Output_data_reloc_generic. Update declarations for
5534 changes listed in output.cc.
5535 (class Output_data_got): Change template parameter to got_size.
5536 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5537 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5538 function.
5539 (Sized_relobj_incr::do_local_plt_offset): New function.
5540 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5541 add_global_generic.
5542
76677ad0
CC
55432011-12-17 Cary Coutant <ccoutant@google.com>
5544
5545 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5546 * resolve.cc (Symbol_table::resolve): Likewise.
5547 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5548 arrays.
5549 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5550
8b8dd8d5
ILT
55512011-12-16 Ian Lance Taylor <iant@google.com>
5552
5553 * output.h (Output_data_reloc_generic::add): Only call
5554 add_dynamic_reloc if this is a dynamic reloc section.
5555
d55525b9
L
55562011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5557
5558 PR gold/13505
5559 * target-reloc.h (apply_relocation): Replace <64, false> with
5560 <size, big_endian>.
5561
ff81c7c1
NC
55622011-11-25 Nick Clifton <nickc@redhat.com>
5563
5564 * po/it.po: New Italian translation.
5565
628f39be
SA
55662011-11-17 Sterling Augustine <saugustine@google.com>
5567
5568 * script.cc (script_include_directive): Implement.
5569 (read_script_file): New local variables name and search_path. Update
5570 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5571 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5572 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5573
98ef3ea4
SA
55742011-11-11 Sterling Augustine <saugustine@google.com>
5575
5576 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5577 (file_or_sections_cmd): Likewise.
5578
f4a8b6d7
DK
55792011-11-11 Doug Kwan <dougkwan@google.com>
5580
5581 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5582 if --just-symbols is given.
5583
29ab395d
DK
55842011-11-10 Doug Kwan <dougkwan@google.com>
5585
5586 PR gold/13362
5587 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5588 when processing data relocs.
5589 * reloc.h (Relocate_functions::rel_unaligned): New method.
5590 (Relocate_functions::pcrel_unaligned): Ditto.
5591 (Relocate_functions::rel32_unaligned): Ditto.
5592 (Relocate_functions::pcrel32_unaligned): Ditto.
5593
2c339f71
DK
55942011-11-09 Doug Kwan <dougkwan@google.com>
5595
5596 PR gold/13362
5597 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5598 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5599 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5600 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5601 (Relocate_functions::rel_unaligned): New.
5602 (Relocate_functions::rel32_unaligned): New.
5603 * target-reloc.h (relocate_for_relocatable): Add code to handle
5604 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5605 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5606 arm_unaligned_reloc_r): New targets.
5607 * testsuite/Makefile.in: Regenerate.
5608 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5609 linking.
5610
3f3cddf1
ILT
56112011-11-02 Ian Lance Taylor <iant@google.com>
5612
5613 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5614 NATIVE_LINKER.
5615 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5616 * options.cc (General_options::finalize): Use library search path
5617 from configure script if specified. If not native and no sysroot,
5618 only search TOOLLIBDIR.
5619 * options.h (Search_directory::Search_directory): Change name to
5620 const std::string&.
5621 (General_options::add_to_library_path_with_sysroot): Change arg to
5622 const std::string&.
5623 * configure, Makefile.in, config.in: Rebuild.
5624
a8e2273b
ILT
56252011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5626
5627 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5628 we are working around the ARM1176 Erratum.
5629 * options.h (General_options::fix_arm1176): Add option.
5630 * testsuite/Makefile.am: Add testcases, and keep current ones
5631 working.
5632 * testsuite/Makefile.in: Regenerate.
5633 * testsuite/arm_fix_1176.s: New file.
5634 * testsuite/arm_fix_1176.sh: Likewise.
5635
cd6eab1c
ILT
56362011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5637
5638 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5639 may_use_blx_.
5640 (Target_arm::may_use_blx): Remove method.
5641 (Target_arm::set_may_use_blx): Likewise.
5642 (Target_arm::may_use_v4t_interworking): New method.
5643 (Target_arm::may_use_v5t_interworking): Likewise.
5644 (Target_arm::may_use_blx_): Remove member variable.
5645 (Arm_relocate_functions::arm_branch_common): Check for v5T
5646 interworking.
5647 (Arm_relocate_functions::thumb_branch_common): Likewise.
5648 (Reloc_stub::stub_type_for_reloc): Likewise.
5649 (Target_arm::do_finalize_sections): Correct interworking checks.
5650 * testsuite/Makefile.am: Add new tests.
5651 * testsuite/Makefile.in: Regenerate.
5652 * testsuite/arm_farcall_arm_arm.s: New test.
5653 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5654 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5655 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5656 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5657 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5658 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5659 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5660
286adcf4
CC
56612011-10-31 Cary Coutant <ccoutant@google.com>
5662
5663 PR gold/13023
5664 * expression.cc (Expression::eval_with_dot): Add
5665 is_section_dot_assignment parameter.
5666 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5667 absolute and assigning to dot within a section.
5668 * script-sections.cc
5669 (Output_section_element_assignment::set_section_addresses): Pass
5670 dot_section to set_if_absolute.
5671 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5672 as is_section_dot_assignment flag to eval_with_dot.
5673 (Output_section_element_dot_assignment::set_section_addresses):
5674 Likewise.
5675 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5676 parameter. Also set value if relative to dot_section; set the
5677 symbol's output_section.
5678 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5679 parameter. Adjust all callers.
5680 (Expression::eval_maybe_dot): Likewise.
5681 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5682 Adjust all callers.
5683 * testsuite/script_test_2.t: Test assignment of an absolute value
5684 to dot within an output section element.
5685
9634ed06
CC
56862011-10-31 Cary Coutant <ccoutant@google.com>
5687
5688 * options.h (class General_options): Add --[no-]gnu-unique options.
5689 * symtab.cc (Symbol_table::sized_write_globals): Convert
5690 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5691
de4101c7
CC
56922011-10-31 Cary Coutant <ccoutant@google.com>
5693
5694 PR gold/13359
5695 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5696 unnecessary assertion.
5697 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5698
7257cc92
ST
56992011-10-31 Sriraman Tallam <tmsriram@google.com>
5700
5701 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5702 gc_mark_symbol.
5703 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5704 gc_mark_symbol.
5705 Change to just keep the section associated with symbol.
5706 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5707 they are externally visible and --export-dynamic is turned on.
5708 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5709
bfc34b3f
ILT
57102011-10-19 Ian Lance Taylor <iant@google.com>
5711
5712 PR gold/13163
5713 * script-sections.cc
5714 (Output_section_element_dot_assignment::needs_output_section): New
5715 function.
5716
ea0d8c47
ILT
57172011-10-19 Ian Lance Taylor <iant@google.com>
5718
5719 PR gold/13204
5720 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5721 --section-start option was seen.
5722 * options.h (General_options::any_section_start): New function.
5723
abd242a9
DM
57242011-10-18 David S. Miller <davem@davemloft.net>
5725
5726 PR binutils/13301
5727 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5728 member to track relocation locations that have moved during TLS
5729 reloc optimizations.
5730 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5731 (Target_sparc::Relocate::relocate): Adjust view down by 4
5732 bytes if it matches reloc_adjust_addr_.
5733 (Target_sparc::Relocate::relocate_tls): Always move the
5734 __tls_get_addr call delay slot instruction forward 4 bytes when
5735 performing relaxation.
5736
bab9090f
CC
57372011-10-18 Cary Coutant <ccoutant@google.com>
5738
5739 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5740 (Output_file::map_no_anonymous): Check for non-zero
5741 return code from posix_fallocate.
5742
f7c5b166
CC
57432011-10-17 Cary Coutant <ccoutant@google.com>
5744
5745 PR gold/13245
5746 * plugin.cc (is_visible_from_outside): Check for symbols
5747 referenced from dynamic objects.
5748 * resolve.cc (Symbol_table::resolve): Don't count references
5749 from dynamic objects as references from real ELF files.
5750 * testsuite/plugin_test_2.sh: Adjust expected result.
5751
b490c0bb
CC
57522011-10-17 Cary Coutant <ccoutant@google.com>
5753
5754 * gold.cc: Include timer.h.
5755 (queue_middle_tasks): Stamp time.
5756 (queue_final_tasks): Likewise.
5757 * main.cc (main): Store timer in parameters. Print timers
5758 for each pass.
5759 * parameters.cc (Parameters::Parameters): Initialize timer_.
5760 (Parameters::set_timer): New function.
5761 (set_parameters_timer): New function.
5762 * parameters.h (Parameters::set_timer): New function.
5763 (Parameters::timer): New function.
5764 (Parameters::timer_): New data member.
5765 (set_parameters_timer): New function.
5766 * timer.cc (Timer::stamp): New function.
5767 (Timer::get_pass_time): New function.
5768 * timer.h (Timer::stamp): New function.
5769 (Timer::get_pass_time): New function.
5770 (Timer::pass_times_): New data member.
5771
f475cf7b
CC
57722011-10-17 Cary Coutant <ccoutant@google.com>
5773
5774 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5775 task for members of lib groups.
5776
cdd7e244
CC
57772011-10-17 Cary Coutant <ccoutant@google.com>
5778
5779 PR gold/13288
4f95c8b4 5780 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5781 (File_read::make_view): Move bounds check (replace with assert)...
5782 (File_read::find_or_make_view): ... to here.
5783
dfb45471
CC
57842011-10-12 Cary Coutant <ccoutant@google.com>
5785
4f95c8b4 5786 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5787 ::read returns less than requested size.
5788
53bbcc1b
CC
57892011-10-10 Cary Coutant <ccoutant@google.com>
5790
4f95c8b4 5791 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5792 Initialize defined_count_.
5793 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5794 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5795 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5796 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5797 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5798 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5799 member.
5800 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5801 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5802 Return zeroes instead of internal error.
5803
397b129b
CC
58042011-10-10 Cary Coutant <ccoutant@google.com>
5805
5806 PR gold/13249
4f95c8b4 5807 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5808 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5809 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5810 (Output_reloc::type_): Adjust size of bit field.
5811 (Output_reloc::use_plt_offset_): New bit field.
5812 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5813 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5814 flag. Adjust all callers.
4f95c8b4 5815 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5816 creating RELATIVE relocations.
5817
d5698657
NC
58182011-10-10 Nick Clifton <nickc@redhat.com>
5819
5820 * po/es.po: Updated Spanish translation.
5821 * po/fi.po: Updated Finnish translation.
5822
6a59a5c2
DN
58232011-10-03 Diego Novillo <dnovillo@google.com>
5824
5825 * options.cc (parse_uint): Fix dereference of RETVAL.
5826
f0558624
ST
58272011-09-29 Sriraman Tallam <tmsriram@google.com>
5828
5829 * layout.h (section_order_map_): New member.
5830 (get_section_order_map): New member function.
5831 * output.cc (Output_section::add_input_section): Check for patterns
5832 only when --section-ordering-file is specified.
5833 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5834 output_sections have been formed.
5835 * layout.cc (Layout_Layout): Initialize section_order_map_.
5836 * plugin.cc (update_section_order): Store order in order_map. Do not
5837 update the order.
5838 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5839 * testsuite/Makefile.in: Regenerate.
5840 * testsuite/plugin_section_order.c: New file.
5841 * testsuite/plugin_final_layout.cc: New file.
5842 * testsuite/plugin_final_layout.sh: New file.
5843
a7dac153
CC
58442011-09-29 Cary Coutant <ccoutant@google.com>
5845
4f95c8b4 5846 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5847 Check for NULL.
4f95c8b4 5848 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5849 symbols during incremental update.
5850 (Symbol_table::add_from_dynobj): Likewise.
5851
eebd87a5
ILT
58522011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5853 Ian Lance Taylor <iant@google.com>
5854
5855 * symtab.cc (Symbol_table::define_special_symbol): Always
5856 canonicalize version string.
5857
403a3331
CC
58582011-09-26 Cary Coutant <ccoutant@google.com>
5859
4f95c8b4
CC
5860 * gold.cc (queue_initial_tasks): Move option checks ...
5861 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5862 some options; make others fatal.
5863
235061c2
CC
58642011-09-26 Cary Coutant <ccoutant@google.com>
5865
5866 gcc PR lto/47247
5867 * plugin.cc (get_symbols_v2): New function.
5868 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5869 (is_referenced_from_outside): New function.
5870 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5871 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5872 (get_symbols): Pass version parameter.
5873 (get_symbols_v2): New function.
5874 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5875 parameter.
5876 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5877 (onload): Add LDPT_GET_SYMBOLS_V2.
5878 (all_symbols_read_hook): Use get_symbols_v2; check for
5879 LDPR_PREVAILING_DEF_IRONLY_EXP.
5880 * testsuite/plugin_test_3.sh: Update expected results.
5881
dc87f620
ILT
58822011-09-23 Simon Baldwin <simonb@google.com>
5883
5884 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5885 configuration options.
5886 * configure: Regenerate.
5887 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5888 * Makefile.in: Regenerate.
5889 * testsuite/Makefile.in: Regenerate.
5890
a8279f82
ST
58912011-09-19 Sriraman Tallam <tmsriram@google.com>
5892
5893 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5894
0c9350c8
CC
58952011-09-19 Cary Coutant <ccoutant@google.com>
5896
5897 * incremental.cc (can_incremental_update): Fix typo in comment.
5898 * incremental.h (can_incremental_update): Likewise.
5899
aa06ae28
CC
59002011-09-18 Cary Coutant <ccoutant@google.com>
5901
5902 * incremental.cc (can_incremental_update): New function.
5903 * incremental.h (can_incremental_update): New function.
5904 * layout.cc (Layout::init_fixed_output_section): Call it.
5905 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5906 * object.cc (Sized_relobj_file::do_layout): Call
5907 can_incremental_update.
5908
ebb300b2
CC
59092011-09-13 Cary Coutant <ccoutant@google.com>
5910
5911 * configure.ac: Check for glibc support for gnu_indirect_function
5912 support with static linking, setting automake conditional
5913 IFUNC_STATIC.
5914 * Makefile.in: Regenerate.
5915 * configure: Regenerate.
5916
5917 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5918 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5919 for IFUNC_STATIC.
5920 * testsuite/Makefile.in: Regenerate.
5921
1206d0d5
CC
59222011-09-13 Cary Coutant <ccoutant@google.com>
5923
5924 * incremental.cc (Sized_relobj_incr::do_layout): Call
5925 report_comdat_group for kept comdat sections.
5926 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5927 * testsuite/Makefile.in: Regenerate.
5928 * testsuite/incr_comdat_test_1.cc: New source file.
5929 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5930 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5931 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5932
40b29874
ILT
59332011-09-13 Ian Lance Taylor <iant@google.com>
5934
5935 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5936 variable external_symbols_offset.
5937
1b045aac
ILT
59382011-09-12 Ian Lance Taylor <iant@google.com>
5939
5940 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5941 triggered if object has no symbols.
5942
24c6c55a
DM
59432011-09-09 David S. Miller <davem@davemloft.net>
5944
5945 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5946 (Output_fill_debug_line::do_write): Likewise.
5947
66570254
CC
59482011-08-29 Cary Coutant <ccoutant@google.com>
5949
5950 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5951 casts to match formatting specs.
5952 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5953
8ea8cd50
CC
59542011-08-26 Cary Coutant <ccoutant@google.com>
5955
5956 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5957 remaining hole size when allocating.
5958 (Layout::make_output_section): Set fill methods for debug sections.
5959 * layout.h (Free_list::Free_list_node): Move from private to
5960 public.
5961 (Free_list::set_min_hole_size): New function.
5962 (Free_list::begin, Free_list::end): New functions.
5963 (Free_list::min_hole_): New data member.
5964 * output.cc: Include dwarf.h.
5965 (Output_fill_debug_info::do_minimum_hole_size): New function.
5966 (Output_fill_debug_info::do_write): New function.
5967 (Output_fill_debug_line::do_minimum_hole_size): New function.
5968 (Output_fill_debug_line::do_write): New function.
5969 (Output_section::Output_section): Initialize new data member.
5970 (Output_section::set_final_data_size): Ensure patch space is larger
5971 than minimum hole size.
5972 (Output_section::do_write): Fill holes in debug sections.
5973 * output.h (Output_fill): New class.
5974 (Output_fill_debug_info): New class.
5975 (Output_fill_debug_line): New class.
5976 (Output_section::set_free_space_fill): New function.
5977 (Output_section::free_space_fill_): New data member.
5978 * testsuite/Makefile.am (incremental_test_3): Add
5979 --incremental-patch option.
5980 (incremental_test_4): Likewise.
5981 (incremental_test_5): Likewise.
5982 (incremental_test_6): Likewise.
5983 (incremental_copy_test): Likewise.
5984 (incremental_common_test_1): Likewise.
5985 * testsuite/Makefile.in: Regenerate.
5986
7cf80422
NC
59872011-08-26 Nick Clifton <nickc@redhat.com>
5988
5989 * po/es.po: Updated Spanish translation.
5990
c3f7b0e5
CC
59912011-08-01 Cary Coutant <ccoutant@google.com>
5992
5993 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5994 * gold/testsuite/Makefile.in: Regenerate.
5995 * gold/testsuite/justsyms_exec.c: New source file.
5996 * gold/testsuite/justsyms_lib.c: New source file.
5997
9590bf25
CC
59982011-08-01 Cary Coutant <ccoutant@google.com>
5999
6000 * layout.cc (Layout::set_segment_offsets): Don't realign text
6001 segment if -Ttext was specified.
6002 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6003 file type.
6004 * object.h (Sized_relobj_file::e_type): New function.
6005 (Sized_relobj_file::e_type_): New data member.
6006 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6007 base address for ET_EXEC files.
6008 * target.cc (Target::do_make_elf_object_implementation): Allow
6009 ET_EXEC files with --just-symbols option.
6010
dcd8d12e
CC
60112011-07-28 Cary Coutant <ccoutant@google.com>
6012
6013 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6014 Add thread_number parameter.
6015 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6016 * workqueue-threads.cc
6017 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6018 current thread if its thread number is greater than desired thread
6019 count.
6020 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6021 Add thread_number parameter.
6022 (Workqueue::should_cancel_thread): Likewise.
6023 (Workqueue::find_runnable_or_wait): Pass thread_number to
6024 should_cancel_thread.
6025 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6026 parameter.
6027
804eb480
ST
60282011-07-22 Sriraman Tallam <tmsriram@google.com>
6029
6030 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6031 only after checking if it cannot be forced local.
6032 * symtab.h (is_externally_visible): Check if the symbol is not forced
6033 local.
6034
f1ddb600
ILT
60352011-07-15 Ian Lance Taylor <iant@google.com>
6036
6037 * options.h (class General_options): Add --print-output-format.
6038 Move -EL next to -EB, for better --help output.
6039 * target-select.cc: Include <cstdio>, "options.h", and
6040 "parameters.h".
6041 (Target_selector::do_target_bfd_name): New function.
6042 (print_output_format): New function.
6043 * target-select.h (class Target_selector): Update declarations.
6044 (Target_selector::target_bfd_name): New function.
6045 (print_output_format): Declare.
6046 * main.cc: Include "target-select.h".
6047 (main): Handle --print-output-format.
6048 * gold.cc: Include "target-select.h".
6049 (queue_initial_tasks): Handle --print-output-format when there are
6050 no input files.
6051 * parameters.cc (parameters_force_valid_target): Give a better
6052 error message if -EB/-EL does not match target.
6053 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6054 function.
6055
7d172687
ILT
60562011-07-15 Ian Lance Taylor <iant@google.com>
6057
6058 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6059 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6060 (Output_data_plt_i386::do_write): Write address of .dynamic
6061 section to first entry in .got.plt section.
6062 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6063 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6064 Initialize layout_.
6065 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6066 section to first entry in .got.plt section.
6067 * layout.h (Layout::dynamic_section): New function.
6068
e9552f7e
ST
60692011-07-13 Sriraman Tallam <tmsriram@google.com>
6070
6071 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6072 to claim_file call.
6073 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6074 input_section_position_, and input_section_glob_.
6075 (read_layout_from_file): Call function section_ordering_specified.
6076 * layout.h (is_section_ordering_specified): New function.
6077 (section_ordering_specified): New function.
6078 (section_ordering_specified_): New boolean member.
6079 * main.cc(main): Call load_plugins after layout object is defined.
6080 * output.cc (Output_section::add_input_section): Use
6081 function section_ordering_specified to check if section ordering is
6082 needed.
6083 * output.cc (Output_section::add_relaxed_input_section): Use
6084 function section_ordering_specified to check if section ordering is
6085 needed.
6086 (Output_section::update_section_layout): New function.
6087 (Output_section::sort_attached_input_sections): Check if input section
6088 must be reordered.
6089 * output.h (Output_section::update_section_layout): New function.
6090 * plugin.cc (get_section_count): New function.
6091 (get_section_type): New function.
6092 (get_section_name): New function.
6093 (get_section_contents): New function.
6094 (update_section_order): New function.
58797674 6095 (allow_section_ordering): New function.
e9552f7e
ST
6096 (Plugin::load): Add the new interfaces to the transfer vector.
6097 (Plugin_manager::load_plugins): New parameter.
6098 (Plugin_manager::all_symbols_read): New parameter.
6099 (Plugin_manager::claim_file): New parameter. Save the elf object for
6100 unclaimed objects.
6101 (Plugin_manager::get_elf_object): New function.
6102 (Plugin_manager::get_view): Change to directly use the bool to check
6103 if get_view is called from claim_file_hook.
6104 * plugin.h (input_objects): New function
6105 (Plugin__manager::load_plugins): New parameter.
6106 (Plugin_manager::claim_file): New parameter.
6107 (Plugin_manager::get_elf_object): New function.
6108 (Plugin_manager::in_claim_file_handler): New function.
6109 (Plugin_manager::in_claim_file_handler_): New member.
6110 (layout): New function.
6111 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6112 handler with an extra parameter. Make the elf object before calling
6113 claim_file handler.
6114 * testsuite/plugin_test.c (get_section_count): New function pointer.
6115 (get_section_type): New function pointer.
6116 (get_section_name): New function pointer.
6117 (get_section_contents): New function pointer.
6118 (update_section_order): New function pointer.
6119 (allow_section_ordering): New function pointer.
6120 (onload): Check if the new interfaces exist.
6121
9446efde
ILT
61222011-07-13 Ian Lance Taylor <iant@google.com>
6123
6124 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6125 relro section.
6126 * x86_64.cc (Target_x86_64::got_section): Likewise.
6127 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6128 (relro_now_test_SOURCES): New variable.
6129 (relro_now_test_DEPENDENCIES): New variable.
6130 (relro_now_test_LDFLAGS): New variable.
6131 (relro_now_test_LDADD): New variable.
6132 (relro_now_test.so): New target.
6133 * testsuite/Makefile.in: Rebuild.
6134
07aa62f2
ILT
61352011-07-12 Ian Lance Taylor <iant@google.com>
6136
6137 PR gold/12980
6138 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6139 GLOB_DAT relocation rather than a RELATIVE relocation for a
6140 protected symbol when creating a shared library.
6141 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6142 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6143 * testsuite/protected_main_1.cc (main): Test that protected
6144 function has same address.
6145
e2153196
ILT
61462011-07-11 Ian Lance Taylor <iant@google.com>
6147
6148 PR gold/12979
6149 * options.h (class General_options): Add -Bgroup.
6150 * options.cc (General_options::finalize): If -Bgroup is set,
6151 default to --unresolved-symbols=report-all.
6152 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6153 * target-reloc.h (issue_undefined_symbol_error): Handle
6154 --unresolved-symbols=report-all.
6155
6daf5215
ILT
61562011-07-08 Ian Lance Taylor <iant@google.com>
6157
6158 PR gold/11985
6159 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6160 if linker script discards key sections.
6161 (Layout::create_dynamic_symtab): Likewise.
6162 (Layout::assign_local_dynsym_offsets): Likewise.
6163 (Layout::sized_create_version_sections): Likewise.
6164 (Layout::create_interp): Likewise.
6165 (Layout::finish_dynamic_section): Likewise.
6166 (Layout::set_dynamic_symbol_size): Likewise.
6167
beabb2c6
ILT
61682011-07-08 Ian Lance Taylor <iant@google.com>
6169
6170 PR gold/12386
6171 * options.h (class General_options): Add --unresolved-symbols.
6172 * target-reloc.h (issue_undefined_symbol_error): Check
6173 --unresolved-symbols. Add comments.
6174
9c16daf1
ILT
61752011-07-08 Ian Lance Taylor <iant@google.com>
6176
6177 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6178 expression more complex.
6179
191f1a2d
ILT
61802011-07-08 Ian Lance Taylor <iant@google.com>
6181
6182 PR gold/11317
6183 * target-reloc.h (issue_undefined_symbol_error): New inline
6184 function, broken out of relocate_section.
6185 (relocate_section): Call issue_undefined_symbol_error.
6186 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6187 there is no TLS segment if we are about to issue an undefined
6188 symbol error.
6189 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6190
62855347
ILT
61912011-07-08 Ian Lance Taylor <iant@google.com>
6192
6193 PR gold/12279
6194 * resolve.cc (Symbol_table::should_override): Add fromtype
6195 parameter. Change all callers. Give error when linking together
6196 TLS and non-TLS symbol.
6197 (Symbol_table::should_override_with_special): Add fromtype
6198 parameter. Change all callers.
6199 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6200 there is no TLS segment if we have reported some errors.
6201 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6202
67181c72
ILT
62032011-07-08 Ian Lance Taylor <iant@google.com>
6204
6205 PR gold/12372
6206 * target.h (Target::plt_address_for_global): New function.
6207 (Target::plt_address_for_local): New function.
6208 (Target::plt_section_for_global): Remove.
6209 (Target::plt_section_for_local): Remove.
6210 (Target::do_plt_address_for_global): New virtual function.
6211 (Target::do_plt_address_for_local): New virtual function.
6212 (Target::do_plt_section_for_global): Remove.
6213 (Target::do_plt_section_for_local): Remove.
6214 (Target::register_global_plt_entry): Add Symbol_table and Layout
6215 parameters.
6216 * output.cc (Output_data_got::Got_entry::write): Use
6217 plt_address_for_global and plt_address_for_local.
6218 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6219 address of output section.
6220 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6221 got_irelative_, and irelative_count_ fields. Update
6222 declarations.
6223 (Output_data_plt_i386::has_irelative_section): New function.
6224 (Output_data_plt_i386::entry_count): Add irelative_count_.
6225 (Output_data_plt_i386::set_final_data_size): Likewise.
6226 (class Target_i386): Add got_irelative_ and rel_irelative_
6227 fields. Update declarations.
6228 (Target_i386::Target_i386): Initialize new fields.
6229 (Target_i386::do_plt_address_for_global): New function replacing
6230 do_plt_section_for_global.
6231 (Target_i386::do_plt_address_for_local): New function replacing
6232 do_plt_section_for_local.
6233 (Target_i386::got_section): Create got_irelative_.
6234 (Target_i386::rel_irelative_section): New function.
6235 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6236 fields. Don't define __rel_iplt_{start,end}.
6237 (Output_data_plt_i386::add_entry): Add symtab and layout
6238 parameters. Change all callers. Use different PLT and GOT for
6239 IFUNC symbols.
6240 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6241 layout parameters. Change all callers. Use different PLT and
6242 GOT.
6243 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6244 (Output_data_plt_i386::rel_irelative): New function.
6245 (Output_data_plt_i386::address_for_global): New function.
6246 (Output_data_plt_i386::address_for_local): New function.
6247 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6248 IRELATIVE GOT when changing IFUNC GOT entries.
6249 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6250 reloc.
6251 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6252 if we didn't create an IRELATIVE GOT.
6253 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6254 plt_address_for_local.
6255 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6256 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6257 got_irelative_, and irelative_count_ fields. Update
6258 declarations.
6259 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6260 Initialize new fields. Remove symtab parameter. Change all
6261 callers.
6262 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6263 irelative_count_.
6264 (Output_data_plt_x86_64::has_irelative_section): New function.
6265 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6266 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6267 fields. Update declarations.
6268 (Target_x86_64::Target_x86_64): Initialize new fields.
6269 (Target_x86_64::do_plt_address_for_global): New function replacing
6270 do_plt_section_for_global.
6271 (Target_x86_64::do_plt_address_for_local): New function replacing
6272 do_plt_section_for_local.
6273 (Target_x86_64::got_section): Create got_irelative_.
6274 (Target_x86_64::rela_irelative_section): New function.
6275 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6276 all callers. Don't create __rel_iplt_{start,end}.
6277 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6278 parameters. Change all callers. Use different PLT and GOT for
6279 IFUNC symbols.
6280 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6281 layout parameters. Change all callers. Use different PLT and
6282 GOT.
6283 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6284 parameters. Change all callers. Use different PLT and GOT for
6285 IFUNC symbols.
6286 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6287 (Output_data_plt_x86_64::rela_irelative): New function.
6288 (Output_data_plt_x86_64::address_for_global): New function.
6289 (Output_data_plt_x86_64::address_for_local): New function.
6290 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6291 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6292 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6293 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6294 parameters.
6295 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6296 reloc.
6297 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6298 symbols if we didn't create an IRELATIVE GOT.
6299 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6300 plt_address_for_local.
6301 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6302 * testsuite/ifuncvar1.c: New test file.
6303 * testsuite/ifuncvar2.c: New test file.
6304 * testsuite/ifuncvar3.c: New test file.
6305 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6306 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6307 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6308 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6309 * testsuite/Makefile.in: Rebuild.
6310
33c15b45
CC
63112011-07-07 Cary Coutant <ccoutant@google.com>
6312
6313 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6314 (two_file_test_1_ndebug.o): Likewise.
6315 (two_file_test_1b_ndebug.o): Likewise.
6316 (two_file_test_2_ndebug.o): Likewise.
6317 (two_file_test_main_ndebug.o): Likewise.
6318 (incremental_test_2): Link with no-debug versions.
6319
f48b5fb7
CC
63202011-07-06 Cary Coutant <ccoutant@google.com>
6321
6322 * gold/incremental.cc
6323 (Output_section_incremental_inputs::write_info_blocks): Check for
6324 hidden and internal symbols.
6325
221597a5
CC
63262011-07-06 Cary Coutant <ccoutant@google.com>
6327
6328 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6329 Check disposition for startup file.
6330 (Incremental_inputs::report_command_line): Ignore
6331 --incremental-startup-unchanged option.
6332 * options.cc (General_options::parse_incremental_startup_unchanged):
6333 New function.
6334 (General_options::General_options): Initialize new data member.
6335 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6336 (General_options): Add --incremental-startup-unchanged option.
6337 (General_options::incremental_startup_disposition): New function.
6338 (General_options::incremental_startup_disposition_): New data member.
6339
e24719f6
CC
63402011-07-06 Cary Coutant <ccoutant@google.com>
6341
6342 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6343 input file index to Script_info ctor.
6344 (Sized_incremental_binary::do_file_has_changed): Find the
6345 command-line argument for files named in scripts.
6346 * incremental.h (Script_info::Script_info): New ctor
6347 with input file index.
6348 (Script_info::input_file_index): New function.
6349 (Script_info::input_file_index_): New data member.
6350 (Incremental_binary::get_library): Add const.
6351 (Incremental_binary::get_script_info): Add const.
6352 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6353 * testsuite/Makefile.am (incremental_test_5): New test case.
6354 (incremental_test_6): New test case.
6355 * testsuite/Makefile.in: Regenerate.
6356
8f7c81e8
CC
63572011-07-06 Cary Coutant <ccoutant@google.com>
6358
6359 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6360 debug output when command lines differ.
6361
9fbd3822
CC
63622011-07-06 Cary Coutant <ccoutant@google.com>
6363
6364 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6365 --incremental-patch option.
6366 * layout.cc (Free_list::allocate): Extend allocation beyond original
6367 end if enabled.
6368 (Layout::make_output_section): Mark sections that should get
6369 patch space.
6370 * options.cc (parse_percent): New function.
6371 * options.h (parse_percent): New function.
6372 (DEFINE_percent): New macro.
6373 (General_options): Add --incremental-patch option.
6374 * output.cc (Output_section::Output_section): Initialize new data
6375 members.
6376 (Output_section::add_input_section): Print section name when out
6377 of patch space.
6378 (Output_section::add_output_section_data): Likewise.
6379 (Output_section::set_final_data_size): Add patch space when
6380 doing --incremental-full.
6381 (Output_section::do_reset_address_and_file_offset): Remove patch
6382 space.
6383 (Output_segment::set_section_list_addresses): Print debug output
6384 only if --incremental-update.
6385 * output.h (Output_section::set_is_patch_space_allowed): New function.
6386 (Output_section::is_patch_space_allowed_): New data member.
6387 (Output_section::patch_space_): New data member.
6388 * parameters.cc (Parameters::incremental_full): New function.
6389 * parameters.h (Parameters::incremental_full): New function
6390 * testsuite/Makefile.am (incremental_test_2): Add test for
6391 --incremental-patch option.
6392 * testsuite/Makefile.in: Regenerate.
6393 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6394 (t18): Remove function body.
6395
f6cccc2c
DK
63962011-07-05 Doug Kwan <dougkwan@google.com>
6397
6398 PR gold/12771
6399 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6400 Arm_Address type for relocation result.
6401 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6402 overflow check.
6403 (Arm_relocate_functions::abs32): Use unaligned access.
6404 (Arm_relocate_functions::rel32): Ditto.
6405 (Arm_relocate_functions::prel31): Ditto.
6406 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6407 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6408 static data relocations.
6409 * testsuite/Makefile.in: Regnerate.
6410 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6411
28a13fec
ILT
64122011-07-05 Ian Lance Taylor <iant@google.com>
6413
6414 PR gold/12392
6415 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6416 symbols if necessary.
6417 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6418
24d47b34
ILT
64192011-07-05 Ian Lance Taylor <iant@google.com>
6420
6421 PR gold/12952
6422 * resolve.cc (Symbol::override_base_with_special): Simply override
6423 version with special symbol version, ignoring previous version.
6424
41f9cbbe
ILT
64252011-07-05 Ian Lance Taylor <iant@google.com>
6426
6427 * object.cc (Sized_relobj_file::include_section_group): Add
6428 information to comment about signature location.
6429
886288f1
ILT
64302011-07-02 Ian Lance Taylor <iant@google.com>
6431
6432 PR gold/12957
6433 * options.h (class General_options): Add -f and -F.
6434 * options.cc (General_options::finalize): Fatal error if -f/-F
6435 are used without -shared.
6436 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6437
ae3a6d4f
ILT
64382011-07-02 Ian Lance Taylor <iant@google.com>
6439
6440 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6441
21131061
ILT
64422011-07-01 Ian Lance Taylor <iant@google.com>
6443
6444 PR gold/12525
6445 PR gold/12952
6446 * resolve.cc (Symbol::override_base_with_special): Don't override
6447 the version if the overriding symbol has a different name.
6448 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6449 all callers. If we give an error about an undefined version,
6450 define the base version if necessary.
6451 * dynobj.h (class Versions): Update declaration.
6452 * testsuite/weak_alias_test_5.cc: New file.
6453 * testsuite/weak_alias_test.script: New file.
6454 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6455 and versioned_alias have the right value, and call t2.
6456 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6457 weak_alias_test_5.so.
6458 (weak_alias_test_LDADD): Likewise.
6459 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6460 * testsuite/Makefile.in: Rebuild.
6461
611062c0
ILT
64622011-07-01 Ian Lance Taylor <iant@google.com>
6463
6464 PR gold/12525
6465 * options.h (class General_options): Support -z notext.
6466 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6467 -Wl,-z,notext.
6468 (two_file_shared_nonpic.so): Likewise.
6469 (two_file_shared_mixed.so): Likewise.
6470 (two_file_shared_mixed_1.so): Likewise.
6471 (weak_undef_lib_nonpic.so): Likewise.
6472 (alt/weak_undef_lib_nonpic.so): Likewise.
6473 (tls_test_shared_nonpic.so): Likewise.
6474 * testsuite/Makefile.in: Rebuild.
6475
328c7c2f
ILT
64762011-07-01 Ian Lance Taylor <iant@google.com>
6477
6478 PR gold/12525
6479 * configure.ac: Test whether static linking works, setting
6480 the automake conditional HAVE_STATIC.
6481 * testsuite/Makefile.am: Disable tests using -static if
6482 HAVE_STATIC is not true.
6483 * configure, testsuite/Makefile.in: Rebuild.
6484
02d7cd44
ILT
64852011-07-01 Ian Lance Taylor <iant@google.com>
6486
6487 PR gold/12525
6488 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6489 Assert if we see DW_EH_PE_indirect.
6490 * target.h (Target::ehframe_datarel_base): New function.
6491 (Target::do_ehframe_datarel_base): New target function.
6492 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6493 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6494 function.
6495
07a60597
ILT
64962011-07-01 Ian Lance Taylor <iant@google.com>
6497
6498 PR gold/12571
6499 * options.h (class General_options): Add
6500 --ld-generated-unwind-info.
6501 * ehframe.cc (Fde::write): Add address parameter. Change all
6502 callers. If associated with PLT, fill in address and size.
6503 (Cie::set_output_offset): Only add merge mapping if there is an
6504 object.
6505 (Cie::write): Add address parameter. Change all callers.
6506 (Eh_frame::add_ehframe_for_plt): New function.
6507 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6508 input_offset_ fields into union u_, with new plt field.
6509 (Fde::Fde): Adjust for new union field.
6510 (Fde::Fde) [Output_data version]: New constructor.
6511 (Fde::add_mapping): Only add merge mapping if there is an object.
6512 (class Cie): Update declarations.
6513 (class Eh_frame): Declare add_ehframe_for_plt.
6514 * layout.cc (Layout::layout_eh_frame): Break out code into
6515 make_eh_frame_section, and call it.
6516 (Layout::make_eh_frame_section): New function.
6517 (Layout::add_eh_frame_for_plt): New function.
6518 * layout.h (class Layout): Update declarations.
6519 * merge.cc (Merge_map::add_mapping): Add assertion.
6520 * i386.cc: Include "dwarf.h".
6521 (class Output_data_plt_i386): Make first_plt_entry,
6522 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6523 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6524 and plt_eh_frame_fde.
6525 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6526 boundary. Call add_eh_frame_for_plt if appropriate.
6527 * x86_64.cc: Include "dwarf.h".
6528 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6529 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6530 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6531 and plt_eh_frame_fde.
6532 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6533 appropriate.
6534
14788a3f
ILT
65352011-06-29 Ian Lance Taylor <iant@google.com>
6536
6537 PR gold/12629
6538 * object.cc (Sized_relobj_file::layout_section): Change shdr
6539 parameter to be const.
6540 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6541 out of do_layout.
6542 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6543 appropriate. Call layout_eh_frame_section.
6544 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6545 sections.
6546 * object.h (class Sized_relobj_file): Update declarations.
6547
6c21fce1
ILT
65482011-06-29 Ian Lance Taylor <iant@google.com>
6549
37e41b03 6550 PR gold/12652
6c21fce1
ILT
6551 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6552 modifier.
6553 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6554
4d5e4e62
ILT
65552011-06-29 Ian Lance Taylor <iant@google.com>
6556
6557 PR gold/12675
6558 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6559 SHT_X86_64_UNWIND.
6560 * layout.cc (Layout::layout_eh_frame): Likewise.
6561
886f533a
ILT
65622011-06-29 Ian Lance Taylor <iant@google.com>
6563
6564 PR gold/12695
6565 * layout.cc (Layout::symtab_section_shndx): New function.
6566 * layout.h (class Layout): Declare symtab_section_shndx.
6567 * output.cc (Output_section::write_header): Call it.
6568
f3ae1b28
ILT
65692011-06-29 Ian Lance Taylor <iant@google.com>
6570
6571 PR gold/12818
6572 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6573 symbols which are not used in a relocation.
6574
aecf301f
ILT
65752011-06-28 Ian Lance Taylor <iant@google.com>
6576
6577 PR gold/12898
6578 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6579 script create indistinguishable segments.
6580 (Layout::set_segment_offsets): Use stable_sort when sorting
6581 segments. Pass this to Compare_segments constructor.
6582 * layout.h (class Layout): Make segment_precedes non-static.
6583 (class Compare_segments): Change from struct to class. Add
6584 layout_ field. Add constructor.
6585 * script-sections.cc
6586 (Script_sections::attach_sections_using_phdrs_clause): Rename
6587 local orphan to is_orphan. Don't report failure to put empty
6588 section in segment. On attachment failure, report name of
6589 section, and attach to first PT_LOAD segment.
6590
03ef7571
ILT
65912011-06-28 Ian Lance Taylor <iant@google.com>
6592
6593 PR gold/12934
6594 * target-select.cc (Target_selector::Target_selector): Add
6595 emulation parameter. Change all callers.
6596 (select_target_by_bfd_name): Rename from select_target_by_name.
6597 Change all callers.
6598 (select_target_by_emulation): New function.
6599 (supported_emulation_names): New function.
6600 * target-select.h (class Target_selector): Add emulation_ field.
6601 Update declarations.
6602 (Target_selector::recognize_by_bfd_name): Rename from
6603 recognize_by_name. Change all callers.
6604 (Target_selector::supported_bfd_names): Rename from
6605 supported_names. Change all callers.
6606 (Target_selector::recognize_by_emulation): New function.
6607 (Target_selector::supported_emulations): New function.
6608 (Target_selector::emulation): New function.
6609 (Target_selector::do_recognize_by_bfd_name): Rename from
6610 do_recognize_by_name. Change all callers.
6611 (Target_selector::do_supported_bfd_names): Rename from
6612 do_supported_names. Change all callers.
6613 (Target_selector::do_recognize_by_emulation): New function.
6614 (Target_selector::do_supported_emulations): New function.
6615 (select_target_by_bfd_name): Change name in declaration.
6616 (select_target_by_emulation): Declare.
6617 (supported_emulation_names): Declare.
6618 * parameters.cc (parameters_force_valid_target): Try to find
6619 target based on emulation from -m option.
6620 * options.h (class General_options): Change doc string for -m.
6621 * options.cc (help): Print emulations.
6622 (General_options::parse_V): Likewise.
6623 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6624 Add emulation parameter. Change all callers.
6625
200b2bb9
ILT
66262011-06-28 Ian Lance Taylor <iant@google.com>
6627
6628 * target.h (class Target): Add osabi_ field.
6629 (Target::osabi): New function.
6630 (Target::set_osabi): New function.
6631 (Target::Target): Initialize osabi_.
6632 (Target::do_adjust_elf_header): Make pure virtual.
6633 (Sized_target::do_adjust_elf_header): Declare.
6634 * target.cc (Sized_target::do_adjust_elf_header): New function.
6635 (class Sized_target): Instantiate all versions.
6636 * freebsd.h (class Target_freebsd): Remove.
6637 (Target_selector_freebsd::do_recognize): Call set_osabi on
6638 Target.
6639 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6640 (Target_selector_freebsd::set_osabi): Remove.
6641 * i386.cc (class Target_i386): Inherit from Sized_target rather
6642 than Target_freebsd.
6643 * x86_64.cc (class Target_x86_64): Likewise.
6644
b3ce541e
ILT
66452011-06-28 Ian Lance Taylor <iant@google.com>
6646
6647 * target.h (Target::can_check_for_function_pointers): Rewrite.
6648 Make non-virtual.
6649 (Target::can_icf_inline_merge_sections): Likewise.
6650 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6651 (Target::Target_info): Add can_icf_inline_merge_sections field.
6652 (Target::do_can_check_for_function_pointers): New virtual
6653 function.
6654 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6655 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6656 from can_check_for_function_pointers, move in file.
6657 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6658 section_may_have_icf_unsafe_poineters, move in file.
6659 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6660 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6661 Rename from can_check_for_function_pointers, move in file.
6662 (Target_i386::can_icf_inline_merge_sections): Remove.
6663 (Target_i386::i386_info): Initialize
6664 can_icf_inline_merge_sections.
6665 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6666 Initialize can_icf_inline_merge_sections.
6667 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6668 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6669 Rename from can_check_for_function_pointers, move in file.
6670 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6671 (Target_x86_64::x86_64_info): Initialize
6672 can_icf_inline_merge_sections.
6673 * testsuite/testfile.cc (Target_test::test_target_info):
6674 Likewise.
6675 * icf.cc (get_section_contents): Correct formatting.
6676
6d1c4efb
ILT
66772011-06-27 Ian Lance Taylor <iant@google.com>
6678
6679 * symtab.cc (Symbol::versioned_name): New function.
6680 (Symbol_table::add_to_final_symtab): Use versioned_name when
6681 appropriate.
6682 (Symbol_table::sized_write_symbol): Likewise.
6683 * symtab.h (class Symbol): Declare versioned_name.
6684 * stringpool.h (class Stringpool_template): Add variant of add
6685 which takes a std::basic_string.
6686 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6687 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6688 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6689 (ver_test_12.o): New target.
6690 * testsuite/Makefile.in: Rebuild.
6691
57eb9b50
DK
66922011-06-27 Doug Kwan <dougkwan@google.com>
6693
6694 * arm.cc (Arm_relocate_functions::thm_jump8,
6695 Arm_relocate_functions::thm_jump11): Use a wider signed
6696 type to compute offset.
6697 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6698 arm_thm_jump8.
6699 * testsuite/Makefile.in: Regenerate.
6700 * testsuite/arm_branch_in_range.sh: Check test results of
6701 arm_thm_jump11 and arm_thm_jump8.
6702 * testsuite/arm_thm_jump11.s: New test source file.
6703 * testsuite/arm_thm_jump11.t: New linker script.
6704 * testsuite/arm_thm_jump8.s: New test source file.
6705 * testsuite/arm_thm_jump8.t: New linker script.
6706
487b39df
ILT
67072011-06-24 Ian Lance Taylor <iant@google.com>
6708
6709 * layout.cc: Include "object.h".
6710 (ctors_sections_in_init_array): New static variable.
6711 (Layout::is_ctors_in_init_array): New function.
6712 (Layout::layout): Add entry to ctors_sections_in_init_array if
6713 appropriate.
6714 * layout.h (class Layout): Declare is_ctors_in_init_array.
6715 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6716 is_ctors_reverse_view is set.
6717 (Sized_relobj_file::write_sections): Add layout parameter. Change
6718 all callers. Set is_ctors_reverse_view field of View_size.
6719 (Sized_relobj_file::reverse_words): New function.
6720 * object.h (Sized_relobj_file::View_size): Add
6721 is_ctors_reverse_view field.
6722 (class Sized_relobj_file): Update declarations.
6723 * testsuite/initpri3.c: New test.
6724 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6725 initpri3b.
6726 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6727 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6728 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6729 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6730 * testsuite/Makefile.in: Rebuild.
6731
472076e4
CC
67322011-06-24 Cary Coutant <ccoutant@google.com>
6733
6734 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6735 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6736 (debug_msg_cdebug.err): New targets.
6737 * testsuite/Makefile.in: Regenerate.
6738 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6739 Fix checks for link with shared library.
6740
a60af0db
DK
67412011-06-24 Doug Kwan <dougkwan@google.com>
6742
6743 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6744 skip empty text sections.
6745 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6746
5393d741
ILT
67472011-06-22 Ian Lance Taylor <iant@google.com>
6748
6749 PR gold/12910
6750 * options.h (class General_options): Add --ctors-in-init-array.
6751 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6752 friends as SHT_PROGBITS for merging sections.
6753 (Layout::layout): Remove special handling of .init_array and
6754 friends. Don't sort if doing relocatable link. Sort for .ctors
6755 and .dtors if ctors_in_init_array.
6756 (Layout::make_output_section): Force correct section types for
6757 .init_array and friends. Don't sort if doing relocatable link,
6758 Don't sort .ctors and .dtors if ctors_in_init_array.
6759 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6760 (Layout::output_section_name): Add relobj parameter. Change all
6761 callers. Handle .ctors. and .dtors. in code rather than table.
6762 Handle .ctors and .dtors if ctors_in_init_array.
6763 (Layout::match_file_name): New function, moved from output.cc.
6764 * layout.h (class Layout): Update declarations.
6765 * output.cc: Include "layout.h".
6766 (Input_section_sort_entry::get_priority): New function.
6767 (Input_section_sort_entry::match_file_name): Just call
6768 Layout::match_file_name.
6769 (Output_section::Input_section_sort_init_fini_compare::operator()):
6770 Handle .ctors and .dtors. Sort by explicit priority rather than
6771 by name.
6772 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6773 * testsuite/initpri2.c: New test.
6774 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6775 (check_PROGRAMS): Add initpri2.
6776 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6777 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6778 * configure, testsuite/Makefile.in: Rebuild.
6779
e1f74f98
ILT
67802011-06-19 Ian Lance Taylor <iant@google.com>
6781
6782 PR gold/12880
6783 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6784 .interp section to a PT_INTERP segment even if we have seen a
6785 --dynamic-linker option. Don't do it if we have seen a PHDRS
6786 clause in a linker script.
6787 (Layout::finalize): Don't create a .interp section if we've
6788 already create a PT_INTERP segment.
6789 (Layout::create_interp): Always call choose_output_section (revert
6790 patch of 2011-06-17). Don't create PT_INTERP segment.
6791 * script-sections.cc
6792 (Script_sections::create_note_and_tls_segments): Add a .interp
6793 section to a PT_INTERP segment even if we have seen a
6794 --dynamic-linker option.
6795
766f91bb
ILT
67962011-06-18 Ian Lance Taylor <iant@google.com>
6797
6798 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6799 merely because a non-PT_LOAD segment has a dynamic reloc.
6800
0d212c3a
ILT
68012011-06-18 Ian Lance Taylor <iant@google.com>
6802
6803 * layout.cc (Layout::finish_dynamic_section): Don't create
6804 DT_FLAGS entry if not needed.
6805
911a5072
ILT
68062011-06-18 Ian Lance Taylor <iant@google.com>
6807
6808 PR gold/12745
6809 * layout.cc (Layout::layout_eh_frame): Correct handling of
6810 writable .eh_frame section.
6811
534b4e5f
ILT
68122011-06-17 Ian Lance Taylor <iant@google.com>
6813
6814 PR gold/12893
6815 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6816 symbol is redefined with the exact same object and value.
6817
10b4f102
ILT
68182011-06-17 Ian Lance Taylor <iant@google.com>
6819
6820 PR gold/12880
6821 * layout.h (class Layout): Add interp_segment_ field.
6822 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6823 (Layout::attach_allocated_section_to_segment): If making shared
6824 library, put .interp section in PT_INTERP segment.
6825 (Layout::finalize): Also call create_interp if -dynamic-linker
6826 option was used.
6827 (Layout::create_interp): Assert that there is no PT_INTERP
6828 segment. If not using a SECTIONS clause, use make_output_section.
6829 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6830 * script-sections.cc
6831 (Script_sections::create_note_and_tls_segments): If making shared
6832 library, put .interp section in PT_INTERP segment.
6833
a29b0dad
ILT
68342011-06-17 Ian Lance Taylor <iant@google.com>
6835
e588ea8d
ILT
6836 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6837 when making a shared library.
6838
68392011-06-17 Ian Lance Taylor <iant@google.com>
6840
6841 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6842 parameter. Change all callers. Don't issue warning about PC32
6843 against locally defined symbol.
a29b0dad 6844
9d3b0698
ILT
68452011-06-16 Ian Lance Taylor <iant@google.com>
6846
6847 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6848 occurs in same object.
6849
85b0f90c
AM
68502011-06-14 Alan Modra <amodra@gmail.com>
6851
6852 * po/POTFILES.in: Regenerate.
6853
a94907d9
ILT
68542011-06-09 Ian Lance Taylor <iant@google.com>
6855
6856 * script-sections.cc
6857 (Orphan_output_section::set_section_addresses): For a relocatable
6858 link set address to 0.
6859
4fb3a1c3
CC
68602011-06-09 Cary Coutant <ccoutant@google.com>
6861
6862 PR gold/12804
6863 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6864 used with --compress-debug-sections.
6865 * gold/object.cc (Sized_relobj_file::do_layout): Report
6866 uncompressed size of compressed input sections.
6867
61220854
CC
68682011-06-08 Cary Coutant <ccoutant@google.com>
6869
6870 PR gold/12804
6871 * testsuite/two_file_test_2_v1.cc: Change initialization of
6872 v2 to keep it in .data.
6873
e6455dfb
CC
68742011-06-07 Cary Coutant <ccoutant@google.com>
6875
6876 * common.cc (Symbol_table::do_allocate_commons_list): Call
6877 gold_fallback.
6878 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6879 (Errors::fallback): New function.
6880 (gold_fallback): New function.
6881 * errors.h (Errors::fallback): New function.
6882 * gold.cc (gold_exit): Change status parameter to enum; adjust
6883 all callers.
6884 (queue_initial_tasks): Call gold_fallback.
6885 * gold.h: Include cstdlib.
6886 (Exit_status): New enum type.
6887 (gold_exit): Change status parameter to enum.
6888 (gold_fallback): New function.
6889 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6890 (Layout::create_symtab_sections): Likewise.
6891 (Layout::create_shdrs): Likewise.
6892 * main.cc (main): Adjust call to gold_exit.
6893 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6894 (Output_data_got::add_got_entry_pair): Likewise.
6895 (Output_section::add_input_section): Likewise.
6896 (Output_section::add_output_section_data): Likewise.
6897 (Output_segment::set_section_list_addresses): Likewise.
6898 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6899
fb0e076f
CC
69002011-06-07 Cary Coutant <ccoutant@google.com>
6901
6902 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6903 for incremental links.
6904 * output.cc (Output_segment::set_section_list_addresses): Remove
6905 FIXME and test for TLS or BSS.
6906
a5ee4d5d
CC
69072011-06-07 Cary Coutant <ccoutant@google.com>
6908
6909 * testsuite/Makefile.am: Add incremental_copy_test,
6910 incremental_common_test_1.
6911 * testsuite/Makefile.in: Regenerate.
6912 * testsuite/common_test_1_v1.c: New source file.
6913 * testsuite/common_test_1_v2.c: New source file.
6914 * testsuite/copy_test_v1.cc: New source file.
6915
5146f448
CC
69162011-06-07 Cary Coutant <ccoutant@google.com>
6917
6918 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6919 update, allocate common from bss section's free list.
6920 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6921 linker-defined symbols.
6922 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6923 Skip GOT and PLT entries that are no longer referenced.
6924 (Output_section_incremental_inputs::write_info_blocks): Mark
6925 linker-defined symbols.
6926 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6927 * output.cc (Output_section::allocate): New function.
6928 * output.h (Output_section::allocate): New function.
6929 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6930 linker-defined symbols.
6931 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6932 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6933 (Symbol::init_base_output_data): Likewise.
6934 (Symbol::init_base_output_segment): Likewise.
6935 (Symbol::init_base_constant): Likewise.
6936 (Sized_symbol::init_output_data): Likewise.
6937 (Sized_symbol::init_output_segment): Likewise.
6938 (Sized_symbol::init_constant): Likewise.
6939 (Symbol_table::do_define_in_output_data): Likewise.
6940 (Symbol_table::do_define_in_output_segment): Likewise.
6941 (Symbol_table::do_define_as_constant): Likewise.
6942 * symtab.h (Symbol::is_predefined): New function.
6943 (Symbol::init_base_output_data): Add is_predefined parameter.
6944 (Symbol::init_base_output_segment): Likewise.
6945 (Symbol::init_base_constant): Likewise.
6946 (Symbol::is_predefined_): New data member.
6947 (Sized_symbol::init_output_data): Add is_predefined parameter.
6948 (Sized_symbol::init_output_segment): Likewise.
6949 (Sized_symbol::init_constant): Likewise.
6950 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6951
26d3c67d
CC
69522011-06-07 Cary Coutant <ccoutant@google.com>
6953
6954 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6955 instead of emit_copy_reloc.
6956 (Copy_relocs::emit_copy_reloc): Refactor.
6957 (Copy_relocs::make_copy_reloc): New function.
6958 (Copy_relocs::add_copy_reloc): Remove.
6959 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6960 section.
6961 (Copy_relocs::make_copy_reloc): New function.
6962 (Copy_relocs::add_copy_reloc): Remove.
6963 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6964 unchanged input files.
6965 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6966 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6967 Reserve BSS space for COPY relocations.
6968 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6969 (Output_section_incremental_inputs::write_info_blocks): Record
6970 whether a symbol is copied from a shared object.
6971 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6972 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6973 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6974 (Incremental_input_entry_reader::get_output_symbol_index): Add
6975 is_copy parameter.
6976 (Incremental_binary::emit_copy_relocs): New function.
6977 (Incremental_binary::do_emit_copy_relocs): New function.
6978 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6979 new data member.
6980 (Sized_incremental_binary::add_copy_reloc): New function.
6981 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6982 (Sized_incremental_binary::Copy_reloc): New struct.
6983 (Sized_incremental_binary::Copy_relocs): New typedef.
6984 (Sized_incremental_binary::copy_relocs_): New data member.
6985 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6986 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6987 * target.h (Sized_target::emit_copy_reloc): New function.
6988 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6989
7cdb37d9
CC
69902011-06-02 Cary Coutant <ccoutant@google.com>
6991
6992 PR gold/12163
6993 * gold/archive.cc (Archive::Archive): Initialize new data member.
6994 (Archive::include_all_members): Return if archive has already been
6995 included.
6996 * gold/archive.h (Archive::include_all_members_): New data member.
6997
cc643b88
NC
69982011-06-02 Nick Clifton <nickc@redhat.com>
6999
7000 * dynobj.h: Fix spelling mistake in comment.
7001 * output.cc: Likewise.
7002
f62a3ca7 70032011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7004 Asier Llano
f62a3ca7
DK
7005
7006 PR gold/12826
cc643b88 7007 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7008 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7009 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7010 redundant arm_exidx_test.so.
7011 * testsuite/Makefile.in: Regenerate.
7012 (check_SCRIPTS): Add pr12826.sh
7013 (check_DATA): Add pr12826.stdout
7014 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7015 * testsuite/pr12826.sh: New file.
7016 * testsuite/pr12826_1.s: Ditto.
7017 * testsuite/pr12826_1.s: Ditto.
7018
8dbe1edc
ILT
70192011-05-30 Ian Lance Taylor <iant@google.com>
7020
7021 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7022 sections.
7023
c49875be
ILT
70242011-05-29 Ian Lance Taylor <iant@google.com>
7025
7026 PR gold/12804
7027 * testsuite/Makefile.am: Use different file name for two_file_test
7028 temporary file for each incremental test.
7029 * testsuite/Makefile.in: Rebuild.
7030
69d53f7a
ILT
70312011-05-29 Ian Lance Taylor <iant@google.com>
7032
7033 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7034 binary input file is empty.
7035
41d0ab5f
ILT
70362011-05-27 Ian Lance Taylor <iant@google.com>
7037
7038 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7039 (ver_test_9.so): Likewise.
7040 * testsuite/Makefile.in: Rebuild.
7041
89d8a36b
CC
70422011-05-26 Cary Coutant <ccoutant@google.com>
7043
7044 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7045 * incremental.cc (Incremental_inputs::report_input_section): Fix
7046 comment, indentation.
7047 (Incremental_inputs::report_comdat_group): New function.
7048 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7049 of data for incremental input file entry.
7050 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7051 group count, COMDAT group signatures.
7052 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7053 an unchanged input file.
7054 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7055 Initialize new data member.
7056 (Incremental_object_entry::add_comdat_group): New function.
7057 (Incremental_object_entry::get_comdat_group_count): New function.
7058 (Incremental_object_entry::get_comdat_signature_key): New function.
7059 (Incremental_object_entry::groups_): New data member.
7060 (Incremental_inputs::report_comdat_group): New function.
7061 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7062 data for incremental input file entry.
7063 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7064 (Incremental_input_entry_reader::get_input_section): Adjust size of
7065 data for incremental input file entry.
7066 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7067 (Incremental_input_entry_reader::get_comdat_group_signature): New
7068 function.
7069 * object.cc (Sized_relobj::include_section_group): Report kept
7070 COMDAT groups for incremental links.
7071
1706a06f
ILT
70722011-05-24 David Meyer <pdox@google.com>
7073
7074 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7075 with name parameter. Add found_name parameter.
7076 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7077 * dirsearch.h (class Dirsearch): Update declaration.
7078
a10ae760
ILT
70792011-05-24 Ian Lance Taylor <iant@google.com>
7080
7081 * archive.cc (Library_base::should_include_member): Pull in object
7082 from archive if it defines the entry symbol.
7083 * parameters.cc (Parameters::entry): New function.
7084 * parameters.h (class Parameters): Declare entry.
7085 * output.h (class Output_file_header): Remove entry_ field.
7086 * output.cc (Output_file_header::Output_file_header): Remove entry
7087 parameter. Change all callers.
7088 (Output_file_header::entry): Use parameters->entry.
7089 * gold.cc (queue_middle_tasks): Likewise.
7090 * plugin.cc (Plugin_hook::run): Likewise.
7091
aa92d6ed
CC
70922011-05-24 Cary Coutant <ccoutant@google.com>
7093
7094 * gold.cc (queue_initial_tasks): Pass incremental base filename
7095 to Output_file::open_base_file; don't print error message.
7096 * incremental-dump.cc (main): Adjust call to
7097 Output_file::open_for_modification.
7098 * incremental-dump.cc (main): Likewise.
7099 * incremental.cc (Incremental_inputs::report_command_line):
7100 Ignore --incremental-base option when comparing command lines.
7101 Ignore parameter when given as separate argument.
7102 * options.h (class General_options): Add --incremental-base.
7103 * output.cc (Output_file::Output_file):
7104 (Output_file::open_base_file): Add base_name and writable parameters;
7105 read base file into new file; print error message here.
7106 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7107 callers.
7108 * output.h (Output_file::open_for_modification): Rename to...
7109 (Output_file::open_base_file): ...this; add base_name and
7110 writable parameters; adjust all callers.
7111 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7112 callers.
7113 * testsuite/Makefile.am (incremental_test_4): Test
7114 --incremental-base.
7115 * testsuite/Makefile.in: Regenerate.
7116
2eedd706
CC
71172011-05-24 Cary Coutant <ccoutant@google.com>
7118
7119 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7120 incremental_test_4.
7121 * testsuite/Makefile.in: Regenerate.
7122 * testsuite/two_file_test_1_v1.cc: New test source file.
7123 * testsuite/two_file_test_1b_v1.cc: New test source file.
7124 * testsuite/two_file_test_2_v1.cc: New test source file.
7125
0f1c85a6
CC
71262011-05-24 Cary Coutant <ccoutant@google.com>
7127
7128 * dynobj.h (Dynobj::do_dynobj): New function.
7129 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7130 flag and soname for shared objects.
7131 * incremental.cc (Incremental_inputs::report_object): Make
7132 either Incremental_object_entry or Incremental_dynobj_entry; add
7133 soname to string table.
7134 (Incremental_inputs::report_input_section): Add assertion.
7135 (Output_section_incremental_inputs::set_final_data_size): Adjust
7136 type of input file entry for shared libraries; adjust size of
7137 shared library info entry.
7138 (Output_section_incremental_inputs::write_input_files): Write
7139 as_needed flag for shared libraries.
7140 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7141 of input file entry for shared libraries; write soname.
7142 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7143 soname from incremental info.
7144 * incremental.h (enum Incremental_input_flags): Add
7145 INCREMENTAL_INPUT_AS_NEEDED.
7146 (Incremental_input_entry::Incremental_input_entry): Initialize new
7147 data member.
7148 (Incremental_input_entry::set_as_needed): New function.
7149 (Incremental_input_entry::as_needed): New function.
7150 (Incremental_input_entry::do_dynobj_entry): New function.
7151 (Incremental_input_entry::as_needed_): New data member.
7152 (Incremental_object_entry::Incremental_object_entry): Don't check
7153 for shared library.
7154 (Incremental_object_entry::do_type): Likewise.
7155 (class Incremental_dynobj_entry): New class.
7156 (Incremental_input_entry_reader::as_needed): New function.
7157 (Incremental_input_entry_reader::get_soname): New function.
7158 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7159 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7160 size of shared library info entry.
58797674 7161 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7162 incremental link when adding DT_NEEDED entries.
7163 * object.h (Object::Object): Initialize new data member.
7164 (Object::dynobj): New function.
7165 (Object::set_as_needed): New function.
7166 (Object::as_needed): New function.
7167 (Object::do_dynobj): New function.
7168 (Object::as_needed_): New data member.
7169
6fa2a40b
CC
71702011-05-24 Cary Coutant <ccoutant@google.com>
7171
7172 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7173 info; adjust display of GOT entries.
7174 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7175 vector of input objects; remove file_status_.
7176 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7177 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7178 got_plt reader; call target hooks to reserve GOT entries.
7179 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7180 of input file info header and GOT info entry.
7181 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7182 relocation info.
7183 (Got_plt_view_info::got_descriptor): Remove.
7184 (Got_plt_view_info::sym_index): New data member.
7185 (Got_plt_view_info::input_index): New data member.
7186 (Local_got_offset_visitor::visit): Write input file index.
7187 (Global_got_offset_visitor::visit): Write 0 for input file index.
7188 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7189 with sym_index and input_index.
7190 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7191 incremental info GOT entry; replace got_descriptor with input_index.
7192 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7193 map from input file index to object.
7194 (Sized_relobj_incr::do_layout): Replace direct data member reference
7195 with accessor function.
7196 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7197 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7198 Adjust size of input file info header.
7199 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7200 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7201 (Incremental_input_entry_reader::get_input_section): Adjust size of
7202 input file info header.
7203 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7204 of incremental info GOT entry.
7205 (Incremental_got_plt_reader::get_got_desc): Remove.
7206 (Incremental_got_plt_reader::get_got_symndx): New function.
7207 (Incremental_got_plt_reader::get_got_input_index): New function.
7208 (Sized_incremental_binary::Sized_incremental_binary): Remove
7209 file_status_; add input_objects_.
7210 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7211 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7212 (Sized_incremental_binary::file_is_unchanged): Remove.
7213 (Sized_incremental_binary::set_input_object): New function.
7214 (Sized_incremental_binary::input_object): New function.
7215 (Sized_incremental_binary::file_status_): Remove.
7216 (Sized_incremental_binary::input_objects_): New data member.
7217 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7218 references.
7219 (Sized_relobj_incr::invalid_address): Move to base class.
7220 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7221 class.
7222 (Sized_relobj_incr::do_output_section_offset): Likewise.
7223 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7224 (Sized_relobj_incr::section_offsets_): Likewise.
7225 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7226 function.
7227 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7228 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7229 with accessor function.
7230 (Sized_relobj_file::do_layout): Likewise.
7231 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7232 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7233 (Sized_relobj_file::compute_final_local_value): Replace refs to
7234 section_offsets_ with accessor function.
7235 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7236 * object.h (Relobj::Relobj): Initialize new data members.
7237 (Relobj::add_dyn_reloc): New function.
7238 (Relobj::first_dyn_reloc): New function.
7239 (Relobj::dyn_reloc_count): New function.
7240 (Relobj::first_dyn_reloc_): New data member.
7241 (Relobj::dyn_reloc_count_): New data member.
7242 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7243 references.
7244 (Sized_relobj::Address): New typedef.
7245 (Sized_relobj::invalid_address): Move here from child class.
7246 (Sized_relobj::Sized_relobj): Initialize new data members.
7247 (Sized_relobj::sized_relobj): New function.
7248 (Sized_relobj::is_output_section_offset_invalid): Move here from
7249 child class.
7250 (Sized_relobj::get_output_section_offset): Likewise.
7251 (Sized_relobj::local_has_got_offset): Likewise.
7252 (Sized_relobj::local_got_offset): Likewise.
7253 (Sized_relobj::set_local_got_offset): Likewise.
7254 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7255 (Sized_relobj::clear_got_offsets): New function.
7256 (Sized_relobj::section_offsets): Move here from child class.
7257 (Sized_relobj::do_output_section_offset): Likewise.
7258 (Sized_relobj::do_set_section_offset): Likewise.
7259 (Sized_relobj::Local_got_offsets): Likewise.
7260 (Sized_relobj::local_got_offsets_): Likewise.
7261 (Sized_relobj::section_offsets_): Likewise.
7262 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7263 references.
7264 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7265 class.
7266 (Sized_relobj_file::sized_relobj): New function
7267 (Sized_relobj_file::local_has_got_offset): Move to base class.
7268 (Sized_relobj_file::local_got_offset): Likewise.
7269 (Sized_relobj_file::set_local_got_offset): Likewise.
7270 (Sized_relobj_file::get_output_section_offset): Likewise.
7271 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7272 (Sized_relobj_file::do_output_section_offset): Likewise.
7273 (Sized_relobj_file::do_set_section_offset): Likewise.
7274 (Sized_relobj_file::Local_got_offsets): Likewise.
7275 (Sized_relobj_file::local_got_offsets_): Likewise.
7276 (Sized_relobj_file::section_offsets_): Likewise.
7277 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7278 (all constructors).
7279 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7280 (Output_reloc::get_symbol_index): Likewise.
7281 (Output_reloc::local_section_offset): Likewise.
7282 (Output_reloc::get_address): Likewise.
7283 (Output_reloc::symbol_value): Likewise.
7284 (Output_data_got::reserve_slot): Move to class definition.
7285 (Output_data_got::reserve_local): New function.
7286 (Output_data_got::reserve_slot_for_global): Remove.
7287 (Output_data_got::reserve_global): New function.
7288 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7289 (all constructors, two instantiations).
7290 (Output_reloc::get_relobj): New function (two instantiations).
7291 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7292 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7293 (Output_data_reloc::add_global): Adjust type of relobj.
7294 (Output_data_reloc::add_global_relative): Likewise.
7295 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7296 (Output_data_reloc::add_local): Likewise.
7297 (Output_data_reloc::add_local_relative): Likewise.
7298 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7299 (Output_data_reloc::add_local_section): Likewise.
7300 (Output_data_reloc::add_output_section): Likewise.
7301 (Output_data_reloc::add_absolute): Likewise.
7302 (Output_data_reloc::add_target_specific): Likewise.
7303 (Output_data_got::reserve_slot): Move definition here.
7304 (Output_data_got::reserve_local): New function.
7305 (Output_data_got::reserve_global): New function.
7306 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7307 section_offsets_ with accessor function.
7308 (Sized_relobj_file::write_sections): Likewise.
7309 (Sized_relobj_file::do_relocate_sections): Likewise.
7310 * target.h (Sized_target::reserve_local_got_entry): New function.
7311 (Sized_target::reserve_global_got_entry): New function.
7312 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7313 (Target_x86_64::reserve_global_got_entry): New function.
7314 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7315
4829d394
CC
73162011-05-23 Cary Coutant <ccoutant@google.com>
7317
7318 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7319 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7320 bit when checking got_type.
7321 * incremental.cc (Sized_incremental_binary::setup_readers):
7322 Store symbol table and string table locations; initialize bit vector
7323 of file status flags.
7324 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7325 unchanged files.
7326 (Sized_incremental_binary::do_process_got_plt): New function.
7327 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7328 (Output_section_incremental_inputs::set_final_data_size): Record
7329 file index for each input file.
7330 (Output_section_incremental_inputs::write_got_plt): Store file index
7331 instead of input entry offset for each GOT entry.
7332 * incremental.h
7333 (Incremental_input_entry::Incremental_input_entry): Initialize new
7334 data member.
7335 (Incremental_input_entry::set_offset): Store file index.
7336 (Incremental_input_entry::get_file_index): New function.
7337 (Incremental_input_entry::file_index_): New data member.
7338 (Incremental_binary::process_got_plt): New function.
7339 (Incremental_binary::do_process_got_plt): New function.
7340 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7341 data members.
7342 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7343 (Sized_incremental_binary::set_file_is_unchanged): New function.
7344 (Sized_incremental_binary::file_is_unchanged): New function.
7345 (Sized_incremental_binary::do_process_got_plt): New function.
7346 (Sized_incremental_binary::file_status_): New data member.
7347 (Sized_incremental_binary::main_symtab_loc_): New data member.
7348 (Sized_incremental_binary::main_strtab_loc_): New data member.
7349 * output.cc (Output_data_got::Got_entry::write): Add case
7350 RESERVED_CODE.
7351 (Output_data_got::add_global): Call add_got_entry.
7352 (Output_data_got::add_global_plt): Likewise.
7353 (Output_data_got::add_global_with_rel): Likewise.
7354 (Output_data_got::add_global_with_rela): Likewise.
7355 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7356 (Output_data_got::add_global_pair_with_rela): Likewise.
7357 (Output_data_got::add_local): Call add_got_entry.
7358 (Output_data_got::add_local_plt): Likewise.
7359 (Output_data_got::add_local_with_rel): Likewise.
7360 (Output_data_got::add_local_with_rela): Likewise.
7361 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7362 (Output_data_got::add_local_pair_with_rela): Likewise.
7363 (Output_data_got::reserve_slot): New function.
7364 (Output_data_got::reserve_slot_for_global): New function.
7365 (Output_data_got::add_got_entry): New function.
7366 (Output_data_got::add_got_entry_pair): New function.
7367 (Output_section::add_output_section_data): Edit FIXME.
7368 * output.h
7369 (Output_section_data_build::Output_section_data_build): New
7370 constructor with size parameter.
7371 (Output_data_space::Output_data_space): Likewise.
7372 (Output_data_got::Output_data_got): Initialize new data member; new
7373 constructor with size parameter.
7374 (Output_data_got::add_constant): Call add_got_entry.
7375 (Output_data_got::reserve_slot): New function.
7376 (Output_data_got::reserve_slot_for_global): New function.
7377 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7378 (Output_data_got::add_got_entry): New function.
7379 (Output_data_got::add_got_entry_pair): New function.
7380 (Output_data_got::free_list_): New data member.
7381 * target.h (Sized_target::init_got_plt_for_update): New function.
7382 (Sized_target::register_global_plt_entry): New function.
7383 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7384 Initialize new data member; call init; add constructor with PLT count.
7385 (Output_data_plt_x86_64::init): New function.
7386 (Output_data_plt_x86_64::add_relocation): New function.
7387 (Output_data_plt_x86_64::reserve_slot): New function.
7388 (Output_data_plt_x86_64::free_list_): New data member.
7389 (Target_x86_64::init_got_plt_for_update): New function.
7390 (Target_x86_64::register_global_plt_entry): New function.
7391 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7392 incremental updates.
7393 (Output_data_plt_x86_64::add_relocation): New function.
7394 * testsuite/object_unittest.cc (Object_test): Set default options.
7395
ec69d6da
ILT
73962011-05-16 Ian Lance Taylor <iant@google.com>
7397
7398 * options.h (class General_options): Make -i a synonym for -r.
7399
732e31de
ILT
74002011-05-16 Ian Lance Taylor <iant@google.com>
7401
7402 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7403
403676b5
CC
74042011-05-10 Cary Coutant <ccoutant@google.com>
7405
7406 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7407 strip_all (-s).
7408
5b7b7d6e
ILT
74092011-05-06 Ian Lance Taylor <iant@google.com>
7410
7411 * layout.cc (Layout::layout): If the output section flags change,
7412 update the ordering.
7413
f0f9babf
CC
74142011-04-25 Cary Coutant <ccoutant@google.com>
7415
7416 * incremental-dump.cc (dump_incremental_inputs): Print local
7417 symbol info for each input file.
7418 * incremental.cc
7419 (Output_section_incremental_inputs::set_final_data_size): Add local
7420 symbol info to input file entries in incremental info.
7421 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7422 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7423 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7424 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7425 implementation.
7426 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7427 (Sized_incr_relobj::do_relocate): Write the local symbols.
7428 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7429 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7430 Adjust size of input file header.
7431 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7432 (Incremental_inputs_reader::get_local_symbol_count): New function.
7433 (Incremental_inputs_reader::get_input_section): Adjust size of input
7434 file header.
7435 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7436 (Sized_incr_relobj::This): New typedef.
7437 (Sized_incr_relobj::sym_size): New const data member.
7438 (Sized_incr_relobj::Local_symbol): New struct.
7439 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7440 (Sized_incr_relobj::do_local_symbol_offset): New function.
7441 (Sized_incr_relobj::local_symbol_count_): New data member.
7442 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7443 (Sized_incr_relobj::local_symbol_index_): New data member.
7444 (Sized_incr_relobj::local_symbol_offset_): New data member.
7445 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7446 (Sized_incr_relobj::local_symbols_): New data member.
7447 * object.h (Relobj::output_local_symbol_count): New function.
7448 (Relobj::local_symbol_offset): New function.
7449 (Relobj::do_output_local_symbol_count): New function.
7450 (Relobj::do_local_symbol_offset): New function.
7451 (Sized_relobj::do_output_local_symbol_count): New function.
7452 (Sized_relobj::do_local_symbol_offset): New function.
7453
d0a9ace3
ILT
74542011-04-22 Vladimir Simonov <sv@sw.ru>
7455
7456 * descriptors.cc (set_close_on_exec): New function.
7457 (Descriptors::open): Use set_close_on_exec.
7458 * output.cc (S_ISLNK): Define if not defined.
7459
94a3fc8b
CC
74602011-04-22 Cary Coutant <ccoutant@google.com>
7461
7462 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7463 global symbol map.
7464 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7465 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7466 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7467 relocations.
7468 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7469 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7470 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7471 * incremental.h
7472 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7473 function.
7474 (Incremental_binary::apply_incremental_relocs): New function.
7475 (Incremental_binary::do_apply_incremental_relocs): New function.
7476 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7477 data member.
7478 (Sized_incremental_binary::add_global_symbol): New function.
7479 (Sized_incremental_binary::global_symbol): New function.
7480 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7481 (Sized_incremental_binary::symbol_map_): New data member.
7482 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7483 * target.h (Sized_target::apply_relocation): New function.
7484 * target-reloc.h (apply_relocation): New function.
7485 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7486
c87e4302
DK
74872011-04-22 Doug Kwan <dougkwan@google.com>
7488
7489 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7490 flag of a SHT_ARM_EXIDX section.
2e702c99 7491 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7492 * testsuite/Makefile.in: Regenerate.
7493 * testsuite/arm_exidx_test.s: New file.
7494 * testsuite/arm_exidx_test.sh: Same.
7495
e7782cf6
CC
74962011-04-20 Cary Coutant <ccoutant@google.com>
7497
7498 PR gold/12689
7499 * archive.h (Incremental_archive_entry::Archive_member):
7500 Initialize arg_serial_ (second constructor).
7501
308ecdc7
ILT
75022011-04-17 Ian Lance Taylor <iant@google.com>
7503
7504 * object.cc (Relocate_info::location): Simplify location string.
7505 * errors.cc (Errors::error_at_location): Don't print program
7506 name.
7507 (Errors::warning_at_location): Likewise.
7508 (Errors::undefined_symbol): Likewise.
7509 * testsuite/debug_msg.sh: Update accordingly.
7510
bec5b579
CC
75112011-04-14 Cary Coutant <ccoutant@google.com>
7512
7513 * gold/layout.cc (Layout::symtab_section_offset): New function.
7514 * gold/layout.h (Layout::symtab_section_offset): New function.
7515 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7516
88597d34
ILT
75172011-04-12 Ian Lance Taylor <iant@google.com>
7518
7519 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7520 with MREMAP_MAYMOVE.
7521 * output.h (class Output_file): Add map_is_allocated_ field.
7522 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7523 not available, provide stubs. If mremap is not available, #define
7524 it to gold_mremap.
7525 (MREMAP_MAYMOVE): Define if not defined.
7526 (Output_file::Output_file): Initialize map_is_allocated_.
7527 (Output_file::resize): Check map_is_allocated_.
7528 (Output_file::map_anonymous): If mmap fails, use malloc.
7529 (Output_file::unmap): Don't do anything for an anonymous map.
7530 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7531 is not available, provide stubs.
7532 (File_read::View::~View): Use free rather than delete[].
7533 (File_read::make_view): Use malloc rather than new[]. If mmap
7534 fails, use malloc.
7535 (File_read::find_or_make_view): Use malloc rather than new[].
7536 * gold.h: Remove HAVE_REMAP code.
7537 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7538 exists. Rename mremap to gold_mremap. If mmap is not available
7539 don't do anything.
7540 * configure, config.in: Rebuild.
7541
11e361bc
ILT
75422011-04-11 Ian Lance Taylor <iant@google.com>
7543
7544 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7545 initialize local variable v.
7546
cdc29364
CC
75472011-04-11 Cary Coutant <ccoutant@google.com>
7548
7549 * archive.cc (Archive::include_member): Adjust call to
7550 report_object.
7551 (Add_archive_symbols::run): Track argument serial numbers.
7552 (Lib_group::include_member): Likewise.
7553 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7554 * archive.h (Incremental_archive_entry::Archive_member):
7555 Initialize arg_serial_.
7556 (Archive_member::arg_serial_): New data member.
7557 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7558 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7559 incremental link.
7560 (Sized_dynobj::do_for_all_local_got_entries): New function.
7561 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7562 function.
7563 * fileread.cc (get_mtime): New function.
7564 * fileread.h (get_mtime): New function.
7565 * gold.cc (queue_initial_tasks): Check for incremental update.
7566 (process_incremental_input): New function.
7567 (queue_middle_tasks): Don't force valid target for incremental
7568 update.
7569 * incremental-dump.cc (find_input_containing_global): Adjust
7570 size of symbol info entry.
7571 (dump_incremental_inputs): Dump argument serial number and
7572 in_system_directory flag; bias shndx by 1; print symbol names
7573 when dumping per-file symbol lists; use new symbol info readers.
7574 * incremental.cc
7575 (Output_section_incremental_inputs:update_data_size): New function.
7576 (Sized_incremental_binary::setup_readers): Setup input readers
7577 for each input file; build maps for files added from libraries
7578 and scripts.
7579 (Sized_incremental_binary::check_input_args): New function.
7580 (Sized_incremental_binary::do_check_inputs): Build map of argument
7581 serial numbers to input arguments.
7582 (Sized_incremental_binary::do_file_has_changed): Rename
7583 do_file_is_unchanged to this; compare file modification times.
7584 (Sized_incremental_binary::do_init_layout): New function.
7585 (Sized_incremental_binary::do_reserve_layout): New function.
7586 (Sized_incremental_binary::do_get_input_reader): Remove.
7587 (Sized_incremental_binary::get_symtab_view): New function.
7588 (Incremental_checker::can_incrementally_link_output_file): Remove.
7589 (Incremental_inputs::report_command_line): Exclude --debug options.
7590 (Incremental_inputs::report_archive_begin): Add parameter; track
7591 argument serial numbers; don't put input file entry for archive
7592 before archive members.
7593 (Incremental_inputs::report_archive_end): Put input file entry
7594 for archive after archive members.
7595 (Incremental_inputs::report_object): Add parameter; track argument
7596 serial numbers and in_system_directory flag.
7597 (Incremental_inputs::report_script): Add parameter; track argument
7598 serial numbers.
7599 (Output_section_incremental_inputs::set_final_data_size): Adjust
7600 size of symbol info entry; check for forwarding symbols.
7601 (Output_section_incremental_inputs::write_input_files): Write
7602 in_system_directory flag and argument serial number.
7603 (Output_section_incremental_inputs::write_info_blocks): Map section
7604 indices between incremental info and original input file; store
7605 input section index for each symbol.
7606 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7607 change operator() to visit().
7608 (class Global_got_offset_visitor): Likewise.
7609 (class Global_symbol_visitor_got_plt):
7610 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7611 classes.
7612 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7613 (Sized_incr_relobj::do_read_symbols): New function.
7614 (Sized_incr_relobj::do_layout): New function.
7615 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7616 (Sized_incr_relobj::do_add_symbols): New function.
7617 (Sized_incr_relobj::do_should_include_member): New function.
7618 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7619 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7620 (Sized_incr_relobj::do_section_size): New function.
7621 (Sized_incr_relobj::do_section_name): New function.
7622 (Sized_incr_relobj::do_section_contents): New function.
7623 (Sized_incr_relobj::do_section_flags): New function.
7624 (Sized_incr_relobj::do_section_entsize): New function.
7625 (Sized_incr_relobj::do_section_address): New function.
7626 (Sized_incr_relobj::do_section_type): New function.
7627 (Sized_incr_relobj::do_section_link): New function.
7628 (Sized_incr_relobj::do_section_info): New function.
7629 (Sized_incr_relobj::do_section_addralign): New function.
7630 (Sized_incr_relobj::do_initialize_xindex): New function.
7631 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7632 (Sized_incr_relobj::do_read_relocs): New function.
7633 (Sized_incr_relobj::do_gc_process_relocs): New function.
7634 (Sized_incr_relobj::do_scan_relocs): New function.
7635 (Sized_incr_relobj::do_count_local_symbols): New function.
7636 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7637 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7638 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7639 (Sized_incr_relobj::do_relocate): New function.
7640 (Sized_incr_relobj::do_set_section_offset): New function.
7641 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7642 (Sized_incr_dynobj::do_read_symbols): New function.
7643 (Sized_incr_dynobj::do_layout): New function.
7644 (Sized_incr_dynobj::do_add_symbols): New function.
7645 (Sized_incr_dynobj::do_should_include_member): New function.
7646 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7647 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7648 (Sized_incr_dynobj::do_section_size): New function.
7649 (Sized_incr_dynobj::do_section_name): New function.
7650 (Sized_incr_dynobj::do_section_contents): New function.
7651 (Sized_incr_dynobj::do_section_flags): New function.
7652 (Sized_incr_dynobj::do_section_entsize): New function.
7653 (Sized_incr_dynobj::do_section_address): New function.
7654 (Sized_incr_dynobj::do_section_type): New function.
7655 (Sized_incr_dynobj::do_section_link): New function.
7656 (Sized_incr_dynobj::do_section_info): New function.
7657 (Sized_incr_dynobj::do_section_addralign): New function.
7658 (Sized_incr_dynobj::do_initialize_xindex): New function.
7659 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7660 (make_sized_incremental_object): New function.
7661 (Incremental_library::copy_unused_symbols): New function.
7662 (Incremental_library::do_for_all_unused_symbols): New function.
7663 * incremental.h (enum Incremental_input_flags): New type.
7664 (class Incremental_checker): Remove.
7665 (Incremental_input_entry::Incremental_input_entry): Add argument
7666 serial number.
7667 (Incremental_input_entry::arg_serial): New function.
7668 (Incremental_input_entry::set_is_in_system_directory): New function.
7669 (Incremental_input_entry::is_in_system_directory): New function.
7670 (Incremental_input_entry::arg_serial_): New data member.
7671 (Incremental_input_entry::is_in_system_directory_): New data member.
7672 (class Script_info): Move here from script.h.
7673 (Script_info::Script_info): Add filename parameter.
7674 (Script_info::filename): New function.
7675 (Script_info::filename_): New data member.
7676 (Incremental_script_entry::Incremental_script_entry): Add argument
7677 serial number.
7678 (Incremental_object_entry::Incremental_object_entry): Likewise.
7679 (Incremental_object_entry::add_input_section): Build list of input
7680 sections with map to original shndx.
7681 (Incremental_object_entry::get_input_section_index): New function.
7682 (Incremental_object_entry::shndx_): New data member.
7683 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7684 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7685 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7686 serial number.
7687 (Incremental_inputs::report_archive_begin): Likewise.
7688 (Incremental_inputs::report_object): Likewise.
7689 (Incremental_inputs::report_script): Likewise.
7690 (class Incremental_global_symbol_reader): New class.
7691 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7692 and store flags and input file type.
7693 (Incremental_input_entry_reader::arg_serial): New function.
7694 (Incremental_input_entry_reader::type): Extract type from flags.
7695 (Incremental_input_entry_reader::is_in_system_directory): New function.
7696 (Incremental_input_entry_reader::get_input_section_count): Call
7697 accessor function for type.
7698 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7699 function for type; adjust size of global symbol entry.
7700 (Incremental_input_entry_reader::get_global_symbol_count): Call
7701 accessor function for type.
7702 (Incremental_input_entry_reader::get_object_count): Likewise.
7703 (Incremental_input_entry_reader::get_object_offset): Likewise.
7704 (Incremental_input_entry_reader::get_member_count): Likewise.
7705 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7706 (Incremental_input_entry_reader::get_member_offset): Likewise.
7707 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7708 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7709 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7710 (Incremental_input_entry_reader::get_global_symbol_reader): New
7711 function.
7712 (Incremental_input_entry_reader::get_output_symbol_index): New
7713 function.
7714 (Incremental_input_entry_reader::type_): Remove.
7715 (Incremental_input_entry_reader::flags_): New data member.
7716 (Incremental_inputs_reader::input_file_offset): New function.
7717 (Incremental_inputs_reader::input_file_index): New function.
7718 (Incremental_inputs_reader::input_file): Call input_file_offset.
7719 (Incremental_inputs_reader::input_file_at_offset): New function.
7720 (Incremental_relocs_reader::get_r_type): Reformat.
7721 (Incremental_relocs_reader::get_r_shndx): Reformat.
7722 (Incremental_relocs_reader::get_r_offset): Reformat.
7723 (Incremental_relocs_reader::data): New function.
7724 (Incremental_binary::Incremental_binary): Initialize new data members.
7725 (Incremental_binary::check_inputs): Add cmdline parameter.
7726 (Incremental_binary::file_is_unchanged): Remove.
7727 (Input_reader::arg_serial): New function.
7728 (Input_reader::get_unused_symbol_count): New function.
7729 (Input_reader::get_unused_symbol): New function.
7730 (Input_reader::do_arg_serial): New function.
7731 (Input_reader::do_get_unused_symbol_count): New function.
7732 (Input_reader::do_get_unused_symbol): New function.
7733 (Incremental_binary::input_file_count): New function.
7734 (Incremental_binary::get_input_reader): Change signature to use
7735 index instead of filename.
7736 (Incremental_binary::file_has_changed): New function.
7737 (Incremental_binary::get_input_argument): New function.
7738 (Incremental_binary::get_library): New function.
7739 (Incremental_binary::get_script_info): New function.
7740 (Incremental_binary::init_layout): New function.
7741 (Incremental_binary::reserve_layout): New function.
7742 (Incremental_binary::output_file): New function.
7743 (Incremental_binary::do_check_inputs): New function.
7744 (Incremental_binary::do_file_is_unchanged): Remove.
7745 (Incremental_binary::do_file_has_changed): New function.
7746 (Incremental_binary::do_init_layout): New function.
7747 (Incremental_binary::do_reserve_layout): New function.
7748 (Incremental_binary::do_input_file_count): New function.
7749 (Incremental_binary::do_get_input_reader): Change signature.
7750 (Incremental_binary::input_args_map_): New data member.
7751 (Incremental_binary::library_map_): New data member.
7752 (Incremental_binary::script_map_): New data member.
7753 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7754 new data members.
7755 (Sized_incremental_binary::output_section): New function.
7756 (Sized_incremental_binary::inputs_reader): Add const.
7757 (Sized_incremental_binary::symtab_reader): Add const.
7758 (Sized_incremental_binary::relocs_reader): Add const.
7759 (Sized_incremental_binary::got_plt_reader): Add const.
7760 (Sized_incremental_binary::get_symtab_view): New function.
7761 (Sized_incremental_binary::Inputs_reader): New typedef.
7762 (Sized_incremental_binary::Input_entry_reader): New typedef.
7763 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7764 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7765 (Sized_incremental_binary::do_file_has_changed): New function.
7766 (Sized_incremental_binary::do_init_layout): New function.
7767 (Sized_incremental_binary::do_reserve_layout): New function.
7768 (Sized_input_reader::Inputs_reader): Remove.
7769 (Sized_input_reader::Input_entry_reader): Remove.
7770 (Sized_input_reader::do_arg_serial): New function.
7771 (Sized_input_reader::do_get_unused_symbol_count): New function.
7772 (Sized_input_reader::do_get_unused_symbol): New function.
7773 (Sized_incremental_binary::do_input_file_count): New function.
7774 (Sized_incremental_binary::do_get_input_reader): Change signature;
7775 use index instead of filename.
7776 (Sized_incremental_binary::section_map_): New data member.
7777 (Sized_incremental_binary::input_entry_readers_): New data member.
7778 (class Sized_incr_relobj): New class.
7779 (class Sized_incr_dynobj): New class.
7780 (make_sized_incremental_object): New function.
7781 (class Incremental_library): New class.
7782 * layout.cc (Free_list::num_lists): New static data member.
7783 (Free_list::num_nodes): New static data member.
7784 (Free_list::num_removes): New static data member.
7785 (Free_list::num_remove_visits): New static data member.
7786 (Free_list::num_allocates): New static data member.
7787 (Free_list::num_allocate_visits): New static data member.
7788 (Free_list::init): New function.
7789 (Free_list::remove): New function.
7790 (Free_list::allocate): New function.
7791 (Free_list::dump): New function.
7792 (Free_list::print_stats): New function.
7793 (Layout_task_runner::run): Resize output file for incremental updates.
7794 (Layout::Layout): Initialize new data members.
7795 (Layout::set_incremental_base): New function.
7796 (Layout::init_fixed_output_section): New function.
7797 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7798 incremental updates.
7799 (Layout::create_gold_note): Do not create gold note section for
7800 incremental updates.
7801 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7802 for incremental updates.
7803 (Layout::set_section_offsets): For incremental updates, allocate space
7804 from free list.
7805 (Layout::create_symtab_sections): Layout with offsets relative to
7806 start of section; for incremental updates, allocate space from free
7807 list.
7808 (Layout::create_shdrs): For incremental updates, allocate space from
7809 free list.
7810 (Layout::finish_dynamic_section): For incremental updates, do not
7811 check --as-needed (fixed in subsequent patch).
7812 * layout.h (class Free_list): New class.
7813 (Layout::set_incremental_base): New function.
7814 (Layout::incremental_base): New function.
7815 (Layout::init_fixed_output_section): New function.
7816 (Layout::allocate): New function.
7817 (Layout::incremental_base_): New data member.
7818 (Layout::free_list_): New data member.
7819 * main.cc (main): Print Free_list statistics.
7820 * object.cc (Relobj::finalize_incremental_relocs): Add
7821 clear_counts parameter; clear counts only when clear_counts is set.
7822 (Sized_relobj::Sized_relobj): Initialize new base class.
7823 (Sized_relobj::do_layout): Don't report special sections.
7824 (Sized_relobj::do_for_all_local_got_entries): New function.
7825 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7826 symtab_off to all symbol table offsets.
7827 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7828 * object.h (class Got_offset_list): Move to top of file.
7829 (Object::Object): Allow case where input_file == NULL.
7830 (Object::~Object): Likewise.
7831 (Object::input_file): Assert that input_file != NULL.
7832 (Object::lock): Allow case where input_file == NULL.
7833 (Object::unlock): Likewise.
7834 (Object::is_locked): Likewise.
7835 (Object::token): Likewise.
7836 (Object::release): Likewise.
7837 (Object::is_incremental): New function.
7838 (Object::get_mtime): New function.
7839 (Object::for_all_local_got_entries): New function.
7840 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7841 (Object::set_is_in_system_directory): New function.
7842 (Object::is_in_system_directory): New function.
7843 (Object::do_is_incremental): New function.
7844 (Object::do_get_mtime): New function.
7845 (Object::do_for_all_local_got_entries): New function.
7846 (Object::is_in_system_directory_): New data member.
7847 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7848 (class Sized_relobj_base): New class.
7849 (class Sized_relobj): Derive from Sized_relobj_base.
7850 (class Sized_relobj::Symbols): Redeclare from base class.
7851 (class Sized_relobj::local_got_offset_list): Remove.
7852 (class Sized_relobj::Output_sections): Redeclare from base class.
7853 (class Sized_relobj::do_for_all_local_got_entries): New function.
7854 (class Sized_relobj::write_local_symbols): Add offset parameter.
7855 (class Sized_relobj::local_symbol_offset_): Update comment.
7856 (class Sized_relobj::local_dynsym_offset_): Update comment.
7857 * options.cc (Input_arguments::add_file): Remove const.
7858 * options.h (Input_file_argument::Input_file_argument):
7859 Initialize arg_serial_ (all constructors).
7860 (Input_file_argument::set_arg_serial): New function.
7861 (Input_file_argument::arg_serial): New function.
7862 (Input_file_argument::arg_serial_): New data member.
7863 (Input_arguments::Input_arguments): Initialize file_count_.
7864 (Input_arguments::add_file): Remove const.
7865 (Input_arguments::number_of_input_files): New function.
7866 (Input_arguments::file_count_): New data member.
7867 (Command_line::number_of_input_files): Call
7868 Input_arguments::number_of_input_files.
7869 * output.cc (Output_segment_headers::Output_segment_headers):
7870 Set current size.
7871 (Output_section::Input_section::current_data_size): New function.
7872 (Output_section::Output_section): Initialize new data members.
7873 (Output_section::add_input_section): Don't do merge sections for
7874 an incremental link; allocate space from free list for an
7875 incremental update.
7876 (Output_section::add_output_section_data): Allocate space from
7877 free list for an incremental update.
7878 (Output_section::update_data_size): New function.
7879 (Output_section::set_fixed_layout): New function.
7880 (Output_section::reserve): New function.
7881 (Output_segment::set_section_addresses): Remove const.
7882 (Output_segment::set_section_list_addresses): Remove const; allocate
7883 space from free list for an incremental update.
7884 (Output_segment::set_offset): Adjust size of RELRO segment for an
7885 incremental update.
7886 * output.h (Output_data::current_data_size): Move here from
7887 child classes.
7888 (Output_data::pre_finalize_data_size): New function.
7889 (Output_data::update_data_size): New function.
7890 (Output_section_headers::update_data_size): new function.
7891 (Output_section_data_build::current_data_size): Move to Output_data.
7892 (Output_data_strtab::update_data_size): New function.
7893 (Output_section::current_data_size): Move to Output_data.
7894 (Output_section::set_fixed_layout): New function.
7895 (Output_section::has_fixed_layout): New function.
7896 (Output_section::reserve): New function.
7897 (Output_section::update_data_size): New function.
7898 (Output_section::has_fixed_layout_): New data member.
7899 (Output_section::free_list_): New data member.
7900 (Output_segment::set_section_addresses): Remove const.
7901 (Output_segment::set_section_list_addresses): Remove const.
7902 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7903 New function.
7904 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7905 New function.
7906 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7907 parameter when calling Add_symbols constructor; store argument
7908 serial number for members of a lib group.
7909 (Add_symbols::locks): Allow case where token == NULL.
7910 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7911 (Read_member::~Read_member): New function.
7912 (Read_member::is_runnable): New function.
7913 (Read_member::locks): New function.
7914 (Read_member::run): New function.
7915 (Check_script::~Check_script): New function.
7916 (Check_script::is_runnable): New function.
7917 (Check_script::locks): New function.
7918 (Check_script::run): New function.
7919 (Check_library::~Check_library): New function.
7920 (Check_library::is_runnable): New function.
7921 (Check_library::locks): New function.
7922 (Check_library::run): New function.
7923 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7924 (Add_symbols::library_): New data member.
7925 (class Read_member): New class.
7926 (class Check_script): New class.
7927 (class Check_library): New class.
7928 * reloc.cc (Read_relocs::is_runnable): Allow case where
7929 token == NULL.
7930 (Read_relocs::locks): Likewise.
7931 (Scan_relocs::locks): Likewise.
7932 (Relocate_task::locks): Likewise.
7933 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7934 to clear counters.
7935 (Sized_relobj::incremental_relocs_scan): Fix comment.
7936 (Sized_relobj::do_relocate): Pass output file offset to
7937 write_local_symbols.
7938 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7939 from class declaration.
7940 * script.cc (read_input_script): Allocate Script_info; pass
7941 argument serial number to report_script.
7942 * script.h (class Script_info): Move to incremental.h.
7943 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7944 * symtab.h (Symbol_table::add_from_incrobj): New function.
7945 (Symbol_table::set_file_offset): New function.
7946
b961d0d7
CC
79472011-04-05 Cary Coutant <ccoutant@google.com>
7948
7949 * incremental-dump.cc (dump_incremental_inputs): Change signature
7950 to take a Sized_incremental_binary; change caller. Use readers
7951 in Sized_incremental_binary.
7952 * incremental.cc
7953 (Sized_incremental_binary::find_incremental_inputs_sections):
7954 Rename do_find_incremental_inputs_sections to this.
7955 (Sized_incremental_binary::setup_readers): New function.
7956 (Sized_incremental_binary::do_check_inputs): Check
7957 has_incremental_info_ flag; move setup code to setup_readers;
7958 use input readers.
7959 (Sized_incremental_binary::do_file_is_unchanged): New function.
7960 (Sized_incremental_binary::do_get_input_reader): New function.
7961 * incremental.h (class Incremental_binary): Move to end of file.
7962 (Incremental_binary::file_is_unchanged): New function.
7963 (Incremental_binary::do_file_is_unchanged): New function.
7964 (Incremental_binary::Input_reader): New class.
7965 (Incremental_binary::get_input_reader): New function.
7966 (class Sized_incremental_binary): Move to end of file.
7967 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7968 input section reader classes.
7969 (Sized_incremental_binary::has_incremental_info): New function.
7970 (Sized_incremental_binary::inputs_reader): New function.
7971 (Sized_incremental_binary::symtab_reader): New function.
7972 (Sized_incremental_binary::relocs_reader): New function.
7973 (Sized_incremental_binary::got_plt_reader): New function.
7974 (Sized_incremental_binary::do_file_is_unchanged): New function.
7975 (Sized_incremental_binary::Sized_input_reader): New class.
7976 (Sized_incremental_binary::get_input_reader): New function.
7977 (Sized_incremental_binary::find_incremental_inputs_sections):
7978 Rename do_find_incremental_inputs_sections to this.
7979 (Sized_incremental_binary::setup_readers): New function.
7980 (Sized_incremental_binary::has_incremental_info_): New data member.
7981 (Sized_incremental_binary::inputs_reader_): New data member.
7982 (Sized_incremental_binary::symtab_reader_): New data member.
7983 (Sized_incremental_binary::relocs_reader_): New data member.
7984 (Sized_incremental_binary::got_plt_reader_): New data member.
7985 (Sized_incremental_binary::current_input_file_): New data member.
7986
a869183f
PP
79872011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7988
7989 PR gold/12640
7990 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7991 violation.
7992
79932011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7994
7995 * archive.cc (Archive::include_member): Adjust call to report_object.
7996 (Add_archive_symbols::run): Add script_info to call to
7997 report_archive_begin.
7998 (Lib_group::include_member): Adjust call to report_object.
7999 (Add_lib_group_symbols::run): Adjust call to report_object.
8000 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8001 blocks. Add object count for script input files.
8002 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8003 script_info parameter; change all callers.
8004 (Incremental_inputs::report_object): Add script_info parameter;
8005 change all callers.
8006 (Incremental_inputs::report_script): Store backpointer to
8007 incremental info entry.
8008 (Output_section_incremental_inputs::set_final_data_size): Record
8009 additional information for scripts.
8010 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8011 * incremental.h (Incremental_script_entry::add_object): New function.
8012 (Incremental_script_entry::get_object_count): New function.
8013 (Incremental_script_entry::get_object): New function.
8014 (Incremental_script_entry::objects_): New data member; adjust
8015 constructor.
8016 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8017 (Incremental_inputs::report_object): Add script_info parameter.
8018 (Incremental_inputs_reader::get_object_count): New function.
8019 (Incremental_inputs_reader::get_object_offset): New function.
8020 * options.cc (Input_arguments::add_file): Return reference to
8021 new input argument.
8022 * options.h (Input_argument::set_script_info): New function.
8023 (Input_argument::script_info): New function.
8024 (Input_argument::script_info_): New data member; adjust all
8025 constructors.
8026 (Input_file_group::add_file): Return reference to new input argument.
8027 (Input_file_lib::add_file): Likewise.
8028 (Input_arguments::add_file): Likewise.
8029 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8030 * script.cc (Parser_closure::Parser_closure): Add script_info
8031 parameter; adjust all callers.
8032 (Parser_closure::script_info): New function.
8033 (Parser_closure::script_info_): New data member.
8034 (read_input_script): Report scripts earlier to incremental info.
8035 (script_add_file): Set script_info in Input_argument.
8036 (script_add_library): Likewise.
8037 * script.h (Script_options::Script_info): Rewrite class.
8038
a869183f 80392011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8040
8041 * archive.cc (Library_base::should_include_member): Move
8042 method here from class Archive.
8043 (Archive::Archive): Initialize base class.
8044 (Archive::should_include_member): Move to base class.
8045 (Archive::do_for_all_unused_symbols): New function.
8046 (Add_archive_symbols::run): Remove redundant access to
8047 incremental_inputs.
8048 (Lib_group::Lib_group): Initialize base class.
8049 (Lib_group::do_filename): New function.
8050 (Lib_group::include_member): Pass pointer to Lib_group to
8051 report_object.
8052 (Lib_group::do_for_all_unused_symbols): New function.
8053 (Add_lib_group_symbols::run): Report archive information for
8054 incremental links.
8055 * archive.h (class Library_base): New base class.
8056 (class Archive): Derive from Library_base.
8057 (Archive::filename): Move to base class.
8058 (Archive::set_incremental_info): Likewise.
8059 (Archive::incremental_info): Likewise.
8060 (Archive::Should_include): Likewise.
8061 (Archive::should_include_member): Likewise.
8062 (Archive::Armap_entry): Remove.
8063 (Archive::Unused_symbol_iterator): Remove.
8064 (Archive::unused_symbols_begin): Remove.
8065 (Archive::unused_symbols_end): Remove.
8066 (Archive::do_filename): New function.
8067 (Archive::do_get_mtime): New function.
8068 (Archive::do_for_all_unused_symbols): New function.
8069 (Archive::task_): Move to base class.
8070 (Archive::incremental_info_): Likewise.
8071 (class Lib_group): Derive from Library_base.
8072 (Lib_group::do_filename): New function.
8073 (Lib_group::do_get_mtime): New function.
8074 (Lib_group::do_for_all_unused_symbols): New function.
8075 (Lib_group::task_): Move to base class.
8076 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8077 function.
8078 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8079 function.
8080 * incremental.cc (Incremental_inputs::report_archive_begin):
8081 Use Library_base; call library's get_mtime; add incremental inputs
8082 entry before members.
8083 (class Unused_symbol_visitor): New class.
8084 (Incremental_inputs::report_archive_end): Use Library_base; use
8085 visitor class to record unused symbols; don't add incremental inputs
8086 entry after members.
8087 (Incremental_inputs::report_object): Use Library_base.
8088 * incremental.h
8089 (Incremental_archive_entry::Incremental_archive_entry): Remove
8090 unused Archive parameter.
8091 (Incremental_inputs::report_archive_begin): Use Library_base.
8092 (Incremental_inputs::report_archive_end): Likewise.
8093 (Incremental_inputs::report_object): Likewise.
8094 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8095 function.
8096 * object.h (Object::for_all_global_symbols): New function.
8097 (Object::do_for_all_global_symbols): New function.
8098 (Sized_relobj::do_for_all_global_symbols): New function.
8099 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8100 function.
8101 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8102 function.
8103
61ab3e40
ILT
81042011-03-27 Ian Lance Taylor <iant@google.com>
8105
8106 * archive.cc (Archive::interpret_header): Return -1 if something
8107 goes wrong. Change callers accordingly.
8108
30e1f9e6
CC
81092011-03-25 Cary Coutant <ccoutant@google.com>
8110
8111 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8112 * testsuite/Makefile.in: Regenerate.
8113
9370ce59 81142011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8115
8116 * plugin.cc (get_view): New.
8117 (Plugin::load): Pass get_view to the plugin.
8118 (Plugin_manager::get_view): New.
8119
9312bb0a
ILT
81202011-03-21 Ian Lance Taylor <iant@google.com>
8121
8122 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8123 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8124
7e12ba9e
ST
81252011-03-21 Sriraman Tallam <tmsriram@google.com>
8126
8127 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8128 Change == to -eq.
8129 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8130 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8131 Change == to -eq.
8132 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8133 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8134
fd7a005d
ILT
81352011-03-14 Ian Lance Taylor <iant@google.com>
8136
8137 * script-sections.cc (Sort_output_sections::script_compare):
8138 Rename from is_before, change return type.
8139 (Sort_output_sections::operator()): Adjust accordingly.
8140
ed16fd1b
ILT
81412011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8142
8143 PR gold/12572
8144 * testsuite/odr_violation2.cc: Add comment to make all error line
8145 numbers double digits.
8146 * testsuite/debug_msg.sh: Adjust expected errors.
8147
71ff8986
ILT
81482011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8149
8150 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8151 but mark earlier ones as non-canonical
8152 (offset_to_iterator): Update search target and example
8153 (do_addr2line): Return extra lines in a vector*
8154 (format_file_lineno): Extract from do_addr2line
8155 (one_addr2line): Add vector* out-param
8156 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8157 when a lineno entry appeared last for its instruction
8158 (Dwarf_line_info): Add vector* out-param
8159 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8160 * symtab.cc (Odr_violation_compare): Include the lineno in the
8161 comparison again.
8162 (linenos_from_loc): New. Combine the canonical line for an
8163 address with its other lines.
8164 (True_if_intersect): New. Helper functor to make
8165 std::set_intersection a query.
8166 (detect_odr_violations): Compare sets of lines instead of just
8167 one line for each function. This became less deterministic, but
8168 has fewer false positives.
8169 * symtab.h: Declarations.
8170 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8171 mix an optimized and non-optimized object in the same binary
8172 (odr_violation2.so): Same.
8173 * testsuite/Makefile.in: Regenerate from Makefile.am.
8174 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8175 * testsuite/debug_msg.sh: Update line numbers and add
8176 assertions.
8177 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8178 non-optimized context.
8179 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8180 isn't inlined, and use OdrDerived in an optimized context.
8181 * testsuite/odr_header1.h: Defines OdrDerived, where
8182 optimization will change the
8183 first-instruction-in-the-destructor's file and line number.
8184 * testsuite/odr_header2.h: Defines OdrBase.
8185
a19fefdc
ILT
81862011-03-09 Ian Lance Taylor <iant@google.com>
8187
8188 * fileread.cc (File_read::clear_views): Don't delete the whole
8189 file view.
8190
ecb351e9
ILT
81912011-03-08 Ian Lance Taylor <iant@google.com>
8192
8193 PR gold/12525
8194 * fileread.cc: #include <climits>.
8195 (GOLD_IOV_MAX): Define.
8196 (File_read::read_multiple): Limit number of entries by iov_max.
8197 * fileread.h (class File_read): Always set max_readv_entries to
8198 128.
8199
b821d13c
ILT
82002011-03-07 Ian Lance Taylor <iant@google.com>
8201
8202 PR gold/12525
8203 * options.h (class General_options): Add -dy and -dn.
8204
89243142
CC
82052011-03-02 Cary Coutant <ccoutant@google.com>
8206
8207 * testsuite/script_test_9.t: Add TLS segment.
8208
d0773f31
ILT
82092011-03-02 Simon Baldwin <simonb@google.com>
8210
8211 * configure.ac: Add check for gnu_indirect_function support in
8212 the toolchain building binutils.
8213 * configure: Rebuild.
8214
9370ce59 82152011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8216
8217 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8218 plugin only symbols.
8219 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8220 in plugin files as not needed in the symbol table.
8221
4cf7a849
ST
82222011-02-11 Sriraman Tallam <tmsriram@google.com>
8223
8224 * output.cc (Output_section::add_input_section): Delay fill
8225 generation for section ordering.
8226
b578bd7d
ILT
82272011-02-09 Ian Lance Taylor <iant@google.com>
8228
8229 PR gold/12316
8230 * object.h (class Sized_relobj): Remove clear_local_symbols.
8231 * reloc.cc (Sized_relobj::do_relocate): Don't call
8232 clear_local_symbols.
8233
9370ce59 82342011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8235
8236 * plugin.cc (is_visible_from_outside): Return true for symbols
8237 in the -u option.
8238
55382fb7
ILT
82392011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8240
8241 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8242 filename.
8243
4e271fff
ST
82442011-02-02 Sriraman Tallam <tmsriram@google.com>
8245
8246 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8247 to std::string.
4e271fff 8248 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8249 section_name to be std::string.
4e271fff
ST
8250 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8251
d433c3ac
ILT
82522011-01-25 Ian Lance Taylor <iant@google.com>
8253
8254 * script.cc (script_add_extern): Rewrite to use
8255 add_symbol_reference.
8256
880473a6
DK
82572011-01-25 Doug Kwan <dougkwan@google.com>
8258
d433c3ac 8259 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8260
f30f86fa
ILT
82612011-01-24 Ian Lance Taylor <iant@google.com>
8262
8263 * options.h (class General_options): Accept
8264 --no-detect-odr-violations.
8265
8e51a0b9
ILT
82662011-01-24 Ian Lance Taylor <iant@google.com>
8267
8268 * version.cc (version_string): Bump to 1.11.
8269
0f3b89d8
ILT
82702011-01-24 Ian Lance Taylor <iant@google.com>
8271
8272 * plugin.cc (class Plugin_rescan): Define new class.
8273 (Plugin_manager::claim_file): Set any_claimed_.
8274 (Plugin_manager::save_archive): New function.
8275 (Plugin_manager::save_input_group): New function.
8276 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8277 necessary.
8278 (Plugin_manager::new_undefined_symbol): New function.
8279 (Plugin_manager::rescan): New function.
8280 (Plugin_manager::rescannable_defines): New function.
8281 (Plugin_manager::add_input_file): Set any_added_.
8282 * plugin.h (class Plugin_manager): define new fields rescannable_,
8283 undefined_symbols_, any_claimed_, and any_added_. Declare
8284 Plugin_rescan as friend. Declare new functions.
8285 (Plugin_manager::Rescannable): Define type.
8286 (Plugin_manager::Rescannable_list): Define type.
8287 (Plugin_manager::Undefined_symbol_list): Define type.
8288 (Plugin_manager::Plugin_manager): Initialize new fields.
8289 * archive.cc (Archive::defines_symbol): New function.
8290 (Add_archive_symbols::run): Pass archive to plugins if any.
8291 * archive.h (class Archive): Declare defines_symbol.
8292 * readsyms.cc (Input_group::~Input_group): New function.
8293 (Finish_group::run): Pass input_group to plugins if any.
8294 * readsyms.h (class Input_group): Declare destructor.
8295 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8296 any.
8297
3bb951e5
ILT
82982011-01-10 Ian Lance Taylor <iant@google.com>
8299
8300 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8301 section as relro.
8302 (Layout::set_segment_offsets): Reset increase_relro before calling
8303 set_section_addresses a second time.
8304
0aa45fac
CC
83052011-01-04 Cary Coutant <ccoutant@google.com>
8306
8307 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8308 sections before NOBITS sections.
8309
0db46eb4
L
83102011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8311
8312 * version.cc (print_version): Update copyright to 2011.
8313
829c9745
CC
83142010-12-23 Cary Coutant <ccoutant@google.com>
8315
8316 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8317 of OS to this->add. Add OD parameter to second form of the function.
8318
7500420b
ILT
83192010-12-20 Ian Lance Taylor <iant@google.com>
8320
8321 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8322 second of two consecutive entries with same offset.
8323
f8e9a930
RW
83242010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8325
8326 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8327 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8328 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8329 to avoid unneeded links against $(LDADD).
8330 * testsuite/Makefile.in: Regenerate.
8331
2fbb4320
ILT
83322010-12-15 Ian Lance Taylor <iant@google.com>
8333
8334 PR gold/12324
8335 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8336 for R_X86_64_32 and R_X86_64_PC32.
8337 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8338 ver_matching_def_pic.o.
8339 (ver_matching_def_pic.o): New target.
8340
fedb228d
RW
83412010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8342
8343 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8344 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8345 Move definition before File_read::View member definitions.
8346 (File_read::View::~View): Initialize and hold lock before
8347 updating current_mapped_bytes.
8348
9b547ce6
RW
83492010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8350
8351 * dwarf_reader.cc: Remove outdated comment.
8352 * gold-threads.cc: Fix typo in error message.
8353 * archive.cc: Fix typos in comments.
8354 * archive.h: Likewise.
8355 * arm-reloc-property.cc: Likewise.
8356 * arm-reloc-property.h: Likewise.
8357 * arm-reloc.def: Likewise.
8358 * arm.cc: Likewise.
8359 * attributes.h: Likewise.
8360 * cref.cc: Likewise.
8361 * ehframe.cc: Likewise.
8362 * fileread.h: Likewise.
8363 * gold.h: Likewise.
8364 * i386.cc: Likewise.
8365 * icf.cc: Likewise.
8366 * incremental.h: Likewise.
8367 * int_encoding.cc: Likewise.
8368 * layout.h: Likewise.
8369 * main.cc: Likewise.
8370 * merge.h: Likewise.
8371 * object.cc: Likewise.
8372 * object.h: Likewise.
8373 * options.cc: Likewise.
8374 * readsyms.cc: Likewise.
8375 * reduced_debug_output.cc: Likewise.
8376 * reloc.cc: Likewise.
8377 * script-sections.cc: Likewise.
8378 * sparc.cc: Likewise.
8379 * symtab.h: Likewise.
8380 * target-reloc.h: Likewise.
8381 * target.cc: Likewise.
8382 * target.h: Likewise.
8383 * timer.cc: Likewise.
8384 * timer.h: Likewise.
8385 * x86_64.cc: Likewise.
8386
83e17bd5
CC
83872010-12-09 Cary Coutant <ccoutant@google.com>
8388
8389 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8390 stack.
8391 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8392 parameter; change all callers.
8393 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8394 * options.h (warn_execstack): New option.
8395
017257f8
DK
83962010-12-07 Doug Kwan <dougkwan@google.com>
8397
8398 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8399 like function call relocations.
8400
c20cbc06
ILT
84012010-12-07 Ian Lance Taylor <iant@google.com>
8402
8403 * archive.cc (Archive::get_elf_object_for_member): Permit
8404 punconfigured to be NULL.
8405 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8406 (Archive::include_member): Pass NULL to get_elf_object_for_member
8407 if we searched for the archive and this is the first included
8408 object.
8409
4dbfafcc
ILT
84102010-12-01 Ian Lance Taylor <iant@google.com>
8411
8412 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8413 track_relocs_type_ field.
8414 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8415 Set track_relocs_type_.
8416 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8417 contents when using RELA relocs.
8418 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8419 reloc_map_.
8420 * reloc.cc (Track_relocs::next_addend): New function.
8421 * reloc.h (class Track_relocs): Declare next_addend.
8422
e5e19edd
ILT
84232010-12-01 Ian Lance Taylor <iant@google.com>
8424
8425 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8426 virtual destructor.
8427
9a5ce24c
ILT
84282010-12-01 Ian Lance Taylor <iant@google.com>
8429
8430 * README: Update compilers known to work and fail.
8431
c7791212
NC
84322010-11-23 Matthias Klose <doko@ubuntu.com>
8433
8434 * configure.in: For --enable-gold, handle value `default' instead of
8435 `both*'. Always install ld as ld.bfd, install as ld if gold is
8436 not the default.
8437 * configure: Regenerate.
8438
0ad220c9
DK
84392010-11-18 Doug Kwan <dougkwan@google.com>
8440
8441 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8442 and right_alignment to be zero. Store result alignment only if it is
8443 greater than existing alignment.
8444
ab8056e0
CC
84452010-11-16 Cary Coutant <ccoutant@google.com>
8446
8447 PR gold/12220
8448 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8449 Check for ".zdebug_line".
8450
fd064a5b
CC
84512010-11-16 Doug Kwan <dougkwan@google.com>
8452 Cary Coutant <ccoutant@google.com>
8453
8454 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8455 by reference; adjust all callers.
8456 * output.cc (Output_segment::set_section_addresses): Adjust references
8457 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8458 list is empty.
8459 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8460 end at page boundary.
8461
6fc6ea19
CC
84622010-11-16 Cary Coutant <ccoutant@google.com>
8463
8464 PR gold/12220
8465 * layout.cc (Layout::choose_output_section): Transform names of
8466 compressed sections even when using a script with a SECTIONS clause.
8467 (Layout::output_section_name): Remove code to transform
8468 compressed debug section names.
8469 * output.cc (Output_section::add_input_section): Use uncompressed
8470 section size when tracking input sections.
8471
95a2c8d6
RS
84722010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8473
8474 * symtab.h (Symbol::NON_PIC_REF): Remove.
8475 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8476 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8477 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8478 (Symbol::use_plt_offset): Take a flags argument and pass it
8479 directly to needs_dynamic_reloc. Restrict check for undefined
8480 weak symbols to function calls.
8481 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8482 (Target_arm::Scan::global): Use it.
8483 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8484 (Target_arm::Relocate::relocate): Likewise.
8485 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8486 parameter with an r_type parameter. Use get_reference_flags
8487 to get the flags.
8488 (Target_arm::Relocate::relocate): Update accordingly.
8489 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8490 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8491 (Target_i386::Scan::global): Likewise.
8492 (Target_i386::Relocate::relocate): Likewise.
8493 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8494 parameter with an r_type parameter. Use get_reference_flags
8495 to get the flags.
8496 (Target_i386::Relocate::relocate): Update accordingly.
8497 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8498 (Target_powerpc::Scan::global): Use it.
8499 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8500 (Target_powerpc::Relocate::relocate): Likewise.
8501 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8502 (Target_sparc::Scan::global): Use it.
8503 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8504 (Target_sparc::Relocate::relocate): Likewise.
8505 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8506 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8507 (Target_x86_64::Scan::global): Likewise.
8508 (Target_x86_64::Relocate::relocate): Likewise.
8509
f625ae50
DK
85102010-11-08 Doug Kwan <dougkwan@google.com>
8511 Cary Coutant <ccoutant@google.com>
8512
8513 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8514 (Arm_exidx_merge_section::section_contents_): New data member.
8515 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8516 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8517 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8518 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8519 in parameters instead of calling Object::section_contents without
8520 locking.
8521 (Arm_output_section::group_section): New parameter TASK. Pass it
8522 to callees that need locking objects.
8523 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8524 to lock EXIDX input sections. Fix a formatting issue. Call
8525 Arm_exidx_merged_section::build_contents to create merged section
8526 contents.
8527 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8528 to lock object of stub table owner.
8529 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8530 TEXT_SIZE to initialize data member TEXT_SIZE_.
8531 (Arm_exidx_input_section::addralign): Fix typo in comment.
8532 (Arm_exidx_input_section::text_size): New method.
8533 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8534 that require locking objects. Lock objects before scanning for stubs
8535 and updating local symbols.
8536 (Arm_input_section<big_endian>::init): Copy contents of original
8537 input section.
2e702c99 8538 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8539 original input section instead of calling Object::section_contents
8540 without locking.
8541 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8542 size without calling Object::section_size().
8543 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8544 for size. Allocate a buffer for merged EXIDX entries.
8545 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8546 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8547 building code to Arm_exidx_merged_section::build_contetns. Write
8548 out contetns in buffer instead of building it on the fly.
8549 (Arm_relobj::make_exidx_input_section): Also pass text section size
8550 to Arm_exidx_input_section constructor.
8551 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8552 (Arm_dynobj::do_read_symbols): Fix memory leak.
8553 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8554 * target.h: (class Task): Add forward declaration.
8555 (Target::relax): Add new parameter TASK and pass it to
8556 Target::do_relax().
8557 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8558
5f9bcf58
CC
85592010-11-05 Cary Coutant <ccoutant@google.com>
8560
8561 PR gold/10708
8562 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8563 object when reading from the file.
8564 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8565 second layout pass.
8566 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8567 when reading section contents.
8568 (get_section_contents): Likewise.
8569 (icf::find_identical_sections): Likewise.
8570 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8571 object when reading from the file.
8572 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8573 the object when doing deferred section layout.
8574
e597fa08
NC
85752010-11-03 Nick Clifton <nickc@redhat.com>
8576
8577 PR gold/12001
8578 * script.h (class Symbol_assignment: name): New member. Returns
8579 the name of the symbol.
8580 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8581 Returns true if the given symbol name is on the list of
8582 assignments wating to be processed.
8583 * archive.cc (should_incldue_member): If the symbol is undefined,
8584 check to see if it is on the list of symbols pending assignment.
8585
3f9a3278
ILT
85862010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8587
8588 * script-sections.cc (Script_sections::find_memory_region): Check
8589 for a NULL output section pointer.
8590
d06fb4d1
DK
85912010-10-29 Doug Kwan <dougkwan@google.com>
8592
8593 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8594 Output_section::add_relaxed_input_section.
8595 * output.cc (Output_section::add_relaxed_input_section): Add new
8596 arguments LAYOUT and NAME. Set section order index.
8597 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8598 Copy section order index.
8599 * output.h (Output_section::add_relaxed_input_section): Add new
8600 arguments LAYOUT and NAME.
8601
90e24de5
ILT
86022010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8603
8604 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8605 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8606 * testsuite/Makefile.in: Regenerate.
8607
c9484ea5
DK
86082010-10-20 Doug Kwan <dougkwan@google.com>
8609
8610 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8611 without SHF_LINK_ORDER flags.
8612 * layout.cc (Layout::choose_output_section): Do not filter
8613 SHF_LINK_ORDER flag in a relocatable link.
8614
5bc2f5be
CC
86152010-10-17 Cary Coutant <ccoutant@google.com>
8616
8617 * output.h (Output_segment::set_section_addresses): Change function
8618 signature. Update all callers.
8619 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8620 sections.
8621 (Output_segment::set_section_addresses): Align after last TLS
8622 section. Add padding before last relro section instead of after.
8623
0c91cf04
DK
86242010-10-17 Doug Kwan <dougkwan@google.com>
8625
8626 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8627 GOT output section to be writable.
8628
8c21d9d3
CC
86292010-10-14 Cary Coutant <ccoutant@google.com>
8630
8631 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8632 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8633 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8634 mode.
8635 * incremental.cc (report_command_line): Ignore all forms of
8636 --incremental.
8637 * layout.cc (Layout::Layout): Check parameters for incremental link
8638 mode.
8639 * options.cc (General_options::parse_incremental): New function.
8640 (General_options::parse_no_incremental): New function.
8641 (General_options::parse_incremental_full): New function.
8642 (General_options::parse_incremental_update): New function.
8643 (General_options::incremental_mode_): New data member.
8644 (General_options::finalize): Check incremental_mode_.
8645 * options.h (General_options): Update help text for --incremental.
8646 Add --no-incremental, --incremental-full, --incremental-update.
8647 (General_options::Incremental_mode): New enum type.
8648 (General_options::incremental_mode): New function.
8649 (General_options::incremental_mode_): New data member.
8650 * parameters.cc (Parameters::incremental_mode_): New data member.
8651 (Parameters::set_options): Set incremental_mode_.
8652 (Parameters::set_incremental_full): New function.
8653 (Parameters::incremental): New function.
8654 (Parameters::incremental_update): New function.
8655 (set_parameters_incremental_full): New function.
8656 * parameters.h (Parameters::set_incremental_full): New function.
8657 (Parameters::incremental): New function.
8658 (Parameters::incremental_update): New function.
8659 (Parameters::incremental_mode_): New data member.
8660 (set_parameters_incremental_full): New function.
8661 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8662 incremental link mode.
8663 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8664 (Sized_relobj::do_relocate_sections): Likewise.
8665 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8666 option.
8667 * testsuite/Makefile.in: Regenerate.
8668 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8669
bb32aa18 86702010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8671
8672 * script-sections.h (class Script_sections): Make
8673 Sections_elements typedef public.
8674 * script-sections.cc (class Sort_output_sections): Add elements_
8675 field. Add constructor which sets it; change all callers.
8676 (Sort_output_sections::is_before): New function.
8677 (Sort_output_sections::operator()): Call is_before.
8678 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8679 conditional.
8680 * testsuite/script_test_10.sh: New test. Test script section
8681 order.
8682 * testsuite/script_test_10.t: Likewise.
8683 * testsuite/script_test_10.s: Likewise.
8684 * testsuite/Makefile.am: Wrap the cross linker tests and the
8685 common tests into NATIVE_OR_CROSS_LINKER.
8686 (check_SCRIPTS): Add script_test_10.sh.
8687 (check_DATA): Add script_test_10.stdout.
8688 (script_test_10.o, script_test_10): New targets.
8689 (script_test_10.stdout): New target.
8690 * configure, testsuite/Makefile.in: Regenerate.
8691
3cef7179
ILT
86922010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8693
8694 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8695 error for the deprecated relocations.
8696 (Target_arm::Scan::global): Likewise.
8697 (Target_arm::Relocate::relocate): Likewise.
8698
7411e9a8
RS
86992010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8700
8701 * fileread.cc (Input_file::find_file): Initialize *found_name
8702 and *namep when using the fallback search for case 4.
8703
6a9da32a
CC
87042010-10-11 Cary Coutant <ccoutant@google.com>
8705
8706 * options.h (class General_options): Redefine -z lazy as an alias for
8707 the negation of -z now.
8708
ac897c20
ILT
87092010-10-11 Ian Lance Taylor <iant@google.com>
8710
8711 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8712 binding.
8713
ea5cae92
NC
87142010-10-06 Nick Clifton <nickc@redhat.com>
8715
8716 * script-sections.cc(class Memory_region): Remove
8717 current_lma_offset_ field. Rename current_vma_offset_ to
8718 current_offset_. Add last_section_ field.
8719 (Memory_region::get_current_vma_address): Rename to
8720 get_current_address.
8721 (Memory_region::get_current_lma_address): Delete.
8722 (Memory_region::increment_vma_offset): Rename to
8723 increment_offset.
8724 (Memory_region::increment_lma_offset): Delete.
8725 (Memory_region::attributes_compatible): New method. Returns
8726 true if the provided section is compatible with the region.
8727 (Memory_region::get_last_section): New method. Returns the last
8728 section to use the region.
8729 (Memory_region::set_last_section): New method. Stores the last
8730 section to use the region.
8731 (Script_sections::block_in_region): New method. Returns true if
8732 a block of memory is contained within a region.
8733 (Script_sections::find_memory_region): New method. Locates a
8734 memory region to be used to set a VMA or LMA address.
8735 (Output_section_definition::set_section_addresses): Add code to
8736 check for addresses set by memory regions.
8737 (Output_segment::set_section_addresses): Remove memory region
8738 walking code.
8739 (Script_sections::create_segment): Add a warning if a header
8740 segment is created outside of any region.
8741 * script-sections.h (class Script_sections): Add prototypes for
8742 find_memory_region and block_in_region methods.
8743 * testsuite/memory_test.s: Use .long instead of .word.
8744 * testsuite/memory_test.t: Add some more output sections.
8745 * testsuite/memory_test.sh: Update expected output.
8746
a9bfd952
DK
87472010-10-02 Doug Kwan <dougkwan@google.com>
8748
8749 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8750 defintion to symtab.h
8751 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8752 declaration to defintion.
8753
bacff3ab
NC
87542010-10-01 Nick Clifton <nickc@redhat.com>
8755
8756 * expression.cc (eval): Replace dummy argument with NULL.
8757 (eval_maybe_dot): Check for a NULL result section pointer.
8758 (Symbol_expression::value): Likewise.
8759 (Dot_expression::value): Likewise.
8760 (BINARY_EXPRESSION): Likewise.
8761 (Max_expression::value): Likewise.
8762 (Min_expression::value): Likewise.
8763 (Absolute_expression::value): Likewise.
8764 (Addr_expression::value_from_output_section): Likewise.
8765 (Loaddddr_expression::value_from_output_section): Likewise.
8766 (Segment_start_expression::value): Likewise.
8767 * script-sections.cc
8768 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8769 argument with NULL.
8770 (Sections_elememt_dot_assignment::set_section_addresses):
8771 Likewise.
8772 (Output_data_expression::do_write_to_buffer): Likewise.
8773 (Output_section_definition::finalize_symbols): Likewise.
8774 (Output_section_definition::set_section_addresses): Likewise.
8775
f81bc8b5
DK
87762010-09-30 Doug Kwan <dougkwan@google.com>
8777
8778 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8779
c95e9f27
ST
87802010-09-28 Sriraman Tallam <tmsriram@google.com>
8781
8782 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8783 function.
c95e9f27
ST
8784 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8785 virtual function.
8786 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8787 virtual function.
8788 * icf.cc (get_section_contents): Inline merge sections only when
8789 target allows it.
8790
3cac54d2
RW
87912010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8792
8793 * configure: Regenerate.
8794
2904037a
ILT
87952010-09-17 Ian Lance Taylor <iant@google.com>
8796
8797 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8798 * testsuite/Makefile.am (memory_test.o): New target.
8799 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8800 memory_test.t.
8801 * testsuite/Makefile.in: Rebuild.
2904037a 8802
bca7fb63
DK
88032010-09-17 Doug Kwan <dougkwan@google.com>
8804
8805 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8806 defintion if relocation uses GOT entries of the symbol.
8807 * testsuite/icf_safe_test.sh: Fix test.
8808 * testsuite/icf_safe_so_test.sh: Fix test.
8809
4ef28648
CC
88102010-09-16 Cary Coutant <ccoutant@google.com>
8811
8812 * script_sections.cc (class Memory_region): Remove "NULL" from
8813 vector initializations.
8814
793990de
CC
88152010-09-15 Cary Coutant <ccoutant@google.com>
8816
8817 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8818 Resolve forwarding symbols.
8819
81e015e2
DK
88202010-09-15 Doug Kwan <dougkwan@google.com>
8821
8822 * gold/testsuite/script_test_3.t: Add ARM special sections.
8823 * gold/testsuite/script_test_4.t: Same.
8824 * gold/testsuite/script_test_5.t: Same.
8825 * gold/testsuite/script_test_6.t: Same.
8826 * gold/testsuite/script_test_7.t: Same.
8827 * gold/testsuite/script_test_7.t: Same.
8828 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8829
36171d64
CC
88302010-09-14 Cary Coutant <ccoutant@google.com>
8831
8832 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8833 (Target_x86_64::Relocate::relocate_tls): Replace check for
8834 saw_tls_block_reloc_ with test for executable section.
8835
d89051bd
CC
88362010-09-12 Cary Coutant <ccoutant@google.com>
8837
8838 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8839 position-independent executables to shared libraries need dynamic
8840 relocations.
8841 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8842 position-independent executables.
8843 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8844 * testsuite/Makefile.in: Regenerate.
8845
fca41f0f
NC
88462010-09-10 Nick Clifton <nickc@redhat.com>
8847
8848 PR gold/11997
8849 * testsuite/memory_test.t: Discard any sections that are not
8850 needed.
8851
6695e4b3
L
88522010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8853
8854 PR gold/11996
8855 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8856 "This::" to work around a bug in gcc 4.2.
8857
8858 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8859
0f72bf6f
RÁE
88602010-09-09 Rafael Espindola <espindola@google.com>
8861
8862 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8863 sections with different PF_X flags in the same segment.
8864 (Layout::find_first_load_seg): Search all segments to find the first
8865 one.
8866 * options.h (rosegment): New.
8867
88682010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8869
05a79166 8870 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8871
aa98ff75
DK
88722010-09-08 Doug Kwan <dougkwan@google.com>
8873
8874 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8875 (Arm_relobj::do_relocate_sections): Add new parameter for output
8876 file to match the parent.
8877 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8878 of local symbols instead of input values. Update code to track
8879 changes in gold::relocate_section.
8880 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8881 (Sized_relobj::compute_final_local_value_internal): New methods.
8882 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8883 body into private version of Sized_relobj::compute_final_local_value.
8884 Call the inline method.
8885 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8886 merged symbol value if there is one.
8887 (Symbol_value::has_output_value): New method defintiion.
8888 (Sized_relobj::Compute_final_local_value_status): New enum type.
8889 (Sized_relobj::compute_final_local_value): New methods.
8890 (Sized_relobj::compute_final_local_value_internal): New methods.
8891 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8892 and arm_cortex_a8.sh.
8893 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8894 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8895 New tests.
8896 * Makefile.in: Regenerate.
8897 * testsuite/arm_bl_out_of_range.s: Update test.
8898 * testsuite/thumb_bl_out_of_range.s: Ditto.
8899 * testsuite/thumb_blx_out_of_range.s: Ditto.
8900 * testsuite/arm_branch_out_of_range.sh: New file.
8901 * testsuite/arm_cortex_a8.sh: Ditto.
8902 * testsuite/arm_cortex_a8_b.s: Ditto.
8903 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8904 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8905 * testsuite/arm_cortex_a8_bl.s: Ditto.
8906 * testsuite/arm_cortex_a8_blx.s: Ditto.
8907 * testsuite/arm_cortex_a8_local.s: Ditto.
8908 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8909 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8910
05a79166
L
89112010-09-08 Rafael Espindola <espindola@google.com>
8912
8913 * Makefile.am (memory_test.stdout): Run readelf with -W.
8914 * Makefile.in: Regenerate.
8915 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8916 64 bit output.
8917
33dbc701
RÁE
89182010-09-08 Rafael Espindola <espindola@google.com>
8919
8920 * script-sections.cc (Script_sections::add_memory_region): Convert
8921 field precision to int.
8922 * script.cc (script_set_section_region, script_set_section_region):
8923 Convert field precision to int.
8924
731ca54a
RÁE
89252010-09-08 Rafael Espindola <espindola@google.com>
8926
8927 * arm.cc (do_finalize_sections): Create the __exidx_start and
8928 __exdix_end symbols even when the section is missing.
8929
7f8cd844
NC
89302010-09-08 Nick Clifton <nickc@redhat.com>
8931
8932 * README: Remove claim that MEMORY is not supported.
8933 * expression.cc (script_exp_function_origin)
8934 (script_exp_function_length): Move from here to ...
8935 * script.cc: ... here.
8936 (script_set_section_region, script_add_memory)
8937 (script_parse_memory_attr, script_include_directive): New
8938 functions.
8939 * script-sections.cc
8940 (class Memory_region): New class.
8941 (class Output_section_definition): Add set_memory_region,
8942 set_section_vma, set_section_lma and get_section_name methods.
8943 (class Script_Sections): Add add_memory_region,
8944 find_memory_region, find_memory_region_origin,
8945 find_memory_region_length and set_memory_region methods.
8946 Have set_section_addresses method walk the list of set memory
8947 regions.
8948 Extend the print methos to display memory regions.
8949 * script-sections.h: Add prototypes for new methods.
8950 Add enum for MEMORY region attributes.
8951 * yyscript.y: Add support for parsing MEMORY regions.
8952 * script-c.h: Add prototypes for new functions.
8953 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8954 * testsuite/Makefile.in: Regenerate.
8955 * testsuite/memory_test.sh: New script.
8956 * testsuite/memory_test.s: New assembler source file.
8957 * testsuite/memory_test.t: New linker script.
8958
a4649286
DK
89592010-08-27 Doug Kwan <dougkwan@google.com>
8960
8961 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8962 reference override an existing dynamic weak reference.
8963 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8964 * testsuite/Makefile.in: Regenerate.
8965 * testsuite/dyn_weak_ref.sh: New file.
8966 * testsuite/dyn_weak_ref_1.c: Ditto.
8967 * testsuite/dyn_weak_ref_2.c: Ditto.
8968
b56648ad
ILT
89692010-08-27 Ian Lance Taylor <iant@google.com>
8970
8971 * incremental.h (class Incremental_input_entry): Add virtual
8972 destructor.
8973
809313cb
ILT
89742010-08-27 Ian Lance Taylor <iant@google.com>
8975
8976 * testsuite/start_lib_test_3.c: Mark t3 as used.
8977
11e32464
NC
89782010-08-27 Nick Clifton <nickc@redhat.com>
8979
8980 * options.cc (version_script): Fix small typo in previous
8981 whitespace tidyup.
8982
ca09d69a
NC
89832010-08-25 Nick Clifton <nickc@redhat.com>
8984
8985 * archive.cc: Formatting fixes: Remove whitespace between
8986 typename and following asterisk. Remove whitespace between
8987 function name and opening parenthesis.
8988 * archive.h: Likewise.
8989 * arm.cc: Likewise.
8990 * attributes.cc: Likewise.
8991 * attributes.h: Likewise.
8992 * common.cc: Likewise.
8993 * copy-relocs.cc: Likewise.
8994 * dirsearch.h: Likewise.
8995 * dynobj.cc: Likewise.
8996 * ehframe.cc: Likewise.
8997 * ehframe.h: Likewise.
8998 * expression.cc: Likewise.
8999 * fileread.cc: Likewise.
9000 * fileread.h: Likewise.
9001 * gc.h: Likewise.
9002 * gold-threads.cc: Likewise.
9003 * gold.cc: Likewise.
9004 * i386.cc: Likewise.
9005 * icf.h: Likewise.
9006 * incremental-dump.cc: Likewise.
9007 * incremental.cc: Likewise.
9008 * layout.cc: Likewise.
9009 * layout.h: Likewise.
9010 * main.cc: Likewise.
9011 * merge.cc: Likewise.
9012 * merge.h: Likewise.
9013 * object.cc: Likewise.
9014 * object.h: Likewise.
9015 * options.cc: Likewise.
9016 * options.h: Likewise.
9017 * output.cc: Likewise.
9018 * output.h: Likewise.
9019 * plugin.cc: Likewise.
9020 * plugin.h: Likewise.
9021 * powerpc.cc: Likewise.
9022 * reloc.cc: Likewise.
9023 * script-c.h: Likewise.
9024 * script-sections.cc: Likewise.
9025 * script.cc: Likewise.
9026 * stringpool.cc: Likewise.
9027 * symtab.cc: Likewise.
9028 * symtab.h: Likewise.
9029 * target.cc: Likewise.
9030 * timer.cc: Likewise.
9031 * timer.h: Likewise.
9032 * version.cc: Likewise.
9033 * x86_64.cc: Likewise.
9034
b8fa8750
NC
90352010-08-24 Nick Clifton <nickc@redhat.com>
9036
9037 PR 11899
9038 * layout.cc (segment_precedes): Sort segments by their physical
9039 addresses, if they have been set.
9040
9919d93b
CC
90412010-08-23 Cary Coutant <ccoutant@google.com>
9042
9043 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9044 symbols data.
9045 (Lib_group::include_member): Unlock object after deleting its
9046 symbols data.
9047 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9048 the bug fixed here.
9049
97b4be1c
CC
90502010-08-19 Neil Vachharajani <nvachhar@google.com>
9051 Cary Coutant <ccoutant@google.com>
9052
9053 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9054 constructor, and set_blocker.
9055 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9056 readsyms_blocker_.
9057 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9058 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9059 * testsuite/Makefile.am (start_lib_test): New test case.
9060 * testsuite/Makefile.in: Regenerate.
9061 * testsuite/start_lib_test_main.c: New file.
9062 * testsuite/start_lib_test_1.c: New file.
9063 * testsuite/start_lib_test_2.c: New file.
9064 * testsuite/start_lib_test_3.c: New file.
9065
dd0b1884
ILT
90662010-08-19 Ian Lance Taylor <iant@google.com>
9067
9068 * Makefile.in: Rebuild with automake 1.11.1.
9069 * aclocal.m4: Likewise.
9070 * testsuite/Makefile.in: Likewise.
9071
7223e9ca
ILT
90722010-08-19 Ian Lance Taylor <iant@google.com>
9073
9074 PR 10893
9075 * i386.cc (class Output_data_plt_i386): Update declarations.
9076 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9077 local_ifuncs_ fields.
9078 (Target_i386::do_plt_section_for_global): New function.
9079 (Target_i386::do_plt_section_for_local): New function.
9080 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9081 parameter; change all callers. Initialize global_ifuncs_ and
9082 local_ifuncs_. If doing a static link define __rel_iplt_start and
9083 __rel_iplt_end.
9084 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9085 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9086 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9087 symbols.
9088 (Target_i386::make_plt_section): New function, broken out of
9089 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9090 (Target_i386::make_plt_entry): Call make_plt_section.
9091 (Target_i386::make_local_ifunc_plt_entry): New function.
9092 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9093 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9094 R_386_IRELATIVE to switch.
9095 (Target_i386::Scan::global): Likewise.
9096 (Target_i386::Relocate::relocate): Likewise.
9097 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9098 switch.
9099 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9100 (Target_x86_64::do_plt_section_for_global): New function.
9101 (Target_x86_64::do_plt_section_for_local): New function.
9102 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9103 parameter; change all callers. If doing a static link define
9104 __rela_iplt_start and __rela_iplt_end.
9105 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9106 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9107 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9108 to point to .plt.
9109 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9110 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9111 switch.
9112 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9113 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9114 R_X86_64_IRELATIVE to switch.
9115 (Target_x86_64::Scan::global): Likewise.
9116 (Target_x86_64::Relocate::relocate): Likewise.
9117 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9118 switch.
9119 * target.h (class Target): Add plt_section_for_global and
9120 plt_section_for_local functions. Add do_plt_section_for_global
9121 and do_plt_section_for_local virtual functions.
9122 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9123 clarifying comments.
9124 (Symbol::use_plt_offset): Handle IFUNC symbol.
9125 * object.cc (Sized_relobj::Sized_relobj): Initialize
9126 local_plt_offsets_.
9127 (Sized_relobj::local_has_plt_offset): New function.
9128 (Sized_relobj::local_plt_offset): New function.
9129 (Sized_relobj::set_local_plt_offset): New function.
9130 (Sized_relobj::do_count): Handle IFUNC symbol.
9131 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9132 a bit away from input_shndx_ field. Add set_is_func_symbol and
9133 is_ifunc_symbol functions.
9134 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9135 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9136 local_plt_offsets_ field.
9137 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9138 * output.h (class Output_section_data): Add non-const
9139 output_section function.
9140 (class Output_data_got): Update declarations.
9141 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9142 Add use_plt_offset parameter to global and local constructors.
9143 Change all callers. Change local_sym_index_ field to 31 bits.
9144 Change GSYM_CODE and CONSTANT_CODE accordingly.
9145 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9146 doing a static link don't set sh_link field.
9147 (Output_data_got::Got_entry::write): Use PLT offset if
9148 appropriate.
9149 (Output_data_got::add_global_plt): New function.
9150 (Output_data_got::add_local_plt): New function.
9151 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9152 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9153 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9154 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9155 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9156 IFUNC conditional.
9157 * testsuite/ifunc-sel.h: New file.
9158 * testsuite/ifuncmain1.c: New file.
9159 * testsuite/ifuncmain1vis.c: New file.
9160 * testsuite/ifuncmod1.c: New file.
9161 * testsuite/ifuncdep2.c: New file.
9162 * testsuite/ifuncmain2.c: New file.
9163 * testsuite/ifuncmain3.c: New file.
9164 * testsuite/ifuncmod3.c: New file.
9165 * testsuite/ifuncmain4.c: New file.
9166 * testsuite/ifuncmain5.c: New file.
9167 * testsuite/ifuncmod5.c: New file.
9168 * testsuite/ifuncmain6pie.c: New file.
9169 * testsuite/ifuncmod6.c: New file.
9170 * testsuite/ifuncmain7.c: New file.
9171 * configure, testsuite/Makefile.in: Rebuild.
9172
56f75c03
ILT
91732010-08-18 Ian Lance Taylor <iant@google.com>
9174
9175 * incremental.cc
9176 (Output_section_incremental_inputs::write_input_files): Add cast
9177 to avoid signed/unsigned comparison warning.
9178 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9179
55455f89
CC
91802010-08-12 Cary Coutant <ccoutant@google.com>
9181
9182 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9183
e2054bcb
ILT
91842010-08-13 Ian Lance Taylor <iant@google.com>
9185
9186 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9187
74f67560
DK
91882010-08-12 Cary Coutant <ccoutant@google.com>
9189 Doug Kwan <dougkwan@google.com>
9190
9191 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9192 defintion overrides non-weak undef, remember that the original undef
9193 is not weak.
9194 * symtab.cc (Symbol_table::sized_write_global): For undef without
9195 an original weak binding, set binding to global in output.
9196 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9197 * testsuite/Makefile.in: Regenerate.
9198 * testsuite/strong_ref_weak_def.sh: New file.
9199 * testsuite/strong_ref_weak_def_1.c: Ditto.
9200 * testsuite/strong_ref_weak_def_2.c: Ditto.
9201
d1238d12
CC
92022010-08-12 Cary Coutant <ccoutant@google.com>
9203
9204 * testsuite/incremental_test.sh: Rewrite.
9205 * testsuite/incremental_test_1.c: Rewrite.
9206 * testsuite/incremental_test_2.c: Rewrite.
9207
0e70b911
CC
92082010-08-12 Cary Coutant <ccoutant@google.com>
9209
9210 * arm.cc (Target_arm::got_size): Add const.
9211 (Target_arm::got_entry_count): New function.
9212 (Target_arm::plt_entry_count): New function.
9213 (Target_arm::first_plt_entry_offset): New function.
9214 (Target_arm::plt_entry_size): New function.
9215 (Output_data_plt_arm::entry_count): New function.
9216 (Output_data_plt_arm::first_plt_entry_offset): New function.
9217 (Output_data_plt_arm::get_plt_entry_size): New function.
9218 * i386.cc (Target_i386::got_size): Add const.
9219 (Target_i386::got_entry_count): New function.
9220 (Target_i386::plt_entry_count): New function.
9221 (Target_i386::first_plt_entry_offset): New function.
9222 (Target_i386::plt_entry_size): New function.
9223 (Output_data_plt_i386::entry_count): New function.
9224 (Output_data_plt_i386::first_plt_entry_offset): New function.
9225 (Output_data_plt_i386::get_plt_entry_size): New function.
9226 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9227 find_incremental_inputs_sections. Dump incremental_got_plt section.
9228 * incremental.cc: Include target.h.
9229 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9230 parameter. Adjust all callers. Find incremental_got_plt section.
9231 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9232 section.
9233 (Output_section_incremental_inputs::set_final_data_size): Calculate
9234 size of incremental_got_plt section.
9235 (Output_section_incremental_inputs::do_write): Write the
9236 incremental_got_plt section.
9237 (Got_plt_view_info): New struct.
9238 (Local_got_offset_visitor): New class.
9239 (Global_got_offset_visitor): New class.
9240 (Global_symbol_visitor_got_plt): New class.
9241 (Output_section_incremental_inputs::write_got_plt): New function.
9242 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9243 Add parameter. Adjust all callers.
9244 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9245 (Incremental_inputs::got_plt_section): New function.
9246 (Incremental_inputs::got_plt_section_): New data member.
9247 (Incremental_got_plt_reader): New class.
9248 * layout.cc (Layout::create_incremental_info_sections): Add the
9249 incremental_got_plt section.
9250 * object.h (Got_offset_list::get_list): New function.
9251 (Got offset_list::for_all_got_offsets): New function.
9252 (Sized_relobj::local_got_offset_list): New function.
9253 * powerpc.cc (Target_powerpc::got_size): Add const.
9254 (Target_powerpc::got_entry_count): New function.
9255 (Target_powerpc::plt_entry_count): New function.
9256 (Target_powerpc::first_plt_entry_offset): New function.
9257 (Target_powerpc::plt_entry_size): New function.
9258 (Output_data_plt_powerpc::entry_count): New function.
9259 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9260 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9261 * sparc.cc (Target_sparc::got_size): Add const.
9262 (Target_sparc::got_entry_count): New function.
9263 (Target_sparc::plt_entry_count): New function.
9264 (Target_sparc::first_plt_entry_offset): New function.
9265 (Target_sparc::plt_entry_size): New function.
9266 (Output_data_plt_sparc::entry_count): New function.
9267 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9268 (Output_data_plt_sparc::get_plt_entry_size): New function.
9269 * symtab.h (Symbol::got_offset_list): New function.
9270 (Symbol_table::for_all_symbols): New function.
9271 * target.h (Sized_target::got_entry_count): New function.
9272 (Sized_target::plt_entry_count): New function.
9273 (Sized_target::plt_entry_size): New function.
9274 * x86_64.cc (Target_x86_64::got_size): Add const.
9275 (Target_x86_64::got_entry_count): New function.
9276 (Target_x86_64::plt_entry_count): New function.
9277 (Target_x86_64::first_plt_entry_offset): New function.
9278 (Target_x86_64::plt_entry_size): New function.
9279 (Output_data_plt_x86_64::entry_count): New function.
9280 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9281 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9282
09ec0418
CC
92832010-08-12 Cary Coutant <ccoutant@google.com>
9284
9285 * archive.cc: Include incremental.h.
9286 (Archive::Archive): Initialize incremental_info_.
9287 (Archive::include_member): Record archive members in incremental info.
9288 (Add_archive_symbols::run): Record begin and end of an archive in
9289 incremental info.
9290 (Lib_group::include_member): Record objects in incremental info.
9291 * archive.h (Incremental_archive_entry): Forward declaration.
9292 (Archive::set_incremental_info): New member function.
9293 (Archive::incremental_info): New member function.
9294 (Archive::Unused_symbol_iterator): New class.
9295 (Archive::unused_symbols_begin): New member function.
9296 (Archive::unused_symbols_end): New member function.
9297 (Archive::incremental_info_): New data member.
9298 * incremental-dump.cc (find_input_containing_global): New function.
9299 (dump_incremental_inputs): Dump new incremental info sections.
9300 * incremental.cc: Include symtab.h.
9301 (Output_section_incremental_inputs): New class.
9302 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9303 new incremental info sections.
9304 (Sized_incremental_binary::do_check_inputs): Likewise.
9305 (Incremental_inputs::report_archive): Remove.
9306 (Incremental_inputs::report_archive_begin): New function.
9307 (Incremental_inputs::report_archive_end): New function.
9308 (Incremental_inputs::report_object): New function.
9309 (Incremental_inputs::finalize_inputs): Remove.
9310 (Incremental_inputs::report_input_section): New function.
9311 (Incremental_inputs::report_script): Rewrite.
9312 (Incremental_inputs::finalize): Do nothing but finalize string table.
9313 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9314 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9315 (Incremental_inputs::create_data_sections): New function.
9316 (Incremental_inputs::relocs_entsize): New function.
9317 (Output_section_incremental_inputs::set_final_data_size): New function.
9318 (Output_section_incremental_inputs::do_write): New function.
9319 (Output_section_incremental_inputs::write_header): New function.
9320 (Output_section_incremental_inputs::write_input_files): New function.
9321 (Output_section_incremental_inputs::write_info_blocks): New function.
9322 (Output_section_incremental_inputs::write_symtab): New function.
9323 * incremental.h (Incremental_script_entry): Forward declaration.
9324 (Incremental_object_entry): Forward declaration.
9325 (Incremental_archive_entry): Forward declaration.
9326 (Incremental_inputs): Forward declaration.
9327 (Incremental_inputs_header_data): Remove.
9328 (Incremental_inputs_header): Remove.
9329 (Incremental_inputs_header_write): Remove.
9330 (Incremental_inputs_entry_data): Remove.
9331 (Incremental_inputs_entry): Remove.
9332 (Incremental_inputs_entry_write): Remove.
9333 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9334 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9335 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9336 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9337 Likewise.
9338 (Incremental_input_entry): New class.
9339 (Incremental_script_entry): New class.
9340 (Incremental_object_entry): New class.
9341 (Incremental_archive_entry): New class.
9342 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9343 (Incremental_inputs::report_inputs): Remove.
9344 (Incremental_inputs::report_archive): Remove.
9345 (Incremental_inputs::report_archive_begin): New function.
9346 (Incremental_inputs::report_archive_end): New function.
9347 (Incremental_inputs::report_object): Change prototype.
9348 (Incremental_inputs::report_input_section): New function.
9349 (Incremental_inputs::report_script): Change prototype.
9350 (Incremental_inputs::get_reloc_count): New function.
9351 (Incremental_inputs::set_reloc_count): New function.
9352 (Incremental_inputs::create_data_sections): New function.
9353 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9354 (Incremental_inputs::inputs_section): New function.
9355 (Incremental_inputs::symtab_section): New function.
9356 (Incremental_inputs::relocs_section): New function.
9357 (Incremental_inputs::get_stringpool): Add const.
9358 (Incremental_inputs::command_line): Add const.
9359 (Incremental_inputs::inputs): Remove.
9360 (Incremental_inputs::command_line_key): New function.
9361 (Incremental_inputs::input_file_count): New function.
9362 (Incremental_inputs::input_files): New function.
9363 (Incremental_inputs::relocs_entsize): New function.
9364 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9365 (Incremental_inputs::finalize_inputs): Remove.
9366 (Incremental_inputs::Input_info): Remove.
9367 (Incremental_inputs::lock_): Remove.
9368 (Incremental_inputs::inputs_): Change type.
9369 (Incremental_inputs::inputs_map_): Remove.
9370 (Incremental_inputs::current_object_entry_): New data member.
9371 (Incremental_inputs::inputs_section_): New data member.
9372 (Incremental_inputs::symtab_section_): New data member.
9373 (Incremental_inputs::relocs_section_): New data member.
9374 (Incremental_inputs::reloc_count_): New data member.
9375 (Incremental_inputs_reader): New class.
9376 (Incremental_symtab_reader): New class.
9377 (Incremental_relocs_reader): New class.
9378 * layout.cc (Layout::finalize): Move finalization of incremental info
9379 and creation of incremental info sections to follow finalization of
9380 symbol table. Set offsets for postprocessing sections.
9381 (Layout::create_incremental_info_sections): Call
9382 Incremental_inputs::create_data_sections. Add incremental symtab
9383 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9384 sections to layout after input sections.
9385 * layout.h (struct Timespec): Forward declaration.
9386 (Layout::incremental_inputs): Add const.
9387 (Layout::create_incremental_info_sections): Add parameter.
9388 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9389 * object.cc: Include incremental.h.
9390 (Relobj::finalize_incremental_relocs): New function.
9391 (Sized_relobj::do_layout): Record input sections in incremental info.
9392 * object.h (Object::output_section): New function.
9393 (Object::output_section_offset): Moved from Relobj.
9394 (Object::get_incremental_reloc_base): New function.
9395 (Object::get_incremental_reloc_count): New function.
9396 (Object::do_output_section): New function.
9397 (Object::do_output_section_offset): Moved from Relobj.
9398 (Object::do_get_incremental_reloc_base): New function.
9399 (Object::do_get_incremental_reloc_count): New function.
9400 (Object::Object): Initialize new data members.
9401 (Relobj::output_section): Renamed do_output_section and moved to
9402 protected.
9403 (Relobj::output_section_offset): Moved to Object.
9404 (Relobj::do_get_incremental_reloc_base): New function.
9405 (Relobj::do_get_incremental_reloc_count): New function.
9406 (Relobj::allocate_incremental_reloc_counts): New function.
9407 (Relobj::count_incremental_reloc): New function.
9408 (Relobj::finalize_incremental_relocs): New function.
9409 (Relobj::next_incremental_reloc_index): New function.
9410 (Relobj::reloc_counts_): New data member.
9411 (Relobj::reloc_bases_): New data member.
9412 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9413 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9414 (Sized_relobj::incremental_relocs_scan): New function.
9415 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9416 (Sized_relobj::incremental_relocs_write): New function.
9417 (Sized_relobj::incremental_relocs_write_reltype): New function.
9418 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9419 incremental link.
9420 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9421 archives and object files elsewhere.
9422 (Add_symbols::run): Report object files here.
9423 (Finish_group::run): Report end of archive at end of group.
9424 * reloc.cc: Include layout.h, incremental.h.
9425 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9426 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9427 (Sized_relobj::incremental_relocs_scan): New function.
9428 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9429 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9430 (Sized_relobj::incremental_relocs_write): New function.
9431 (Sized_relobj::incremental_relocs_write_reltype): New function.
9432 * script.cc (read_input_script): Rewrite test for incremental link.
9433 Change call to Incremental_inputs::report_script.
9434 * symtab.h (Symbol_table::first_global_index): New function.
9435 (Symbol_table::output_count): New function.
9436
ce0d1972
DK
94372010-08-12 Doug Kwan <dougkwan@google.com>
9438
9439 * arm.cc (Target_arm::merge_object_attributes): Check command line
9440 options --no-wchar-size-warning and --no-enum-size-warning.
9441 * options.h (General_options): Add ld-compatible options
9442 --no-enum-size-warning and --no-wchar-size-warning.
9443
6e5710ce
ILT
94442010-08-04 Ian Lance Taylor <iant@google.com>
9445
9446 * x86_64.cc (Target_x86_64::Scan::local): Use
9447 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9448 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9449 (Target_x86_64::Scan::global): Likewise.
9450 (Target_x86_64::Relocate::relocate): Likewise.
9451 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9452 Likewise.
9453
fef830db
CC
94542010-08-03 Cary Coutant <ccoutant@google.com>
9455
9456 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9457 to reserve space in merged_strings vector. Keep total input size
9458 for stats.
9459 (Output_merge_string::do_print_merge_stats): Print total input size.
9460 * merge.h (Output_merge_string): Add input_size_ field.
9461 * stringpool.cc (Stringpool_template::string_length): Move
9462 implementations out of Stringpool_template class and place in
9463 stringpool.h.
9464 * stringpool.h (string_length): Move out of Stringpool_template.
9465
1e3811b0
ILT
94662010-08-03 Ian Lance Taylor <iant@google.com>
9467
9468 PR 11712
9469 * layout.cc (relaxation_loop_body): If address of load segment is
9470 set, adjust address to include headers if possible.
9471
7af0c620
ILT
94722010-08-03 Ian Lance Taylor <iant@google.com>
9473
9474 * version.cc (version_string): Bump to 1.10.
9475
22f0da72
ILT
94762010-08-03 Ian Lance Taylor <iant@google.com>
9477
9478 PR 11805
9479 * layout.h (enum Output_section_order): Define.
9480 (class Layout): Update declarations.
9481 * layout.cc (Layout::get_output_section): Add order parameter.
9482 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9483 is_first_non_relro parameters. Change all callers.
9484 (Layout::choose_output_section): Likewise.
9485 (Layout::add_output_section_data): Likewise.
9486 (Layout::make_output_section): Likewise. Set order.
9487 (Layout::default_section_order): New function.
9488 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9489 * output.cc (Output_section::Output_section): Initialize order_.
9490 Don't initialize deleted fields.
9491 (Output_segment::Output_segment): Don't initialize deleted
9492 fields.
9493 (Output_segment::add_output_section_to_load): New function
9494 replacing add_output_section. Change all callers to call this or
9495 add_output_section_to_nonload.
9496 (Output_segment::add_output_section_to_nonload): New function.
9497 (Output_segment::remove_output_section): Rewrite.
9498 (Output_segment::add_initial_output_data): Likewise.
9499 (Output_segment::has_any_data_sections): Likewise.
9500 (Output_segment::is_first_section_relro): Likewise.
9501 (Output_segment::maximum_alignment): Likewise.
9502 (Output_segment::has_dynamic_reloc): New function replacing
9503 dynamic_reloc_count. Change all callers.
9504 (Output_segment::has_dynamic_reloc_list): New function replacing
9505 dynamic_reloc_count_list. Change all callers.
9506 (Output_segment::set_section_addresses): Rewrite.
9507 (Output_segment::set_offset): Rewrite.
9508 (Output_segment::find_first_and_last_list): Remove.
9509 (Output_segment::set_tls_offsets): Rewrite.
9510 (Output_segment::first_section_load_address): Likewise.
9511 (Output_segment::output_section_count): Likewise.
9512 (Output_segment::section_with_lowest_load_address): Likewise.
9513 (Output_segment::write_section_headers): Likewise.
9514 (Output_segment::print_sections_to_map): Likewise.
9515 * output.h (class Output_data): Remove dynamic_reloc_count_
9516 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9517 (Output_data::add_dynamic_reloc): Rewrite.
9518 (Output_data::has_dynamic_reloc): New function.
9519 (Output_data::dynamic_reloc_count): Remove.
9520 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9521 is_last_relro_, is_first_non_relro_, is_interp_,
9522 is_dynamic_linker_section_ fields. Add order and set_order
9523 functions. Remove is_relro_local, set_is_relro_local,
9524 is_last_relro, set_is_last_relro, is_first_non_relro,
9525 set_is_first_non_relro functions, is_interp, set_is_interp,
9526 is_dynamic_linker_section, and set_is_dynamic_linker_section
9527 functions.
9528 (class Output_segment): Change Output_data_list from std::list to
9529 std:;vector. Add output_lists_ field. Remove output_data_ and
9530 output_bss_ fields. Update declarations.
9531
3ff2ccb0
ILT
95322010-08-02 Ian Lance Taylor <iant@google.com>
9533
9534 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9535 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9536 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9537
88a4108b
ILT
95382010-08-02 Ian Lance Taylor <iant@google.com>
9539
9540 PR 11855
9541 * script.cc (Script_options::Script_options): Initialize
9542 symbol_definitions_ and symbol_references_.
9543 (Script_options::add_symbol_assignment): Update
9544 symbol_definitions_ and symbol_references_.
9545 (Script_options::add_symbol_reference): New function.
9546 (script_symbol): New function.
9547 * script.h (class Script_options): Add symbol_definitions_ and
9548 symbol_references_ fields.
9549 (Script_options::referenced_const_iterator): New type.
9550 (Script_options::referenced_begin): New function.
9551 (Script_options::referenced_end): New function.
9552 (Script_options::is_referenced): New function.
9553 (Script_options::any_unreferenced): New function.
9554 * script-c.h (script_symbol): Declare.
9555 * yyscript.y (exp): Call script_symbol.
9556 * symtab.cc: Include "script.h".
9557 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9558 Change all callers. Check symbols referenced by scripts.
9559 (Symbol_table::add_undefined_symbols_from_command_line): Add
9560 layout parameter. Change all callers.
9561 (Symbol_table::do_add_undefined_symbols_from_command_line):
9562 Likewise. Break out loop body. Check symbols referenced by
9563 scripts.
9564 (Symbol_table::add_undefined_symbol_from_command_line): New
9565 function broken out of
9566 do_add_undefined_symbols_from_command_line.
9567 * symtab.h (class Symbol_table): Update declarations.
9568 * archive.cc: Include "layout.h".
9569 (Archive::should_include_member): Add layout parameter. Change
9570 all callers. Check for symbol mentioned in expression.
9571 * archive.h (class Archive): Update declaration.
9572 * object.cc (Sized_relobj::do_should_include_member): Add layout
9573 parameter.
9574 * object.h (Object::should_include_member): Add layout parameter.
9575 Change all callers.
9576 (Object::do_should_include_member): Add layout parameter.
9577 (class Sized_relobj): Update declaration.
9578 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9579 parameter.
9580 * dynobj.h (class Sized_dynobj): Update declaration.
9581 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9582 layout parameter.
9583 * plugin.h (class Sized_pluginobj): Update declaration.
9584
5f1ab67a
ILT
95852010-08-02 Ian Lance Taylor <iant@google.com>
9586
9587 PR 11866
9588 * output.cc (Output_segment::set_offset): Search for the first and
9589 last sections rather than assuming that the list is in order.
9590 (Output_segment::find_first_and_last_list): New function.
9591 * output.h (class Output_segment): Update declarations.
9592 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9593 (relro_strip_test_SOURCES): New variable.
9594 (relro_strip_test_DEPENDENCIES): New variable.
9595 (relro_strip_test_LDFLAGS): New variable.
9596 (relro_strip_test_LDADD): New variable.
9597 (relro_strip_test.so): New target.
9598
a8df5856
ILT
95992010-08-02 Ian Lance Taylor <iant@google.com>
9600
9601 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9602 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9603 (Target_i386::got_tlsdesc_section): New function.
9604 (Target_i386::got_section): Create space for GOT entries for
9605 TLSDESC relocations.
9606 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9607 R_386_TLS_GOTDESC.
9608 (Target_i386::Scan::global): Likewise.
9609 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9610 using TLSDESC GOT.
9611 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9612 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9613 (Target_x86_64::got_tlsdesc_section): New function.
9614 (Target_x86_64::got_section): Create space for GOT entries for
9615 TLSDESC relocations.
9616 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9617 R_386_TLS_GOTDESC.
9618 (Target_x86_64::Scan::global): Likewise.
9619 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9620 using TLSDESC GOT.
9621
0c10a0a6
ILT
96222010-08-02 Ian Lance Taylor <iant@google.com>
9623
9624 * testsuite/final_layout.sh: Use dc to convert from hex to
9625 decimal.
9626
41cbeecc
ST
96272010-07-29 Sriraman Tallam <tmsriram@google.com>
9628
9629 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9630 paramter to the call to gold::gc_process_relocs.
9631 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9632 paramter to the call to gold::gc_process_relocs.
9633 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9634 parameter to the call to gold::gc_process_relocs.
9635 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9636 template parameter to the call to gold::gc_process_relocs.
9637 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9638 paramter to the call to gold::gc_process_relocs.
9639 * gc.h (get_embedded_addend_size): New function.
9640 (gc_process_relocs): Save the size of the reloc for use by ICF.
9641 * icf.cc (get_section_contents): Get the addend from the text section
9642 for SHT_REL relocation sections.
9643 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9644 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9645 * int_encoding.h (read_from_pointer): New overloaded function.
9646 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9647 * testsuite/icf_sht_rel_addend_test.sh: New file.
9648 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9649 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9650
6ea55b82
RW
96512010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9652
9653 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9654 * Makefile.in: Regenerate.
9655 * testsuite/Makefile.in: Regenerate.
9656
9691462b
ILT
96572010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9658
9659 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9660 * gold/testsuite/debug_msg.cc: Likewise.
9661 * gold/testsuite/odr_violation1.cc
9662 * gold/testsuite/odr_violation2.cc
9663
76897331
CC
96642010-07-21 Cary Coutant <ccoutant@google.com>
9665
9666 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9667 string, and length fields.
9668 (Output_merge_string::Merged_strings_list): New type.
9669 (Output_merge_string::Merged_strings_lists): New typedef.
9670 (Output_merge_string): Replace merged_strings_ with
9671 merged_strings_lists_.
9672 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9673 Merged_strings_list per input object and section. Don't store pointer
9674 to the string. Don't store length with each merged string entry.
9675 (Output_merge_string::finalize_merged_data): Loop over list of merged
9676 strings lists. Recompute length of each merged string.
9677
78384e8f
CC
96782010-07-15 Cary Coutant <ccoutant@google.com>
9679
9680 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9681 here.
9682
783659f9
ILT
96832010-07-14 Ian Lance Taylor <iant@google.com>
9684
9685 * descriptors.cc (Descriptors::open): Report correct name in error
9686 message.
9687
131687b4
DK
96882010-07-13 Doug Kwan <dougkwan@google.com>
9689
9690 * arm.cc (Arm_input_section::Arm_input_section): For a
9691 SHT_ARM_EXIDX section, always keeps the input sections.
9692 (Arm_input_section::set_exidx_section_link): New method.
9693 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9694 has_errors_ to false.
9695 (Arm_exidx_input_section::has_errors,
9696 Arm_exidx_input_section::set_has_errors): New methods.
9697 (Arm_exidx_input_section::has_errors_): New data member.
9698 (Arm_relobj::get_exidx_shndx_list): New method.
9699 (Arm_output_section::append_text_sections_to_list): Do not skip
9700 section without SHF_EXECINSTR.
9701 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9702 errors.
2e702c99 9703 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9704 section header. Make error messages more verbose. Check for
9705 a non-executable section linked to an EXIDX section.
9706 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9707 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9708 check that there is no deferred EXIDX section if we exit early.
9709 Instead of not making an EXIDX section in case of an error, make one
9710 and set the has_errors flag of it.
9711 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9712 in a relocatable link.
9713 (Target_arm::do_relax): Look for the EXIDX output section instead of
9714 assuming that it is called .ARM.exidx.
2e702c99 9715 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9716 section list. Do not check for SHF_EXECINSTR section flags but
9717 skip any input section with errors.
9718 * output.cc (Output_section::Output_section): Initialize
9719 always_keeps_input_sections_ to false.
9720 (Output_section::add_input_section): Check for
9721 always_keeps_input_sections_.
9722 * output.h (Output_section::always_keeps_input_sections,
9723 Output_section::set_always_keeps_input_sections): New methods.
9724 (Output_section::always_keeps_input_sections): New data member.
9725
69517287
RÁE
97262010-07-13 Rafael Espindola <espindola@google.com>
9727
9728 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9729 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9730
82742395
ILT
97312010-07-13 Philip Herron <herron.philip@googlemail.com>
9732 Ian Lance Taylor <iant@google.com>
9733
9734 * output.h (Output_section_lookup_maps::add_merge_section):
9735 Correct check of whether value was inserted.
9736 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9737 (Output_section_lookup_maps::add_relaxed_input_section):
9738 Likewise.
9739 * arm.cc (Target_arm::got_section): Remove used local os.
9740 * i386.cc (Target_i386::got_section): Likewise.
9741 * x86_64.cc (Target_x86_64::got_section): Likewise.
9742 * sparc.cc (Target_sparc::got_section): Likewise.
9743 (Target_sparc::relocate): Remove unused local have_got_offset.
9744 * powerpc.cc (Target_powerpc::relocate): Likewise.
9745
f2d707b5
ILT
97462010-07-13 Ian Lance Taylor <iant@google.com>
9747
241531d6
ILT
9748 * compressed_output.cc (zlib_decompress): Fix signature in
9749 !HAVE_ZLIB_H case.
9750
f2d707b5
ILT
9751 * archive.cc (Archive::include_member): Unlock an external member
9752 of a thin archive. Don't bother to delete an object we know is
9753 NULL.
9754
a2e47362
CC
97552010-07-12 Cary Coutant <ccoutant@google.com>
9756
9757 * compressed_output.cc (zlib_decompress): New function.
9758 (get_uncompressed_size): New function.
9759 (decompress_input_section): New function.
9760 * compressed_output.h (get_uncompressed_size): New function.
9761 (decompress_input_section): New function.
9762 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9763 Handle compressed debug sections.
9764 * layout.cc (is_compressed_debug_section): New function.
9765 (Layout::output_section_name): Map compressed section names to
9766 canonical names.
9767 * layout.h (is_compressed_debug_section): New function.
9768 (is_debug_info_section): Recognize compressed debug sections.
9769 * merge.cc: Include compressed_output.h.
9770 (Output_merge_data::do_add_input_section): Handle compressed
9771 debug sections.
9772 (Output_merge_string::do_add_input_section): Handle compressed
9773 debug sections.
9774 * object.cc: Include compressed_output.h.
9775 (Sized_relobj::Sized_relobj): Initialize new data members.
9776 (build_compressed_section_map): New function.
9777 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9778 * object.h (Object::section_is_compressed): New method.
9779 (Object::do_section_is_compressed): New method.
9780 (Sized_relobj::Compressed_section_map): New type.
9781 (Sized_relobj::do_section_is_compressed): New method.
9782 (Sized_relobj::compressed_sections_): New data member.
9783 * output.cc (Output_section::add_input_section): Handle compressed
9784 debug sections.
9785 * reloc.cc: Include compressed_output.h.
9786 (Sized_relobj::write_sections): Handle compressed debug sections.
9787
ce279a62
CC
97882010-07-08 Cary Coutant <ccoutant@google.com>
9789
9790 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9791 weak when resolving to a dynamic def.
9792 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9793 for weak undef/dynamic def cases. Adjust callers.
9794 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9795 undef_binding_weak_.
9796 (Symbol_table::sized_write_globals): Adjust symbol binding.
9797 (Symbol_table::sized_write_symbol): Add binding parameter.
9798 * symtab.h (Symbol::set_undef_binding): New method.
9799 (Symbol::is_undef_binding_weak): New method.
9800 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9801 (Symbol_table::should_override): Add new parameter.
9802 (Symbol_table::sized_write_symbol): Add new parameter.
9803
9804 * testsuite/weak_undef_file1.cc: Add new test case.
9805 * testsuite/weak_undef_file2.cc: Fix header comment.
9806 * testsuite/weak_undef_test.cc: Add new test case.
9807
b2286c10
DK
98082010-06-29 Doug Kwan <dougkwan@google.com>
9809
9810 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9811 Initialize USE_SYMBOL_.
9812 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9813 definition.
9814 (Arm_reloc_property::uses_symbol_): New data member declaration.
9815 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9816 uses symbol value and symbol is undefined but not weakly undefined.
9817
4802450a
RÁE
98182010-06-28 Rafael Espindola <espindola@google.com>
9819
9820 * plugin.cc (Plugin::load): Use dlerror.
9821
e5ca47ba
ILT
98222010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9823
9824 * symtab.cc (detect_odr_violations): When reporting an ODR
9825 violation, report an object where the symbol is defined.
9826
8a75a161
DK
98272010-06-25 Doug Kwan <dougkwan@google.com>
9828
9829 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9830 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9831 definition.
9832 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9833 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9834 target hook to detect function points.
9835 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9836 * icf.h (Icf::check_section_for_function_pointers): Change type of
9837 parameter SECTION_NAME to const reference to std::string. Use
9838 target hook to determine if section may have unsafe pointers.
9839 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9840 method definition.
9841
42218b9f
RÁE
98422010-06-21 Rafael Espindola <espindola@google.com>
9843
9844 * fileread.cc (Input_file::find_fie): New
9845 (Input_file::open): Use Input_file::find_fie.
9846 * fileread.h (Input_file::find_fie): New
9847 * plugin.cc (set_extra_library_path): New.
9848 (Plugin::load): Add set_extra_library_path to the transfer vector.
9849 (Plugin_manager::set_extra_library_path): New.
9850 (Plugin_manager::add_input_file): Use the extra search path if set.
9851 (set_extra_library_path(): New.
9852 * plugin.h (Plugin_manager): Add set_extra_library_path and
9853 extra_search_path_.
9854
a0506cca
CC
98552010-06-19 Cary Coutant <ccoutant@google.com>
9856
9857 * layout.cc (gdb_sections): Add .debug_types.
9858 (lines_only_debug_sections): Likewise.
9859
6508b958
RÁE
98602010-06-18 Rafael Espindola <espindola@google.com>
9861
9862 * plugin.cc (add_input_file,add_input_library)
9863 (Plugin_manager::add_input_file): Make filename arguments const.
9864 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9865 const.
9866
3e235302
DK
98672010-06-16 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9870 .ARM.attributes section if we have not merged any input
9871 attributes sections.
9872
106e8a6c
DK
98732010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9874
9875 * arm.cc: Allow combining objects with no EABI version
9876 information.
9877
91ff43fe
RÁE
98782010-06-15 Rafael Espindola <espindola@google.com>
9879
9880 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9881
68ed838c
ILT
98822010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9883
9884 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9885 (struct iovec): Correct !HAVE_READV definition.
9886
f3a2388f
CC
98872010-06-10 Cary Coutant <ccoutant@google.com>
9888
9889 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9890 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9891 reloc sections.
9892 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9893
9894 PR 11683
9895 * symtab.h (Symbol::is_placeholder): New member function.
9896 * target-reloc.h (relocate_section): Check for placeholder symbols.
9897
9898 * testsuite/Makefile.am (plugin_test_8): New test.
9899 (plugin_test_9): New test.
9900 * testsuite/Makefile.in: Regenerate.
9901
e1df38aa
NC
99022010-06-09 Nick Clifton <nickc@redhat.com>
9903
9904 * yyscript.y (input_list_element): Allow strings prefixed with
9905 the '-' character. Treat these as libraries.
9906 * script.cc (script_add_library): New function. Adds a library
9907 specified by "-l<name>" found in an input script.
9908 * script-c.h: Add prototype for script_add_library.
9909
25bbe950
DK
99102010-06-07 Doug Kwan <dougkwan@google.com>
9911
9912 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9913 Restrict stub-group size to be within long conditional branch
9914 range when working around cortex-A8 erratum.
9915
0f32ea4c
ILT
99162010-06-07 Damien Diederen <dd@crosstwine.com>
9917
9918 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9919 #ifdef typo.
9920
8fe2a369
ST
99212010-06-03 Sriraman Tallam <tmsriram@google.com>
9922
9923 PR gold/11658
9924 * output.cc
9925 (Output_section::Input_section_sort_entry::compare_section_ordering):
9926 Change to return non-zero correctly.
9927 (Output_section::Input_section_sort_section_order_index_compare
9928 ::operator()): Change to fix ambiguity in comparisons.
9929
6e9ba2ca
ST
99302010-06-01 Sriraman Tallam <tmsriram@google.com>
9931
9932 * gold.h (is_wildcard_string): New function.
9933 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9934 (Layout::layout_eh_frame): Ditto.
9935 (Layout::find_section_order_index): New method.
9936 (Layout::read_layout_from_file): New method.
9937 * layout.h (Layout::find_section_order_index): New method.
9938 (Layout::read_layout_from_file): New method.
9939 (Layout::input_section_position_): New private member.
9940 (Layout::input_section_glob_): New private member.
9941 * main.cc (main): Call read_layout_from_file here.
9942 * options.h (--section-ordering-file): New option.
9943 * output.cc (Output_section::input_section_order_specified_): New
9944 member.
9945 (Output_section::Output_section): Initialize new member.
9946 (Output_section::add_input_section): Add new parameter.
9947 Keep input sections when --section-ordering-file is used.
9948 (Output_section::set_final_data_size): Sort input sections when
9949 section ordering file is specified.
9950 (Output_section::Input_section_sort_entry): Add new parameter.
9951 Check sorting type.
9952 (Output_section::Input_section_sort_entry::compare_section_ordering):
9953 New method.
9954 (Output_section::Input_section_sort_compare::operator()): Change to
9955 consider section_order_index.
9956 (Output_section::Input_section_sort_init_fini_compare::operator()):
9957 Change to consider section_order_index.
9958 (Output_section::Input_section_sort_section_order_index_compare
9959 ::operator()): New method.
9960 (Output_section::sort_attached_input_sections): Change to sort
9961 according to section order when specified.
e1df38aa
NC
9962 (Output_section::add_input_section<32, true>): Add new parameter.
9963 (Output_section::add_input_section<64, true>): Add new parameter.
9964 (Output_section::add_input_section<32, false>): Add new parameter.
9965 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9966 * output.h (Output_section::add_input_section): Add new parameter.
9967 (Output_section::input_section_order_specified): New
9968 method.
9969 (Output_section::set_input_section_order_specified): New method.
9970 (Input_section::Input_section): Initialize section_order_index_.
9971 (Input_section::section_order_index): New method.
9972 (Input_section::set_section_order_index): New method.
9973 (Input_section::section_order_index_): New member.
9974 (Input_section::Input_section_sort_section_order_index_compare): New
9975 struct.
9976 (Output_section::input_section_order_specified_): New member.
9977 * script-sections.cc (is_wildcard_string): Delete and move modified
9978 method to gold.h.
9979 (Output_section_element_input::Output_section_element_input): Modify
9980 call to is_wildcard_string.
9981 (Output_section_element_input::Input_section_pattern
9982 ::Input_section_pattern): Ditto.
9983 (Output_section_element_input::Output_section_element_input): Ditto.
9984 * testsuite/Makefile.am (final_layout): New test case.
9985 * testsuite/Makefile.in: Regenerate.
9986 * testsuite/final_layout.cc: New file.
9987 * testsuite/final_layout.sh: New file.
9988
3537c84b
RÁE
99892010-06-01 Rafael Espindola <espindola@google.com>
9990
9991 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9992
105b6afd
RÁE
99932010-06-01 Rafael Espindola <espindola@google.com>
9994
9995 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9996 visibility of symbols.
9997
29e11421
DK
99982010-05-27 Doug Kwan <dougkwan@google.com>
9999
10000 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10001 from start of output section instead of address for a local symbol
10002 in a merged or relaxed section when doing a relocatable link.
10003
5e0f337e
RÁE
100042010-05-26 Rafael Espindola <espindola@google.com>
10005
703d02da 10006 PR 11604
5e0f337e
RÁE
10007 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10008 adding sections the garbage collector removed.
10009 * gold/testsuite/Makefile.am: Add test.
10010 * gold/testsuite/Makefile.in: Regenerate.
10011 * gold/testsuite/plugin_test_7.sh: New.
10012 * gold/testsuite/plugin_test_7_1.c: New.
10013 * gold/testsuite/plugin_test_7_2.c: New.
10014
f4187277
RÁE
100152010-05-26 Rafael Espindola <espindola@google.com>
10016
10017 * script-sections.cc (Output_section_definition::set_section_addresses):
10018 Check for --section-start.
10019
5c388529
DK
100202010-05-26 Doug Kwan <dougkwan@google.com>
10021
10022 * arm.cc (Arm_scan_relocatable_relocs): New class.
10023 (Target_arm::relocate_special_relocatable): New method.
10024 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10025 (Arm_relocate_functions::thumb_branch_common): Same.
10026 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10027 instead of Default_scan_relocatable_relocs.
10028 * target-reloc.h (relocate_for_relocatable): Let target handle
10029 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10030 * target.h (Sized_target::relocate_special_relocatable): New method.
10031
bca1c3ae
ILT
100322010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10033
10034 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10035
0439c796
DK
100362010-05-23 Doug Kwan <dougkwan@google.com>
10037
10038 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10039 instead of a cast.
10040 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10041 with a direct branch, not a conditional branch, to a stub.
10042 * merge.cc (Output_merge_base::record_input_section): New method
10043 defintion.
10044 (Output_merge_data::do_add_input_section): Record input section if
10045 keeps-input-sections flag is set.
10046 (Output_merge_string::do_add_input_section): Ditto.
10047 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10048 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10049 INPUT_SECTIONS_.
10050 (Output_merge_base::keeps_input_sections,
10051 Output_merge_base::set_keeps_input_sections,
10052 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10053 method definitions.
10054 (Output_merge_base::Input_sections): New type declaration.
10055 (Output_merge_base::input_sections_begin,
10056 Output_merge_base::input_sections_end,
10057 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10058 (Output_merge_base::bool keeps_input_sections_,
10059 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10060 Output_merge_base::input_sections_): New data members.
10061 (Output_merge_data::do_set_keeps_input_sections): New method
10062 defintion.
10063 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10064 * output.cc (Output_section::Input_section::relobj): Move method
10065 defintion from class declaration to here and handle merge sections.
10066 (Output_section::Input_section::shndx): Ditto.
10067 (Output_section::Output_section): Remove initializations of removed
10068 data members and initialize new data member LOOKUP_MAPS_.
10069 (Output_section::add_input_section): Set keeps-input-sections flag
10070 for a newly created merge output section as appropriate. Adjust code
10071 to use Output_section_lookup_maps class.
10072 (Output_section::add_relaxed_input_section): Adjst code for lookup
10073 maps code refactoring.
2e702c99 10074 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10075 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10076 class. If adding input section to a newly created merge output
10077 section fails, remove the new merge section.
10078 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10079 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10080 (Output_section::find_merge_section): Ditto.
0439c796 10081 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10082 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10083 Output_section_lookup_maps class.
10084 (Output_section::get_input_sections): Export merge sections. Adjust
10085 code to use Output_section_lookup_maps class.
10086 (Output_section:::add_script_input_section): Adjust code to use
10087 Output_section_lookup_maps class. Update lookup maps for merge
10088 sections also.
10089 (Output_section::discard_states): Use Output_section_lookup_maps.
10090 (Output_section::restore_states): Same.
10091 * output.h (Merge_section_properties): Move class defintion out of
10092 Output_section.
10093 (Output_section_lookup_maps): New class.
10094 (Output_section::Input_section::is_merge_section): New method
10095 defintion.
10096 (Output_section::Input_section::relobj): Move defintion out of class
10097 defintion. Declare method only.
10098 (Output_section::Input_section::shndx): Ditto.
10099 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10100 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10101 (Output_section::Merge_section_by_properties_map,
10102 Output_section::Output_section_data_by_input_section_map,
10103 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10104 Remove types.
2e702c99 10105 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10106 KEEPS_INPUT_SECTIONS.
10107 (Output_section::build_lookup_maps): New method declaration.
10108 (Output_section::merge_section_map_,
10109 Output_section::merge_section_by_properties_map_,
10110 Output_section::relaxed_input_section_map_,
10111 Output_section::is_relaxed_input_section_map_valid_): Remove data
10112 members.
10113 (Output_section::lookup_maps_): New data member.
10114
76295588
L
101152010-05-21 Doug Kwan <dougkwan@google.com>
10116
10117 PR gold/11619
10118 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10119 avoid a compilation error.
10120
d103a984
RÁE
101212010-05-19 Rafael Espindola <espindola@google.com>
10122
10123 * script-sections.cc (Output_section_definition::allocate_to_segment):
10124 Update the phdrs_list even when the output section is NULL.
10125 * testsuite/Makefile.am: Add test.
10126 * testsuite/Makefile.in: Regenerate.
10127 * testsuite/script_test_9.cc: New.
10128 * testsuite/script_test_9.sh: New.
10129 * testsuite/script_test_9.t: New.
10130
6625d24e
DK
101312010-05-19 Doug Kwan <dougkwan@google.com>
10132
10133 * arm.cc (Arm_input_section::original_size): New method.
10134 (Arm_input_section::do_addralign): Add a cast.
10135 (Arm_input_section::do_output_offset): Remove static cast.
10136 (Arm_input_section::original_addralign,
10137 Arm_input_section::original_size_): Change type to uint32_t.
10138 (Arm_input_section::init): Add safe casts for section alignment
10139 and size.
10140 (Arm_input_section::set_final_data_size): Do not set address and
10141 offset of stub table.
10142 (Arm_output_section::fix_exidx_coverage): Change use of of
10143 Output_section::Simple_input_section to that of
10144 Output_section::Input_section.
10145 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10146 except for the first pass.
10147 * output.cc (Output_section::get_input_sections): Change type of
10148 input_sections to std::list<Input_section>.
10149 (Output_section::add_script_input_section): Rename from
10150 Output_section::add_simple_input_section. Change type of SIS
10151 parameter from Simple_input_section to Input_section.
10152 * output.h (Output_section::Simple_input_section): Remove class.
10153 (Output_section::Input_section): Change class visibility to public.
10154 (Output_section::Input_section::addralign): Use stored alignments
10155 for special input sections if set.
10156 (Output_section::Input_section::set_addralign): New method.
10157 (Output_section::get_input_sections): Change parameter type from
10158 list of Simple_input_section to list of Input_section.
10159 (Output_section::add_script_input_section): Rename from
10160 Output_section::add_simple_input_section. Change first parameter's
10161 type from Simple_input_section to Input_section and remove the
10162 second and third parameters.
10163 * script-sections.cc (Input_section::Input_section_list): Change
10164 type to list of Output_section::Input_section/
10165 (Input_section_info::Input_section_info): Change parameter type of
10166 INPUT_SECTION to Output_section::Input_section.
10167 (Input_section_info::input_section): Change return type.
10168 (Input_section_info::input_section_): Change type to
10169 Output_section::Input_section.
10170 (Output_section_element_input::set_section_addresses): Adjust code
10171 to use Output_section::Input_section instead of
10172 Output_section::Simple_input_section. Adjust code for renaming
10173 of Output_section::add_simple_input_section.
10174 (Orphan_output_section::set_section_addresses): Ditto.
10175
e1e82ea4
RW
101762010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10177
10178 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10179 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10180
91e75c8a
RÁE
101812010-05-18 Rafael Espindola <espindola@google.com>
10182
10183 * options.cc (General_options::finalize): Handle -nostdlib.
10184 * options.h (nostdlib): New option.
10185 * script.cc (script_add_search_dir): Handle -nostdlib.
10186
da59ad79
DK
101872010-05-12 Doug Kwan <dougkwan@google.com>
10188
10189 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10190 attributes section only if there no attributes section after merging.
10191 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10192 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10193 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10194 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10195 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10196 and arm_attr_merge_7.stdout.
10197 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10198 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10199 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10200 arm_attr_merge_7b.o): New rules.
10201 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10202 arm_attr_merge_7
10203 * testsuite/Makefile.in: Regenerate.
10204 * testsuite/arm_attr_merge.sh: New file.
10205 * testsuite/arm_attr_merge_[67][ab].s: Same.
10206
3e01a7fd
NC
102072010-05-05 Nick Clifton <nickc@redhat.com>
10208
10209 * po/es.po: Updated Spanish translation.
10210
7ad2014a
L
102112010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10212
10213 * Makefile.am (install-exec-local): Properly install gold as
10214 default cross linker.
10215 * Makefile.in: Regenerated.
10216
4fda8867
NC
102172010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10218 Nick Clifton <nickc@redhat.com>
10219
10220 * configure.ac (install_as_default): Define and set to false
10221 unless --enable-gold or --enable-gold=both/gold has been
10222 specified.
10223 * configure: Regenerate.
10224
10225 * Makefile.am (install-exec-local): Install the executable as
10226 'ld.gold'. If install_as_default is true then also install it as
10227 'ld'.
10228 * Makefile.in: Regenerated.
10229
bd288ea2
ILT
102302010-04-24 Ian Lance Taylor <iant@google.com>
10231
10232 * layout.cc (Layout::layout_reloc): In relocatable link don't
10233 combine reloc sections for grouped sections.
10234
ef38fd8a
ST
102352010-04-23 Sriraman Tallam <tmsriram@google.com>
10236
10237 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10238 sections that are not ordinary to icf.
10239 * icf.cc (get_section_contents): Handle relocation pointing to section
10240 with no object or shndx information.
10241 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10242 * testsuite/Makefile.in: Regenerate.
10243 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10244 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10245
f6973bdc
ILT
102462010-04-22 Ian Lance Taylor <iant@google.com>
10247
10248 * expression.cc (Expression::Expression_eval_info): Add
10249 result_alignment_pointer field.
10250 (Expression::eval_with_dot): Add result_alignment_pointer
10251 parameter. Change all callers.
10252 (Expression::eval_maybe_dot): Likewise.
10253 (class Binary_expression): Add alignment_pointer parameter to
10254 left_value and right_value. Change all callers.
10255 (BINARY_EXPRESSION): Set result alignment.
10256 (class Trinary_expression): Add alignment_pointer parameter to
10257 arg2_value and arg3_value. Change all callers.
10258 (Trinary_cond::value): Set result alignment.
10259 (Max_expression::value, Min_expression::value): Likewise.
10260 (Align_expression::value): Likewise.
10261 * script-sections.cc (class Sections_element): Add dot_alignment
10262 parameter to set_section_addresses virtual function. Update
10263 instantiations.
10264 (class Output_section_element): Likewise.
10265 (Script_sections::create_segments): Add dot_alignment parameter.
10266 Change all callers.
10267 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10268 (Script_sections::set_phdrs_clause_addresses): Likewise.
10269 * script-sections.h: Update declarations.
10270 * script.h: Update declarations.
10271 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10272 min_p_align.
10273 * testsuite/script_test_3.t: Set large alignment.
10274 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10275 segment has expected alignment.
10276
9c9c98a5
NC
102772010-04-22 Nick Clifton <nickc@redhat.com>
10278
10279 * po/gold.pot: Updated by the Translation project.
10280 * po/vi.po: Updated Vietnamese translation.
10281
2253bfba
L
102822010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10283
10284 * testsuite/Makefile.am (check_PROGRAMS): Add
10285 icf_virtual_function_folding_test.
10286 * testsuite/Makefile.in: Regenerated.
10287
85fdf906
AH
102882010-04-15 Andrew Haley <aph@redhat.com>
10289
10290 * options.h (merge_exidx_entries): New option.
10291 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10292 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10293 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10294 (Target_arm::merge_exidx_entries): New function.
10295 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10296 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10297 to Arm_exidx_fixup constructor.
10298 Add new arg, merge_exidx_entries.
10299 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10300 Arm_output_section::fix_exidx_coverage.
10301
ce97fa81
ST
103022010-04-18 Sriraman Tallam <tmsriram@google.com>
10303
10304 * icf.cc (get_section_contents): Check for preemptible functions.
10305 Ignore addend when appropriate.
10306 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10307 section folded.
10308 (add_from_relobj): Check for section folded.
10309 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10310 * symtab.h (should_add_dynsym_entry): Add new parameter.
10311 * target-reloc.h (scan_relocs): Check for section folded.
10312 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10313 Check reloc types for function pointers in shared objects.
10314 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10315 case.
10316 (icf_preemptible_functions_test): New test case.
10317 (icf_string_merge_test): New test case.
10318 * testsuite.Makefile.in: Regenerate.
10319 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10320 bar_glob. Refactor code.
10321 * testsuite/icf_preemptible_functions_test.cc: New file.
10322 * testsuite/icf_preemptible_functions_test.sh: New file.
10323 * testsuite/icf_string_merge_test.cc: New file.
10324 * testsuite/icf_string_merge_test.sh: New file.
10325 * testsuite/icf_virtual_function_folding_test.cc: New file.
10326 * testsuite/icf_virtual_function_folding_test.sh: New file.
10327
04ceb17c
DK
103282010-04-14 Doug Kwan <dougkwan@google.com>
10329
10330 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10331 for local symbol recounting if we remove a section due to ICF.
10332 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10333 there are no regular objects in input.
10334
153e7da4
DK
103352010-04-13 Doug Kwan <dougkwan@google.com>
10336
10337 * arm.cc (Arm_input_section::set_final_data_size): Compute
10338 accurate final data size instead of using current data size.
10339
4dbd9faf
DK
103402010-04-09 Doug Kwan <dougkwan@google.com>
10341
10342 * layout.cc (Layout::choose_output_section): Handle script section
10343 types.
10344 (Layout::make_output_section_for_script): Add section type parameter.
10345 Handle script section types.
10346 * layout.h (Layout::make_output_section_for_script): Add section
10347 type parameter.
10348 * output.cc (Output_section::Output_section): Initialize data member
10349 is_noload_.
10350 (Output_section::do_reset_address_and_file_offset): Do not set address
10351 to 0 if section is a NOLOAD section.
10352 * output.h (Output_section::is_noload): New method.
10353 (Output_section::set_is_noload): Ditto.
10354 (Output_section::is_noload_): New data member.
10355 * script-c.h (Script_section_type): New enum type.
10356 (struct Parser_output_section_header): Add new file section_type.
10357 * script-sections.cc (Sections_element::output_section_name): Add
10358 parameter for returning script section type.
10359 (Output_section_definition::output_section_name): Ditto.
10360 (Output_section_definition::section_type)P; New method.
10361 (Output_section_definiton::script_section_type_name): Ditto.
10362 (Output_section_definition::script_section_type_): New data member.
10363 (Output_section_definition::Output_section_definition): Initialize
10364 data member Output_section_definition::script_section_type_.
10365 (Output_section_definition::create_sections): Pass script section type
10366 to Layout::make_output_section_for_script.
10367 (Output_section_definition::output_section_name): Return script
10368 section type to caller.
10369 (Output_section_definition::set_section_address): Do not advance
10370 dot value and load address if section type is NOLOAD. Set address
10371 of NOLOAD sections regardless of section flags.
10372 (Output_section_definition::print): Print section type if it is
10373 not SCRIPT_SECTION_TYPE_NONE.
10374 (Output_section_definition::section_type): New method.
10375 (Output_section_definition::script_section_type_name): Ditto.
10376 (Script_sections::output_section_name): Add new parameter
10377 PSECTION_TYPE for returning script section type. Pass it to
10378 section elements. Handle discard sections.
10379 (Sort_output_sections::operator()): Handle NOLOAD sections.
10380 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10381 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10382 returning script section type.
10383 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10384 INFO and NOLOAD.
10385 * yyscript.y (union): Add new field SECTION_TYPE.
10386 (COPY, DSECT, INFO, NOLOAD): New tokens.
10387 (opt_address_and_section_type): Change type to output_section_header.
10388 (section_type): New non-terminal
10389 (section_header): Handle section type.
2253bfba 10390 (opt_address_and_section_type): Return section type value.
4dbd9faf 10391
721ea635
L
103922010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10393
10394 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10395 * testsuite/plugin_common_test_2.c (foo): Likewise.
10396
6bf924b0
DK
103972010-04-08 Doug Kwan <dougkwan@google.com>
10398
10399 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10400 Output_merge_data.
10401 * output.cc (Output_section::add_merge_input_section): Simplify
10402 code and return status of Output_merge_base::add_input_section.
e1df38aa 10403 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10404 returns true.
10405
24af6f92
DK
104062010-04-07 Doug Kwan <dougkwan@google.com>
10407
10408 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10409 if section is marked as containing instructions but has no mapping
10410 symbols.
10411 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10412 correct section index.
10413 (Arm_relobj::find_linked_text_section): Ditto.
10414
00698fc5
CC
104152010-04-07 Cary Coutant <ccoutant@google.com>
10416
10417 * archive.cc (include_member): Destroy Read_symbols_data object before
10418 releasing file.
10419 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10420 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10421 (Read_symbols_data::~Read_symbols_data) New destructor.
10422 (Section_relocs::Section_relocs) New constructor.
10423 (Section_relocs::~Section_relocs) New destructor.
10424 (Read_relocs_data::Read_relocs_data) New constructor.
10425 (Read_relocs_data::~Read_relocs_data) New destructor.
10426 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10427 pointers to NULL after deleting.
10428
7296d933
DK
104292010-04-07 Doug Kwan <dougkwan@google.com>
10430
10431 * arm.cc: Replace "endianity" with "endianness" in comments.
10432 (Arm_exidx_cantunwind): Ditto.
10433 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10434 (Arm_relobj::merge_flags_and_attributes): New method.
10435 (Arm_relobj::merge_flags_and_attributes_): New data member.
10436 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10437 (Arm_relobj::scan_sections_for_stubs): Ditto.
10438 (Arm_relobj::do_read_symbols): Check to see if we really want to
10439 merge processor-specific flags and attributes. Exit early if
10440 an object is empty except for section names and the undefined symbol.
10441 (Target_arm::do_finalize_sections): Move check for ELF format to
10442 Arm_relobj::do_read_symbols. Merge processor specific flags and
10443 attributes from a regular object only when we have determined that
10444 it is aapropriate. Do not create an .ARM.attributes section in
10445 output if there is no regular input object.
10446 (Target_arm::merge_processor_specific_flags): Check
10447 --warn-mismatch before printing any error.
10448 (Target_arm::merge_object_attributes): Ditto.
10449 * gold.cc (queue_middle_tasks): Handle the case in which there is
10450 no regular object in input.
10451 * options.cc (General_options::parse_EB): New method.
10452 (General_options::parse_EL): Same.
10453 (General_options::General_options): Initialize endianness_.
10454 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10455 New options.
10456 (General_options::Endianness): New enum.
10457 (General_options::endianness): New method.
10458 (General_options::endianness_): New data member.
10459 * parameters.cc (Parameters::set_options): Check target endianness.
10460 (Parameters::set_target_once): Ditto.
10461 (Parameters::check_target_endianness): New method.
10462 (parameters_force_valid_target): If either -EL or -EB is specified,
10463 use it to define endianness of default target.
10464 * parameters.h (Parameters::check_target_endianness): New method
10465 declaration.
10466 * target.h (class Target): Change "endianity" to "endianness"
10467 in comments.
10468
efc8d4f2
RW
104692010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10470
10471 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10472 * configure: Regenerate.
10473 * Makefile.in: Regenerate.
10474 * testsuite/Makefile.in: Regenerate.
10475
be234d88
CC
104762010-04-06 Cary Coutant <ccoutant@google.com>
10477
10478 gcc PR lto/42757
10479 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10480 prevailing definitions of common symbols.
10481 * testsuite/plugin_test_6.sh: New test case.
10482 * testsuite/plugin_common_test_1.c: New test case.
10483 * testsuite/plugin_common_test_2.c: New test case.
10484 * testsuite/Makefile.am (plugin_test_6): New test case.
10485 * testsuite/Makefile.in: Regenerate.
10486
bd32c6bd
NC
104872010-04-06 Nick Clifton <nickc@redhat.com>
10488
10489 * po/vi.po: New Vietnamese translation.
10490
323c532f
DK
104912010-03-30 Doug Kwan <dougkwan@google.com>
10492
10493 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10494
4fcd97eb
DK
104952010-03-25 Doug Kwan <dougkwan@google.com>
10496
10497 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10498 to avoid a conversion warning on a 32-bit host.
10499
4ebf39db
ILT
105002010-03-24 Ian Lance Taylor <iant@google.com>
10501
10502 * testsuite/script_test_3.t: Add a TLS segment.
10503 * testsuite/Makefile.am (check_PROGRAMS): Add
10504 tls_phdrs_script_test.
10505 (tls_phdrs_script_test_SOURCES): Define.
10506 (tls_phdrs_script_test_DEPENDENCIES): Define.
10507 (tls_phdrs_script_test_LDFLAGS): Define.
10508 (tls_phdrs_script_test_LDADD): Define.
10509 * testsuite/Makefile.in: Rebuild.
10510
4a599bdd
CC
105112010-03-23 Cary Coutant <ccoutant@google.com>
10512
10513 * fileread.cc (find_or_make_view): Fix comment.
10514
6c93b22c
ILT
105152010-03-23 Ian Lance Taylor <iant@google.com>
10516
10517 * script-sections.cc (class Orphan_section_placement): Define
10518 PLACE_TLS and PLACE_TLS_BSS.
10519 (Orphan_section_placement::Orphan_section_placement): Initialize
10520 new places.
10521 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10522 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10523 (tls_script_test_SOURCES): Define.
10524 (tls_script_test_DEPENDENCIES): Define.
10525 (tls_script_test_LDFLAGS): Define.
10526 (tls_script_test_LDADD): Define.
10527 * testsuite/Makefile.in: Rebuild.
10528
a2c7281b
DK
105292010-03-22 Doug Kwan <dougkwan@google.com>
10530
10531 * arm.cc (Arm_relocate_functions::abs8,
10532 Arm_relocate_functions::abs16): Use correct check for overflow
10533 specified in the ARM ELF specs.
10534 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10535 target of a BLX instruction specially.
10536 (Reloc_stub::stub_type_for_reloc): Ditto.
10537 (Relocate::relocate): Use symbolic names instead of numeric relocation
10538 codes to report error.
10539 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10540 workaround.
10541 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10542 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10543 thumb2_blx_out_of_range.stdout
10544 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10545 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10546 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10547 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10548 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10549 thumb2_blx_in_range, thumb2_blx_in_range.o,
10550 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10551 thumb2_blx_out_of_range.o): New rules.
2e702c99 10552 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10553 thumb2_blx_in_range and thumb2_blx_out_of_range.
10554 * testsuite/Makefile.in: Regenerate.
10555 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10556 * testsuite/thumb_blx_in_range.s: New file.
10557 * testsuite/thumb_blx_out_of_range.s: New file.
10558
b0193076
RÁE
105592010-03-22 Rafael Espindola <espindola@google.com>
10560
10561 * archive.cc (Should_include): Move to archive.h.
10562 (should_include_member): Make it a member of Archive.
10563 (Lib_group): New.
10564 (Add_lib_group_symbols): New.
10565 * archive.h: Include options.h.
10566 (Archive_member): Moved from Archive.
10567 (Should_include): Moved from archive.cc.
10568 (Lib_group): New.
10569 (Add_lib_group_symbols): New.
10570 * dynobj.cc (do_should_include_member): New.
10571 * dynobj.h (do_should_include_member): New.
10572 * gold.cc (queue_initial_tasks): Update call to queue.
10573 * main.cc (main): Print lib group stats.
10574 * object.cc (do_should_include_member): New.
10575 * object.h: Include archive.h.
10576 (Object::should_include_member): New.
10577 (Object::do_should_include_member): New.
10578 (Sized_relobj::do_should_include_member): New.
10579 * options.cc (General_options::parse_start_lib): New.
10580 (General_options::parse_end_lib): New.
10581 (Input_arguments::add_file): Handle lib groups.
10582 (Input_arguments::start_group): Check we are not in a lib.
10583 (Input_arguments::start_lib): New.
10584 (Input_arguments::end_lib): New.
10585 * options.h (General_options): Add start_lib and end_lib.
10586 (Input_argument::lib_): New.
10587 (Input_argument::lib): New.
10588 (Input_argument::is_lib): New.
10589 (Input_file_lib): New.
10590 (Input_arguments::in_lib_): New.
10591 (Input_arguments::in_lib): New.
10592 (Input_arguments::start_lib): New.
10593 (Input_arguments::end_lib_): New.
10594 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10595 in unused members as preempted.
10596 (Sized_pluginobj::do_should_include_member): New.
10597 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10598 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10599 return the blocker.
10600 (Read_symbols::do_whole_lib_group): New.
10601 (Read_symbols::do_lib_group): New.
10602 (Read_symbols::do_read_symbols): Handle lib groups.
10603 (Read_symbols::get_name): Handle lib groups.
10604 * readsyms.h (Read_symbols): Add an archive member pointer.
10605 (Read_symbols::do_whole_lib_group): New.
10606 (Read_symbols::do_lib_group): New.
10607 (Read_symbols::member_): New.
10608 * script.cc (read_input_script): Update call to queue_soon.
10609
d099120c
DK
106102010-03-19 Doug Kwan <dougkwan@google.com>
10611
10612 * arm.cc (Stub_table::Stub_table): Initialize new data members
10613 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10614 (Stub_table::add_reloc_stub): Assign stub offset and update
10615 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10616 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10617 New data members.
2e702c99 10618 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10619 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10620 instead of going over all reloc stubs.
2e702c99 10621 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10622 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10623 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10624 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10625 Stringpool_template::offset_.
10626 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10627 Stringpool_template::offset_ to zero.
10628
1aa37384
DK
106292010-03-15 Doug Kwan <dougkwan@google.com>
10630
10631 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10632 offset_.
10633 (Stringpool_template::new_key_offset): New method.
10634 (Stringpool_template::add_string): Assign offsets when adding new
10635 strings.
10636 (Stringpool_template::set_string_offsets): Do not set string offsets
10637 when not optimizing.
10638 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10639 member size_.
2e702c99
RM
10640 (Chunked_vector::clear): Clear size_.
10641 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10642 (Chunked_vector::size): Return size_.
10643 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10644 (Chunked_vector::size_): New data member.
1aa37384
DK
10645 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10646 (Stringpool_template::new_key_offset): New method declaration.
10647 (Stringpool_template::offset_): New data member.
10648
b672b057
RÁE
106492010-03-15 Rafael Espindola <espindola@google.com>
10650
10651 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10652 Add_symbols' constructor.
10653 * readsyms.h (Add_symbols): Remove the input_group member.
10654
b6848d3c
ILT
106552010-03-10 Ian Lance Taylor <iant@google.com>
10656
10657 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10658 target to ask whether a reference to a symbol requires a stack
10659 split.
10660 * target.h (Target::is_call_to_non_split): New function.
10661 (Target::do_is_call_to_non_split): Declare virtual function.
10662 * target.cc: Include "symtab.h".
10663 (Target::do_is_call_to_non_split): New function.
10664 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10665
a2a5469e
CC
106662010-03-10 Cary Coutant <ccoutant@google.com>
10667
10668 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10669 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10670 (File_read::open[2]): Add whole_file_view_ to list of views.
10671 (File_read::make_view): Remove test of whole_file_view_.
10672 (File_read::find_or_make_view): Create whole_file_view_ if
10673 necessary.
10674 (File_read::clear_views): Replace bool parameter with enum;
10675 adjust all callers. Don't delete views with permanent data;
10676 do delete cached views and views from archives if
10677 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10678 if clearing the corresponding view.
10679 * fileread.h (File_read::Clear_views_mode): New enum.
10680 (File_read::View::is_permanent_view): New method.
10681 (File_read::clear_views): Replace bool parameter
10682 with enum; adjust all callers.
10683 * options.h (General_options): Change keep_files_mapped option;
10684 add map_whole_files.
10685 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10686 releasing the file.
10687 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10688 the file.
10689
8861f32b
DM
106902010-03-10 David S. Miller <davem@davemloft.net>
10691
10692 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10693
d62d0f5f
ST
106942010-03-09 Sriraman Tallam <tmsriram@google.com>
10695
10696 * icf.cc (get_section_contents): Add '@' marker after processing the
10697 merge reloc.
10698
9177756d
DK
106992010-03-08 Doug Kwan <dougkwan@google.com>
10700
10701 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10702 due to a conversion warning.
10703 (Arm_relobj::update_output_local_symbol_count): Check for local
10704 symbol with unset output index.
10705
9e9e071b
ILT
107062010-03-05 Ian Lance Taylor <iant@google.com>
10707
10708 * options.h (class General_options): Add --spare-dynamic-tags.
10709 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10710 --spare-dynamic-tags.
10711
a81ee015
ILT
107122010-03-05 Ian Lance Taylor <iant@google.com>
10713
10714 * incremental.cc: Include "libiberty.h".
10715
44ec90b9
RO
107162010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10717
10718 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10719 function, is_info_ member.
10720 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10721 (Versions::Versions): Update caller.
10722 (Versions::define_base_version): Likewise.
10723 (Versions::add_def): Likewise.
10724
0897ed3b
ST
107252010-03-03 Sriraman Tallam <tmsriram@google.com>
10726
10727 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10728 (Scan::possible_function_pointer_reloc): New function.
10729 (Scan::local_reloc_may_be_function_pointer): Change to call
10730 possible_function_pointer_reloc.
10731 (Scan::global_reloc_may_be_function_pointer): Ditto.
10732 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10733 relocations in ".data.rel.ro._ZTV" section.
10734 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10735 * testsuite/icf_safe_so_test.cc: Ditto.
10736 * testsuite/icf_safe_test.cc: Ditto.
10737 * testsuite/icf_safe_test.sh: Ditto.
10738
d3bbad62
ILT
107392010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10740 Ian Lance Taylor <iant@google.com>
10741
10742 * target-reloc.h (relocate_section): Check the symbol table index
10743 for -1U before setting the local symbol index.
10744 (scan_relocatable_relocs): If copying the relocation, record that
10745 the local symbol is required.
10746 * object.h (Symbol_value::is_output_symtab_index_set): New
10747 function.
10748 (Symbol_value::may_be_discarded_from_output_symtab): New
10749 function.
10750 (Symbol_value::has_output_symtab_entry): New function.
10751 (Symbol_value::needs_output_symtab_entry): Remove.
10752 (Symbol_value::output_symtab_index): Make sure the symbol index is
10753 set.
10754 (Symbol_value::set_output_symtab_index): Make sure the symbol
10755 index is not set. Make sure the new index is valid.
10756 (Symbol_value::set_must_have_output_symtab_entry): New function.
10757 (Symbol_value::has_output_dynsym_entry): New function.
10758 (Symbol_value::set_output_dynsym_index): Make sure the new index
10759 is valid.
10760 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10761 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10762 local symbol if permitted.
10763 (Sized_relobj::do_finalize_local_symbols): Call
10764 is_output_symtab_index_set rather than needs_output_symtab_entry.
10765 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10766 rather than needs_output_symtab_entry. Call
10767 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10768 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10769 is_output_symtab_index_set rather than needs_output_symtab_entry.
10770 * testsuite/discard_locals_relocatable_test.c: New file.
10771 * testsuite/discard_locals_test.sh: Test -r.
10772 * testsuite/Makefile.am (check_DATA): Add
10773 discard_locals_relocatable_test1.syms,
10774 discard_local_relocatable_test2.syms.
10775 (MOSTLYCLEANFILES): Likewise. Also add
10776 discard_locals_relocatable_test1.lout and
10777 discard_locals_relocatable_test2.out.
10778 (discard_locals_relocatable_test1.syms): New target.
10779 (discard_locals_relocatable_test.o): New target.
10780 (discard_locals_relocatable_test1.out): New target.
10781 (discard_locals_relocatable_test2.syms): New target.
10782 (discard_locals_relocatable_test2.out): New target.
10783 (various): Add missing ../ld-new dependencies.
10784 * testsuite/Makefile.in: Rebuild.
10785
7e8ccf26
NC
107862010-03-03 Nick Clifton <nickc@redhat.com>
10787
10788 * po/fi.po: New Finnish translation.
10789
2a0ff005
DK
107902010-03-01 Doug Kwan <dougkwan@google.com>
10791
10792 * layout.cc (Layout::Layout): Force section types of .init_array*,
10793 .preinit_array* and .fini_array* sections.
10794 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10795 Fix check of return value of std::string::find.().
10796 (Output_section::Input_section_sort_compare::operator()): Remove
10797 comment about .init_array.
10798 (Output_section::Input_section_sort_init_fini_compare::operator()):
10799 New method.
10800 (Output_section::sort_attached_input_sections): Handle .init_array
10801 and .fini_array specially.
10802 * output.h (Output_section::Inut_section_sort_compare): Update
10803 comment.
10804 (Output_section::Input_section_sort_init_fini_compare): New struct.
10805
c3e4ae29
DK
108062010-02-26 Doug Kwan <dougkwan@google.com>
10807
10808 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10809 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10810 * testsuite/debug_msg.sh: Avoid matching source line number for
10811 use of global variable undef_int.
10812
2fd9ae7a
DK
108132010-02-26 Doug Kwan <dougkwan@google.com>
10814
10815 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10816 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10817 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10818 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10819 * options.cc (General_options::General_options): Initialize member
10820 fix_v4bx_.
10821 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10822 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10823 and rm_no_fix_v4bx.stdout
10824 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10825 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10826 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10827 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10828 and arm_no_fix_v4bx.
10829 * Makefile.in: Regenerate.
10830 * testsuite/arm_fix_v4bx.s: New file.
10831 * testsuite/arm_fix_v4bx.sh: Ditto.
10832
67ec7d0b
DK
108332010-02-24 Doug Kwan <dougkwan@google.com>
10834
10835 * arm.cc (Target_arm::got_section): Make the .got section the first
10836 non RELRO section in the data segment.
10837 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10838 suffixes of section names.
10839
10165461
DK
108402010-02-24 Doug Kwan <dougkwan@google.com>
10841
10842 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10843 flags and attributes merging if an input file is a binary file.
10844 * fileread.cc (Input_file::open): Record format of original file.
10845 * fileread.h (Input_file::Format): New enum type.
2e702c99 10846 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10847 (Input_file::format): New method definition.
10848 (Input_file::format_):: New data member.
10849
4a54abbb
DK
108502010-02-24 Doug Kwan <dougkwan@google.com>
10851
10852 * arm.cc (Arm_output_data_got): New class.
10853 (ARM_TCB_SIZE): New constant
10854 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10855 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10856 If user uses a script with a SECTIONS clause, issue only a warning
10857 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10858 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10859 garbage collection.
10860 (Target_arm::got_mode_index_entry): Handle static linking.
10861 (Target_arm::Scan::local): Ditto.
10862 (Target_arm::Scan::global): Ditto.
10863 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10864 all incorrectly implemented relocations.
e1df38aa 10865 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10866 Arm_output_section::fix_exidx_coverage.
10867 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10868 from ".ARM.exidx." and ".ARM.extab.".
10869
ca419a6f
ILT
108702010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10871
10872 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10873 section if it does not already exist.
10874 * attributes.cc (Attributes_section_data::Attributes_section_data):
10875 Don't crash if size is zero.
10876
135b9c78
ILT
108772010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10878 Ian Lance Taylor <iant@google.com>
10879
10880 * gold.cc (queue_middle_tasks): If no input files were opened,
10881 exit.
10882 * workqueue.h (Task_function::Task_function): Assert that there is
10883 a blocker.
10884
bb0bfe4f
DK
108852010-02-22 Doug Kwan <dougkwan@google.com>
10886
10887 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10888 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10889 types to avoid warnings due to different uint64_t implementations
10890 on different hosts.
10891
2a2b6d42
DK
108922010-02-21 Doug Kwan <dougkwan@google.com>
10893
10894 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10895 handling of the maximum backward branch offset.
2e702c99 10896 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10897 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10898 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10899 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10900 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10901 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10902 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10903 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10904 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10905 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10906 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10907 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10908 thumb2_bl_out_of_range.o): New rules.
10909 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10910 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10911 thumb2_bl_out_of_range
10912 * testsuite/Makefile.in: Regenerate.
10913 * testsuite/arm_bl_in_range.s: New file.
10914 * testsuite/arm_bl_out_of_range.s: Ditto.
10915 * testsuite/arm_branch_in_range.sh: Ditto.
10916 * testsuite/arm_branch_range.t: Ditto.
10917 * testsuite/thumb2_branch_range.t: Ditto.
10918 * testsuite/thumb_bl_in_range.s: Ditto.
10919 * testsuite/thumb_bl_out_of_range.s: Ditto.
10920 * testsuite/thumb_branch_range.t: Ditto.
10921
b487ad64
ST
109222010-02-20 Sriraman Tallam <tmsriram@google.com>
10923
10924 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10925 Add reloc offset information.
10926 * icf.cc (get_section_contents): Change iterators to point to the new
10927 vectors. Add reloc offset information to the contents.
10928 * icf.h (Icf::Sections_reachable_info): New typedef.
10929 (Icf::Sections_reachable_list): New typedef.
10930 (Icf::Offset_info): New typedef.
10931 (Icf::Reloc_info): New struct typedef.
10932 (Icf::Reloc_info_list): New typedef.
10933 (Icf::symbol_reloc_list): Delete method.
10934 (Icf::addend_reloc_list): Delete method.
10935 (Icf::section_reloc_list): Delete method.
10936 (Icf::reloc_info_list): New method.
10937 (Icf::reloc_info_list_): New member.
10938
f96accdf
DK
109392010-02-19 Doug Kwan <dougkwan@google.com>
10940
10941 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10942 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10943 * arm.cc (Arm_relocation_functions): New forward declaration.
10944 (Target_arm::Target_arm): Initialize new data members
10945 got_mod_index_offset_ and tls_base_symbol_defined_.
10946 (Target_arm::Relocate::relocate_tls): New method.
10947 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10948 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10949 New methods.
2e702c99 10950 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10951 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10952 (Target_arm::got_mod_index_offset_,
10953 Target_arm::tls_base_symbol_defined_): New data members.
10954 (Target_arm::Scan::local, Target::Scan::global,
10955 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10956 relocations.
10957
c8761b9a
DK
109582010-02-18 Doug Kwan <dougkwan@google.com>
10959
10960 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10961 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10962 text section as a parameter becuase some broken tools may not set
10963 the link in section header.
10964 (Target_arm::has_got_section): New method.
10965 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10966 without any mapping symbol as data only. Remove warning.
10967 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10968 link in its section header, try to discover the link by inspecting the
10969 REL31 relocation at the beginning of the section.
10970 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10971 in error message.
10972 (Target_arm::Scan::global): Treat any reference to the symbol
10973 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10974
21bb3914
ST
109752010-02-12 Sriraman Tallam <tmsriram@google.com>
10976
10977 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10978 (Scan::global_reloc_may_be_function_pointer): New function.
10979 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10980 (Scan::global_reloc_may_be_function_pointer): New function.
10981 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10982 (Scan::global_reloc_may_be_function_pointer): New function.
10983 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10984 (Scan::global_reloc_may_be_function_pointer): New function.
10985 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10986 (Scan::global_reloc_may_be_function_pointer): New function.
10987 (Scan::possible_function_pointer_reloc): New function.
10988 (Target_x86_64::can_check_for_function_pointers): New function.
10989 * gc.h (gc_process_relocs): Scan relocation types to determine if
10990 function pointers were taken for targets that support it.
10991 * icf.cc (Icf::find_identical_sections): Include functions for
10992 folding in safe ICF whose pointer is not taken.
10993 * icf.h (Secn_fptr_taken_set): New typedef.
10994 (fptr_section_id_): New member.
10995 (section_has_function_pointers): New function.
10996 (set_section_has_function_pointers): New function.
10997 (check_section_for_function_pointers): New function.
10998 * options.h: Fix comment for safe ICF option.
10999 * target.h (can_check_for_function_pointers): New function.
11000 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11001 Modify icf_safe_test for X86-64.
11002 * testsuite/Makefile.in: Regenerate.
11003 * testsuite/icf_safe_so_test.cc: New file.
11004 * testsuite/icf_safe_so_test.sh: New file.
11005 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11006 (main): Change to take pointer to function kept_func_3.
11007 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11008 folding is done correctly for X86-64.
11009
0da6fa6c
DM
110102010-02-12 David S. Miller <davem@davemloft.net>
11011
11012 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11013 is_symbolless parameter.
11014 (Output_reloc<SHT_REL>::is_symbolless): New.
11015 (Output_reloc<SHT_REL>::is_symbolless_): New.
11016 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11017 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11018 (Output_reloc<SHT_RELA>::is_symbolless): New.
11019 (Output_data_reloc::add_global): Handle is_symbolless.
11020 (Output_data_reloc::add_global_relative): Likewise.
11021 (Output_data_reloc::add_local): Likewise.
11022 (Output_data_reloc::add_local_relative): Likewise.
11023 (Output_data_reloc::add_symbolless_global_addend): New.
11024 (Output_data_reloc::add_symbolless_local_addend): New.
11025 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11026 is_symbolless.
11027 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11028 instead of ->is_relative_
11029 (Output_reloc::write): Likewise.
11030 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11031 (Output_reloc::write_rel): Simplify.
11032
11033 * sparc.cc (Target_sparc::Scan::local): Use
11034 ->add_symbolless_local_addend as needed.
11035 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11036 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11037 based upon relocation offset.
11038
e4782e83
DK
110392010-02-11 Doug Kwan <dougkwan@google.com>
11040
11041 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11042 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11043 beginning of function.
11044 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11045 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11046 parameter is_32bit in calls to should_apply_static_reloc.
11047 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11048 (check_DATA): Add arm_abs_global.stdout.
11049 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11050 arm_abs_global.stdout): New rules.
11051 (MOSTLLYCLEANFILES): Add arm_abs_global
11052 * Makefile.in: Regenerate.
11053 * testsuite/arm_abs_global.s: New file.
11054 * testsuite/arm_abs_global.sh: Ditto.
11055 * testsuite/arm_abs_lib.s: Ditto.
11056
93ceb764
ILT
110572010-02-11 Ian Lance Taylor <iant@google.com>
11058
11059 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11060 Read_relocs task.
11061 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11062 Allocate_commons_task first.
11063 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11064 task, rather than symtab_lock_.
11065 (Gc_process_relocs::~Gc_process_relocs): New function.
11066 (Gc_process_relocs::is_runnable): Check this_blocker_.
11067 (Gc_process_relocs::locks): Use next_blocker_ rather than
11068 blocker_.
11069 (Scan_relocs::~Scan_relocs): New function.
11070 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11071 symtab_lock_.
11072 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11073 next_blocker_.
11074 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11075 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11076 constructor accordingly.
11077 (class Gc_process_relocs): Likewise.
11078 (class Scan_relocs): Likewise.
11079 * common.h (class Allocate_commons_task): Remove symtab_lock_
11080 field, and corresponding constructor parameter.
11081 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11082 symtab_lock_.
11083 (Allocate_commons_task::locks): Likewise.
11084
114dfbe1
ILT
110852010-02-11 Ian Lance Taylor <iant@google.com>
11086
11087 * gold-threads.h (class Once): Define.
11088 (class Initialize_lock): Rewrite as child of Once.
11089 * gold-threads.cc (class Once_initialize): Define.
11090 (once_pointer_control): New static variable.
11091 (once_pointer, once_arg): New static variables.
11092 (c_run_once): New static function.
11093 (Once::Once, Once::run_once, Once::internal_run): New functions.
11094 (class Initialize_lock_once): Remove.
11095 (initialize_lock_control): Remove.
11096 (initialize_lock_pointer): Remove.
11097 (initialize_lock_once): Remove.
11098 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11099 (Initialize_lock::initialize): Rewrite.
11100 (Initialize_lock::do_run_once): New function.
11101 * archive.cc (Archive::interpret_header): Only clear name if it is
11102 not already empty.
11103 * fileread.cc: Include "gold-threads.h"
11104 (file_counts_lock): New static variable.
11105 (file_counts_initialize_lock): Likewise.
11106 (File_read::release): Only increment counts when using --stats.
11107 Use a lock around the increment.
11108 * parameters.cc (class Set_parameters_target_once): Define.
11109 (set_parameters_target_once): New static variable.
11110 (Parameters::Parameters): Move here from parameters.h.
11111 (Parameters::set_target): Rewrite.
11112 (Parameters::set_target_once): New function.
11113 (Parameters::clear_target): Move here and rewrite.
11114 * parameters.h (class Parameters): Update declarations. Add
11115 set_parameters_target_once_ field.
11116 (Parameters::Parameters): Move to parameters.cc.
11117 (Parameters::clear_target): Likewise.
11118 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11119 task.
11120 (Start_group::~Start_group): New function.
11121 (Start_group::is_runnable): New function.
11122 (Start_group::locks, Start_group::run): New functions.
11123 (Finish_group::run): Change saw_undefined to size_t.
11124 * readsyms.h (class Start_group): Define.
11125 (class Finish_group): Change saw_undefined_ field to size_t.
11126 (Finish_group::Finish_group): Remove saw_undefined and
11127 this_blocker parameters. Change all callers.
11128 (Finish_group::set_saw_undefined): New function.
11129 (Finish_group::set_blocker): New function.
11130 * symtab.h (class Symbol_table): Change saw_undefined to return
11131 size_t. Change saw_undefined_ field to size_t.
11132 * target-select.cc (Set_target_once::do_run_once): New function.
11133 (Target_selector::Target_selector): Initialize set_target_once_
11134 field. Don't initialize lock_ and initialize_lock_ fields.
11135 (Target_selector::instantiate_target): Rewrite.
11136 (Target_selector::set_target): New function.
11137 * target-select.h (class Set_target_once): Define.
11138 (class Target_selector): Update declarations. Make
11139 Set_target_once a friend. Remove lock_ and initialize_lock_
11140 fields. Add set_target_once_ field.
11141
fa17a3f4
ILT
111422010-02-10 Ian Lance Taylor <iant@google.com>
11143
11144 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11145 queueing any tasks.
11146 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11147 (queue_middle_tasks): Add all blockers before queueing any tasks.
11148 (queue_final_tasks): Likewise.
11149 * token.h (Task_token::add_blockers): New function.
11150 * object.h (Input_objects::number_of_relobjs): New function.
11151
c7177d31
ILT
111522010-02-10 Ian Lance Taylor <iant@google.com>
11153
5de0e392
ILT
11154 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11155 shared, not if not position independent.
11156 * x86_64.cc (Relocate::relocate_tls): Likewise.
11157 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11158 (tls_pie_pic_test): New target.
11159 * testsuite/Makefile.in: Rebuild.
11160
c7177d31
ILT
11161 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11162 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11163 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11164 * testsuite/Makefile.in: Rebuild.
11165
684b268a
DM
111662010-02-09 David S. Miller <davem@davemloft.net>
11167
11168 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11169 R_SPARC_RELATIVE using ->add_local_relative().
11170 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11171
612a8d3d
DM
11172 * output.h (Output_data_dynamic::add_section_size): New method
11173 that takes two Output_data objects.
11174 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11175 entry param. Handle it in initializers.
11176 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11177 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11178 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11179 arg.
11180 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11181 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11182 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11183 for dynrel_includes_plt.
11184 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11185 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11186 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11187 before .rela.plt
11188 (Target_sparc::do_finalize_sections): Update to pass true for
11189 dynrel_includes_plt.
11190 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11191 output before .rela.plt
11192 (Target_powerpc::do_finalize_sections): Update to pass true for
11193 dynrel_includes_plt when 32-bit.
11194
cb1be87e
DK
111952010-02-08 Doug Kwan <dougkwan@google.com>
11196
11197 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11198 method.
11199 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11200 Arm_relobj::scan_section_for_cortex_a8_stubs,
11201 Arm_relobj::do_relocation_section): Instead of calling
11202 Output_section::output_address, use faster
11203 Arm_relobj::simple_input_section_output_address.
11204
705b5121
DM
112052010-02-08 David S. Miller <davem@davemloft.net>
11206
11207 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11208 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11209 relocation helper function.
11210
024c4466
DM
11211 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11212 just like R_SPARC_GOT{10,13,22}.
11213 (Target_sparc::Scan::local): Likewise.
11214 (Target_sparc::Relocate:relocate): Likewise.
11215
9109c078
ILT
112162010-02-06 Ian Lance Taylor <iant@google.com>
11217
11218 * configure.ac: Rewrite targetobjs duplicate removal code to use
11219 only shell constructs.
11220 * configure: Rebuild.
11221
cf846138
DK
112222010-02-05 Doug Kwan <dougkwan@google.com>
11223
11224 PR 11247
11225 * arm.cc (Arm_relobj::section_is_scannable): New method.
11226 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11227 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11228
6cfaf60b
DK
112292010-02-04 Doug Kwan <dougkwan@google.com>
11230
11231 PR 11247
11232 * arm-reloc-property.cc (cstdio): Include.
11233 * configure.ac (targetobjs): Remove duplicates.
11234 * configure: Regenerate.
11235 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11236 big and little endian version for a given address size.
11237
5c57f1be
DK
112382010-02-03 Doug Kwan <dougkwan@google.com>
11239
11240 * arm-reloc-property.cc
11241 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11242 definition.
11243 * arm-reloc-property.h
11244 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11245 New method definition.
11246 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11247 declaration.
11248 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11249 overflow to N.
11250 (GOT_PREL): Change implemented to Y.
11251 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11252 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11253 (Arm_relocate_functions::movw_abs_nc): Remove method.
11254 (Arm_relocate_functions::movt_abs): Ditto.
11255 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11256 (Arm_relocate_functions::thm_movt_abs): Ditto.
11257 (Arm_relocate_functions::movw_rel_nc): Ditto.
11258 (Arm_relocate_functions::movw_rel): Ditto.
11259 (Arm_relocate_functions::movt_rel): Ditto.
11260 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11261 (Arm_relocate_functions:thm_movw_rel): Ditto.
11262 (Arm_relocate_functions:thm_movt_rel): Ditto.
11263 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11264 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11265 New method definitions.
11266 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11267 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11268 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11269 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11270 (Target_arm::Relocate::relocate): Check for non-static or
11271 unimplemented relocation code and exit early. Change calls to
11272 Target_arm::reloc_uses_thumb_bit and
11273 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11274 instead. Refactor code to handle similar relocations to increase
11275 code sharing. Remove check for unsupported relocation code in switch
11276 statement.
11277 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11278 relocation property table to find out size. Change error message to
11279 print out the name of a relocation code instead of the numeric value.
11280 (Target_arm::scan_reloc_for_stub): Use relocation property table
11281 instead of calling Target_arm::reloc_uses_thumb_bit().
11282
218c5831
DK
112832010-02-02 Doug Kwan <dougkwan@google.com>
11284
11285 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11286 types of relaxed input section.
11287
0d31c79d
DK
112882010-02-02 Doug Kwan <dougkwan@google.com>
11289
11290 * Makefile.am (HFILES): Add arm-reloc-property.h.
11291 (DEFFILES): New.
2e702c99
RM
11292 (TARGETSOURCES): Add arm-reloc-property.cc
11293 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11294 (libgold_a_SOURCES): $(DEFFILES)
11295 * Makefile.in: Regenerate.
11296 * arm-reloc-property.cc: New file.
11297 * arm-reloc-property.h: New file.
11298 * arm-reloc.def: New file.
11299 * arm.cc: Update comments.
11300 (arm-reloc-property.h): New included header.
11301 (arm_reloc_property_table): New global variable.
11302 (Target_arm::do_select_as_default_target): New method definition.
11303 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11304 arm-reloc-property to targ_extra_obj.
11305 * parameters.cc (set_parameters_target): Call
11306 Target::select_as_default_target().
11307 * target.h (Target::select_as_default_target): New method definition.
11308 (Target::do_select_as_default_target): Same.
11309
546c7457
DK
113102010-02-01 Doug Kwan <dougkwan@google.com>
11311
11312 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11313 first_output_text_section_.
11314 (Arm_exidx_fixup::first_output_text_section): New method definition.
11315 (Arm_exidx_fixup::first_output_text_section_): New data member.
11316 (Arm_exidx_fixup::process_exidx_section): Record the first text
11317 output section seen.
11318 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11319 and entsize in output section header.
11320
11b861d5
DK
113212010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11322
11323 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11324 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11325 (Arm_relocate_functions::thm_alu11): New Method.
11326 (Arm_relocate_functions::thm_pc8): New Method.
11327 (Arm_relocate_functions::thm_pc12): New Method.
11328 (Target_arm::Scan::local): Handle the relocations.
11329 (Target_arm::Scan::global): Likewise.
11330 (Target_arm::Relocate::relocate): Likewise.
11331 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11332
c9a2c125
DK
113332010-01-29 Doug Kwan <dougkwan@google.com>
11334
11335 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11336 of relocation types as ld.
11337
1521477a
DK
113382010-01-29 Doug Kwan <dougkwan@google.com>
11339
11340 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11341 to public.
11342 (Arm_relocate_functions::thumb_branch_common): Ditto.
11343 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11344 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11345 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11346 Arm_relocate_functions::jump24): Remove.
11347 (Target_arm::Relocate::relocate): Adjust code to call
11348 Arm_relocation_functions::arm_branch_common and
11349 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11350 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11351
e7eca48c
DK
113522010-01-29 Doug Kwan <dougkwan@google.com>
11353
11354 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11355 output_local_symbol_count_needs_update_.
11356 (Arm_relobj::output_local_symbol_count_needs_update,
11357 Arm_relobj::set_output_local_symbol_count_needs_update,
11358 Arm_relobj::update_output_local_symbol_count): New methods.
11359 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11360 member.
11361 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11362 of pointed function as in a R_ARM_PREL31 relocation.
11363 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11364 for output local symbol count updating.
11365 (Target_arm::do_relax): Update output local symbol counts in objects
11366 if necessary.
11367 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11368
02961d7e
ILT
113692010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11370
11371 * arm.cc: Added support for the ARM relocations:
11372 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11373 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11374 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11375 movw_prel_nc).
11376 (Arm_relocate_functions::movw_rel): New method.
11377 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11378 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11379 thm_movw_prel_nc).
11380 (Arm_relocate_functions::thm_movw_rel): New method.
11381 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11382 thm_movt_prel).
11383 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11384 relocations.
11385 (Target_arm::Scan::global): Likewise.
11386 (Target_arm::Relocate::relocate): Likewise.
11387 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11388 Likewise.
11389
b10d2873
ILT
113902010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11391
11392 * arm.cc: Added support for ARM group relocations.
11393 (Target_arm::reloc_needs_sym_origin): New method.
11394 (Arm_relocate_functions::calc_grp_kn): New method.
11395 (Arm_relocate_functions::calc_grp_residual): New method.
11396 (Arm_relocate_functions::calc_grp_gn): New method.
11397 (Arm_relocate_functions::arm_grp_alu): New Method.
11398 (Arm_relocate_functions::arm_grp_ldr): New Method.
11399 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11400 (Arm_relocate_functions::arm_grp_ldc): New Method.
11401 (Target_arm::Scan::local): Handle the ARM group relocations.
11402 (Target_arm::Scan::global): Likewise.
11403 (Target_arm::Relocate::relocate): Likewise.
11404 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11405 Likewise.
11406
2b328d4e
DK
114072010-01-26 Doug Kwan <dougkwan@google.com>
11408
11409 * arm.cc (set): Include.
11410 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11411 pointer type.
2e702c99 11412 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11413 (Arm_output_section::append_text_sections_to_list): New method.
11414 (Arm_output_section::fix_exidx_coverage): Ditto.
11415 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11416 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11417 Relobj::set_section_offset() instead of
11418 Sized_relobj::invalidate_section_offset().
2e702c99 11419 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11420 parameter for section headers. Ignore relocation sections for
11421 unallocated sections and EXIDX sections.
11422 (Target_arm::fix_exidx_coverage): New method.
11423 (Target_arm::output_section_address_less_than): New type.
11424 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11425 linked text section instead of the EXIDX section.
11426 (Arm_output_section::create_stub_group): Add an assertion to check
11427 that this is not an EXIDX output section.
11428 (Arm_output_section::append_text_sections_to_list): New method.
11429 (Arm_output_section::fix_exidx_coverage): Ditto.
11430 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11431 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11432 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11433 first pass.
11434 (Target_arm::fix_exidx_coverage): New method.
11435 * object.h (Relobj::set_output_section): New method.
11436 (Sized_relobj::invalidate_section_offset): Remove method.
11437 (Sized_relobj::do_invalidate_section_offset): Remove method.
11438 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11439
c7f3c371
DK
114402010-01-25 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11443 Fix warning due to signed and unsigned comparison on a 32-bit host.
11444
8923b24c
DK
114452010-01-22 Doug Kwan <dougkwan@google.com>
11446
11447 * arm.cc (Target_arm::do_relax): Record an output section for section
11448 offset adjustment it contains any stub table that has changed.
11449 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11450 offsets in an output section if necessary.
11451 * output.cc (Output_section::Output_section): Initialize
11452 section_offsets_need_adjustments_.
11453 (Output_section::add_input_section_for_script): Renamed to
11454 Output_section::add_simple_input_section.
11455 (Output_section::save_states): Add a comment.
11456 (Output_section::discard_states): New method defintion.
11457 (Output_section::adjust_section_offsets): Same.
11458 * output.h (Output_section::add_input_section_for_script): Renamed to
11459 Output_section::add_simple_input_section.
11460 (Output_section::discard_states): New method declaration.
11461 (Output_section::adjust_section_offsets): Same.
11462 (Output_section::section_offsets_need_adjustment,
11463 Output_section::set_section_offsets_need_adjustment): New method
11464 definitions.
11465 (Output_section::section_offsets_need_adjustment_): New data member.
11466 * script-sections.cc
11467 (Output_section_element_input::set_section_address): Adjust code for
11468 renaming of Output_section::add_input_section_for_script.
11469 (Orphan_output_section::set_section_address): Same.
11470
9b2fd367
DK
114712010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11472
11473 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11474 Fix_v4bx enum values .
11475 * gold/options.h (General_options): New option definitions.
11476 (General_options::fix_v4bx): New method.
11477 (General_options::Fix_v4bx): New enum.
11478 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11479 (General_options::parse_fix_v4bx_interworking): New method.
11480
80d0d023
DK
114812010-01-22 Doug Kwan <dougkwan@google.com>
11482
11483 * arm.cc (Arm_exidx_fixup): New class.
11484
af2cdeae
DK
114852010-01-21 Doug Kwan <dougkwan@google.com>
11486
11487 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11488 classes.
11489 (Arm_exidx_section_offset_map): New type.
11490
993d07c1
DK
114912010-01-21 Doug Kwan <dougkwan@google.com>
11492
11493 * arm.cc (Arm_exidx_input_section): New class.
11494 (Arm_relobj::exidx_input_section_by_link,
11495 Arm_relobj::exidx_input_section_by_shndx,
11496 Arm_relobj::make_exidx_input_section): New methods.
11497 (read_arm_attributes_section): Remove.
11498 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11499 information about them.
11500 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11501 to here.
11502
5ac169d4
DK
115032010-01-20 Doug Kwan <dougkwan@google.com>
11504
11505 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11506 Input_section_specifier to Section_id.
11507 (Target_arm::new_arm_input_section: Adjust code for change of key
11508 type.
11509 (Target_arm::find_arm_input_section): Ditto.
11510 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11511 (Section_id): Remove.
11512 (Garbage_collection::Section_id_hash): Remove.
11513 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11514 (Section_id): Remove.
11515 (Icf::Section_id_hash): Remove.
11516 * object.h (Section_id, Const_section_id, Section_id_hash,
11517 Const_section_id_hash): New type definitions.
11518 * output.cc (Output_section::add_relaxed_input_section): Change to
11519 use Const_section_id instead of Input_section_specifier as key type.
11520 (Output_section::add_merge_input_section): Ditto.
11521 (Output_section::build_relaxation_map): Change to use Section_id
11522 instead of Input_section_specifier as key type.
2e702c99 11523 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11524 Ditto.
11525 (Output_section::convert_input_sections_to_relaxed_sections): Change
11526 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11527 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11528 (Output_section::find_relaxed_input_section): Ditto.
11529 * output.h (Input_section_specifier): Remove class.
11530 (Output_section::Output_section_data_by_input_section_map): Change
11531 key type to Const_section_id.
11532 (Output_section::Output_relaxed_input_section_by_input_section_map):
11533 Ditto.
11534 (Output_section::Relaxation_map): Change key type to Section_id.
11535
a2162063
ILT
115362010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11537
11538 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11539 (class Arm_v4bx_stub): New class.
11540 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11541 (Stub_factory::make_arm_v4bx_stub): New method.
11542 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11543 (Stub_table::empty): Handle v4bx stubs.
11544 (Stub_table::add_arm_v4bx_stub): New method.
11545 (Stub_table::find_arm_v4bx_stub): New method.
11546 (Arm_relocate_functions::v4bx): New method.
11547 (Target_arm::fix_v4bx): New method.
11548 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11549 (Stub_table::relocate_stubs): Likewise.
11550 (Stub_table::do_write): Likewise.
11551 (Stub_table::update_data_size_and_addralign): Likewise.
11552 (Stub_table::finalize_stubs): Likewise.
11553 (Target_arm::Scan::local): Likewise.
11554 (Target_arm::Scan::global): Likewise.
11555 (Target_arm::do_finalize_sections): Likewise.
11556 (Target_arm::Relocate::relocate): Likewise.
11557 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11558 Likewise.
11559 (Target_arm::scan_reloc_for_stub): Likewise.
11560 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11561
5696ab0b
ILT
115622010-01-19 Ian Lance Taylor <iant@google.com>
11563
11564 * output.cc (Output_section_headers::do_sized_write): Write large
11565 segment count to sh_info field.
11566 (Output_file_header::do_sized_write): For large segment count,
11567 write PN_XNUM to e_phnum field.
11568
800d0f56
ILT
115692010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11570
11571 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11572 (Arm_relocate_functions::thm_jump8): New function.
11573 (Arm_relocate_functions::thm_jump11): New function.
11574 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11575 R_ARM_THM_JUMP11.
11576 (Target_arm::Scan::global): Likewise.
11577 (Target_arm::Relocate::relocate): Likewise.
11578 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11579 Likewise.
11580
41263c05
DK
115812010-01-14 Doug Kwan <dougkwan@google.com>
11582
11583 * arm.cc (map, utility): Include headers.
11584 (Target_arm::apply_cortex_a8_workaround): New method.
11585 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11586 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11587 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11588 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11589 the --[no-]fix-cortex-a8 command line options.
11590 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11591 (Target_arm::relocate_stub): Use addend in instruction template.
11592 * options.h (DEFINE_bool): Set the user-set flag.
11593 (General_options): Add --[no-]-fix-cortex options.
11594 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11595 : Update fast look-up map after conversion.
41263c05 11596
459e9b03
ST
115972010-01-14 Sriraman Tallam <tmsriram@google.com>
11598
11599 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11600 in the first pass of do_layout.
11601
b521dfe4
DK
116022010-01-13 Doug Kwan <dougkwan@google.com>
11603
11604 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11605 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11606 apparent compiler problem of not folding static constant integral
11607 data members of elfcpp::Elf_sizes<32>.
11608
44272192
DK
116092010-01-13 Doug Kwan <dougkwan@google.com>
11610
11611 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11612 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11613 Arm_relobj::scan_section_for_cortex_a8_erratum,
11614 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11615 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11616 sections to scan for relocation stubs into a new method
11617 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11618 relocation and Cortex-A8 stub scanning.
11619 (Target_arm::do_relax): Force stubs to be after stubbed sections
11620 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11621 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11622 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11623
44b71ece
ILT
116242010-01-12 Ian Lance Taylor <iant@google.com>
11625
11626 * target-reloc.h (visibility_error): New inline function.
11627 (relocate_section): Call visibility_error.
11628 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11629 (MOSTLYCLEANFILES): Likewise.
11630 (protected_4_pic.o, protected_3.err): New targets.
11631 * testsuite/protected_4.cc: New file.
11632
a120bc7f
DK
116332010-01-12 Doug Kwan <dougkwan@google.com>
11634
11635 * arm.cc (Cortex_a8_reloc): New class.
11636 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11637 and cortex_a8_relocs_info_.
11638 (Target_arm::fix_cortex_a8): New method definition.
11639 (Target_arm::Cortex_a8_relocs_info): New type.
11640 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11641 New data member declarations.
11642 (Target_arm::scan_reloc_for_stub): Record information about
11643 relocations for THUMB branches that might be exempted from the
11644 Cortex-A8 workaround.
11645 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11646 at the beginning of a relaxation pass.
11647
20138696
DK
116482010-01-12 Doug Kwan <dougkwan@google.com>
11649
11650 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11651 (Arm_relobj::Mapping_symbol_position,
11652 Arm_reloj::Mapping_symbol_position_less,
11653 Arm_relobj::Mapping_symbols_info): New types.
11654 (Target_arm::is_mapping_symbol_name): New method definition.
11655 (Arm_relobj::do_count_local_symbols): Save information about mapping
11656 symbols.
11657
089d69dc
DK
116582010-01-11 Doug Kwan <dougkwan@google.com>
11659
11660 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11661 Arm_relocate_functions::thumb32_branch_upper,
11662 Arm_relocate_functions::thumb32_branch_lower,
11663 Arm_relocate_functions::thumb32_cond_branch_offset,
11664 Arm_relocate_functions::thumb32_cond_branch_upper,
11665 Arm_relocate_functions::thumb32_cond_branch_lower,
11666 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11667 branch offset encoding.
11668 (Arm_relocate_functions::thumb_branch_common): Use new branch
11669 offset encoding methods to avoid code duplication.
11670 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11671 (Stub_addend_reader::operator()): Use new branch encoding method
11672 to avoid code duplication.
11673
99e5bff2
DK
116742010-01-11 Doug Kwan <dougkwan@google.com>
11675
11676 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11677 (Target_arm::do_finalize_sections): Define special EXIDX section
11678 symbols only if referenced.
11679 * gc.h (Garbage_collection::add_reference): New method.
11680 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11681 code duplication.
11682
98e090bd
ILT
116832010-01-11 Ian Lance Taylor <iant@google.com>
11684
d0a91bd8
ILT
11685 * script.cc (Version_script_info::build_expression_list_lookup):
11686 Change complaing about duplicate wildcard match from error to
11687 warning.
11688
98e090bd
ILT
11689 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11690 of 2009-12-30.
11691 (Version_script_info::Version_script_info): Initialize globs_,
11692 default_version_, default_is_global_, and exact_. Don't
11693 initialize globals_ or locals_.
11694 (Version_script_info::build_lookup_tables): Build local symbols
11695 first.
11696 (Version_script_info::unquote): New function.
11697 (Version_script_info::add_exact_match): New function.
11698 (Version_script_info::build_expression_list_lookup): Remove lookup
11699 parameter. Add is_global parameter. Change all callers. Handle
11700 wildcard pattern specially. Unquote pattern. Call
11701 add_exact_match.
11702 (Version_script_info::get_name_to_match): New function.
11703 (Version_script_info::get_symbol_version): New function.
11704 (Version_script_info::get_symbol_version_helper): Remove.
11705 (Version_script_info::check_unmatched_names): Call unquote.
11706 * script.h (class Version_script_info): Change get_symbol_version
11707 to be non-inline and add is_global parameter; change all callers.
11708 Rewrite symbol_is_local. Update declarations. Define struct
11709 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11710 Remove globals_ and locals_ members. Add exact_, globs_,
11711 default_version_, is_global_.
11712 (Version_script_info::Glob): Remove pattern, add expression and
11713 is_global. Update constructor. Change all callers.
11714 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11715 default version.
11716 (Versions::symbol_section_contents): If a symbol is undefined, or
11717 defined in a dynamic object, set the version index to
11718 VER_NDX_LOCAL.
11719 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11720 symbol_is_local.
11721 (Symbol_table::add_from_pluginobj): Likewise.
11722 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11723
d56962d3
DK
117242010-01-11 Doug Kwan <dougkwan@google.com>
11725
11726 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11727 (incremental_dump_LDADD): Add linking option for libintl.
11728 * Makefile.in: Regenerate.
11729
94e6ee91
L
117302010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11731
11732 PR gold/11144
11733 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11734 instead of -Ds.
11735 * testsuite/Makefile.in: Regenerated.
11736
e96c574b
DK
117372010-01-10 Doug Kwan <dougkwan@google.com>
11738
11739 * options.h (DEFINE_var): Use parentheses around argument varname__
11740 in macro body to avoid any unintended subsequent substitutions.
11741
7198066b
ILT
117422010-01-10 Ian Lance Taylor <iant@google.com>
11743
ba4d53bf
ILT
11744 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11745 candidates before doing symbol resolution.
11746
7198066b
ILT
11747 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11748 ODR candidates if only one is weak.
11749
a2beed37
ILT
117502010-01-08 Ian Lance Taylor <iant@google.com>
11751
11752 * script.cc (Version_script_info::build_expression_list_lookup):
11753 Don't warn about ambiguous version, just record the ambiguity.
11754 (Version_script_info::get_symbol_version_helper): Give error if
11755 version is ambiguous.
11756
2fb7225c
DK
117572010-01-08 Doug Kwan <dougkwan@google.com>
11758
11759 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11760 prev_data_size_ and prev_addralign_. Remove initializer for
11761 deleted data member has_been_changed_.
11762 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11763 to determine if the table is empty.
11764 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11765 Remove.
11766 (Stub_table::add_reloc_stub): Define method in class definition
11767 instead of just declaring it there.
11768 (Stub_table::add_cortex_a8_stub): New method definition.
11769 (Stub_table::update_data_size_and_addralign): Ditto.
11770 (Stub_table::finalize_stubs): Ditto.
11771 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11772 (Stub_table::do_addralign_): Return address alignment in the
11773 (Stub_table::do_reset_address_and_file_offset): Define method in
11774 class definition instead of declaring it there. Set current data
11775 size to be the data size of the previous pass.
11776 (Stub_table::set_final_data_size): Use current data size as the
11777 final data size.
11778 (Stub_table::relocate_stub): Change parameter type of stub from
11779 Reloc_stub pointer to Stub pointer.
11780 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11781 (Stub_table::Cortex_a8_stub_list): New typedef.
11782 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11783 Stub_table::prev_addralign_): New data member.
11784 (Arm_relobj::Arm_relobj): Initialize data member
11785 section_has_cortex_a8_workaround_.
11786 (Arm_relobj::section_has_cortex_a8_workaround,
11787 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11788 definitions.
11789 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11790 declarations.
11791 (Target_arm::relocate_stub): Change parameter type of stub from
11792 Reloc_stub pointer to Stub pointer.
11793 (Insn_template::size, Insn_template::alignment): Handle
11794 THUMB16_SPECIAL_TYPE.
11795 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11796 Stub_table::update_data_size_and_addralign,
11797 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11798 definitions.
11799 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11800 (Stub_table::do_write): Ditto.
11801 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11802
880cd20d
ILT
118032010-01-08 Ian Lance Taylor <iant@google.com>
11804
11805 PR 11108
11806 * symtab.h (class Symbol): Remove fields is_target_special_ and
11807 has_plt_offset_. Add field is_defined_in_discarded_section_.
11808 (Symbol::is_defined_in_discarded_section): New function.
11809 (Symbol::set_is_defined_in_discarded_section): New function.
11810 (Symbol::has_plt_offset): Rewrite.
11811 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11812 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11813 Don't initialize is_target_special_ or has_plt_offset_.
11814 Initialize is_defined_in_discarded_section_.
11815 (Symbol_table::add_from_relobj): If appropriate, set
11816 is_defined_in_discarded_section.
11817 * resolve.cc (Symbol::override_base_with_special): Don't test
11818 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11819 * target-reloc.h (relocate_section): Do special handling for
11820 symbols defined in discarded sections for global symbols as well
11821 as local symbols.
11822
2703e3eb
ILT
118232010-01-08 Ian Lance Taylor <iant@google.com>
11824
11825 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11826 the SHT_SYMTAB case.
11827
339d40a3
ILT
118282010-01-08 Ian Lance Taylor <iant@google.com>
11829
11830 * object.cc (Sized_relobj::do_layout): Don't get confused if
11831 layout_eh_frame returns NULL.
11832
abecea76
ILT
118332010-01-08 Ian Lance Taylor <iant@google.com>
11834
11835 PR 11084
11836 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11837 dynamic symbol table, use the normal symbol table.
11838 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11839 symbol table.
11840
6b7dd3f3
ILT
118412010-01-08 Ian Lance Taylor <iant@google.com>
11842
11843 PR 11072
11844 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11845 sections.
11846
36c50e63
L
118472010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11848
11849 * version.cc (print_version): Change to "Copyright 2010".
11850
e291e7b9
ILT
118512010-01-08 Ian Lance Taylor <iant@google.com>
11852
11853 PR 10287
11854 PR 11063
11855 * i386.cc (class Target_i386): Change return type of plt_section
11856 to be non-const.
11857 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11858 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11859 tls_desc_rel_ field.
11860 (Output_data_plt_i386::rel_tls_desc): New function.
11861 (Target_i386::rel_tls_desc_section): New function.
11862 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11863 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11864 R_386_TLS_DESC reloc in rel_tls_desc_section.
11865 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11866 Define struct Tlsdesc_info.
11867 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11868 (Target_x86_64::do_reloc_symbol_index): New function.
11869 (Target_x86_64::add_tlsdesc_info): New function.
11870 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11871 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11872 tlsdesc_rel_ field.
11873 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11874 all callers.
11875 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11876 (Target_x86_64::rela_tlsdesc_section): New function.
11877 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11878 handling.
11879 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11880 (Target_x86_64::do_reloc_addend): New function.
11881 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11882 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11883 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11884 (Output_reloc::type): New function.
11885 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11886 (Output_reloc::is_target_specific): New function.
11887 (Output_reloc::target_arg): New function.
11888 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11889 absolute relocs and target specific relocs.
11890 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11891 add_target_specific.
11892 (class Output_data_reloc) [SHT_RELA]: Likewise.
11893 * output.cc (Output_reloc::Output_reloc): Add four new versions
11894 for absolute relocs and target specific relocs.
11895 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11896 (Output_reloc::get_symbol_index): Likewise.
11897 (Output_reloc::local_section_offset): Check that local_sym_index_
11898 is not TARGET_CODE or 0.
11899 (Output_reloc::symbol_value): Likewise.
11900 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11901 reloc.
11902 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11903 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11904 functions.
11905 * layout.cc (add_target_dynamic_tags): Use output section for
11906 DT_PLTRELSZ and DT_JMPREL.
11907
3a44184e
ILT
119082010-01-07 Ian Lance Taylor <iant@google.com>
11909
11910 PR 11061
11911 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11912 function.
11913 (class Output_data_reloc_generic): Define.
11914 (class Output_data_reloc_base): Change base class to
11915 Output_data_reloc_generic. Change add() method to call
11916 bump_relative_reloc_count for a relative reloc. Remove
11917 sort_relocs_ field.
11918 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11919 to sort_relocs().
11920 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11921 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11922 appropriate.
11923 * layout.h (class Layout): Update declaration.
11924
ea715a34
ILT
119252010-01-07 Ian Lance Taylor <iant@google.com>
11926
11927 * output.h (class Output_data): Add const version of
11928 output_section and do_output_section.
11929 (class Output_section_data): Add const version of
11930 do_output_section.
11931 (class Output_section): Likewise.
11932 * layout.cc (Layout::add_target_dynamic_tags): New function.
11933 * layout.h (class Layout): Update declarations.
11934 * arm.cc (Target_arm::do_finalize_sections): Use
11935 add_target_dynamic_tags.
11936 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11937 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11938 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11939 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11940
659948a4
ILT
119412010-01-07 Ian Lance Taylor <iant@google.com>
11942
11943 PR 11042
11944 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11945 object as needed.
11946
9d3b86f6
ILT
119472010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11948 Ian Lance Taylor <iant@google.com>
11949
11950 PR 11019
11951 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11952 Xindex::read_symtab_xindex.
11953
bb0d3eb0
DK
119542010-01-07 Doug Kwan <dougkwan@google.com>
11955
11956 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11957 (Insn_template::thumb16_bcond_insn): New method declaration.
11958 (Insn_template): Fix spelling.
11959 (Stub::thumb16_special): New method declaration.
11960 (Stub::do_write): Define virtual method which was previously pure
11961 virtual.
11962 (Stub::do_thumb16_special): New method declaration.
11963 (Stub::do_fixed_endian_write): New template member.
11964 (Reloc_stub::do_write): Remove.
11965 (Reloc_stub::do_fixed_endian_write): Remove.
11966 (Cortex_a8_stub): New class definition.
11967 (Stub_factory::make_cortex_a8_stub): New method definition.
11968 (Stub_factory::Stub_factory): Add missing static storage class
11969 qualifier for elf32_arm_stub_a8_veneer_blx.
11970
ffeef7df
ILT
119712010-01-07 Ian Lance Taylor <iant@google.com>
11972
dc3f80fe
ILT
11973 PR 10980
11974 * options.h (class General_options): Add --warn-unresolved-symbols
11975 and --error-unresolved-symbols.
11976 * errors.cc (Errors::undefined_symbol): Implement
11977 --warn-unresolved-symbols.
11978
ffeef7df
ILT
11979 * options.h (class General_options): Add -z text and -z textoff.
11980 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11981
f1ec9ded
ST
119822010-01-06 Sriraman Tallam <tmsriram@google.com>
11983
11984 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11985 (Garbage_collection::cident_sections): New function.
11986 (Garbage_collection::add_cident_section): New function.
11987 (Garbage_collection::cident_sections_): New member.
11988 (gc_process_relocs): Add references to sections whose names are C
11989 identifiers.
11990 * gold.h (cident_section_start_prefix): New constant.
11991 (cident_section_stop_prefix): New constant.
11992 (is_cident): New function.
11993 * layout.cc (Layout::define_section_symbols): Replace string constants
11994 with the newly defined constants.
11995 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11996 C identifiers.
11997 * testsuite/Makefile.am: Add gc_orphan_section_test.
11998 * testsuite/Makefile.in: Regenerate.
11999 * testsuite/gc_orphan_section_test.cc: New file.
12000 * testsuite/gc_orphan_section_test.sh: New file.
12001
6eda8c29
ILT
120022010-01-06 Ian Lance Taylor <iant@google.com>
12003
b9674e17
ILT
12004 PR 10980
12005 * options.h (class General_options): Add --warn-shared-textrel.
12006 * layout.cc (Layout::finish_dynamic_section): Implement
12007 --warn-shared-textrel.
12008
6eda8c29
ILT
12009 PR 10980
12010 * options.h (class General_options): Add --warn-multiple-gp.
12011
32dcd44e
ILT
120122010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12013
12014 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12015 $(THREADSLIB) and $(LIBDL).
12016 * Makefile.in: Rebuild.
12017
a192ba05
ILT
120182010-01-06 Ian Lance Taylor <iant@google.com>
12019
12020 PR 10980
12021 * options.cc (General_options::parse_section_start): New function.
12022 (General_options::section_start): New function.
12023 (General_options::General_options): Initialize all members.
12024 * options.h: Include <map>
12025 (class General_options): Add --section-start. Add section_starts_
12026 member.
12027 * layout.cc (Layout::attach_allocated_section_to_segment): If
12028 --section-start was used, set the address of the segment. Remove
12029 local sort_sections.
12030 (Layout::relaxation_loop_body): If the address of the load segment
12031 has been set by --section-start, don't use it.
12032 * output.h (Output_segment::update_flags_for_output_section): New
12033 function.
12034 * output.cc (Output_segment::add_output_section): Call
12035 update_flags_for_output_section.
12036
dde3f402
ILT
120372010-01-05 Ian Lance Taylor <iant@google.com>
12038
62dfdd4d
ILT
12039 PR 10980
12040 * options.h (class General_options): Add --undefined-version.
12041 * script.cc (struct Version_expression): Add was_matched_by_symbol
12042 field.
12043 (Version_script_info::matched_symbol): New function.
12044 (Version_script_info::get_symbol_version_helper): Call
12045 matched_symbol.
12046 (Version_script_info::check_unmatched_names): New function.
12047 * script.h (class Version_script_info): Update declarations.
12048 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12049
9c4ae156
ILT
12050 * options.h (class General_options): Use DEFINE_bool_alias for
12051 allow_multiple_definition.
12052 * resolve.cc (Symbol_table::should_override): Don't test
12053 allow_multiple_definition.
12054
dde3f402
ILT
12055 PR 10980
12056 * options.h (class General_options): Add --cref.
12057 * main.cc (main): Print cref table if --cref. Don't close mapfile
12058 until after printing cref table.
12059 * cref.cc: Include "symtab.h".
12060 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12061 (Cref_table_compare::operator()): New function.
12062 (Cref_inputs::gather_cref): New function.
12063 (filecol): New static const.
12064 (Cref_inputs::print_cref): New function.
12065 (Cref::print_cref): New function.
12066 * cref.h: Include <cstdio>.
12067 (class Cref): Update declarations.
12068 * mapfile.h (Mapfile::file): New function.
12069 * object.h (class Object): Define Symbols. Declare virtual
12070 do_get_global_symbols.
12071 (Object::get_global_symbols): New function.
12072 * object.cc (Input_objects::add_object): Pass object to cref_ if
12073 --cref.
12074 (Input_objects::archive_start): Likewise.
12075 (Input_objects::archive_stop): Likewise.
12076 (Input_objects::print_cref): New function.
12077 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12078 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12079 --cref.
12080 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12081 function.
12082 * plugin.h (class Sized_pluginobj): Update declarations.
12083
8781f709
ILT
120842010-01-05 Ian Lance Taylor <iant@google.com>
12085
12086 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12087 to is_default_version. Rename insdef to insdefault.
12088 (Symbol_table::add_from_relobj): Rename def to is_default_version
12089 and local to is_forced_local.
12090 (Symbol_table::add_from_pluginobj): Likewise.
12091 (Symbol_table::add_from_dynobj): Likewise.
12092 (Symbol_table::define_special_symbol): Rename insdef to
12093 insdefault.
12094
fe35d28d
ILT
120952010-01-04 Ian Lance Taylor <iant@google.com>
12096
30bc8c46
ILT
12097 PR 10980
12098 * options.h (class General_options): Add
12099 --allow-multiple-definition and -z muldefs.
12100 * resolve.cc (Symbol_table::should_override): Don't warn about a
12101 multiple symbol definition if --allow-multiple-definition or -z
12102 muldefs.
12103
7eaea549
ILT
12104 PR 10980
12105 * options.h (class General_options): Add --add-needed and
12106 --copy-dt-needed-entries. Tweak --as-needed help entry.
12107 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12108 error if --copy-dt-needed-entries aka --add-needed is used and
12109 would cause a change in behaviour.
12110
fe35d28d
ILT
12111 PR 10980
12112 * options.h (class General_options): Add -G as a short version of
12113 --shared. Add no-op options -assert, -g, and -i.
12114
55a2bb35
ST
121152010-01-04 Sriraman Tallam <tmsriram@google.com>
12116
12117 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12118 check for .text or .gnu.linkonce.t sections.
12119 * icf.cc (Icf::find_identical_sections): Ditto.
12120 Change the detection for mangled function name within the section
12121 name.
12122 * icf.h (is_section_foldable_candidate): New function.
12123
719328e1
ILT
121242009-12-30 Ian Lance Taylor <iant@google.com>
12125
12126 PR 10980
12127 * options.h (class General_options): Permit two dashes with
12128 --retain-symbols-file.
12129
d7bb5745
ILT
121302009-12-30 Ian Lance Taylor <iant@google.com>
12131
403a15dd
ILT
12132 PR 10979
12133 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12134 don't put the file header and segment headers in the text
12135 segment.
12136
eda294df
ILT
12137 PR 10979
12138 * common.cc (Sort_commons::operator()): Stabilize sort when both
12139 entries are NULL.
12140 (Symbol_table::do_allocate_commons_list): When allocating common
12141 symbols, skip a symbol which is no longer common.
12142 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12143 an object before checking its type.
12144 * testsuite/common_test_2.c: New file.
12145 * testsuite/common_test_3.c: New file.
12146 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12147 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12148 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12149 (common_test_2_pic.o, common_test_2.so): New targets.
12150 (common_test_3_pic.o, common_test_3.so): New targets.
12151 * testsuite/Makefile.in: Rebuild.
12152
d7bb5745
ILT
12153 PR 10979
12154 * script.cc (read_input_script): If we see a new SECTIONS clause,
12155 and we have added an input section, give an error.
12156 * layout.h (class Layout): Add have_added_input_section function.
12157 Add have_added_input_section_ field.
12158 * layout.cc (Layout::Layout): Initialize
12159 have_added_input_section_.
12160 (Layout::layout): Set have_added_input_section_.
12161 (Layout::layout_eh_frame): Likewise.
12162
fc59c572
ILT
121632009-12-30 Ian Lance Taylor <iant@google.com>
12164
12165 PR 10931
12166 * options.h (class General_options): Add --sort-common option.
12167 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12168 * common.cc (Sort_common): Add sort_order parameter to
12169 constructor. Add sort_order_ field.
12170 (Sort_commons::operator): Check sort_order_.
12171 (Symbol_table::allocate_commons): Determine the sort order.
12172 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12173 Change all callers.
12174 (Symbol_table::do_allocate_commons_list): Likewise.
12175
1c74fab0
ILT
121762009-12-30 Ian Lance Taylor <iant@google.com>
12177
12178 PR 10916
12179 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12180 symbols from this object, don't change the visibility of an
12181 undefined symbol.
12182 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12183
6affe781
ILT
121842009-12-30 Ian Lance Taylor <iant@google.com>
12185
12186 PR 10861
12187 * script.h (class Version_script_info): Define Language enum.
12188 Update declarations. Define Glob, Exact, and Lookup types. Add
12189 new fields globals_, locals_, and is_finalized_.
12190 * script.cc: Various formatting fixes.
12191 (class Parser_closure): Change language_stack_ from a vector of
12192 std::string to one of Version_script_info::Language. Adjust all
12193 uses accordingly.
12194 (class Lazy_demangler): Remove.
12195 (struct Version_expression): Change language from std::string to
12196 Version_script_info::Language.
12197 (Version_script_info::Version_script_info): New function.
12198 (Version_script_info::~Version_script_info): Don't call clear.
12199 (Version_script_info::finalize): New function.
12200 (Version_script_info::build_lookup_tables): New function.
12201 (Version_script_info::build_expression_list_lookup): New
12202 function.
12203 (Version_script_info::get_symbol_version_helper): Rewrite to use
12204 lookup tables.
12205 (Version_script_info::print_expression_list): Adjust to use
12206 Version_script_info::Language.
12207 (script_push_lex_into_version_mode): Check that the version script
12208 has not been finalized.
12209 (version_script_push_lang): Change language string to
12210 Version_script_info::Language.
12211 * options.cc (Command_line::version_script): New function.
12212 * options.h (class General_options): Add finalize_dynamic_list
12213 function. Change version_script from declaration to definition.
12214 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12215 * testsuite/version_script.map: Remove duplicate def of foo.
12216 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12217 version_script.map.
12218 * testsuite/Makefile.in: Rebuild.
12219
818bf354
ILT
122202009-12-30 Ian Lance Taylor <iant@google.com>
12221
12222 PR 10843
12223 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12224 if the input symbol index is 0, make the output symbol index 0.
12225
ebcc8304
ILT
122262009-12-30 Ian Lance Taylor <iant@google.com>
12227
12228 PR 10670
12229 * options.h (class General_options): Add -x/--discard-all.
12230 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12231 --discard-all. If the local symbol needs a dynamic entry, check
12232 that before handling --discard-locals.
12233
176fe33f
ILT
122342009-12-30 Ian Lance Taylor <iant@google.com>
12235
bb321bb1
ILT
12236 PR 10450
12237 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12238 flags to PF_R.
12239 (Output_segment::add_output_section): Don't change the flags if
12240 the type is PT_TLS.
12241
176fe33f
ILT
12242 PR 10450
12243 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12244 GNU hash table if they need a dynamic value. Otherwise, don't add
12245 them if they are defined in a dynamic object or are forced local.
12246
e8cd95c7
ILT
122472009-12-29 Ian Lance Taylor <iant@google.com>
12248
1b81fb71
ILT
12249 PR 10450
12250 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12251 .gnu.hash table for a 32-bit target.
12252
8d6d383d
ILT
12253 PR 10450
12254 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12255 regular and a dynamic object only needs a dynamic symbol table
12256 entry if it is externally visible.
12257
e785ec03
ILT
12258 PR 10450
12259 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12260 constructor. Add global_offset_table_ field.
12261 (Target_i386::got_section): Set global_offset_table_.
12262 (Target_i386::do_finalize_sections): Set global_offset_table_
12263 size.
12264 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12265 in constructor. Add global_offset_table_ field.
12266 (Target_x86_64::got_section): Set global_offset_table_.
12267 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12268 size.
12269
1a2dff53
ILT
12270 * layout.cc (Layout::Layout): Initialize increase_relro_.
12271 (Layout::get_output_section): Add is_relro, is_last_relro, and
12272 is_first_non_relro parameters. Change all callers.
12273 (Layout::choose_output_section): Likewise.
12274 (Layout::add_output_section_data): Likewise.
12275 (Layout::make_output_section): Likewise.
12276 (Layout::set_segment_offsets): Clear increase_relro when using a
12277 linker script.
12278 * layout.h (class Layout): Add increase_relro method. Add
12279 increase_relro_ field. Update declarations.
12280 * output.cc (Output_section::Output_section): Initialize
12281 is_last_relro_ and is_first_non_relro_.
12282 (Output_segment::add_output_section): Group relro sections is
12283 do_sort is true. Handle is_last_relro and is_first_non_relro.
12284 (Output_segment::maximum_alignment): Remove relro handling.
12285 (Output_segment::set_section_addresses): Add increase_relro
12286 parameter. Change all callers. Add initial alignment to align
12287 relro sections on separate page. Remove old relro handling.
12288 (Output_segment::set_section_list_addresses): Remove in_relro
12289 parameter. Change all callers.
12290 (Output_segment::set_offset): Add increase parameter. Change all
12291 callers. Remove old relro handling.
12292 * output.h (class Output_section): Add new methods: is_last_relro,
12293 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12294 Add is_last_relro_ and is_first_non_relro_ fields.
12295 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12296 Create separate .got.plt section. Call increase_relro.
12297 * x86_64.cc (Target_x86_64::got_section): Likewise.
12298 * testsuite/relro_script_test.t: Add .got.plt.
12299
f0ba79e2
ILT
12300 PR 10450
12301 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12302 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12303 (Layout::finalize): Call set_dynamic_symbol_size.
12304 (Layout::set_dynamic_symbol_size): New function.
12305 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12306 set_dynamic_symbol_size.
12307
e8cd95c7
ILT
12308 PR 10450
12309 * output.h (class Output_section): Add is_entsize_zero_ field.
12310 * output.cc (Output_section::Output_section): Initialize
12311 is_entsize_zero_.
12312 (Output_section::set_entsize): If two different entsizes are
12313 requested, force it to zero.
12314 (Output_section::add_input_section): Set flags for .debug_str
12315 before updating section flags. Set entsize.
12316 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12317 and SHF_STRING if all input sections have those flags.
12318
3e1b9a8a
RÁE
123192009-12-29 Rafael Espindola <espindola@google.com>
12320
12321 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12322 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12323 reporting.
3e1b9a8a 12324
3dcad376
ST
123252009-12-29 Sriraman Tallam <tmsriram@google.com>
12326
12327 * options.cc (General_options::parse_version): Allow -v to exit
12328 without an error if there is nothing to link.
12329
084e2665
ILT
123302009-12-29 Ian Lance Taylor <iant@google.com>
12331
12332 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12333 using a version of gcc before 4.1.
12334 * configure: Rebuild.
12335
250acde3
CD
123362009-12-28 Chris Demetriou <cgd@google.com>
12337
12338 * attributes.cc (Output_attributes_section_data::do_write): Use
12339 std::vector::front rather than std::vector::data.
12340
99fff23b
ILT
123412009-12-28 Ian Lance Taylor <iant@google.com>
12342
12343 * symtab.h (class Symbol_table): Add enum Defined.
12344 * resolve.cc (Symbol_table::should_override): Add defined
12345 parameter. Change all callers. Test whether object is NULL
12346 before calling a method on it.
12347 (Symbol_table::report_resolve_problem): Add defined parameter.
12348 Change all callers.
12349 (Symbol_table::should_override_with_special): Likewise.
12350 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12351 parameter. Change all callers.
12352 (Symbol_table::do_define_in_output_data): Likewise.
12353 (Symbol_table::define_in_output_segment): Likewise.
12354 (Symbol_table::do_define_in_output_segment): Likewise.
12355 (Symbol_table::define_as_constant): Likewise.
12356 (Symbol_table::do_define_as_constant): Likewise.
12357 * script.h (class Symbol_assignment): Add is_defsym parameter to
12358 constructor; change all callers.
12359 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12360 parameter. Change all callers. Add is_defsym_ field.
12361 (class Parser_closure): Add parsing_defsym parameter to
12362 constructor; change all callers. Add parsing_defsym accessor
12363 function. Add parsing_defsym_ field.
12364
556bd683
ILT
123652009-12-28 Ian Lance Taylor <iant@google.com>
12366
12367 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12368 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12369
1782c879
ILT
123702009-12-23 Ian Lance Taylor <iant@google.com>
12371
12372 * i386.cc (Target_i386::do_calls_non_split): Recognize
12373 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12374 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12375 -fsplit-stack prologue when using %r11.
1782c879 12376
329ca2b1
ST
123772009-12-21 Sriraman Tallam <tmsriram@google.com>
12378
12379 * options.cc (General_options::parse_version): Make -v continue and do
12380 the link like GNU ld does.
12381
d675ff46
RÁE
123822009-12-17 Rafael Avila de Espindola <espindola@google.com>
12383
12384 * Makefile.am (CCFILES): Add timer.cc.
12385 (HFILES): Add timer.h.
12386 * configure.ac: Check for sysconf and times.
12387 * main.cc: include timer.h.
12388 (main): Use Timer instead of get_run_time.
12389 * timer.cc: New.
12390 * timer.h: New.
12391 * workqueue.cc: include timer.h.
12392 (Workqueue::find_and_run_task):
12393 Report user, sys and wall time.
12394 * Makefile.in: Regenerate.
12395 * config.in: Regenerate.
12396 * configure: Regenerate.
12397
d6344fb5
DK
123982009-12-16 Doug Kwan <dougkwan@google.com>
12399
12400 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12401 sections.
12402 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12403 relaxed input sections.
12404 * output.cc (Output_section::find_relaxed_input_section): Change
12405 return type to Output_relaxed_input_section pointer. Adjust code
12406 for new type of relaxed_input_section_map_.
12407 * output.h (Output_section::find_relaxed_input_section): Change
12408 return type to Output_relaxed_input_section pointer.
12409 (Output_section::Output_relaxed_input_section_by_input_section_map):
12410 New type.
12411 (Output_section::relaxed_input_section_map_): Change type to
12412 Output_section::Output_relaxed_input_section_by_input_section_map.
12413 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12414 input section.
12415
0e0d5469
ILT
124162009-12-15 Ian Lance Taylor <iant@google.com>
12417
12418 * layout.cc (Layout::create_shstrtab): Only write out after input
12419 sections if we are compressing debug sections.
12420
0649a889
ILT
124212009-12-15 Ian Lance Taylor <iant@google.com>
12422
12423 * archive.cc (Archive::add_symbols): Only look up a symbol without
12424 a version if there is, in fact, a version.
12425
2ea97941
ILT
124262009-12-14 Ian Lance Taylor <iant@google.com>
12427
12428 Revert -Wshadow changes, all changes from:
12429 2009-12-11 Doug Kwan <dougkwan@google.com>
12430 2009-12-11 Nick Clifton <nickc@redhat.com>
12431 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12432
b0eec2cc
DK
124332009-12-11 Doug Kwan <dougkwan@google.com>
12434
12435 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12436 due to -Wshadow.
12437 * attributes.cc (Object_attribute::size): Ditto.
12438 (Attributes_section_data::size): Ditto.
12439 (Attributes_section_data::Attributes_section_data): Ditto.
12440 (Output_attributes_section_data::do_write): Ditto.
12441 * attributes.h (Object_attribute::set_type): Ditto.
12442 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12443
91d6fa6a
NC
124442009-12-11 Nick Clifton <nickc@redhat.com>
12445
12446 * archive.cc: Fix shadowed variable warnings.
12447 * arm.cc: Likewise.
12448 * compressed_output.cc: Likewise.
12449 * compressed_output.h: Likewise.
12450 * configure: Likewise.
12451 * dwarf_reader.cc: Likewise.
12452 * dynobj.cc: Likewise.
12453 * dynobj.h: Likewise.
12454 * ehframe.cc: Likewise.
12455 * ehframe.h: Likewise.
12456 * errors.cc: Likewise.
12457 * expression.cc: Likewise.
12458 * fileread.cc: Likewise.
12459 * fileread.h: Likewise.
12460 * freebsd.h: Likewise.
12461 * i386.cc: Likewise.
12462 * icf.cc: Likewise.
12463 * incremental.h: Likewise.
12464 * layout.cc: Likewise.
12465 * layout.h: Likewise.
12466 * mapfile.cc: Likewise.
12467 * merge.cc: Likewise.
12468 * merge.h: Likewise.
12469 * object.cc: Likewise.
12470 * object.h: Likewise.
12471 * options.h: Likewise.
12472 * output.cc: Likewise.
12473 * output.h: Likewise.
12474 * parameters.cc: Likewise.
12475 * plugin.cc: Likewise.
12476 * powerpc.cc: Likewise.
12477 * reduced_debug_output.cc: Likewise.
12478 * reduced_debug_output.h: Likewise.
12479 * reloc.cc: Likewise.
12480 * reloc.h: Likewise.
12481 * resolve.cc: Likewise.
12482 * script-sections.cc: Likewise.
12483 * script.cc: Likewise.
12484 * script.h: Likewise.
12485 * sparc.cc: Likewise.
12486 * symtab.cc: Likewise.
12487 * symtab.h: Likewise.
12488 * target-select.cc: Likewise.
12489 * target-select.h: Likewise.
12490 * token.h: Likewise.
12491 * workqueue.cc: Likewise.
12492 * workqueue.h: Likewise.
12493 * x86_64.cc: Likewise.
12494
a0351a69
DK
124952009-12-10 Doug Kwan <dougkwan@google.com>
12496
12497 * arm.cc (attributes.h): New include.
12498 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12499 (Arm_relobj::~Arm_relobj): Delete object pointed by
12500 attributes_section_data_.
12501 (Arm_relobj::attributes_section_data): New method definition.
12502 (Arm_relobj::attributes_section_data_): New data member declaration.
12503 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12504 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12505 attributes_section_data_.
12506 (Arm_dynobj::attributes_section_data): New method definition.
12507 (Arm_dynobj::attributes_section_data_): New data member declaration.
12508 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12509 initialization value of may_use_blx_ to false.
2e702c99 12510 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12511 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12512 object attributes to compute results instead of hard-coding.
12513 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12514 Target_arm::get_secondary_compatible_arch,
12515 Target_arm::set_secondary_compatible_arch
12516 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12517 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12518 New method declarations.
12519 (Target_arm::get_aeabi_object_attribute): New method definition.
12520 (Target_arm::attributes_section_data_): New data member declaration.
12521 (read_arm_attributes_section): New template definition.
12522 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12523 (Arm_dynobj::do_read_symbols): Ditto.
12524 (Target_arm::do_finalize_sections): Merge attributes sections from
12525 input. Check for BLX use after attributes section merging.
12526 Fix __exidx_start and __exidx_end visibility. Create an
12527 .ARM.attributes section if necessary.
12528 (Target_arm::get_secondary_compatible_arch,
12529 Target_arm::set_secondary_compatible_arch,
12530 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12531 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12532 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12533 New method definitions.
12534
b59befec
ILT
125352009-12-09 Ian Lance Taylor <iant@google.com>
12536
12537 * plugin.cc (Plugin::load): Don't cast from void* to a function
12538 pointer.
12539
1276bc89
ILT
125402009-12-09 Ian Lance Taylor <iant@google.com>
12541
12542 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12543 information fields.
12544
2f2de248
L
125452009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12546
12547 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12548 Replace two_file_shared_1.so with two_file_shared_2.so.
12549 * testsuite/Makefile.in: Regenerated.
12550
4f787271
DK
125512009-12-08 Doug Kwan <dougkwan@google.com>
12552
12553 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12554 (HFILES): Add attributes.h and int_encoding.h.
12555 * Makefile.in: Regenerate.
12556 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12557 function definitions to int_encoding.cc
12558 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12559 prototypes to int_encoding.h
12560 * reduced_debug_output.cc (int_encoding.h): New include.
12561 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12562 function definitions to int_encoding.cc
12563 (insert_into_vector, read_from_pointer): Move template definitions to
12564 int_encoding.h
12565 * attributes.cc: New file.
12566 * attributes.h: New file.
12567 * int_encoding.cc: New file.
12568 * int_encoding.h: New file.
12569
20b52f1a
RÁE
125702009-12-07 Rafael Avila de Espindola <espindola@google.com>
12571
12572 PR gold/11055
12573 * incremental-dump.cc (dump_incremental_inputs): New.
12574 (main): Use dump_incremental_inputs.
12575
53d7974c
L
125762009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12577
12578 PR gold/10893
12579 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12580 checking elfcpp::STT_FUNC.
12581 (Target_i386::Relocate::relocate): Likewise.
12582 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12583
12584 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12585 symbols from shared libraries into normal FUNC symbols.
12586
12587 * symtab.h (Symbol): Add is_func and use it.
12588
05a352e6
DK
125892009-12-05 Doug Kwan <dougkwan@google.com>
12590
12591 * arm.cc (Target_arm::arm_info): Initialize new fields
12592 attributes_section and attributes_vendor.
12593 * i386.cc (Target_i386::i386_info): Same.
12594 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12595 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12596 fields attributes_section and attributes_vendor.
53d7974c 12597 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12598 * target.h (Target::attributes_section, Target::attributes_vendor,
12599 Target::is_attributes_section, Target::attribute_arg_type,
12600 Target::attributes_order): New method definitions.
12601 (Target::Target_info::attributes_section,
12602 Target::Target_info::attributes_vendor): New fields.
12603 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12604 virtual method definitions.
12605 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12606 attributes_section and attributes_vendor.
12607 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12608
f4e5969c
DK
126092009-12-05 Doug Kwan <dougkwan@google.com>
12610
12611 * arm.cc: Update comments about interworking and stub generation.
12612 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12613 considered as non-PIC.
12614 (Arm_relocate_functions::base_abs): Fix formatting.
12615 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12616 of function to use GOT entry address instead of offset.
12617 (Target_arm::Scan::global): Issue an error if a symbol would need a
12618 PLT does not get one because it is untyped. Remove code to create
12619 dynamic symbols for relative branches.
12620 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12621 takes unsigned integer instead of boolean.
12622
1abce4a6
L
126232009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12624
12625 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12626 (two_file_test_LDADD): Likewise.
12627 (common_test_1_LDADD): Likewise.
12628 (exception_test_LDADD) Likewise.
12629 (weak_test_LDADD): Likewise.
12630 (many_sections_test_LDADD): Likewise.
12631 (initpri1_LDADD): Likewise.
12632 (script_test_1_LDADD): Likewise.
12633 (script_test_2_LDADD): Likewise.
12634 (justsyms_LDADD): Likewise.
12635 (binary_test_LDADD): Likewise.
12636 (large_LDADD): Likewise.
12637 * testsuite/Makefile.in: Regenerated.
12638
adcf2816 126392009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12640
adcf2816
L
12641 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12642 (Symbol_table::override_with_special): Likewise.
12643 (Symbol_table::add_from_object): Likewise.
12644
28e67f5d
RÁE
126452009-12-04 Rafael Avila de Espindola <espindola@google.com>
12646
12647 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12648 Don't set the data_offset twice.
12649
ae10a101
RÁE
126502009-12-04 Rafael Avila de Espindola <espindola@google.com>
12651
12652 * testsuite/Makefile.in: Regenerate.
12653
f59f41f3
DK
126542009-12-03 Doug Kwan <dougkwan@google.com>
12655
12656 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12657 (Target_arm::do_finalize_sections): Add parameter for symbol table
12658 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12659 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12660 parameter for symbol table pointer.
12661 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12662 an additional parameter for a pointer to symbol table.
12663 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12664 parameter for a symbol table pointer.
12665 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12666 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12667 Ditto.
12668 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12669 parameter for a symbol table pointer.
12670
ca55d848
RÁE
126712009-12-03 Rafael Avila de Espindola <espindola@google.com>
12672
12673 * incremental.cc (Incremental_inputs_header)
12674 (Incremental_inputs_header_write, Incremental_inputs_entry)
12675 (Incremental_inputs_entry_write): Move ...
12676 * incremental.h (Incremental_inputs_header)
12677 (Incremental_inputs_header_write, Incremental_inputs_entry)
12678 (Incremental_inputs_entry_write): here.
12679
3aec4f9c
RÁE
126802009-12-02 Rafael Avila de Espindola <espindola@google.com>
12681
12682 * incremental.cc (make_sized_incremental_binary): Set the target.
12683 Error if it is incompatible.
12684 * output.h (Output_file): Add filename method.
12685
9c0ae74d
RÁE
126862009-12-02 Rafael Avila de Espindola <espindola@google.com>
12687
12688 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12689 from the get_* methods.
12690
a45500ae
RÁE
126912009-12-02 Rafael Avila de Espindola <espindola@google.com>
12692
12693 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12694 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12695 Write 0 for the data_offset of scripts.
12696
325e6408
RÁE
126972009-12-02 Rafael Avila de Espindola <espindola@google.com>
12698
12699 * testsuite/Makefile.am: Add the incremental_test.sh test.
12700 * testsuite/incremental_test.sh: New.
12701 * testsuite/incremental_test_1.c: New.
12702 * testsuite/incremental_test_2.c: New.
12703
954c3e2e
RÁE
127042009-12-01 Rafael Avila de Espindola <espindola@google.com>
12705
703d02da 12706 * incremental-dump.cc (main): Fix typos.
954c3e2e 12707
f8086623
RÁE
127082009-11-27 Rafael Avila de Espindola <espindola@google.com>
12709
12710 PR gold/11025
12711 * incremental-dump.cc (main): Use llu to print 64 bit values.
12712
3b0dd6ac
L
127132009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12714 H.J. Lu <hongjiu.lu@intel.com>
12715
12716 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12717 $(LIBDL).
12718 (incremental_dump_LDADD): Likewise.
12719 * Makefile.in: Regenerated.
12720
a6d1ef57 127212009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12722
a6d1ef57
DK
12723 Revert:
12724
12725 2009-11-25 Doug Kwan <dougkwan@google.com>
12726
12727 * arm.cc (Target_arm::Target_arm): Move method definition
12728 outside of class definition. Add code to handle
12729 --target1-rel, --target1-abs and --target2= options.
12730 (Target_arm::get_reloc_reloc_type): Change method to be
12731 non-static and const.
12732 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12733 New data member declaration.
12734 (Target_arm::Scan::local, Target_arm::Scan::global,
12735 Target_arm::Relocate::relocate,
12736 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12737 Adjust call to Target_arm::get_real_reloc_type.
12738 (Target_arm::get_real_reloc_type): Use command line options
12739 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12740 * options.h (--target1-rel, --target1-abs, --target2): New
12741 ARM-only options.
12742
50aeb7d4
DK
127432009-11-25 Doug Kwan <dougkwan@google.com>
12744
12745 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12746 class definition. Add code to handle --target1-rel, --target1-abs
12747 and --target2= options.
12748 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12749 and const.
12750 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12751 member declaration.
12752 (Target_arm::Scan::local, Target_arm::Scan::global,
12753 Target_arm::Relocate::relocate,
12754 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12755 call to Target_arm::get_real_reloc_type.
12756 (Target_arm::get_real_reloc_type): Use command line options to
12757 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12758 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12759 options.
12760
51938283
DK
127612009-11-25 Doug Kwan <dougkwan@google.com>
12762
12763 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12764 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12765 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12766 formatting.
12767 (Arm_relocate_functions::thm_call): Replace body with a call to
12768 Arm_relocate_functions::thumb_branch_common.
12769 (Arm_relocate_functions::thm_jump24,
12770 Arm_relocate_functions::thm_xpc22): New method definitions.
12771 (Arm_relocate_functions::thumb_branch_common): New method definition.
12772 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12773 operator.
12774 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12775 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12776
e2b8f3c4
RÁE
127772009-11-24 Rafael Avila de Espindola <espindola@google.com>
12778
12779 * Makefile.am: Build incremental-dump
12780 * Makefile.in: Regenerate.
12781 * incremental-dump.cc: New.
12782 * incremental.cc (Incremental_inputs_header_data,
12783 Incremental_inputs_entry_data): Move to incremental.h
12784 * incremental.h: (Incremental_inputs_header_data,
12785 Incremental_inputs_entry_data): Move from incremental.cc
12786
bcba9aec
RÁE
127872009-11-24 Rafael Avila de Espindola <espindola@google.com>
12788
12789 * incremental.cc (Incremental_inputs_header,
12790 Incremental_inputs_header_write, Incremental_inputs_entry,
12791 Incremental_inputs_entry_write): Add a typedef with the data type.
12792
7c3afe08
RÁE
127932009-11-24 Rafael Avila de Espindola <espindola@google.com>
12794
12795 * incremental.cc (Incremental_inputs_header,
12796 Incremental_inputs_header_write, Incremental_inputs_entry,
12797 Incremental_inputs_entry_write): Update comment about which
12798 type has the filed descriptions.
12799
d204b6e9
DK
128002009-11-15 Doug Kwan <dougkwan@google.com>
12801
12802 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12803 (Arm_relocate_functions::arm_branch_common): Change method defintion
12804 in class definition to a method declaration and update list of formal
12805 parameters.
12806 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12807 Arm_relocation_functions::jump24): Adjust call to
12808 Arm_relocate_functions::arm_branch_common. Update list of formal
12809 parameters.
12810 (Arm_relocate_functions::xpc25): New method definition.
12811 (Arm_relocate_functions::arm_branch_common): Move method defintion
12812 out from class definition. Use stubs for mode-switching and extending
12813 branch ranges.
12814 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12815 specially. Change code to enable use of stubs in ARM branches.
12816
43d12afe
DK
128172009-11-10 Doug Kwan <dougkwan@google.com>
12818
12819 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12820 in method declaration.
12821 (Target_arm::relocate_stub): New method declaration.
12822 (Target_arm::default_target): Change to return a pointer instead of
12823 a const reference.
12824 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12825 Target_arm::default_target.
12826 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12827 method definition.
12828 (Target_arm::relocate_section): Adjust view.
12829 (Target_arm::relocate_stub): New method definition.
12830
ac33a407
DK
128312009-11-10 Doug Kwan <dougkwan@google.com>
12832
12833 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12834 a format warning.
12835 * incremental.cc (open_incremental_binary): Initialized local
12836 variables to avoid warnings.
12837 * object.cc (make_elf_object): Ditto.
12838 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12839 a format warning.
e1df38aa 12840
88ee28e9
L
12841009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12842
12843 PR gold/10930
12844 * testsuite/plugin_test.c: Include "config.h".
12845
2daedcd6
DK
128462009-11-09 Doug Kwan <dougkwan@google.com>
12847
12848 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12849 (arm_symbol_value): Remove.
12850 (Arm_relocate_functions::arm_branch_common,
12851 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12852 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12853 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12854 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12855 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12856 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12857 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12858 Arm_relocate_functions::thm_mobw_abs_nc,
12859 Arm_relocate_functions::thm_mov_abs,
12860 Arm_relocate_functions::movw_prel_nc,
12861 Arm_relocate_functions::thm_movt_abs,
12862 Arm_relocate_functions::movt_prel,
12863 Arm_relocate_functions::thm_movw_prel_nc,
12864 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12865 (Target_arm::Relocate::relocate): Only decompose address into two
12866 parts if relocation type uses the thumb-bit and pass the actual
12867 bit instead of a flag indicating that the thumb-bit is used. Adjust
12868 calls to methods in Arm_relocate_functions for this change.
12869
1276bc89 128702009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12871
12872 PR 10925
12873 * reloc.cc: Instantiate
12874 Sized_relobj::initialize_input_to_output_maps and
12875 Sized_relobj:free_input_to_output_maps.
12876
e53ad1b5
ILT
128772009-11-06 Ian Lance Taylor <iant@google.com>
12878
12879 PR 10876
12880 * defstd.cc (in_segment): Set only_if_ref true for "end".
12881
eb44217c
DK
128822009-11-06 Doug Kwan <dougkwan@google.com>
12883
12884 * arm.cc (class Reloc_stub): Correct a comment.
12885 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12886 (Target_arm::scan_section_for_stubs): New method declaration.
12887 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12888 Change methods from private to protected.
12889 (Target_arm::do_may_relax): New method definition.
12890 (Target_arm::do_relax, Target_arm::group_sections,
12891 Target_arm::scan_reloc_for_stub,
12892 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12893 (Target_arm::arm_input_section_map_): New data member declaration.
12894 (Target_arm::scan_reloc_for_stub,
12895 Target_arm::scan_reloc_section_for_stubs,
12896 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12897 Target_arm::do_relax): New method definitions.
12898
5d329b7d
ILT
128992009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12900
12901 * configure.ac: Check for (struct stat)::st_mtim
12902 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12903 * config.in: Regenerate.
12904 * configure: Regenerate.
12905
96a0d71b
ILT
129062009-11-05 Ian Lance Taylor <iant@google.com>
12907
12908 PR 10910
12909 * output.cc (Output_segment::add_output_section): Add missing
12910 return statement.
12911
594c8e5e
ILT
129122009-11-04 Ian Lance Taylor <iant@google.com>
12913
12914 PR 10880
12915 * object.h (class Object): Add is_needed and set_is_needed
12916 methods. Add is_needed_ field. Make bool fields into bitfields.
12917 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12918 defined in a dynamic object and referenced by a regular object,
12919 set is_needed for the dynamic object.
12920 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12921 if the file is marked with as_needed and it is not needed.
12922
22b127cc
ILT
129232009-11-04 Ian Lance Taylor <iant@google.com>
12924
12925 PR 10887
12926 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12927 tags if data is discarded by linker script.
12928 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12929 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12930 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12931 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12932
f5c870d2
ILT
129332009-11-04 Ian Lance Taylor <iant@google.com>
12934
12935 * layout.cc (Layout::get_output_section): Add is_interp and
12936 is_dynamic_linker_section parameters. Change all callers.
12937 (Layout::choose_output_section): Likewise.
12938 (Layout::make_output_section): Likewise.
12939 (Layout::add_output_section_data): Add is_dynamic_linker_section
12940 parameter. Change all callers.
12941 * layout.h (class Layout): Update declarations.
12942 * output.h (class Output_section): Add is_interp, set_is_interp,
12943 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12944 Add is_interp_, is_dynamic_linker_section_ fields. Change
12945 generate_code_fills_at_write_ to a bitfield.
12946 * output.cc (Output_section::Output_sections): Initialize new
12947 fields.
12948 (Output_segment::add_output_section): Add do_sort parameter.
12949 Change all callers.
12950
1ae4d23b
ILT
129512009-11-03 Ian Lance Taylor <iant@google.com>
12952
12953 PR 10860
12954 * options.h (class General_options): Add --warn-common.
12955 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12956 merging two common symbols.
12957 (Symbol_table::should_override): Handle --warn-common when merging
12958 a common symbol with a defined symbol. Use report_resolve_problem
12959 for multiple definitions.
12960 (Symbol_table::report_resolve_problem): New function.
12961 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12962
55da9579
DK
129632009-11-03 Doug Kwan <dougkwan@google.com>
12964
12965 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12966 stub_factory_.
12967 (Target_arm::stub_factory): New method definition.
12968 (Target_arm::new_arm_input_section,
12969 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12970 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12971 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12972 New type definitions.
12973 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12974 member declarations.
12975 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12976 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12977 New method definitions.
12978
37a9ac43
ILT
129792009-11-03 Ian Lance Taylor <iant@google.com>
12980
12981 * options.h (class General_options): Add --warn_constructors.
12982
b3d6a3d4
ILT
129832009-11-03 Ian Lance Taylor <iant@google.com>
12984
12985 PR 10893
12986 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12987 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12988
934b01dd
ILT
129892009-11-03 Ian Lance Taylor <iant@google.com>
12990
12991 PR 10895
12992 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12993 --msgid-bugs-address.
12994 (install-pdf): New target.
12995 (install-data_yes): Look up one directory to find mkinstalldirs.
12996
03c1939b
L
129972009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12998
12999 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13000 tree.
13001
ebd95253
DK
130022009-10-30 Doug Kwan <dougkwan@google.com>
13003
13004 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13005
e9bbb538
DK
130062009-10-30 Doug Kwan <dougkwan@google.com>
13007
13008 * arm.cc (Stub_addend_reader): New struct template definition
13009 and partial specializations.
13010 (Stub_addend_reader::operator()): New method definition for a
13011 partially specialized template.
13012
d5b40221
DK
130132009-10-30 Doug Kwan <dougkwan@google.com>
13014
13015 * arm.cc (Arm_relobj::processor_specific_flags): New method
13016 definition.
13017 (Arm_relobj::do_read_symbols): New method declaration.
13018 (Arm_relobj::processor_specific_flags_): New data member declaration.
13019 (Arm_dynobj): New class definition.
13020 (Target_arm::do_finalize_sections): Add input_objects parameter.
13021 (Target_arm::do_adjust_elf_header): New method declaration.
13022 (Target_arm::are_eabi_versions_compatible,
13023 (Target_arm::merge_processor_specific_flags): New method declaration.
13024 (Target_arm::do_make_elf_object): New overloaded method definitions
13025 and declaration.
13026 (Arm_relobj::do_read_symbols): New method definition.
13027 (Arm_dynobj::do_read_symbols): Ditto.
13028 (Target_arm::do_finalize_sections): Add input_objects parameters.
13029 Merge processor-specific flags from all input objects.
13030 (Target_arm::are_eabi_versions_compatible,
13031 Target_arm::merge_processor_specific_flags,
13032 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13033 New method definitions.
13034 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13035 Input_objects pointer type parameter.
13036 * layout.cc (Layout::finalize): Pass input objects to target's.
13037 finalize_sections function.
13038 * output.cc (Output_file_header::do_sized_write): Set ELF file
13039 header's processor-specific flags.
13040 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13041 Input_objects pointer type parameter.
13042 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13043 * target.h (Input_objects): New forward class declaration.
13044 (Target::processor_specific_flags,
13045 Target::are_processor_specific_flags_sect): New method definitions.
13046 (Target::finalize_sections): Add input_objects parameter.
13047 (Target::Target): Initialize processor_specific_flags_ and
13048 are_processor_specific_flags_set_.
13049 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13050 parameter.
13051 (Target::set_processor_specific_flags): New method definition.
13052 (Target::processor_specific_flags_,
13053 Target::are_processor_specific_flags_set_): New data member
13054 declarations.
13055 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13056 Input_objects pointer type parameter.
13057
ebabffbd
DK
130582009-10-30 Doug Kwan <dougkwan@google.com>
13059
13060 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13061
ad0f2072
ILT
130622009-10-28 Ian Lance Taylor <iant@google.com>
13063
13064 * object.h (class Relobj): Drop options parameter from
13065 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13066 do_scan_relocs, do_relocate. Change all callers.
13067 (class Sized_relobj): Drop options parameters from
13068 do_gc_process_relocs, do_scan_relocs, do_relocate,
13069 do_relocate_sections, relocate_sections, emit_relocs_scan,
13070 emit_relocs_scan_reltype. Change all callers.
13071 (struct Relocate_info): Remove options field and all references to
13072 it.
13073 * reloc.h (class Read_relocs): Remove options constructor
13074 parameter and options_ field. Change all callers.
13075 (class Gc_process_relocs, class Scan_relocs): Likewise.
13076 (class Relocate_task): Likewise.
13077 * target-reloc.h (scan_relocs): Remove options parameter. Change
13078 all callers.
13079 (scan_relocatable_relocs): Likewise.
13080 * target.h (class Sized_target): Remove options parameter from
13081 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13082 all callers.
13083 * gc.h (gc_process_relocs): Remove options parameter. Change all
13084 callers.
13085 * arm.cc: Update functions to remove options parameters.
13086 * i386.cc: Likewise.
13087 * powerpc.cc: Likewise.
13088 * sparc.cc: Likewise.
13089 * x86_64.cc: Likewise.
13090 * testsuite/testfile.cc: Likewise.
13091
8ffa3667
DK
130922009-10-28 Doug Kwan <dougkwan@google.com>
13093
13094 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13095 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13096 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13097 New method definitions.
13098
40f36857
CC
130992009-10-28 Cary Coutant <ccoutant@google.com>
13100
13101 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13102 (Plugin::cleanup_done_): New member.
13103 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13104 (Plugin_manager::cleanup_done_): Remove.
13105 (Plugin_manager::add_input_file): Edit error message.
13106 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13107 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13108
2c849493
ILT
131092009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13110
13111 * fileread.cc: (File_read::View::~View): Use the new
13112 data_ownership_ filed.
13113 (File_read::~File_read): Dispose the new whole_file_view_.
13114 (File_read::open): Mmap the whole file if needed.
13115 (File_read::open): Use whole_file_view_ instead of contents_.
13116 (File_read::find_view): Use whole_file_view_ if applicable.
13117 (File_read::do_read): Use whole_file_view_ instead of contents_.
13118 (File_read::make_view): Use whole_file_view_ instead of contents_,
13119 update File_read::View::View call.
13120 (File_read::find_or_make_view): Update File_read::View::View
13121 call.
13122 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13123 remove contents_
13124 (File_read::View::Data_ownership): New enum.
13125 (File_read::View::View): Replace bool mapped_ with Data_ownership
13126 argument.
13127 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13128 (File_read::View::data_ownership_): New field.
13129 (File_read::contents_): Remove (replaced by whole_file_view_).
13130 (File_read::whole_file_view_): New field.
13131 * options.h (class General_options): Add --keep-files-mapped.
13132
24998053
CC
131332009-10-27 Cary Coutant <ccoutant@google.com>
13134
13135 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13136 * testsuite/Makefile.am (plugin_test_5): New test case.
13137 * testsuite/Makefile.in: Regenerate.
13138
72adc4fa
DK
131392009-10-25 Doug Kwan <dougkwan@google.com>
13140
13141 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13142 from private to protected to allow access by child class.
13143 (Sized_relobj::do_relocate_sections): New method declaration.
13144 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13145 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13146 Sized_relobj::relocate_sections. Instantiate template explicitly
13147 for different target sizes and endianity.
13148
07f508a2
DK
131492009-10-24 Doug Kwan <dougkwan@google.com>
13150
13151 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13152 (Arm_input_section::as_arm_input_section): New method.
13153 (Arm_output_section): New class definition.
13154 (Arm_output_section::create_stub_group,
13155 Arm_output_section::group_sections): New method definitions.
13156
10ad9fe5
DK
131572009-10-22 Doug Kwan <dougkwan@google.com>
13158
13159 * arm.cc (Arm_input_section): New class definition.
13160 (Arm_input_section::init, Arm_input_section:do_write,
13161 Arm_input_section::set_final_data_size,
13162 Arm_input_section::do_reset_address_and_file_offset): New method
13163 definitions.
13164
56ee5e00
DK
131652009-10-21 Doug Kwan <dougkwan@google.com>
13166
13167 * arm.cc (Stub_table, Arm_input_section): New forward class
13168 declarations.
13169 (Stub_table): New class defintion.
13170 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13171 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13172 New method definition.
13173
b569affa
DK
131742009-10-21 Doug Kwan <dougkwan@google.com>
13175
13176 * arm.cc: Update copyright comments.
13177 (Target_arm): New forward class template declaration.
13178 (Arm_address): New type.
13179 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13180 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13181 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13182 constants.
13183 (Insn_template): Same.
13184 (DEF_STUBS): New macro.
13185 (Stub_type): New enum type.
13186 (Stub_template): New class definition.
13187 (Stub): Same.
13188 (Reloc_stub): Same.
13189 (Stub_factory): Same.
13190 (Target_arm::Target_arm): Initialize may_use_blx_ and
13191 should_force_pic_veneer_.
13192 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13193 Target_arm::should_force_pic_veneer,
13194 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13195 Target_arm::using_thumb_only, Target_arm:;default_target): New
13196 method defintions.
13197 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13198 New data member declarations.
13199 (Insn_template::size, Insn_template::alignment): New method defintions.
13200 (Stub_template::Stub_template): New method definition.
13201 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13202 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13203 (Stub_factory::Stub_factory): New method definition.
13204 * gold.h (string_hash): New template.
13205 * output.h (Input_section_specifier::hash_value): Use
13206 gold::string_hash.
13207 (Input_section_specifier::string_hash): Remove.
13208 * stringpool.cc (Stringpool_template::string_hash): Use
13209 gold::string_hash.
13210
6c172549
DK
132112009-10-20 Doug Kwan <dougkwan@google.com>
13212
13213 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13214 symbols of relaxed input sections.
13215 * output.h (Output_section::find_relaxed_input_section): Make
13216 method public.
13217
c5617f2f
DK
132182009-10-16 Doug Kwan <dougkwan@google.com>
13219
13220 * dynobj.cc (Versions::Versions): Initialize version_script_.
13221 Only insert base version symbol definition for a shared object
13222 if version script defines any version versions.
13223 (Versions::define_base_version): New method definition.
13224 (Versions::add_def): Check that base version is not needed.
13225 (Versions::add_need): Define base version lazily.
13226 * dynobj.h (Versions::define_base_version): New method declaration.
13227 (Versions::needs_base_version_): New data member declaration.
13228 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13229 (check_DATA): Add no_version_test.stdout.
13230 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13231 New make rules.
13232 * testsuite/Makefile.in: Regenerate.
13233 * testsuite/no_version_test.c: New file.
13234 * testsuite/no_version_test.sh: Ditto.
13235
3c12dcdb
DK
132362009-10-16 Doug Kwan <dougkwan@google.com>
13237
13238 * expression.cc (class Segment_start_expression): New class definition.
13239 (Segment_start_expression::value): New method definition.
13240 (script_exp_function_segment_start): Return a new
13241 Segment_start_expression.
13242 * gold/script-c.h (script_saw_segment_start_expression): New function
13243 prototype.
13244 * script-sections.cc (Script_sections::Script_sections): Initialize
13245 SAW_SEGMENT_START_EXPRESSION_ to false.
13246 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13247 and -Tbbs options to specify section addresses if given in
13248 command line and no SEGMENT_START expression is seen in a script.
13249 * script-sections.h (Script_sections::saw_segment_start_expression,
13250 Script_sections::set_saw_segment_start_expression): New method
13251 definition.
13252 (Script_sections::saw_segment_start_expression_): New data member
13253 declaration.
13254 * script.cc (script_saw_segment_start_expression): New function.
13255 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13256 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13257 script_test_7.sh and script_test_8.sh.
13258 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13259 script_test_8.stdout.
13260 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13261 (script_test_6, script_test_6.stdout, script_test_7,
13262 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13263 * Makefile.in: Regenerate.
13264 * testsuite/script_test_6.sh: New file.
13265 * testsuite/script_test_6.t: Same.
13266 * testsuite/script_test_7.sh: Same.
13267 * testsuite/script_test_7.t: Same.
13268 * testsuite/script_test_8.sh: Same.
13269
64b1ae37
DK
132702009-10-16 Doug Kwan <dougkwan@google.com>
13271
13272 * output.cc (Output_segment::set_section_list_address): Cast
13273 expressions to unsigned long long type to avoid format warnings.
13274
661be1e2
ILT
132752009-10-15 Ian Lance Taylor <iant@google.com>
13276
12edd763 13277 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13278 dot assignment to script_sections_.
12edd763
ILT
13279 * script-sections.cc (Script_sections::add_dot_assignment):
13280 Initialize if necessary.
13281
68b6574b
ILT
13282 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13283 program headers with no load segment if there is a linker script.
13284
661be1e2
ILT
13285 * layout.cc (Layout::set_segment_offsets): Align the file offset
13286 to the segment aligment for -N or -n with no load segment.
13287 * output.cc (Output_segment::add_output_section): Don't crash if
13288 the first section is a TLS section.
13289 (Output_segment::set_section_list_addresses): Print an error
13290 message if the address moves backward in a linker script.
13291 * script-sections.cc
13292 (Output_section_element_input::set_section_addresses): Don't
13293 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13294 (Orphan_output_section::set_section_addresses): Likewise.
13295
f15f61a7
DK
132962009-10-15 Doug Kwan <dougkwan@google.com>
13297
13298 * layout.cc (Layout::finish_dynamic_section): Generate tags
13299 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13300 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13301 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13302
82bb573a
ILT
133032009-10-14 Ian Lance Taylor <iant@google.com>
13304
13305 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13306 fields.
13307 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13308 data_shdr fields of relinfo.
13309 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13310 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13311 R_386_TLS_LDO_32, adjust based on section flags.
13312 (Target_i386::Relocate::fix_up_ldo): Remove.
13313
374ad285
ILT
133142009-10-13 Ian Lance Taylor <iant@google.com>
13315
13316 Add support for -pie.
13317 * options.h (class General_options): Add -pie and
13318 --pic-executable.
13319 (General_options::output_is_position_independent): Test -pie.
13320 (General_options::output_is_executable): Return true if not shared
13321 and not relocatable.
13322 (General_options::output_is_pie): Remove.
13323 * options.cc (General_options::finalize): Reject incompatible uses
13324 of -pie.
13325 * gold.cc (queue_middle_tasks): A -pie link is not static.
13326 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13327 * symtab.cc (Symbol::final_value_is_known): Return false if
13328 output_is_position_independent.
13329 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13330 output_is_position_independent.
13331 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13332 output_is_position_independent.
13333 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13334 output_is_position_independent.
13335 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13336 two_file_pie_test.
13337 (basic_pie_test.o, basic_pie_test): New targets.
13338 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13339 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13340 (two_file_pie_test): New target.
13341 * testsuite/Makefile.in: Rebuild.
13342 * README: Remove note saying that -pie is not supported.
13343
c6585162
ILT
133442009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13345
13346 * options.h (class General_options): Add -init and -fini.
13347 * layout.cc (Layout::finish_dynamic_section): Emit
13348 given init and fini functions.
13349
032ce4e9
ST
133502009-10-13 Sriraman Tallam <tmsriram@google.com>
13351
13352 * gc.h (gc_process_relocs): Check if icf is enabled using new
13353 function.
13354 * gold.cc (queue_initial_tasks): Likewise.
13355 (queue_middle_tasks): Likewise.
13356 * object.cc (do_layout): Likewise.
13357 * symtab.cc (is_section_folded): Likewise.
13358 * main.cc (main): Likewise.
13359 * reloc.cc (Read_relocs::run): Likewise.
13360 (Sized_relobj::do_scan_relocs): Likewise.
13361 * icf.cc (is_function_ctor_or_dtor): New function.
13362 (Icf::find_identical_sections): Check if function is ctor or dtor when
13363 safe icf is chosen.
13364 * options.h (General_options::icf): Change option to be an enum.
13365 (Icf_status): New enum.
13366 (icf_enabled): New method.
13367 (icf_safe_folding): New method.
13368 (set_icf_status): New method.
13369 (icf_status_): New variable.
13370 * (options.cc) (General_options::finalize): Set icf_status_.
13371 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13372 icf_test and icf_keep_unique_test to use the --icf enum flag.
13373 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13374 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13375
f345227a
ST
133762009-10-12 Sriraman Tallam <tmsriram@google.com>
13377
13378 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13379 includes to gc.h and icf.h.
13380 * arm.cc: Include gc.h.
13381 * gold.cc: Likewise.
13382 * i386.cc: Likewise.
13383 * powerpc.cc: Likewise.
13384 * sparc.cc: Likewise.
13385 * x86_64.cc: Likewise.
13386 * gc.h: Include icf.h.
13387
1c7814ed
ILT
133882009-10-11 Ian Lance Taylor <iant@google.com>
13389
13390 * plugin.cc: Include "gold.h" before other header files.
13391
ae3b5189
CD
133922009-10-10 Chris Demetriou <cgd@google.com>
13393
13394 * options.h (Input_file_argument::Input_file_type): New enum.
13395 (Input_file_argument::is_lib_): Replace with...
13396 (Input_file_argument::type_): New member.
13397 (Input_file_argument::Input_file_argument): Take Input_file_type
13398 'type' rather than boolean 'is_lib' as second argument.
13399 (Input_file_argument::is_lib): Use type_.
13400 (Input_file_argument::is_searched_file): New function.
13401 (Input_file_argument::may_need_search): Handle is_searched_file.
13402 * options.cc (General_options::parse_library): Support -l:filename.
13403 (General_options::parse_just_symbols): Update for Input_file_argument
13404 changes.
13405 (Command_line::process): Likewise.
13406 * archive.cc (Archive::get_file_and_offset): Likewise.
13407 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13408 * script.cc (read_script_file, script_add_file): Likewise.
13409 * fileread.cc (Input_file::Input_file): Likewise.
13410 (Input_file::will_search_for): Handle is_searched_file.
13411 (Input_file::open): Likewise.
13412 * readsyms.cc (Read_symbols::get_name): Likewise.
13413 * testsuite/Makefile.am (searched_file_test): New test.
13414 * testsuite/Makefile.in: Regenerate.
13415 * testsuite/searched_file_test.cc: New file.
13416 * testsuite/searched_file_test_lib.cc: New file.
13417
f3048a1d
ILT
134182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13419 Ian Lance Taylor <iant@google.com>
13420
13421 * descriptor.cc: Include <cstdio> and "binary-io.h".
13422 (Descriptors::open): Open the files in binary mode always.
13423 * script.cc (Lex::get_token): Treat \r as whitespace.
13424
d4780e57
ILT
134252009-10-09 Ian Lance Taylor <iant@google.com>
13426
13427 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13428
d9a893b8
ILT
134292009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13430 Ian Lance Taylor <iant@google.com>
13431
13432 * configure.ac: Check for readv function also.
13433 * fileread.cc (readv): Define if not HAVE_READV.
13434 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13435 does not exist.
13436 * config.in: Regenerate.
13437 * configure: Regenerate.
13438
c0a62865
DK
134392009-10-09 Doug Kwan <dougkwan@google.com>
13440
13441 * layout.cc (Layout::make_output_section): Call target hook to make
13442 ordinary output section.
13443 (Layout::finalize): Adjust parameter list of call the
13444 Target::may_relax().
13445 * layout.h (class Layout::section_list): New method.
13446 * merge.h (Output_merge_base::entsize): Change visibility to public.
13447 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13448 New methods.
13449 (Output_merge_string::do_is_string): New method.
13450 * object.cc (Sized_relobj::do_setup): renamed from
13451 Sized_relobj::set_up.
13452 * object.h (Sized_relobj::adjust_shndx,
13453 Sized_relobj::initializ_input_to_output_maps,
13454 Sized_relobj::free_input_to_output_maps): Change visibilities to
13455 protected.
13456 (Sized_relobj::setup): Virtualize.
13457 (Sized_relobj::do_setup): New method declaration.
13458 (Sized_relobj::invalidate_section_offset,
13459 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13460 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13461 * options.cc (parse_int): New function.
13462 * options.h (parse_int): New declaration.
13463 (DEFINE_int): New macro.
13464 (stub_group_size): New option.
13465 * output.cc (Output_section::Output_section): Initialize memebers
13466 merge_section_map_, merge_section_by_properties_map_,
13467 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13468 (Output_section::add_input_section): Handled deferred code-fill
13469 generation and remove an old comment.
13470 (Output_section::add_relaxed_input_section): New method definition.
13471 (Output_section::add_merge_input_section): Use merge section by
13472 properties map to speed to search. Update merge section maps
13473 as appropriate.
13474 (Output_section::build_relaxation_map): New method definition.
13475 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13476 Same.
13477 (Output_section::relax_input_section): Renamed to
13478 Output_section::convert_input_sections_to_relaxed_sections and change
13479 interface to take a vector of pointers to relaxed sections.
13480 (Output_section::find_merge_section,
13481 Output_section::find_relaxed_input_section): New method definitions.
13482 (Output_section::is_input_address_mapped,
13483 Output_section::output_offset, Output_section::output_address):
13484 Use output section data maps to speed up searching.
13485 (Output_section::find_starting_output_address): Add comments.
13486 (Output_section::do_write,
13487 Output_section::write_to_postprocessing_buffer): Do code-fill
13488 generation as appropriate.
13489 (Output_section::get_input_sections): Invalidate relaxed input section
13490 map.
13491 (Output_section::restore_states): Adjust type of checkpoint .
13492 Invalidate relaxed input section map.
13493 * output.h (Output_merge_base): New class declaration.
13494 (Input_section_specifier): New class defintion.
13495 (class Output_relaxed_input_section) Change base class to
13496 Output_section_data_build.
13497 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13498 base class initializer.
13499 (Output_section::add_relaxed_input_section): New method declaration.
13500 (Output_section::Input_section): Change visibility to protected.
2e702c99 13501 (Output_section::Input_section::relobj,
c0a62865
DK
13502 Output_section::Input_section::shndx): Handle relaxed input sections.
13503 Output_section::input_sections) Change visibility to protected. Also
13504 define overload to return a non-const pointer.
13505 (Output_section::Merge_section_properties): New class defintion.
13506 (Output_section::Merge_section_by_properties_map,
13507 Output_section::Output_section_data_by_input_section_map,
13508 Output_section::Relaxation_map): New types.
13509 (Output_section::relax_input_section): Rename method to
13510 Output_section::convert_input_sections_to_relaxed_sections and change
13511 interface to take a vector of relaxed section pointers.
13512 (Output_section::find_merge_section,
13513 Output_section::find_relaxed_input_section,
13514 Output_section::build_relaxation_map,
13515 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13516 New method declarations.
13517 (Output_section::merge_section_map_
13518 Output_section::merge_section_by_properties_map_,
13519 Output_section::relaxed_input_section_map_,
13520 Output_section::is_relaxed_input_section_map_valid_,
13521 Output_section::generate_code_fills_at_write_): New data members.
13522 * script-sections.cc
13523 (Output_section_element_input::set_section_addresses): Call
13524 current_data_size and addralign methods of relaxed input sections.
13525 (Orphan_output_section::set_section_addresses): Call current_data_size
13526 and addralign methods of relaxed input sections.
13527 * symtab.cc (Symbol_table::compute_final_value): Extract template
13528 from the body of Symbol_table::sized_finalize_symbol.
13529 (Symbol_table::sized_finalized_symbol): Call
13530 Symbol_table::compute_final_value.
13531 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13532 (Symbol_table::compute_final_value): New templated method declaration.
13533 * target.cc (Target::do_make_output_section): New method defintion.
13534 * target.h (Target::make_output_section): New method declaration.
13535 (Target::relax): Add more parameters for input objects, symbol table
13536 and layout. Adjust call to do_relax.
13537 (Target::do_make_output_section): New method declaration.
13538 (Target::do_relax): Add parameters for input objects, symbol table
13539 and layout.
13540
d446d6c4
ILT
135412009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13542
13543 * pread.c: Include stdio.h.
13544
bc06c745
ILT
135452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13546
13547 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13548 defined.
13549
75aea3d0
ILT
135502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13551
13552 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13553 Change read_shndx type to unsigned int.
13554 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13555 int.
13556 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13557 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13558 Change read_shndx type to unsigned int.
13559 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13560 int.
13561 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13562 * layout.cc (Layout::create_symtab_sections): Cast the result of
13563 local_symcount * symsize to off_t in the gold_assert.
13564
be8fcb75
ILT
135652009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13566
13567 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13568 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13569 R_ARM_BASE_ABS.
13570 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13571 (Arm_relocate_functions::thm_abs5): New function.
13572 (Arm_relocate_functions::abs12): New function.
13573 (Arm_relocate_functions::abs16): New function.
13574 (Arm_relocate_functions::base_abs): New function.
13575 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13576 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13577 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13578 R_ARM_BASE_ABS.
13579 (Scan::global): Likewise.
13580 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13581 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13582 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13583 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13584 R_ARM_BASE_ABS.
13585
c2a122b6
ILT
135862009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13587
13588 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13589 (Arm_relocate_functions::movt_prel): New function.
13590 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13591 (Arm_relocate_functions::thm_movt_prel): New function.
13592 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13593 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13594 (Scan::global, Relocate::relocate): Likewise.
13595 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13596
c4aa1e2d
ILT
135972009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13598
13599 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13600 Incremental_checker.
13601 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13602 unsigned int.
13603 (class Incremental_inputs_header): New class.
13604 (Incremental_inputs_header_writer): Edit comment.
13605 (Incremental_inputs_entry): New class.
13606 (Incremental_inputs_entry_writer): Edit comment.
13607 (Sized_incremental_binary::do_find_incremental_inputs_section):
13608 Add *strtab_shndx parameter, fill it.
13609 (Sized_incremental_binary::do_check_inputs): New method.
13610 (Incremental_checker::can_incrementally_link_output_file): Use
13611 Sized_incremental_binary::check_inputs.
13612 (Incremental_inputs::report_command_line): Save command line in
13613 command_line_.
13614 * incremental.h:
13615 (Incremental_binary::find_incremental_inputs_section): New
13616 method.
13617 (Incremental_binary::do_find_incremental_inputs_section): Add
13618 strtab_shndx parameter.
13619 (Incremental_binary::do_check_inputs): New pure virtual method.
13620 (Sized_incremental_binary::do_check_inputs): Declare.
13621 (Incremental_checker::Incremental_checker): Add incremental_inputs
13622 parameter, use it to initialize incremental_inputs_.
13623 (Incremental_checker::incremental_inputs_): New field.
13624 (Incremental_checker::command_line): New method.
13625 (Incremental_checker::inputs): New method.
13626 (Incremental_checker::command_line_): New field.
13627
c549a694
ILT
136282009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13629
13630 * incremental.cc: Include <cstdarg> and "target-select.h".
13631 (vexplain_no_incremental): New function.
13632 (explain_no_incremental): New function.
13633 (Incremental_binary::error): New method.
13634 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13635 method.
13636 (make_sized_incremental_binary): New function.
13637 (open_incremental_binary): New function.
13638 (can_incrementally_link_file): Add checks if output is ELF and has
13639 inputs section.
13640 * incremental.h: Include "elfcpp_file.h" and "output.h".
13641 (Incremental_binary): New class.
13642 (Sized_incremental_binary): New class.
13643 (open_incremental_binary): Declare.
13644 * object.cc (is_elf_object): Use
13645 elfcpp::Elf_recognizer::is_elf_file.
13646 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13647 * output.h (Output_file::filesize): New method.
13648
fd3c5f0b
ILT
136492009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13650
13651 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13652 New function.
13653 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13654 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13655 function.
13656 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13657 function.
13658 (Arm_relocate_functions::movw_abs_nc): New function.
13659 (Arm_relocate_functions::movt_abs): New function.
13660 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13661 (Arm_relocate_functions::thm_movt_abs): New function.
13662 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13663 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13664 (Scan::global): Likewise.
13665 (Relocate::relocate): Likewise.
13666 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13667
7f5309a5
ILT
136682009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13669
13670 * arm.cc (Arm_relocate_functions::got_prel) New function.
13671 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13672 (Relocate::relocate): Likewise.
13673 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13674
364c7fa5
ILT
136752009-10-06 Ian Lance Taylor <iant@google.com>
13676
13677 * options.h (class General_options): Define
13678 split_stack_adjust_size parameter.
13679 * object.h (class Object): Add uses_split_stack_ and
13680 has_no_split_stack_ fields. Add uses_split_stack and
13681 has_no_split_stack accessor functions. Declare
13682 handle_split_stack_section.
13683 (class Reloc_symbol_changes): Define.
13684 (class Sized_relobj): Define Function_offsets. Declare
13685 split_stack_adjust, split_stack_adjust_reltype, and
13686 find_functions.
13687 * object.cc (Object::handle_split_stack_section): New function.
13688 (Sized_relobj::do_layout): Call handle_split_stack_section.
13689 * dynobj.cc (Sized_dynobj::do_layout): Call
13690 handle_split_stack_section.
13691 * reloc.cc (Sized_relobj::relocate_sections): Call
13692 split_stack_adjust for executable sections in split_stack
13693 objects. Pass reloc_map to relocate_section.
13694 (Sized_relobj::split_stack_adjust): New function.
13695 (Sized_relobj::split_stack_adjust_reltype): New function.
13696 (Sized_relobj::find_functions): New function.
13697 * target-reloc.h: Include "object.h".
13698 (relocate_section): Add reloc_symbol_changes parameter. Change
13699 all callers.
13700 * target.h (class Target): Add calls_non_split method. Declare
13701 do_calls_non_split virtual method. Declare match_view and
13702 set_view_to_nop.
13703 * target.cc: Include "elfcpp.h".
13704 (Target::do_calls_non_split): New function.
13705 (Target::match_view): New function.
13706 (Target::set_view_to_nop): New function.
13707 * gold.cc (queue_middle_tasks): Give an error if mixing
13708 split-stack and non-split-stack objects with -r.
13709 * i386.cc (Target_i386::relocate_section): Add
13710 reloc_symbol_changes parameter.
13711 (Target_i386::do_calls_non_split): New function.
13712 * x86_64.cc (Target_x86_64::relocate_section): Add
13713 reloc_symbol_changes parameter.
13714 (Target_x86_64::do_calls_non_split): New function.
13715 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13716 parameter.
13717 * powerpc.cc (Target_powerpc::relocate_section): Add
13718 reloc_symbol_changes parameter.
13719 * sparc.cc (Target_sparc::relocate_section): Add
13720 reloc_symbol_changes parameter.
13721 * configure.ac: Call AM_CONDITIONAL for the default target.
13722 * configure: Rebuild.
13723 * testsuite/Makefile.am (TEST_AS): New variable.
13724 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13725 (check_DATA): Add split_i386 and split_x86_64 files.
13726 (SPLIT_DEFSYMS): Define.
13727 (split_i386_[1234n].o): New targets.
13728 (split_i386_[124]): New targets.
13729 (split_i386_[1234r].stdout): New targets.
13730 (split_x86_64_[1234n].o): New targets.
13731 (split_x86_64_[124]): New targets.
13732 (split_x86_64_[1234r].stdout): New targets.
13733 (MOSTLYCLEANFILES): Add new executables.
13734 * testsuite/split_i386.sh: New file.
13735 * testsuite/split_x86_64.sh: New file.
13736 * testsuite/split_i386_1.s: New file.
13737 * testsuite/split_i386_2.s: New file.
13738 * testsuite/split_i386_3.s: New file.
13739 * testsuite/split_i386_4.s: New file.
13740 * testsuite/split_i386_n.s: New file.
13741 * testsuite/split_x86_64_1.s: New file.
13742 * testsuite/split_x86_64_2.s: New file.
13743 * testsuite/split_x86_64_3.s: New file.
13744 * testsuite/split_x86_64_4.s: New file.
13745 * testsuite/split_x86_64_n.s: New file.
13746 * testsuite/testfile.cc (Target_test): Update relocation_section
13747 function.
13748 * testsuite/Makefile.in: Rebuild.
13749
e8a9fcda
ILT
137502009-10-06 Ian Lance Taylor <iant@google.com>
13751
13752 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13753 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13754 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13755 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13756 the address on ldo_addrs_.
13757 (Target_i386::Relocate::fix_up_ldo): New function.
13758
e99daf92
ILT
137592009-10-06 Rafael Espindola <espindola@google.com>
13760
13761 * plugin.cc (add_input_library): New.
13762 (Plugin::load): Add add_input_library to tv.
13763 (Plugin_manager::add_input_file): Add the is_lib argument.
13764 (add_input_file): Update call to Plugin_manager::add_input_file.
13765 (add_input_library): New.
13766 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13767
966d4097
DK
137682009-09-30 Doug Kwan <dougkwan@google.com>
13769
13770 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13771 symbol and call Symbol::may_need_copy_reloc to determine if
13772 a copy reloc is needed.
13773 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13774 nocopyreloc is given in command line.
13775 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13776 given in command line.
13777 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13778 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13779 of the removed Target_i386::may_need_copy_reloc.
13780 * options.h (copyreloc): New option with default value false.
13781 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13782 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13783 instead of the removed Target_powerpc::may_need_copy_reloc.
13784 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13785 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13786 instead of the removed Target_sparc::may_need_copy_reloc.
13787 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13788 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13789 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13790 instead of the removed Target_x86_64::may_need_copy_reloc.
13791
029ba973
ILT
137922009-09-30 Ian Lance Taylor <iant@google.com>
13793
13794 * object.h (class Object): Remove target_ field, and target,
13795 sized_target, and set_target methods.
13796 (Object::sized_target): Remove.
13797 (class Sized_relobj): Update declarations. Remove sized_target.
13798 * object.cc (Sized_relobj::setup): Remove target parameter.
13799 Change all callers.
13800 (Input_objects::add_object): Don't do anything with the target.
13801 (make_elf_sized_object): Add punconfigured parameter. Change all
13802 callers. Set or test parameter target.
13803 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13804 Change all callers.
13805 * parameters.cc (Parameters::set_target): Change parameter type to
13806 be non-const.
13807 (Parameters::default_target): Remove.
13808 (set_parameters_target): Change parameter type to be non-const.
13809 (parameters_force_valid_target): New function.
13810 (parameters_clear_target): New function.
13811 * parameters.h (class Parameters): Update declarations. Remove
13812 default_target method. Add sized_target and clear_target
13813 methods. Change target_ to be non-const.
13814 (set_parameters_target): Update declaration.
13815 (parameters_force_valid_target): Declare.
13816 (parameters_clear_target): Declare.
13817 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13818 as NULL if we aren't searching.
13819 (Add_symbols::run): Don't check for compatible target.
13820 * fileread.cc (Input_file::open_binary): Call
13821 parameters_force_valid_target.
13822 * gold.cc (queue_middle_tasks): Likewise.
13823 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13824 set_target on object.
13825 * dynobj.h (class Sized_dynobj): Update declarations.
13826 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13827 make_elf_object returns NULL.
13828 (Archive::include_member): Don't check whether object target is
13829 compatible.
13830 * output.cc (Output_section::add_input_section): Get target from
13831 parameters.
13832 (Output_section::relax_input_section): Likewise.
13833 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13834 parameters.
13835 (Sized_relobj::do_scan_relocs): Likewise.
13836 (Sized_relobj::relocate_sections): Likewise.
13837 * resolve.cc (Symbol_table::resolve): Likewise.
13838 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13839 parameter. Change all callers.
13840 (Symbol_table::add_from_object): Get target from parameters.
13841 (Symbol_table::add_from_relobj): Don't check object target.
13842 (Symbol_table::add_from_dynobj): Likewise.
13843 (Symbol_table::define_special_symbol): Get target from
13844 parameters.
13845 * symtab.h (class Symbol_table): Update declaration.
13846 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13847 parameter. Change all callers. Clear parameter target.
13848 (Binary_test): Test target here.
13849 * testsuite/object_unittest.cc (gold_testsuite): Remove
13850 target_test_pointer parameter. Change all callers.
13851 (Object_test): Test target here.
13852
a6a22b83
ILT
138532009-09-26 Ian Lance Taylor <iant@google.com>
13854
13855 * testsuite/initpri1.c: Don't try to use constructor priorities if
13856 compiling with gcc before 4.3.
13857
6a8f49fe
ILT
138582009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13859
13860 * testsuite/retain_symbols_file_test.sh (check_present): Change
13861 output file name to retain_symbols_file_test.stdout.
13862 (check_absent): Likewise.
13863
8c604651
CS
138642009-09-18 Craig Silverstein <csilvers@google.com>
13865
13866 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13867 * options.cc: Include <cerrno> and <fstream>.
13868 (General_options::finalize): Parse -retain-symbols-file tag.
13869 * options.h: New flag.
13870 (General_options): New method should_retain_symbol, new
13871 variable symbols_to_retain.
13872 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13873 should_retain_symbol map.
13874 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13875 * testsuite/Makefile.in: Regenerate.
13876 * testsuite/retain_symbols_file_test.sh: New file.
13877
ca58b19f
NC
138782009-09-18 Nick Clifton <nickc@redhat.com>
13879
13880 * po/es.po: Updated Spanish translation.
13881
20e6d0d6
DK
138822009-09-17 Doug Kwan <dougkwan@google.com>
13883
13884 * debug.h (DEBUG_RELAXATION): New constant.
13885 (DEBUG_ALL): Add DEBUG_RELAXATION.
13886 (debug_string_to_enum): Add relaxation debug option.
13887 * layout.cc
13888 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13889 Layout::Relaxation_debug_check::read_sections,
13890 Layout::Relaxation_debug_check::read_sections): New method definitions.
13891 (Layout::Layout): Initialize data members
13892 record_output_section_data_from_scrips_,
13893 script_output_section_data_list_ and relaxation_debug_check_.
13894 (Layout::save_segments, Layout::restore_segments,
13895 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13896 Layout::relaxation_loop_body): New method definitions.
13897 (Layout::finalize): Support relaxation. Move section layout code to
13898 Layout::relaxation_loop_body.
13899 (Layout::set_asection_address_from_script): Move code for orphan
13900 section placement out.
13901 (Layout::place_orphan_sections_in_script): New method definition.
13902 * layout.h (Output_segment_headers, Output_file_header):
13903 New forward class declarations.
13904 (Layout::~Layout): Define.
13905 (Layout::new_output_section_data_from_script): New method definition.
13906 (Layout::place_orphan_sections_in_script): New method declaration.
13907 (Layout::Segment_states): New type declaration.
13908 (Layout::save_segments, Layout::restore_segments,
13909 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13910 Layout::relaxation_loop_body): New method declarations.
13911 (Layout::Output_section_data_list): New type declaration.
13912 (Layout::Relaxation_debug_check): New class definition.
13913 (Layout::record_output_section_data_from_script_,
13914 Layout::script_output_section_data_list_, Layout::segment_states_,
13915 Layout::relaxation_debug_check_): New data members.
13916 * output.cc: (Output_section_headers::do_size): New method definition.
13917 (Output_section_headers::Output_section_headers): Move size
13918 computation to Output_section_headers::do_size.
13919 (Output_segment_headers::do_size): New method definition.
e1df38aa 13920 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13921 Output_file_header::do_size and call it.
13922 (Output_file_header::do_size): New method definition.
13923 (Output_data_group::Output_data_group): Adjust call to
13924 Output_section_data.
13925 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13926 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13927 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13928 RELAXED_INPUT_SECTION_CODE.
13929 (Output_section::Output_section): Initialize data member checkpoint_.
13930 (Output_section::~Output_section): Delete checkpoint object pointed
13931 by checkpoint_.
13932 (Output_section::add_input_section): Always add an Input_section if
13933 relaxing.
13934 (Output_section::add_merge_input_section): Add assert.
13935 (Output_section::relax_input_section): New method definition.
13936 (Output_section::set_final_data_size): Set load address to zero for
13937 an unallocated section.
13938 (Output_section::do_address_and_file_offset_have_reset_values):
13939 New method definition.
13940 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13941 Handle relaxed input section.
13942 (Output_section::sort_attached_input_sections): Checkpoint input
13943 section list lazily.
13944 (Output_section::get_input_sections): Change type of input_sections to
13945 list of Simple_input_section pointers. Checkpoint input section list
13946 lazily. Also handle relaxed input sections.
13947 (Output_section::add_input_section_for_script): Take a reference to
13948 a Simple_input_section object instead of Relobj pointer and section
13949 index as parameter. Handle relaxed input sections.
13950 (Output_section::save_states, Output_section::restore_states): New
13951 method definitions.
13952 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13953 (Output_data::is_data_size_fixed): New method definition.
13954 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13955 if it is fixed.
13956 (Output_data::address_and_file_offset_have_reset_values): New method
13957 definition.
13958 (Output_data::do_address_and_file_offset_have_reset_values): New method
13959 definition.
13960 (Output_data::set_data_size): Check that data size is not fixed.
13961 (Output_data::fix_data_size): New method definition.
13962 (Output_data::is_data_size_fixed_): New data member.
13963 (Output_section_headers::set_final_data_size): New method definition.
13964 (Output_section_headers::do_size): New method declaration.
13965 (Output_segment_headers::set_final_data_size): New method definition.
13966 (Output_segment_headers::do_size): New method declaration.
13967 (Output_file_header::set_final_data_size)::New method definition.
13968 (Output_file_header::do_size)::New method declaration.
13969 (Output_section_data::Output_section_data): Add new parameter
13970 is_data_size_fixed and use it to fix data size.
13971 (Output_data_const::Output_data_const): Adjust call to base class
13972 constructor and fix data size.
13973 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13974 base class constructor and fix data size.
13975 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13976 base class constructor and fix data size.
13977 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13978 class constructor and fix data size.
13979 (Output_data_group::set_final_data_size): New method definition.
13980 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13981 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13982 class constructor and fix data size.
13983 (Output_relaxed_input_section): New class definition.
13984 (Output_section::Simple_input_section): New class definition.
13985 (Output_section::get_input_sections): Adjust parameter list.
13986 (Output_section::add_input_section_for_script): Same.
13987 (Output_section::save_states, Output_section::restore_states,
13988 Output_section::do_address_and_file_offset_have_reset_values,
13989 (Output_section::Input_section::Input_section): Handle
13990 RELAXED_INPUT_SECTION_CODE. Add new overload for
13991 Output_relaxed_input_section.
13992 (Output_section::Input_section::is_input_section,
13993 Output_section::Input_section::set_output_section): Handle relaxed
13994 input section.
13995 (Output_section::Input_section::is_relaxed_input_section,
13996 Output_section::Input_section::output_section_data,
13997 Output_section::Input_section::relaxed_input_section): New method
13998 definitions.
13999 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14000 value.
14001 (Output_section::Input_section::u1_): Update comments.
14002 (Output_section::Input_section::u2_): Add new union member poris.
14003 (Output_section::Checkpoint_output_section): New classs definition.
14004 (Output_section::relax_input_section): New method declaration.
14005 (Output_section::checkpoint_): New data member.
14006 (Output_segment): Update comments.
14007 (Output_segment::Output_segment): Un-privatize copy constructor.
14008 (Output_segment::operator=): Un-privatize.
14009 * script-sections.cc (Output_section_element::Input_section_list):
14010 Change element type to Output_section::Simple_input_section.
14011 (Output_section_element_dot_assignment::set_section_addresses):
14012 Register output section data for relaxation clean up.
14013 (Output_data_exression::Output_data_expression): Adjust call to base
14014 constructor to fix data size.
14015 (Output_section_element_data::set_section_addresses): Register
14016 Output_data_expression object for relaxation clean up.
14017 (struct Input_section_info): Replace Relobj pointer and section index
14018 pair with Output_section::Simple_input_section and Convert struct to a
14019 class.
14020 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14021 Input_section_info data member to use accessors.
20e6d0d6
DK
14022 (Output_section_element_input::set_section_addresses): Use layout
14023 parameter. Adjust code to use Output_section::Simple_input_section
14024 and Input_secction_info classes. Register filler for relaxation
14025 clean up.
14026 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14027 and section index pair with Output_section::Simple_input_section
14028 class. Adjust code accordingly.
14029 (Phdrs_element::release_segment): New method definition.
14030 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14031 segment list.
14032 (Script_sections::release_segments): New method definition.
14033 * gold/script-sections.h (Script_sections::release_segments): New
14034 method declaration.
14035 * gold/target.h (Target::may_relax, Target::relax,
14036 Target::do_may_relax, Target::do_relax): New method definitions.
14037
5e445df6
ILT
140382009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14039
14040 * arm.cc (has_signed_unsigned_overflow): New function.
14041 (Arm_relocate_functions::abs8): New function.
14042 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14043 (Target_arm::Scan::global): Likewise.
14044 (Target_arm::relocate::relocate): Likewise.
14045 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14046 Likewise.
14047
8c604651 140482009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14049
14050 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14051 * testsuite/Makefile.in: Regenerate.
14052
1e9cc1c2
NC
140532009-09-11 Nick Clifton <nickc@redhat.com>
14054
14055 * po/gold.pot: Updated by the Translation project.
14056
6a89f575
CC
140572009-09-08 Cary Coutant <ccoutant@google.com>
14058
14059 * output.cc (Output_file::open): Add execute permission to empty file.
14060 * testsuite/Makefile.am (permission_test): New test.
14061 * testsuite/Makefile.in: Regenerate.
14062
fdcac5af
ILT
140632009-09-02 Ian Lance Taylor <iant@google.com>
14064
14065 * output.cc (Output_file::resize): Call map_no_anonymous rather
14066 than map.
14067
44453f85
ILT
140682009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14069
14070 * gold.cc: Include "incremental.h".
14071 (queue_initial_tasks): Call Incremental_checker methods.
14072 * incremental.cc: Include "output.h".
14073 (Incremental_checker::can_incrementally_link_output_file): New
14074 method.
14075 * incremental.h (Incremental_checker): New class.
14076
14077 * output.cc (Output_file::open_for_modification): New method.
14078 (Output_file::map_anonymous): Changed return type to bool. Record
14079 map in base_ field.
14080 (Output_file::map_no_anonymous): New method, broken out of map.
14081 (Output_file::map): Use map_no_anonymous and map_anonymous.
14082 * output.h (class Output_file): Update declarations.
14083
293c1386
CC
140842009-08-24 Cary Coutant <ccoutant@google.com>
14085
14086 * options.h (Command_line::Pre_options): New class.
14087 (Command_line::pre_options): New member.
14088 * options.cc (gold::options::ready_to_register): New variable.
14089 (One_option::register_option): Do nothing if not registering options.
14090 Assert if same short option registered twice.
14091 (General_options::General_options): Turn off option registration when
14092 done constructing.
14093 (Command_line::Pre_options::Pre_options): New constructor.
14094
f773f3d2
CC
140952009-08-24 Cary Coutant <ccoutant@google.com>
14096
06a73cfe
CC
14097 * options.h (General_options::no_keep_memory): Remove incorrect
14098 short option.
f773f3d2 14099
a15af8e2
RW
141002009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14101
14102 * Makefile.am (am__skiplex, am__skipyacc): New.
14103 * Makefile.in: Regenerate.
14104
c462b41b
RW
141052009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14106
14ec8efd
RW
14107 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14108 (INCLUDES): ... this.
14109 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14110 (AM_CPPFLAGS): Renamed from ...
14111 (INCLUDE): ... this.
14112 * Makefile.in, testsuite/Makefile.in: Regenerate.
14113
81ecdfbb
RW
14114 * Makefile.in: Regenerate.
14115 * aclocal.m4: Likewise.
14116 * config.in: Likewise.
14117 * configure: Likewise.
14118 * testsuite/Makefile.in: Likewise.
14119
c462b41b
RW
14120 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14121 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14122 * Makefile.in: Regenerate.
14123 * testsuite/Makefile.in: Regenerate.
14124
2da73f13
CC
141252009-08-19 Cary Coutant <ccoutant@google.com>
14126
14127 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14128 symbols in shared libraries overridden by hidden or internal symbols
14129 in the main program.
14130
2db70501
CD
141312009-08-19 Chris Demetriou <cgd@google.com>
14132
14133 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14134 checking source file names in error messages.
14135
f733487b
DK
141362009-08-18 Doug Kwan <dougkwan@google.com>
14137
14138 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14139 an elcpp::Ehdr as parameter. Adjust call to set_target.
14140 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14141 an elfcpp::Ehdr as parameter.
14142 * object.cc (Object::set_target): Remove the version that looks up
14143 a target and sets it.
14144 (Sized_relobj::setup): Take a Target object instead of
14145 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14146 (make_elf_sized_object): Find target and ask target to
14147 make an ELF object.
14148 * object.h: (Object::set_target): Remove the version that looks up
14149 a target and sets it.
14150 (Sized_relobj::setup): Take a Target object instead of
14151 an elfcpp:Ehdr as parameter.
14152 * target.cc: Include dynobj.h.
14153 (Target::do_make_elf_object_implementation): New.
2e702c99 14154 (Target::do_make_elf_object): New.
f733487b
DK
14155 * target.h (Target::make_elf_object): New template declaration.
14156 (Target::do_make_elf_object): New method declarations.
14157 (Target::do_make_elf_object_implementation): New template declaration.
14158
cc70f101
ILT
141592009-08-14 Ian Lance Taylor <iant@google.com>
14160
14161 * gold.h (FUNCTION_NAME): Define.
14162 (gold_unreachable): Use FUNCTION_NAME.
14163
ef5e0cb1
ST
141642009-08-12 Sriraman Tallam <tmsriram@google.com>
14165
14166 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14167 symbol in the --keep-unique list is not found.
14168
48c187ce
ST
141692009-08-12 Sriraman Tallam <tmsriram@google.com>
14170
14171 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14172 been maked as --keep-unique.
14173 (Icf::unfold_section): New function.
14174 * icf.h (Icf::unfold_section): New function.
14175 * options.h (General_options::keep_unique): New option.
14176 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14177 * testsuite/Makefile.in: Regenerate.
14178 * testsuite/icf_keep_unique_test.sh: New file.
14179 * testsuite/icf_keep_unique_test.cc: New file.
14180
645afe0c
CC
141812009-08-12 Cary Coutant <ccoutant@google.com>
14182
14183 PR 10471
14184 * resolve.cc (Symbol_table::resolve): Check for references from
14185 dynamic objects to hidden and internal symbols.
14186 * testsuite/Makefile.am (hidden_test.sh): New test.
14187 * testsuite/Makefile.in: Regenerate.
14188 * testsuite/hidden_test.sh: New script.
14189 * testsuite/hidden_test_1.c: New test source.
14190 * testsuite/hidden_test_main.c: New test source.
14191
11af873f
DK
141922009-08-11 Doug Kwan <dougkwan@google.com>
14193
14194 * arm.cc: Update comments.
14195 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14196 segment to locate the .ARM.exidx section if present.
14197
b9f7d72d
DK
141982009-08-09 Doug Kwan <dougkwan@google.com>
14199
14200 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14201 patch.
14202
ddd3c53c
ST
142032009-08-07 Sriraman Tallam <tmsriram@google.com>
14204 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14205 compiler warnings.
14206
27721062
ST
142072009-08-06 Sriraman Tallam <tmsriram@google.com>
14208
14209 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14210 valid tls_segment only for non-debug-section relocations.
14211 * testsuite/Makefile.am: Add gc_tls_test.
14212 * testsuite/Makefile.in: Regenerate.
14213 * testsuite/gc_tls_test.cc: New file.
14214 * testsuite/gc_tls_test.sh: New file.
14215
ef15dade 142162009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14217
ef15dade
ST
14218 * icf.cc: New file.
14219 * icf.h: New file.
14220 * Makefile.am (CCFILES): Add icf.cc.
14221 (HFILES): Add icf.h
14222 * Makefile.in: Regenerate.
14223 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14224 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14225 section, symbol and addend information for the relocs.
14226 * gold.cc (queue_middle_tasks): Call identical code folding.
14227 * gold.h: Add defines for multimap.
14228 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14229 to the call of finalize_local_symbols.
14230 * main.cc (main): Create object of class Icf.
14231 * object.cc (Sized_relobj::do_layout): Allow this function to be
14232 called twice during icf.
14233 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14234 to sections marked as identical by icf.
14235 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14236 when available.
14237 (Sized_relobj::do_section_entsize): New function.
14238 * object.h (Object::section_entsize): New function.
14239 (Object::do_section_entsize): New pure virtual function.
14240 (Relobj::finalize_local_symbols): Add new parameter.
14241 (Relobj::do_section_entsize): New function.
14242 * options.h (General_options::icf): New option.
14243 (General_options::icf_iterations): New option.
14244 (General_options::print_icf_sections): New option.
14245 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14246 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14247 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14248 icf.
14249 * symtab.cc (Symbol_table::is_section_folded): New function.
14250 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14251 to sections marked as identical by icf.
14252 * symtab.h (Symbol_table::set_icf): New function.
14253 (Symbol_table::icf): New function.
14254 (Symbol_table::is_section_folded): New function.
14255 (Symbol_table::icf_): New data member.
14256 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14257 * testsuite/Makefile.am: Add commands to build icf_test.
14258 * testsuite/Makefile.in: Regenerate.
14259 * testsuite/icf_test.sh: New file.
14260 * testsuite/icf_test.cc: New file.
14261
c3b65ac4
CD
142622009-07-24 Chris Demetriou <cgd@google.com>
14263
14264 * layout.cc (is_compressible_debug_section): Fix incorrect
14265 comment about compressed section names.
14266
1caf2c51
ILT
142672009-07-20 Ian Lance Taylor <ian@airs.com>
14268
14269 PR 10419
14270 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14271
1ef4d87f
ILT
142722009-07-16 Ian Lance Taylor <iant@google.com>
14273
14274 PR 10400
14275 * layout.h: #include <map>.
14276 (class Kept_section): Change from struct to class. Add accessors
14277 and setters. Add section size to Comdat_group mapping. Change
14278 Comdat_group to std::map. Add is_comdat_ field. Add
14279 linkonce_size field in union.
14280 (class Layout): Update declaration of find_or_add_kept_section.
14281 Don't declare find_kept_object.
14282 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14283 parameter. Add object, shndx, is_comdat, and is_group_name
14284 parameters. Change all callers. Adjust for new Kept_section.
14285 (Layout::find_kept_object): Remove.
14286 * object.cc (Sized_relobj::include_section_group): Update use of
14287 Kept_section. Rename secnum to shndx. Only record
14288 Kept_comdat_section if sections are the same size.
14289 (Sized_relobj::include_linkonce_section): Update use of
14290 Kept_section. Only record Kept_comdat_section if sections are the
14291 same size. Set size of linkonce section.
14292 (Sized_relobj::map_to_kept_section): Update call to
14293 get_kept_comdat_section.
14294 * object.h (class Sized_relobj): Rename fields in
14295 Kept_comdat_section to drop trailing underscores; change object
14296 field to Relobj*. Change Kept_comdat_section_table to store
14297 struct rather than pointer.
14298 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14299 Add kept_object and kept_shndx parameters. Change all callers.
14300 (Sized_relobj::get_kept_comdat_section): Change return type to
14301 bool. Add kept_object and kept_shndx parameters. Change all
14302 callers.
14303 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14304 Layout::find_or_add_kept_section.
14305
37c3b7b0
ILT
143062009-07-09 Ian Lance Taylor <iant@google.com>
14307
14308 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14309 Reserve space in the hash table.
14310
98fa85cb
ILT
143112009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14312
14313 * fileread.cc (File_read::get_mtime): New method.
14314 * fileread.h (Timespec): New structure.
14315 (File_read::get_mtime): New method.
14316 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14317 Renamed from timestamp_nsec.
14318 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14319 Elf_Xword.
e1df38aa 14320 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14321 timestamp_nsec.
e1df38aa 14322 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14323 (Incremental_inputs::report_obejct): Save mtime; style fix.
14324 (Incremental_inputs::report_script): Save mtime; style fix.
14325 (Incremental_inputs::finalize_inputs): Style fix.
14326 (Incremental_inputs::finalize): Style fix.
14327 (Incremental_inputs::create_input_section_data): Store inputs
14328 mtime.
14329 * incremental.h (Incremental_inputs::report_script): Add mtime
14330 argument.
14331 (Incremental_inputs::Input_info::Input_info): Intialize only one
14332 union member.
14333 (Incremental_inputs::Input_info::archive): Move to nameless
14334 union.
14335 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14336 (Incremental_inputs::Input_info::script): Move to nameless union.
14337 (Incremental_inputs::mtime): New field.
14338 * script.cc (read_input_script): Pass file mtime to
14339 Incremental_input.
14340 * script.h (Script_info::inputs): Style fix.
14341
c9d70757
ILT
143422009-07-01 Ian Lance Taylor <ian@airs.com>
14343
14344 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14345 instead of 32.
14346
9c547ec3
ILT
143472009-06-24 Ian Lance Taylor <iant@google.com>
14348
14349 PR 10156
14350 * layout.cc (Layout::choose_output_section): If we find an
14351 existing section, update the flags.
14352 (Layout::create_notes): New function, broken out of
14353 Layout::finalize.
14354 (Layout::finalize): Don't create note sections.
14355 (Layout::create_note): Don't crash if linker script discards
14356 section.
14357 (Layout::create_gold_note): Likewise.
14358 (Layout::create_build_id): Likewise. Don't set
14359 after_input_sections on the section.
14360 (Layout::create_executable_stack_info): Remove target parameter.
14361 Change caller.
14362 * layout.h (class Layout): Declare create_notes. Update
14363 declaration of create_executable_stack_info.
14364 * gold.cc (queue_middle_tasks): Call create_notes.
14365 * output.cc (Output_section::update_flags_for_input_section): Move
14366 here from output.h. If SHF_ALLOC flag is newly set, mark address
14367 invalid.
14368 * output.h (Output_data::mark_address_invalid): New function.
14369 (class Output_section): Only declare, not define,
14370 update_flags_for_input_section. Remove set_flags.
14371
55458500
ILT
143722009-06-24 Ian Lance Taylor <iant@google.com>
14373
14374 * script-sections.cc (Output_section_definition::
14375 set_section_addresses): Rename shadowing local load_address to
14376 laddr.
14377
1307d6cd
ILT
143782009-06-24 Ian Lance Taylor <iant@google.com>
14379
14380 PR 10244
14381 * reloc.cc (relocate_sections): Skip empty relocation sections.
14382
ec3f783e
ILT
143832009-06-23 Ian Lance Taylor <iant@google.com>
14384
14385 PR 10156
14386 * layout.cc (Layout::create_note): Use choose_output_section
14387 rather than make_output_section.
14388
459c9f1c
ILT
143892009-06-23 Ian Lance Taylor <iant@google.com>
14390
14391 PR 10237
14392 * options.cc (General_options::parse_V): Set printed_version_.
14393 (General_options::General_options): Initialize printed_version_.
14394 * options.h (class General_options): Add printed_version_ field.
14395 * gold.cc (queue_initial_tasks): If there are no input files,
14396 don't give a fatal error if we printed the version information.
14397 (queue_middle_tasks): If using -r with a shared object, give a
14398 fatal error rather than an ordinary error.
14399
1518dc8f
ILT
144002009-06-23 Ian Lance Taylor <iant@google.com>
14401
14402 PR 10219
14403 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14404 (Layout::make_output_section): Set have_stabstr_section_ if we see
14405 a .stab*str section.
14406 (Layout::finalize): Call link_stabs_sections.
14407 (Layout::link_stabs_sections): New file.
14408 * layout.h (class Layout): Add have_stabstr_section_ field.
14409 Declare link_stabs_sections.
14410
3d857b98
DK
144112009-06-23 Doug Kwan <dougkwan@google.com>
14412
14413 * Makefile.am (libgold_a_LIBADD): New.
14414 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14415 * Makefile.in: Regenerate.
3d857b98
DK
14416 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14417 * configure: Regenerate.
14418 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14419 * fileread.cc: Include sys/state.h
14420 * gold.h: Declare memmem and strndup if found missing.
14421 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14422
0639a6f6
ILT
144232009-06-23 Ian Lance Taylor <iant@google.com>
14424
14425 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14426 * configure: Rebuild.
14427
8d63875c
ILT
144282009-06-23 Ian Lance Taylor <iant@google.com>
14429
14430 PR 10147
14431 * object.cc (Object::section_contents): Don't try to get a view if
14432 the section has length zero.
14433 (Object::handle_gnu_warning_section): If the section is empty, use
14434 the name of the section as the warning.
14435
f7c8a183
ILT
144362009-06-23 Ian Lance Taylor <iant@google.com>
14437
14438 PR 10133
14439 * stringpool.h (class Stringpool_template): Add optimize_ field.
14440 (Stringpool_template::set_optimize): New function.
14441 * stringpool.cc (Stringpool_template::Stringpool_template):
14442 Initialize optimize_ field.
14443 (Stringpool_template::set_string_offsets): Test local optimize
14444 fild rather than parameter.
14445 * layout.cc (Layout::Layout): Call set_optimize on the section
14446 name stringpool.
14447
e6a307ba
ILT
144482009-06-22 Ian Lance Taylor <iant@google.com>
14449
14450 PR 10030
14451 * yyscript.y: Parse TARGET.
14452 * script.cc (script_set_target): New function.
14453 * script-c.h (script_set_target): Declare.
14454 * options.cc (General_options::string_to_object_format): Rename
14455 from string_to_object_format in anonymous namespace. Change
14456 callers.
14457 * options.h (class General_options): Declare
14458 string_to_object_format.
14459
3ee173de
ILT
144602009-06-22 Ian Lance Taylor <iant@google.com>
14461
14462 * script-sections.cc (Script_sections::create_segments): Don't put
14463 program headers in a PT_LOAD segment if -n or -N.
14464
144652009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14466
14467 PR 10141
14468 * options.h (class General_options): Add -z lazy and -z now. Sort
14469 -z options into alphabetical order.
14470 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14471
cd6739a1 144722009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14473
14474 * layout.cc (Layout::make_output_section): Call
14475 Target::new_output_section.
14476 (Layout::attach_allocated_section_to_segment): Put large section
14477 sections in a separate load segment with the large segment flag
14478 set.
14479 (Layout::segment_precedes): Sort large data segments after other
14480 load segments.
14481 (align_file_offset): New static function.
14482 (Layout::set_segment_offsets): Use align_file_offset.
14483 * output.h (class Output_section): Add is_small_section_ and
14484 is_large_section_ fields.
14485 (Output_section::is_small_section): New function.
14486 (Output_section::set_is_small_section): New function.
14487 (Output_section::is_large_section): New function.
14488 (Output_section::set_is_large_section): New function.
14489 (Output_section::is_large_data_section): New function.
14490 (class Output_segment): Add is_large_data_segment_ field.
14491 (Output_segment::is_large_data_segment): New function.
14492 (Output_segment::set_is_large_data_segment): New function.
14493 * output.cc (Output_section::Output_section): Initialize new
14494 fields.
14495 (Output_segment::Output_segment): Likewise.
14496 (Output_segment::add_output_section): Add assertion that large
14497 data sections always go in large data segments. Force small data
14498 sections to the end of the list of data sections. Force small BSS
14499 sections to the start of the list of BSS sections. For large BSS
14500 sections to the end of the list of BSS sections.
14501 * symtab.h (class Symbol): Declare is_common_shndx.
14502 (Symbol::is_defined): Check Symbol::is_common_shndx.
14503 (Symbol::is_common): Likewise.
14504 (class Symbol_table): Define enum Commons_section_type. Update
14505 declarations. Add small_commons_ and large_commons_ fields.
14506 * symtab.cc (Symbol::is_common_shndx): New function.
14507 (Symbol_table::Symbol_table): Initialize new fields.
14508 (Symbol_table::add_from_object): Put small and large common
14509 symbols in the right list.
14510 (Symbol_table::sized_finalized_symbol): Check
14511 Symbol::is_common_shndx.
14512 (Symbol_table::sized_write_globals): Likewise.
14513 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14514 common symbol lists. Don't call do_allocate_commons_list if the
14515 list is empty.
14516 (Symbol_table::do_allocate_commons_list): Remove is_tls
14517 parameter. Add comons_section_type parameter. Change all
14518 callers. Handle small and large common symbols.
14519 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14520 Symbol::is_common_shndx.
14521 * resolve.cc (symbol_to_bits): Likewise.
14522 * target.h (Target::small_common_shndx): New function.
14523 (Target::small_common_section_flags): New function.
14524 (Target::large_common_shndx): New function.
14525 (Target::large_common_section_flags): New function.
14526 (Target::new_output_section): New function.
14527 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14528 small_common_section_flags, and large_common_section_flags
14529 fields.
14530 (Target::do_new_output_section): New virtual function.
14531 * arm.cc (Target_arm::arm_info): Initialize new fields.
14532 * i386.cc (Target_i386::i386_info): Likewise.
14533 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14534 Likewise.
14535 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14536 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14537 (Target_x86_64::do_new_output_section): New function.
14538 * configure.ac: Define conditional MCMODEL_MEDIUM.
14539 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14540 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14541 (large_LDFLAGS): Define.
14542 * testsuite/large.c: New file.
14543 * testsuite/testfile.cc (Target_test::test_target_info):
14544 Initialize new fields.
14545 * configure, testsuite/Makefile.in: Rebuild.
14546
bb04269c
DK
145472009-06-05 Doug Kwan <dougkwan@google.com>
14548
14549 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14550 * Makefile.in: Regenerate.
bb04269c
DK
14551 * i386.cc (class Target_i386): Define new virtual method to
14552 override do_is_local_label_name in parent.
14553 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14554 local symbols if --discard-locals or -X is given.
14555 * options.h (class General_options): Declare new options
14556 '--discard-locals' and '-X' for discarding locals.
14557 * target.h (class Target): Define new methods is_local_label_name.
14558 Declare new virtual method do_is_local_label_name.
14559 * target.cc: New file.
14560 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14561 (check_SCRIPTS): Add discard_locals_test.sh.
14562 (check_DATA): Add discard_local_tests.syms.
14563 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14564 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14565 * testsuite/Makefile.in: Regenerate.
14566 * testsuite/discard_locals_test.c: New file.
14567 * testsuite/discard_locals_test.sh: Same.
14568
805bb01c
DK
145692009-06-05 Doug Kwan <dougkwan@google.com>
14570
14571 * object.cc (Sized_relobj::Sized_relobj): Initialize
14572 discarded_eh_frame_shndx_ to -1U.
14573 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14574 section.
14575 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14576 a discarded .eh_frame section.
14577 (Sized_relobj::do_finalize_local_symbols): Ditto.
14578 * object.h (class Sized_relobj): Declare new member
14579 discarded_eh_frame_shndx_.
14580 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14581 (local_labels_test.o, local_labels_test): New rules.
14582 * testsuite/Makefile.in: Regenerate.
14583
1dcd334d
DK
145842009-06-04 Doug Kwan <dougkwan@google.com>
14585
14586 * layout.cc (Layout::section_name_mapping): Add mapping for
14587 special ARM sections.
14588
96d49306
DK
145892009-06-03 Doug Kwan <dougkwan@google.com>
14590
14591 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14592 (utils::has_overflow): Same.
14593
dff16297
ILT
145942009-06-03 Ian Lance Taylor <iant@google.com>
14595
14596 * layout.cc (Layout::section_name_mapping): New array, replacing
14597 Layout::linkonce_mapping.
14598 (Layout::section_name_mapping_count): New variable, replacing
14599 Layout::linkonce_mapping_count.
14600 (Layout::linkonce_output_name): Remove.
14601 (Layout::output_section_name): Rewrite.
14602 * layout.h (class Layout): Rename Linkonce_mapping to
14603 Section_name_mapping, linkonce_mapping to section_name_mapping,
14604 linkonce_mapping_count to section_name_mapping_count. Don't
14605 declare linkonce_output_name.
14606
c121c671
DK
146072009-06-03 Doug Kwan <dougkwan@google.com>
14608
14609 * gold/arm.cc (namespace utils): New.
14610 (Target_arm::reloc_is_non_pic): Define new method.
14611 (class Arm_relocate_functions): New.
14612 (Target_arm::Relocate::relocate): Handle relocation types used by
14613 Android.
14614
07800fab
ILT
146152009-06-03 Ian Lance Taylor <iant@google.com>
14616
14617 * arm.cc (Target_arm::scan::global): Use || instead of |.
14618
c121c671
DK
146192009-06-02 Doug Kwan <dougkwan@google.com>
14620
14621 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14622 issued_non_pic_error_.
14623 (class Target_arm::Scan): Declare new method check_non_pic.
14624 Define new method symbol_needs_plt_entry.
14625 Declare new data member issued_non_pic_error_.
14626 (class Target_arm::Relocate): Declare new method
14627 should_apply_static_reloc.
14628 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14629 (Target_arm::Scan::check_non_pic): Define new method.
14630 (Target_arm::Scan::local): Handle a small subset of reloc types used
14631 by Android.
14632 (Target_arm::Scan::local): Same.
14633 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14634
b19b0c6d
ILT
146352009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14636
14637 * incremental.cc (Incremental_inputs::report_command_line): Filter
14638 out --incremental-* options.
14639
94cdfcff
DK
146402009-05-29 Doug Kwan <dougkwan@google.com>
14641
14642 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14643 template class.
14644 (class Target_arm): Update comment.
14645 (Target_arm::Target_arm): Initialize new data members GOT_,
14646 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14647 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14648 and Target_arm::rel_dyn_section.
14649 Declare new_enum Target_arm::Got_type.
14650 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14651 and DYNBSS_.
14652 Update commments for member do_dynsym_value.
14653 (Target_arm::got_size, Target_arm::plt_section,
14654 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14655 new methods inside class defintion.
14656 (Target_arm::got_section): Define new method.
14657 (Target_arm::rel_dyn_section): Same.
14658 (Output_data_plt_arm): New template class.
14659 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14660 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14661 (Output_data_plt_arm::add_entry): Same.
14662 (Output_data_plt_arm::first_plt_entry): Define new
14663 static data member for PLT instruction template.
14664 (Output_data_plt_arm::plt_entry): Same.
14665 (Output_data_plt_arm::do_write): Define new method.
14666 (Target_arm::make_plt_entry): Same.
14667 (Target_arm::do_finalize_sections): Same.
14668 (Target_arm::do_dynsym_value): Same.
14669
4a657b0d
DK
146702009-05-28 Doug Kwan <dougkwan@google.com>
14671
14672 * Makefile.am (TARGETSOURCES): Add arm.cc.
14673 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14674 * Makefile.in: Regenerate.
14675 * arm.cc: New file.
14676 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14677
e7ae8c36
DK
146782009-05-26 Doug Kwan <dougkwan@google.com>
14679
14680 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14681 (General_options::check_excluded_libs): Strip off directories in
14682 archive name before matching like GNU ld does.
14683 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14684 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14685 (exclude_libs_test_LDFLAGS): Add linker option
14686 -Wl,--exclude-libs,libexclude_libs_test_3
14687 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14688 an explicit archive without using -l.
14689 (alt/libexclude_libs_test_3.a): New make rule.
14690 * testsuite/Makefile.in: Regenerate.
14691 * testsuite/exclude_libs_test.c : Declare lib3_default().
14692 (main): Call it.
14693 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14694 * exclude_libs_test_3.c: New file.
14695
f12e7348
NC
146962009-05-26 Nick Clifton <nickc@redhat.com>
14697
14698 * po/id.po: New Indonesian translation.
14699 * po/gold.pot: Updated template file.
14700
4daadc0d
ST
147012009-05-22 Sriraman Tallam <tmsriram@google.com>
14702
e1df38aa 14703 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14704 gc_comdat_test files. Add -Wl,--gc-sections to build
14705 gc_comdat_test.
14706 * testsuite/Makefile.in: Regenerate.
14707 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14708
531813ad
ST
147092009-05-21 Sriraman Tallam <tmsriram@google.com>
14710
14711 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14712 kept comdat section was garbage collected.
14713 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14714 * testsuite/Makefile.in: Regenerate.
14715 * testsuite/gc_comdat_test.sh: New file.
14716 * testsuite/gc_comdat_test_1.cc: New file.
14717 * testsuite/gc_comdat_test_2.cc: New file.
14718
65514900
CC
147192009-05-19 Doug Kwan <dougkwan@google.com>
14720
14721 * archive.cc (Archive::Archive): Move constructor from archive.h
14722 to here. Initialize no_export_.
14723 (Archive::get_elf_object_for_member): Set no_export flag of object.
14724 * archive.h (Archive::Archive): Move constructor body to
14725 archive.cc.
14726 (Archive::no_export): New method.
14727 (Archive::no_export_): New field.
14728 * object.h (Object::Object): Initialize no_export_ to false.
14729 (Object::no_export, Object::set_no_export): New methods.
14730 (Object::no_export_): New field.
14731 * options.cc (General_options::parse_exclude_libs): New method.
14732 (General_options::check_excluded_libs) Same.
14733 * options.h (exclude_libs): New option.
14734 (General_options::check_excluded_libs): New method declaration.
14735 (General_options::excluded_libs_): New field.
14736 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14737 default or protected visibility if an object has no-export flag set.
14738 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14739 (check_SCRIPTS): Add exclude_libs_test.sh.
14740 (check_DATA): Add exclude_libs_test.syms.
14741 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14742 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14743 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14744 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14745 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14746 libexclude_libs_test_2.a): New rules.
14747 * testsuite/Makefile.in: Regenerate.
14748 * testsuite/exclude_libs_test.c: New file.
14749 * testsuite/exclude_libs_test.sh: Ditto.
14750 * testsuite/exclude_libs_test_1.c: Ditto.
14751 * testsuite/exclude_libs_test_2.c: Ditto.
14752
1b77ea50
ILT
147532009-05-15 Ian Lance Taylor <iant@google.com>
14754
14755 * configure.ac: Check for declarations for cases where libiberty.h
14756 checks HAVE_DECL_xxx.
14757 * configure, config.in: Rebuild.
14758
072fe7ce
ILT
147592009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14760
14761 * gold.h (Incremental_argument_list): Remove (invalid) forward
14762 declaration.
14763 * incremental.cc (Incremental_inputs::report_achive): New method.
14764 (Incremental_inputs::report_object): New method.
14765 (Incremental_inputs::report_script): New method.
14766 (Incremental_inputs::finalize_inputs): New method.
14767 (Incremental_inputs::finalize): Call finalize_inputs().
14768 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14769 Create inputs entries.
14770 * incremental.h (Incremental_input_type): New enum.
14771 (Incremental_inputs::Incremental_input): Initialize new fields.
14772 (Incremental_inputs::report_inputs): New method.
14773 (Incremental_inputs::report_achive): New method.
14774 (Incremental_inputs::report_object): New method.
14775 (Incremental_inputs::report_script): New method.
14776 (Incremental_inputs::finalize_inputs): New method.
14777 (Incremental_inputs::Input_info): New struct.
14778 (Incremental_inputs::Input_info_map): New typedef.
14779 (Incremental_inputs::lock_): New field.
14780 (Incremental_inputs::Inputs_): New field.
14781 (Incremental_inputs::Inputs_map): New field.
14782 * main.cc (main): Call Incremental_input::report_inputs.
14783 * options.h (Input_argument_list): Typedef moved from
14784 Input_arguments.
14785 (Input_file_group::Files): Remove, use ::Input_argument_list.
14786 (Input_file_group::Input_argument_list): Remove, use
14787 ::Input_argument_list.
14788 * plugin.cc (Plugin_manager::add_input_file): Add error in
14789 incremental build.
14790 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14791 functions.
14792 * script.cc (read_input_script): Call
14793 Incremental_input::report_script.
14794 * script.h (Script_info): New class.
14795
b0481b0b
ILT
147962009-04-27 Ian Lance Taylor <iant@google.com>
14797
14798 * x86_64.cc (do_adjust_output_section): Set entsize to
14799 plt_entry_size.
14800
b22a5a41 148012009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14802
14803 * output.cc (Output_file::close): After short writes, continue
14804 writing from the correct offset in the buffer being written.
14805
40fde488
CD
148062009-04-23 Chris Demetriou <cgd@google.com>
14807
14808 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14809 * configure: Regenerate.
14810 * config.in: Regenerate.
14811 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14812 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14813
3ce2c28e
ILT
148142009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14815
14816 * incremental.cc (Incremental_inputs_header_data): Renamed from
14817 Incremental_input_header_data.
14818 (Incremental_inputs_header_data::data_size): New field.
14819 (Incremental_inputs_header_data::put_input_file_count): Renamed
14820 from input_file_count.
14821 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14822 from command_line_offset.
14823 (Incremental_inputs_header_data::put_reserved): Renamed from
14824 put_reserved.
14825 (Incremental_inputs_entry_data): Renamed from
14826 Incremental_input_entry_data.
14827 (Incremental_inputs_entry_data::data_size): New field.
14828 (Incremental_inputs::report_command_line): New method.
14829 (Incremental_inputs::finalize): New method.
14830 (Incremental_inputs::create_incremental_inputs_data): New method.
14831 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14832 * incremental.h: New file.
14833 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14834 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14835 incremental builds.
703d02da 14836 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14837 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14838 (Layout::create_incremental_info_sections): New method.
14839 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14840 * main.cc (main): Notify Incremental_input of the command line.
14841
e55bde5e
ILT
148422009-04-01 Ian Lance Taylor <iant@google.com>
14843 Mikolaj Zalewski <mikolajz@google.com>
14844
14845 * gold.h (reserve_unordered_map): Define, three versions, one for
14846 each version of Unordered_map.
14847 * layout.cc (Layout::Layout): Remove options parameter. Add
14848 number_of_input_files parameter. Don't initialize options_.
14849 Initialize number_of_input_files_ and resized_signatures_. Move
14850 sections_are_attached_.
14851 (Layout::layout_group): Reserve space for group_signatures_.
14852 (Layout::find_or_add_kept_section): Change name parameter to be a
14853 reference. Resize signatures_ map when it gets large enough.
14854 (Layout::layout_eh_frame): Use parameters->options() instead of
14855 this->options_.
14856 (Layout::make_output_section): Likewise.
14857 (Layout::attach_allocated_section_to_segment): Likewise.
14858 (Layout::finalize, Layout::create_executable_stack): Likewise.
14859 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14860 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14861 * layout.h (class Layout): Update declarations. Remove options_
14862 field. Add number_of_input_files_ and resized_signatures_
14863 fields. Move sections_are_attached_ field.
14864 * main.cc (main): Pass number of input files to Layout
14865 constructor. Don't pass options.
14866
154b857c
ILT
148672009-03-30 Ian Lance Taylor <iant@google.com>
14868
14869 * ffsll.c (ffsll): Correct implementation.
14870
2f35ab9b
ILT
148712009-03-27 Ian Lance Taylor <iant@google.com>
14872
fd03461a
ILT
14873 * ffsll.c: New file.
14874 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14875 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14876 * ftruncate.c (ftruncate): Declare before definition.
14877 * mremap.c (mremap): Likewise.
14878 * pread.c (pread): Likewise.
14879 * configure, Makefile.in, config.in: Rebuild.
14880
2f35ab9b
ILT
14881 * mremap.c: New file.
14882 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14883 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14884 (mremap): Declare if HAVE_MREMAP is not defined.
14885 * configure, Makefile.in, config.in: Rebuild.
14886
33aea2fd
CC
148872009-03-27 Cary Coutant <ccoutant@google.com>
14888
14889 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14890 position independent.
14891 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14892 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14893
6d479619
CC
148942009-03-24 Cary Coutant <ccoutant@google.com>
14895
14896 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14897 an executable.
14898 (needs_dynamic_reloc): Likewise.
14899
afc06bb8
ILT
149002009-03-24 Ian Lance Taylor <iant@google.com>
14901
14902 * yyscript.y (file_cmd): Recognize EXTERN.
14903 (extern_name_list, extern_name_list_body): New nonterminals.
14904 * script.cc (script_add_extern): Define.
14905 * script-c.h (script_add_extern): Declare.
14906
f6060a4d
ILT
149072009-03-24 Rafael Avila de Espindola <espindola@google.com>
14908
14909 * object.cc (is_elf_object): Define.
14910 * object.h (is_elf_object): Declare.
14911 * archive.cc (Archive::get_elf_object_for_member): Call
14912 is_elf_object.
33aea2fd 14913 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14914
26736d8e
ILT
149152009-03-24 Elliott Hughes <enh@google.com>
14916
14917 * output.cc (Output_file::map_anonymous): Define.
14918 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14919 try an anonymous one. Report the size if the mmap fails.
14920 * output.h (class Output_file): Declare map_anonymous.
14921
22fd9730
ILT
149222009-03-24 Ian Lance Taylor <iant@google.com>
14923
14924 * target-select.cc (instantiate_target): Don't acquire the lock if
14925 the instantiated_target_ field has already been set.
14926
cb010894
ILT
149272009-03-23 Ian Lance Taylor <iant@google.com>
14928
7f055c20
ILT
14929 * gold-threads.h (class Initialize_lock): Define.
14930 * gold-threads.cc (class Initialize_lock_once): Define.
14931 (initialize_lock_control): New static variable.
14932 (initialize_lock_pointer): New static variable.
14933 (initialize_lock_once): New static function.
14934 (Initialize_lock::Initialize_lock): Define.
14935 (Initialize_lock::initialize): Define.
14936 * target-select.h: Include "gold-threads.h".
14937 (class Target_selector): Add lock_ and initialize_lock_ fields.
14938 Don't define instantiate_target, just declare it.
14939 * target-select.cc (Target_selector::Target_selector): Initialize
14940 new fields.
14941 (Target_selector::instantiate_target): Define.
14942 * descriptors.h: Include "gold-threads.h".
14943 (class Descriptors): Add initialize_lock_ field.
14944 * descriptors.cc (Descriptors::Descriptors): Initialize new
14945 field.
14946 (Descriptors::open): Use initialize_lock_ field
14947 * errors.h (class Errors): Add initialize_lock_ field.
14948 * errors.cc (Errors::Errors): Initialize new field.
14949 (Errors::initialize_lock): Use initialize_lock_ field.
14950 * powerpc.cc (class Target_selector_powerpc): Remove
14951 instantiated_target_ field. In do_recognize call
14952 instantiate_target rather than do_instantiate_target. In
14953 do_instantiate_target just allocate a new target.
14954 * sparc.cc (class Target_selector_sparc): Likewise.
14955
36959681
ILT
14956 * freebsd.h: New file.
14957 * i386.cc: Include "freebsd.h".
14958 (Target_i386): Derive from Target_freebsd rather than
14959 Sized_target.
14960 (Target_selector_i386): Derive from Target_selector_freebsd rather
14961 than Target_selector.
14962 * x86_64.cc: Include "freebsd.h".
14963 (Target_x86_64): Derive from Target_freebsd rather than
14964 Sized_target.
14965 (Target_selector_x86_64): Derive from Target_selector_freebsd
14966 rather than Target_selector.
14967 * target.h (class Target): Add adjust_elf_header and
14968 do_adjust_elf_header.
14969 * output.cc (Output_file_header:: do_sized_write): Call target
14970 adjust_elf_header routine.
14971 * configure.tgt: Set targ_osabi.
14972 * configure.ac: Define GOLD_DEFAULT_OSABI.
14973 * parameters.cc (Parameters::default_target): Pass
14974 GOLD_DEFAULT_OSABI to select_target.
14975 * target-select.h (class Target_selector): Make instantiate_target
14976 protected rather than private.
14977 * Makefile.am (HFILES): Add freebsd.h.
14978 * configure, Makefile.in, config.in: Rebuild.
14979
cb010894
ILT
14980 * merge.cc (do_add_input_section): Correct pend value. Change
14981 message about last entry not being null terminated from error to
14982 warning.
14983
0e879927
ILT
149842009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14985
14986 * incremental.cc: New file.
14987 * Makefile.am (CCFILES): Add incremental.cc.
14988 * Makefile.in: Rebuild.
14989
41105937
PP
149902009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14991
14992 * layout.cc (Layout::output_section_name): Preserve names
14993 of '.note.' sections.
e1df38aa 14994
60439920
ILT
149952009-03-19 Ian Lance Taylor <iant@google.com>
14996
14997 * descriptors.cc (Descriptors::open): Check that the options are
14998 valid before using them.
14999
0d371ad3
ILT
150002009-03-18 Ian Lance Taylor <iant@google.com>
15001
15002 * script-sections.h: Include <list>.
15003 (class Script_sections): Change Sections_elements from std::vector
15004 to std::list. Typedef public Elements_iterator. Add
15005 orphan_section_placement_, data_segment_align_start_, and
15006 saw_data_segment_align_ fields. Remove data_segment_align_index_
15007 field.
15008 * script-sections.cc (class Orphan_section_placement): New class.
15009 (class Sections_element): Add virtual functions is_relro and
15010 orphan_section_init. Remove virtual function place_orphan_here.
15011 (class Output_section_definition): Add is_relro and
15012 orphan_section_init. Remove place_orphan_here.
15013 (class Orphan_output_section): Likewise.
15014 (Script_sections::Script_sections): Update for field changes.
15015 (Script_sections::data_segment_align): Set saw_data_segment_align_
15016 and data_segment_align_start_, not data_segment_align_index.
15017 (Script_sections::data_segment_relro_end): Check
15018 saw_data_segment_align_. Use data_segment_align_start_ rather
15019 than data_segment_align_index_.
15020 (Script_sections::place_orphan): Rewrite to use
15021 Orphan_section_placement.
15022
9201d894
ILT
150232009-03-17 Ian Lance Taylor <iant@google.com>
15024
9c5b8369
ILT
15025 * archive.cc (Archive::add_symbols): Check for a version attached
15026 to the symbol name in the archive map.
15027 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15028 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15029 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15030 (ver_test_11.a): New target.
15031 * testsuite/Makefile.in: Rebuild.
15032
9201d894
ILT
15033 * configure.ac: Check for chsize and posix_fallocate. Replace
15034 ftruncate.
15035 * ftruncate.c: New file, from gnulib.
15036 * output.cc (posix_fallocate): Define dummy version if not
15037 HAVE_POSIX_FALLOCATE.
15038 (Output_file::map): Call posix_fallocate rather than lseek and
15039 write.
15040 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15041 * configure, Makefile.in, config.in: Rebuild.
15042
ef4ab7a8 150432009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15044
ef4ab7a8
PP
15045 * layout.h (Layout::create_note): Add section_name parameter.
15046 * layout.cc (Layout::create_note): Likewise.
15047 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15048
8c500701
ILT
150492009-03-17 Ian Lance Taylor <iant@google.com>
15050
e85b18e1
ILT
15051 * descriptors.cc: Include "options.h".
15052 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15053 (Descriptors::open): Always use O_CLOEXEC when opening a new
15054 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15055 then set FD_CLOEXEC.
15056
9efe6174
ILT
15057 * sparc.cc (class Target_sparc): Add has_got_section.
15058 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15059 make sure we have a GOT section.
15060
15061 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15062 (Target_sparc::Scan::local): Likewise.
15063 (Target_sparc::Scan::global): Likewise.
15064 (Target_sparc::Relocate::relocate): Likewise.
15065 (Target_sparc::Relocate::relocate_tls): Likewise.
15066
8c500701
ILT
15067 * symtab.cc (Symbol_table::define_default_version): New function,
15068 broken out of add_from_object.
15069 (Symbol_table::add_from_object): Call define_default_version.
15070 (Symbol_table::define_special_symbol): Add resolve_oldsym
15071 parameter. Change all callers. If the version for a symbol comes
15072 from a version script, resolve it with the symbol with the same
15073 name with no version. Also add the symbol without a version if
15074 appropriate.
15075 (do_define_in_output_data): If resolving with oldsym, don't delete
15076 sym.
15077 (do_define_in_output_segment): Likewise.
15078 (do_define_as_constant): Likewise.
15079 * symtab.h (class Symbol_table): Update declarations.
15080
f1ed28fb
ILT
150812009-03-13 Ian Lance Taylor <iant@google.com>
15082
15f8229b
ILT
15083 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15084 (Read_symbols::requeue): New function.
15085 (Read_symbols::do_read_symbols): If make_elf_object fails because
15086 the target type is not configured, and the file was searched for,
15087 issue a warning and retry with the next directory.
15088 (Add_symbols::run): If the file has an incompatible format, and
15089 it was searched for, requeue the Read_symbols task. On error,
15090 release the object.
15091 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15092 dirindex parameter to constructor. Change all callers. Declare
15093 incompatible_warning and requeue.
15094 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15095 input_argument_ and input_group_ fields. Add them to
15096 constructor. Change all callers.
15097 (class Read_script): Add dirindex_ field. Add it to constructor.
15098 Change all callers.
15099 * archive.cc (Archive::setup): Remove input_objects parameter.
15100 Change all callers.
15101 (Archive::get_file_and_offset): Likewise.
15102 (Archive::read_all_symbols): Likewise.
15103 (Archive::read_symbols): Likewise.
15104 (Archive::get_elf_object_for_member): Remove input_objects
15105 parameter. Add punconfigured parameter. Change all callers.
15106 (Archive::add_symbols): Change return type to bool. Check return
15107 value of include_member.
15108 (Archive::include_all_members): Likewise.
15109 (Archive::include_member): Change return type to bool. Return
15110 false if first included object has incompatible target. Set
15111 included_member_ field.
15112 (Add_archive_symbols::run): If add_symbols returns false, requeue
15113 Read_symbols task.
15114 * archive.h (class Archive): Add included_member_ field.
15115 Initialize it in constructor. Add input_file and searched_for
15116 methods. Update declarations.
15117 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15118 input_argument_ fields. Add them to constructor. Change all
15119 callers.
15120 * script.cc: Include "target-select.h".
15121 (class Parser_closure): Add skip_on_incompatible_target_ and
15122 found_incompatible_target_ fields. Add
15123 skip_on_incompatible_target parameter to constructor. Change all
15124 callers. Add methods skip_on_incompatible_target,
15125 clear_skip_on_incompatible_target, found_incompatible_target, and
15126 set_found_incompatible_target.
15127 (read_input_script): Add dirindex parameter. Change all callers.
15128 If parser finds an incompatible target, requeue Read_symbols
15129 task.
15130 (script_set_symbol): Clear skip_on_incompatible_target in
15131 closure.
15132 (script_add_assertion, script_parse_option): Likewise.
15133 (script_start_sections, script_add_phdr): Likewise.
15134 (script_check_output_format): New function.
15135 * script.h (read_input_script): Update declaration.
15136 * script-c.h (script_check_output_format): Declare.
15137 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15138 (ignore_cmd): Remove OUTPUT_FORMAT.
15139 * fileread.cc (Input_file::Input_file): Add explicit this.
15140 (Input_file::will_search_for): New function.
15141 (Input_file::open): Add pindex parameter. Change all callers.
15142 * fileread.h (class Input_file): Add input_file_argument method.
15143 Declare will_search_for. Update declarations.
15144 * object.cc (make_elf_object): Add punconfigured parameter.
15145 Change all callers.
15146 * object.h (class Object): Make input_file public. Add
15147 searched_for method.
15148 (make_elf_object): Update declaration.
15149 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15150 restart search.
15151 * dirsearch.h (class Dirsearch): Update declaration.
15152 * options.h (class General_options): Add --warn-search-mismatch.
15153 * parameters.cc (Parameters::is_compatible_target): New function.
15154 * parameters.h (class Parameters): Declare is_compatible_target.
15155 * workqueue.cc (Workqueue::add_blocker): New function.
15156 * workqueue.h (class Workqueue): Declare add_blocker.
15157
f1ed28fb
ILT
15158 * fileread.cc (Input_file::open): Remove options parameter.
15159 Change all callers.
15160 (Input_file::open_binary): Likewise.
15161 * script.cc (read_input_script): Likewise.
15162 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15163 options parameter from constructor. Change all callers.
15164 (class Read_script): Likewise.
15165 * fileread.h (class Input_file): Update declarations.
15166 * script.h (read_input_script): Update declaration.
15167
34dd024a
NC
151682009-03-10 Nick Clifton <nickc@redhat.com>
15169
15170 * po/es.po: New Spanish translation.
15171
6d71b17c
CC
151722009-03-06 Cary Coutant <ccoutant@google.com>
15173
15174 * options.cc (parse_short_option): Keep dash_z from registering itself.
15175
031cdbed
ILT
151762009-03-03 Ian Lance Taylor <iant@google.com>
15177
15178 PR 9918
15179 * target-reloc.h (relocate_section): Pass output_section to
15180 relocate.
15181 * i386.cc (Target_i386::should_apply_static_reloc): Add
15182 output_section parameter. Change all callers.
15183 (Target_i386::Relocate::relocate): Add output_section parameter.
15184 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15185 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15186 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15187 * testsuite/two_file_shared.sh: New script.
15188 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15189 (check_DATA): Add two_file_shared.dbg.
15190 (two_file_shared.dbg): New target.
15191 * testsuite/Makefile.in: Rebuild.
15192
15d5fa16
ILT
151932009-03-01 Ian Lance Taylor <iant@google.com>
15194
15195 * configure.ac: Check for byteswap.h.
15196 * configure: Rebuild.
15197 * config.in: Rebuild.
15198
8a4c0b0d
ILT
151992009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15200
15201 * layout.cc (Layout::find_or_add_kept_section): New function.
15202 (Layout::add_comdat): Removed.
15203 * layout.h (struct Kept_section): Move out of class Layout.
15204 Remove trailing underscores from field names. Add group_sections
15205 field. Rename group_ field to is_group. Change all uses.
15206 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15207 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15208 comdat_groups_ field.
15209 (Sized_relobj::include_section_group): Use
15210 find_or_add_kept_section and Kept_section::group_sections.
15211 (Sized_relobj::include_linkonce_section): Likewise.
15212 * object.cc (class Sized_relobj): Don't define Comdat_group or
15213 Comdat_group_table. Remove find_comdat_group and
15214 add_comdat_group. Remove comdat_groups_ field.
15215 * plugin.cc (include_comdat_group): Use
15216 Layout::find_or_add_kept_section.
15217
b4ecf66b
ILT
152182009-02-28 Ian Lance Taylor <iant@google.com>
15219
14359ca0
ILT
15220 * README: --gc-sections and map files are now supported. Document
15221 some build requirements.
15222
b4ecf66b
ILT
15223 PR 6992
15224 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15225 relocatable link set the value of the section symbol to zero.
15226 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15227 relocatable link don't include the section address in the local
15228 symbol value.
15229
0602e05a
ILT
152302009-02-27 Ian Lance Taylor <iant@google.com>
15231
fd9d194f
ILT
15232 PR 6811
15233 * options.h (class Search_directory): Add is_system_directory.
15234 (class General_options): Declare is_in_system_directory.
15235 * options.cc (get_relative_sysroot): Make static.
15236 (get_default_sysroot): Make static.
15237 (General_optoins::is_in_system_directory): New function.
15238 * fileread.cc (Input_file::is_in_system_directory): New function.
15239 * fileread.h (class Input_file): Declare is_in_system_directory.
15240 * object.h (class Object): Add is_in_system_directory.
15241 (class Input_objects): Remove system_library_directory_ field.
15242 * object.cc (Input_objects::add_object): Don't set
15243 system_library_directory_.
15244 (input_objects::found_in_system_library_directory): Remove.
15245 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15246 parameter. Change all callers.
15247 (Symbol_table::sized_write_globals): Likewise.
15248 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15249 Call Object::is_in_system_directory.
15250 * symtab.h (class Symbol_table): Update declarations.
15251
61edd21f
ILT
15252 PR 5990
15253 * descriptors.h (Open_descriptor): Add is_on_stack field.
15254 * descriptors.cc (Descriptors::open): If the descriptor is on the
15255 top of the stack, remove it. Initialize is_on_stack field.
15256 (Descriptors::release): Only add pod to stack if it is not on the
15257 stack already.
15258 (Descriptors::close_some_descriptor): Clear stack_next and
15259 is_on_stack fields.
15260
e29e076a
ILT
15261 PR 7091
15262 * output.cc (Output_section::find_starting_output_address): Rename
15263 from starting_output_address; add PADDR parameter; change return
15264 type.
15265 * output.h (class Output_section): Declare
15266 find_starting_output_address instead of starting_output_address.
15267 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15268 section symbol for which we can't find a merge section.
15269
0602e05a
ILT
15270 PR 9836
15271 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15272 hidden or internal, force the symbol to be local.
15273 * resolve.cc (Symbol::override_visibility): Define.
15274 (Symbol::override_base): Use override_visibility.
15275 (Symbol_table::resolve): Likewise.
15276 (Symbol::override_base_with_special): Likewise.
15277 (Symbol_table::override_with_special): If the visibility is hidden
15278 or internal, force the symbol to be local.
15279 * symtab.h (class Symbol): Add set_visibility and
15280 override_visibility.
15281 * testsuite/ver_test_1.sh: New file.
15282 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15283 (check_DATA): Add ver_test_1.syms.
15284 (ver_test_1.syms): New target.
15285 * testsuite/Makefile.in: Rebuild.
15286
401a9a73
CC
152872009-02-25 Cary Coutant <ccoutant@google.com>
15288
15289 * layout.cc (Layout::choose_output_section): Don't rename sections
15290 when using a linker script that has a SECTIONS clause.
15291 * Makefile.in: Regenerate.
15292
15293 * testsuite/Makefile.am (script_test_5.sh): New test case.
15294 * testsuite/Makefile.in: Regenerate.
15295 * testsuite/script_test_5.cc: New file.
15296 * testsuite/script_test_5.sh: New file.
15297 * testsuite/script_test_5.t: New file.
15298
f488e4b0
CC
152992009-02-13 Rafael Avila de Espindola <espindola@google.com>
15300
15301 * archive.cc (Archive::include_member): Update calls to add_symbols.
15302 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15303 the Layout argument.
15304 * dynobj.h (do_add_symbols): Add the Layout argument.
15305 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15306 Layout argument.
15307 * object.h (Object::add_symbols): Add the Layout argument.
15308 (Object::do_add_symbols): Add the Layout argument.
15309 (Sized_relobj::do_add_symbols): Add the Layout argument.
15310 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15311 Unify the two versions.
15312 (Add_plugin_symbols): Remove.
15313 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15314 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15315 (Add_plugin_symbols): Remove.
15316 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15317 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15318 (Add_symbols::run): Make it work with Pulginobj.
15319
89dd1680
ILT
153202009-02-06 Ian Lance Taylor <iant@google.com>
15321
15322 * object.cc (Sized_relobj::do_layout): Make info message start
15323 with lower case letter.
15324
266d0a74
ILT
153252009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15326
602b464e
ILT
15327 * binary.cc: Fix file comment.
15328
266d0a74
ILT
15329 * options.h (enum Incremental_disposition): Define.
15330 (class General_options): Add new options: --incremental,
15331 --incremental_changed, --incremental_unchanged,
15332 --incremental_unknown. Add incremental_disposition_ and
15333 implicit_incremental_ fields.
15334 (General_options::incremental_disposition): New function.
15335 (class Position_dependent_options): Add incremental_disposition
15336 option.
15337 (Position_dependent_options::copy_from_options): Set incremental
15338 dispositions.
15339 * options.cc (General_options::parse_incremental_changed): New
15340 function.
2e702c99
RM
15341 (General_options::parse_incremental_unchanged): New function.
15342 (General_options::parse_incremental_unknown): New function.
15343 (General_options::General_options): Initialize new fields
266d0a74 15344 incremental_disposition_ and implicit_incremental_.
2e702c99 15345 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15346 without --incremental.
15347
f073bbf7
CD
153482009-02-06 Chris Demetriou <cgd@google.com>
15349
15350 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15351 pointer and to report location as the file name associated with
15352 the symbol.
15353 (gold_undefined_symbol_at_location): New function to replace the
15354 old gold_undefined_symbol functionality.
15355 * target-reloc.h (relocate_section): Update to use
15356 gold_undefined_symbol_at_location.
15357 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15358 Call gold_undefined_symbol function rather than gold_error.
15359 * errors.h (Errors::undefined_symbol): Take location as a
15360 string, rather than calculating it from a relocation.
15361 * errors.cc (Errors::fatal): Print "fatal error:" before the
15362 formatted message.
15363 (Errors::error, Errors::error_at_location): Print "error: "
15364 before the formatted message.
15365 (Errors::undefined_symbol): Take location as a string, rather
15366 than calculating it from a relocation.
15367 (gold_undefined_symbol_at_location): New function akin to
15368 old gold_undefined_symbol, calculates location from relocation.
15369 (gold_undefined_symbol): Change to take only a Symbol pointer
15370 and to report location as the file name associated with the symbol.
15371 * testsuite/debug_msg.sh: Update for changed error messages.
15372 * testsuite/undef_symbol.sh: Likewise.
15373
8e94a90c
ILT
153742009-02-04 Duncan Sands <baldrick@free.fr>
15375
15376 PR 9812
15377 * reduced_debug_output.h
15378 (Output_reduced_debug_abbrev_section::failed): Use format for
15379 gold_warning.
15380 (Output_reduced_debug_info_section::faild): Likewise.
15381
88a0e15b
ILT
153822009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15383
15384 * script.cc (Lazy_demangler): New class.
2e702c99 15385 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15386 symbol only once.
15387
5efc7cd2
CC
153882009-01-29 Cary Coutant <ccoutant@google.com>
15389
15390 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15391 to __tls_get_addr.
15392 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15393
e0ebcf42
ILT
153942009-01-28 Ian Lance Taylor <iant@google.com>
15395
5efc7cd2 15396 * version.cc (version_string): Bump to 1.9.
75fe7426 15397
e0ebcf42
ILT
15398 * gold.h: Include <cstring> and <stdint.h>.
15399 * version.cc: Include <cstdio>.
15400 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15401 warning.
15402 * reduced_debug_output.cc (insert_into_vector): Rename from
15403 Insert_into_vector; change all callers. Use Swap_unaligned to
15404 avoid aliasing issue; remove union since it is unnecessary.
15405
8e2813be 154062009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15407
15408 * Makefile.am (CCFILES): Add gc.cc.
15409 (HFILES): Add gc.h.
15410 * Makefile.in: Regenerate.
15411 * gold.cc (Gc_runner): New class.
15412 (queue_initial_tasks): Call garbage collection related tasks
15413 when corresponding options are invoked.
15414 (queue_middle_gc_tasks): New function.
15415 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15416 processed early before laying out sections during garbage collection.
15417 * gold.h (queue_middle_gc_tasks): New function.
15418 (is_prefix_of): Move from "layout.cc".
15419 * i386.cc (Target_i386::gc_process_relocs): New function.
15420 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15421 * main.cc (main): Create object of class "Garbage_collection".
15422 * object.cc (Relobj::copy_symbols_data): New function.
15423 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15424 (Sized_relobj::do_layout): Allow this function to be called twice
15425 during garbage collection and defer layout of section during the
6d03d481
ST
15426 first call.
15427 * object.h (Relobj::get_symbols_data): New function.
15428 (Relobj::is_section_name_included): New function.
15429 (Relobj::copy_symbols_data): New function.
15430 (Relobj::set_symbols_data): New function.
15431 (Relobj::get_relocs_data): New function.
15432 (Relobj::set_relocs_data): New function.
15433 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15434 (Relobj::gc_process_relocs): New function.
15435 (Relobj::do_gc_process_relocs): New pure virtual function.
15436 (Relobj::sd_): New data member.
15437 (Sized_relobj::is_output_section_offset_invalid): New function.
15438 (Sized_relobj::do_gc_process_relocs): New function.
15439 * options.h (General_options::gc_sections): Modify to not be a no-op.
15440 (General_options::print_gc_sections): New option.
15441 * plugin.cc (Plugin_finish::run): Remove function call to
15442 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15443 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15444 * reloc.cc (Read_relocs::run): Add task to process relocs and
15445 determine unreferenced sections when doing garbage collection.
15446 (Gc_process_relocs): New class.
15447 (Sized_relobj::do_gc_process_relocs): New function.
15448 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15449 sections that are garbage collected.
15450 * reloc.h (Gc_process_relocs): New class.
15451 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15452 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15453 symbols whose corresponding sections are garbage collected.
15454 (Symbol_table::Symbol_table): Add new parameter for the garbage
15455 collection object.
15456 (Symbol_table::gc_mark_undef_symbols): New function.
15457 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15458 (Symbol_table::gc_mark_dyn_syms): New function.
15459 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15460 as garbage.
15461 (Symbol_table::add_from_object): Likewise.
15462 (Symbol_table::add_from_relobj): When building shared objects, do not
15463 treat externally visible symbols as garbage.
15464 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15465 table information for static and relocatable links.
15466 * symtab.h (Symbol_table::set_gc): New function.
15467 (Symbol_table::gc): New function.
15468 (Symbol_table::gc_mark_undef_symbols): New function.
15469 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15470 (Symbol_table::gc_mark_dyn_syms): New function.
15471 (Symbol_table::gc_): New data member.
e1df38aa 15472 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15473 function.
15474 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15475 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15476
3b293544
CF
154772009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15478
15479 * options.h (General_options::gc_sections): Define as a no-op for now.
15480 (General_options::no_keep_memory): Ditto.
15481 (General_options::Bshareable): Define.
15482 * options.cc (General_options::finalize): Honor -Bshareable.
15483
83d22aa8
AS
154842009-01-20 Andreas Schwab <schwab@suse.de>
15485
15486 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15487 read the value in the contents, since we don't use it. Use the
15488 template endianness when writing.
15489 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15490
cd536b21
AS
154912009-01-19 Andreas Schwab <schwab@suse.de>
15492
15493 * configure.tgt (powerpc64-*): Fix targ_obj.
15494
99e9a495
ILT
154952009-01-15 Ian Lance Taylor <iant@google.com>
15496
15497 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15498 local symbols when stripping all symbols.
15499
bbbfea06
CC
155002009-01-14 Cary Coutant <ccoutant@google.com>
15501
99e9a495 15502 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15503
0f7c0701
CC
155042009-01-14 Cary Coutant <ccoutant@google.com>
15505
15506 * archive.cc (Archive::get_elf_object_for_member): Remove call
15507 to File_read::claim_for_plugin.
15508 * descriptors.cc (Descriptors::open): Remove reference to
15509 is_claimed.
15510 (Descriptors::claim_for_plugin): Remove.
15511 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15512 (Descriptors::is_claimed): Remove.
15513 (claim_descriptor_for_plugin): Remove.
15514 * fileread.cc (File_read::claim_for_plugin): Remove.
15515 * fileread.h (File_read::claim_for_plugin): Remove.
15516 (File_read::descriptor): Reopen descriptor if necessary.
15517 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15518 (Plugin_manager::all_symbols_read): Add task parameter. Change
15519 all callers.
15520 (Plugin_manager::get_input_file): New function.
15521 (Plugin_manager::release_input_file): New function.
15522 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15523 corresponding data member.
15524 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15525 and pass to base constructor. Change all callers.
15526 (get_input_file, release_input_file): New functions.
15527 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15528 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15529 (Plugin_manager::all_symbols_read): Add task parameter.
15530 (Plugin_manager::get_input_file): New function.
15531 (Plugin_manager::release_input_file): New function.
15532 (Plugin_manager::task_): New data member.
15533 (Pluginobj::Pluginobj): Add filesize parameter.
15534 (Pluginobj::filename): New function.
15535 (Pluginobj::descriptor): New function.
15536 (Pluginobj::filesize): New function.
15537 (Pluginobj::filesize_): New data member.
15538 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15539 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15540 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15541
15542 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15543 with archive libraries.
15544 * testsuite/Makefile.in: Regenerate.
15545 * testsuite/plugin_test.c (struct sym_info): New type.
15546 (get_input_file, release_input_file): New static variables.
15547 (onload): Capture new transfer vector entries.
15548 (claim_file_hook): Stop reading at end of file according to filesize.
15549 Factor out parsing of readelf output into separate function.
15550 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15551 APIs and get the source file name from the symbol table. Convert
15552 source file name to corresponding object file name. Print info
15553 message when adding new input files.
15554 (parse_readelf_line): New function.
15555 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15556 * testsuite/plugin_test_2.sh: Likewise.
15557 * testsuite/plugin_test_3.sh: Likewise.
15558 * testsuite/plugin_test_4.sh: New test case.
15559
62a6d109
ILT
155602009-01-07 Ian Lance Taylor <iant@google.com>
15561
15562 * version.cc (version_string): Bump to 1.8.
15563
483620e8
CC
155642008-12-23 Cary Coutant <ccoutant@google.com>
15565
15566 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15567 * plugin.cc (Plugin_manager::finish): Rename as
15568 layout_deferred_objects. Move cleanup to separate function.
15569 (Plugin_manager::cleanup): New function.
15570 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15571 separately.
15572 * plugin.h (Plugin_manager::finish): Rename as
15573 layout_deferred_objects.
15574 (Plugin_manager::cleanup): New function.
15575 (Plugin_manager::cleanup_done): New field.
15576
d66a9eb3
CC
155772008-12-23 Cary Coutant <ccoutant@google.com>
15578
15579 * plugin.cc (is_visible_from_outside): New function.
15580 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15581 so we don't return "IR only" status for exported symbols or -r links.
15582
15583 * testsuite/Makefile.am (plugin_test_3): New test case.
15584 * testsuite/Makefile.in: Regenerate.
15585 * testsuite/plugin_test_3.sh: New file.
15586
5995b570
CC
155872008-12-22 Cary Coutant <ccoutant@google.com>
15588
15589 * object.cc (Sized_relobj::layout_section): New function.
15590 (Sized_relobj::do_layout): Defer layout of input sections until after
15591 plugin has provided replacement files.
15592 (Sized_relobj::do_layout_deferred_sections): New function.
15593 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15594 (Relobj::layout_deferred_sections): New function.
15595 (Relobj::do_layout_deferred_sections): New function.
15596 (Sized_relobj::do_layout_deferred_sections): New function.
15597 (Sized_relobj::layout_section): New function.
15598 (Sized_relobj::Deferred_layout): New structure.
15599 (Sized_relobj::deferred_layout_): New field.
15600 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15601 Change all callers. Layout deferred sections.
15602 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15603 references.
15604 (Plugin_hook::run): Move code from do_plugin_hook inline.
15605 (Plugin_hook::do_plugin_hook): Remove.
15606 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15607 (Plugin_manager::finish): Renamed, was cleanup.
15608 (Plugin_manager::should_defer_layout): New function.
15609 (Plugin_manager::add_deferred_layout_object): New function.
15610 (Plugin_manager::Deferred_layout_list): New type.
15611 (Plugin_manager::deferred_layout_objects_): New field.
15612 (Plugin_hook::do_plugin_hook): Remove.
15613
ee769c88
ILT
156142008-12-17 Ian Lance Taylor <iant@google.com>
15615
15616 * options.h (class General_options): Add --no case for
15617 --export-dynamic.
15618
abc8dcba
CC
156192008-12-16 Cary Coutant <ccoutant@google.com>
15620
15621 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15622 vector.
15623 (Plugin_manager::claim_file): Create plugin object even if
15624 plugin did not call the add_symbols callback.
15625 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15626 asking for more symbols than were added.
15627 * testsuite/Makefile.am (plugin_test_1): Add test case with
15628 no global symbols.
15629 (empty.syms): New target.
15630 * testsuite/Makefile.in: Regenerate.
15631 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15632 message. Don't call add_symbols if no globals.
15633 (all_symbols_read_hook): Don't provide replacement for empty
15634 claimed file.
15635
b0074644
ILT
156362008-12-12 Ian Lance Taylor <iant@google.com>
15637
68943102
ILT
15638 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15639 r_type == 0 for a local symbol with r_sym == 0.
15640 (scan_relocatable_relocs): Pass r_sym to
15641 local_non_section_strategy.
15642 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15643 r_sym parameter.
15644
b0074644
ILT
15645 * configure.ac: Update test for TLS descriptors: they are
15646 supported as of glibc 2.9.
15647 * configure: Rebuild.
15648
c2508178
ILT
156492008-12-11 Ian Lance Taylor <iant@google.com>
15650
15651 PR 7091
15652 * target-reloc.h (Default_scan_relocatable_relocs): For each
15653 function, map r_type == 0 to RELOC_DISCARD.
15654
2756a258
CC
156552008-12-10 Cary Coutant <ccoutant@google.com>
15656
15657 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15658 object to override a kept COMDAT group from a plugin object.
15659
bb6f53d3
ILT
156602008-12-09 Ian Lance Taylor <iant@google.com>
15661
fbc558e1
ILT
15662 PR 7088
15663 * yyscript.y (file_cmd): Handle INPUT.
15664
bb6f53d3
ILT
15665 * testsuite/initpri1.c: Change all declarations to be full
15666 prototypes by adding void, to avoid compiler warnings.
15667
4674ecfc
CC
156682008-12-05 Rafael Avila de Espindola <espindola@google.com>
15669
15670 * options.cc (General_options::parse_plugin_opt): New.
15671 (General_options::add_plugin): The argument now is just the filename.
15672 (General_options::add_plugin_option): New.
15673 * options.h (plugin_opt): New.
15674 (add_plugin): Change argument name.
15675 (add_plugin_option): New.
15676 * plugin.cc (Plugin::load): Don't parse the plugin option.
15677 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15678 (Plugin::add_option): New.
15679 (Plugin::args_): Change type.
15680 (Plugin::filename_): New.
15681 (Plugin_manager::add_plugin_option): New.
15682 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15683 * testsuite/Makefile.in: Regenerate.
15684
fd06b4aa
CC
156852008-12-05 Cary Coutant <ccoutant@google.com>
15686
15687 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15688 Handle --strip-lto-sections option.
15689 * options.h (strip_lto_sections): New option.
15690
6c52134c
CC
156912008-12-01 Cary Coutant <ccoutant@google.com>
15692
15693 * plugin.cc (ld_plugin_message): Change format parameter to const.
15694 Fix mismatch between new[] and delete.
15695
a45248e0
CC
156962008-11-14 Cary Coutant <ccoutant@google.com>
15697
15698 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15699 instead of -1U.
15700
c82fbeee
CS
157012008-11-05 Craig Silverstein <csilvers@google.com>
15702
15703 * options.cc (General_options::parse_dynamic_list): New function.
15704 * options.h (General_options): New flags dynamic_list,
15705 dynamic_list_data, dynamic_list_cpp_new, and
15706 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15707 (General_options::in_dynamic_list): New function.
15708 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15709 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15710 (Lex::can_continue_name): Likewise.
15711 (yylex): Likewise.
15712 (read_script_file): New parameter script_options.
15713 (read_dynamic_list): New function.
15714 (Script_options::define_dynamic_list): New function.
15715 (dynamic_list_keyword_parsecodes): New variable.
15716 (dynamic_list_keywords): New variable.
15717 * script.h (Script_options::define_dynamic_list): New function
15718 prototype.
15719 (read_dynamic_list): New function prototype.
15720 * symtab.cc (strprefix): New macro.
15721 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15722 dynamic_list_data, dynamic_list_cpp_new, and
15723 dynamic_list_cpp_typeinfo.
15724 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15725 (dynamic_list_expr): New rule.
15726 (dynamic_list_nodes): Likewise.
15727 (dynamic_list_node): Likewise.
15728 * testsuite/Makefile.am (dynamic_list): New test.
15729 * testsuite/Makefile.in: Regenerated.
15730 * testsuite/dynamic_list.t: New file.
15731 * testsuite/dynamic_list.sh: New file.
15732
e0bb29a5
CS
157332008-11-05 Craig Silverstein <csilvers@google.com>
15734
15735 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15736 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15737 (t11_last): Likewise.
15738 * testsuite/ver_test_6.c (main): Likewise.
15739
4e1e25e0
CC
157402008-10-07 Cary Coutant <ccoutant@google.com>
15741
15742 * options.c (General_options::finalize): Add check for -static and
15743 -shared.
15744 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15745 is not empty.
15746
92f03fcb
CC
157472008-10-02 Cary Coutant <ccoutant@google.com>
15748
15749 * plugin.cc (make_sized_plugin_object): Fix conditional
15750 compilation to work when not all targets are enabled.
15751
fbd8a257
CC
157522008-09-29 Cary Coutant <ccoutant@google.com>
15753
15754 * archive.cc (Archive::get_file_and_offset): Use filename instead
15755 of name to get library path.
15756 (Archive::include_member): Unlock external member of a thin archive.
15757
15758 * testsuite/Makefile.am (TEST_AR): New variable.
15759 (thin_archive_test_1): New test.
15760 (thin_archive_test_2): New test.
81636b3f
CC
15761 * testsuite/Makefile.in: Regenerate.
15762 * testsuite/thin_archive_main.cc: New file.
15763 * testsuite/thin_archive_test_1.cc: New file.
15764 * testsuite/thin_archive_test_2.cc: New file.
15765 * testsuite/thin_archive_test_3.cc: New file.
15766 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15767
eff45813
CC
157682008-09-29 Cary Coutant <ccoutant@google.com>
15769
15770 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15771 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15772 instead of -1U.
15773 (Sized_relobj::do_finalize_local_symbols): Likewise.
15774 (Sized_relobj::map_to_kept_section): Likewise.
15775 * object.h (Sized_relobj::invalid_address): New constant.
15776 (Sized_relobj::do_output_section_offset): Check for invalid_address
15777 and return -1ULL.
15778 * output.cc (Output_reloc::local_section_offset): Use constant
15779 invalid_address instead of -1U.
15780 (Output_reloc::get_address): Likewise.
15781 (Output_section::output_address): Change -1U to -1ULL.
15782 * output.h (Output_reloc::invalid_address): New constant.
15783 * reloc.cc (Sized_relobj::write_sections): Use constant
15784 invalid_address instead of -1U.
15785 (Sized_relobj::relocate_sections): Likewise.
15786 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15787 values for merge sections.
15788 * target-reloc.h (relocate_for_relocatable): Use constant
15789 invalid_address instead of -1U.
15790
89fc3421
CC
157912008-09-19 Cary Coutant <ccoutant@google.com>
15792
15793 Add plugin functionality for link-time optimization (LTO).
15794 * configure.ac (plugins): Add --enable-plugins option.
15795 * configure: Regenerate.
15796 * config.in: Regenerate.
15797 * Makefile.am (LIBDL): New variable.
15798 (CCFILES): Add plugin.cc.
15799 (HFILES): Add plugin.h.
15800 (ldadd_var): Add LIBDL.
15801 * Makefile.in: Regenerate.
15802
15803 * archive.cc: Include "plugin.h".
15804 (Archive::setup): Don't preread archive symbols when using a plugin.
15805 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15806 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15807 files.
15808 (Archive::include_member): Add symbols from plugin objects.
15809 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15810 * descriptors.cc (Descriptors::open): Check for file descriptors
15811 abandoned by plugins.
15812 (Descriptors::claim_for_plugin): New function.
15813 * descriptors.h (Descriptors::claim_for_plugin): New function.
15814 (Open_descriptor::is_claimed): New field.
15815 (claim_descriptor_for_plugin): New function.
15816 * fileread.cc (File_read::claim_for_plugin): New function.
15817 * fileread.h (File_read::claim_for_plugin): New function.
15818 (File_read::descriptor): New function.
15819 * gold.cc: Include "plugin.h".
15820 (queue_initial_tasks): Add task to call plugin hooks for generating
15821 new object files.
15822 * main.cc: Include "plugin.h".
15823 (main): Load plugin libraries.
15824 * object.h (Pluginobj): Declare.
15825 (Object::pluginobj): New function.
15826 (Object::do_pluginobj): New function.
15827 (Object::set_target): New function.
15828 * options.cc: Include "plugin.h".
15829 (General_options::parse_plugin): New function.
15830 (General_options::General_options): Initialize plugins_ field.
15831 (General_options::add_plugin): New function.
15832 * options.h (Plugin_manager): Declare.
15833 (General_options): Add --plugin option.
15834 (General_options::has_plugins): New function.
15835 (General_options::plugins): New function.
15836 (General_options::add_plugin): New function.
15837 (General_options::plugins_): New field.
15838 * plugin.cc: New file.
15839 * plugin.h: New file.
15840 * readsyms.cc: Include "plugin.h".
15841 (Read_symbols::do_read_symbols): Check for archive before checking
15842 for ELF file. Call plugin hooks to claim files.
15843 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15844 from a real object file; force override when processing replacement
15845 files.
15846 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15847 (Symbol::init_base_object): Likewise.
15848 (Symbol::init_base_output_data): Likewise.
15849 (Symbol::init_base_output_segment): Likewise.
15850 (Symbol::init_base_constant): Likewise.
15851 (Symbol::init_base_undefined): Likewise.
15852 (Symbol::output_section): Assert that object is not a plugin.
15853 (Symbol_table::add_from_pluginobj): New function.
15854 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15855 undefined.
15856 (Symbol_table::sized_write_globals): Likewise.
15857 (Symbol_table::add_from_pluginobj): Instantiate template.
15858 * symtab.h (Sized_pluginobj): Declare.
15859 (Symbol::in_real_elf): New function.
15860 (Symbol::set_in_real_elf): New function.
15861 (Symbol::in_real_elf_): New field.
15862 (Symbol_table::add_from_pluginobj): New function.
15863
15864 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15865 (LIBDL): New variable.
15866 (LDADD): Add LIBDL.
15867 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15868 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15869 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15870 (MOSTLYCLEANFILES): Likewise.
15871 * testsuite/Makefile.in: Regenerate.
15872 * testsuite/plugin_test.c: New file.
15873 * testsuite/plugin_test_1.sh: New file.
15874 * testsuite/plugin_test_2.sh: New file.
15875
de31bda5
ILT
158762008-09-16 Ian Lance Taylor <iant@google.com>
15877
9c2d0ef9
ILT
15878 * target-reloc.h (relocate_section): Check whether a symbol is
15879 defined by the ABI before reporting an undefined symbol error.
15880 * target.h (Target::is_defined_by_abi): Make parameter const.
15881 (Target::do_is_defined_by_abi): Likewise.
15882 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15883 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15884 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15885 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15886 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15887 * testsuite/Makefile.in: Rebuild.
15888
de31bda5
ILT
15889 * fileread.cc (make_view): Add casts to avoid warning.
15890
9fa33bee
AO
158912008-09-16 Alexandre Oliva <aoliva@redhat.com>
15892
15893 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15894 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15895
183fd0e3
AO
158962008-09-16 Alexandre Oliva <aoliva@redhat.com>
15897
15898 * options.h (General_options::output_is_executable): New.
15899 (General_options::output_is_pie): New.
15900 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15901 for shared libraries.
15902 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15903
7be8330a
CD
159042008-09-11 Chris Demetriou <cgd@google.com>
15905
15906 * options.h (origin): New -z option.
15907 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15908 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15909 in DT_FLAGS_1.
15910
a9caad02
CC
159112008-09-05 Cary Coutant <ccoutant@google.com>
15912
15913 * fileread.cc (File_read::make_view): Add check for attempt to map
15914 beyond end of file.
15915
ae6dce4d
CC
159162008-09-05 Cary Coutant <ccoutant@google.com>
15917
15918 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15919 explicit instantiations.
15920
d7ab2a47
KVH
159212008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15922
15923 PR gold/6858
15924 * options.cc (General_options::finalize): Allow undefined symbols
15925 in shlibs if linking -shared.
15926
15927 PR gold/6859
15928 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15929 symbols as not needing a dynsym entry.
15930
1e52a9c1
CS
159312008-08-20 Craig Silverstein <csilvers@google.com>
15932
15933 * fileread.cc (File_read::open): Do not lock the file unless it
15934 was successfully opened.
15935
d85c80a3
CC
159362008-08-14 Cary Coutant <ccoutant@google.com>
15937
15938 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15939 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15940 * testsuite/tls_test.cc (struct int128): 128-bit struct
15941 for testing TLS relocs with non-zero addend.
15942 (v12): New TLS variable.
15943 (t12): New test.
15944 (t_last): Add check for v12.
15945 * testsuite/tls_test.h (t12): New function.
15946 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15947
2d924fd9
ILT
159482008-08-13 Ian Lance Taylor <iant@google.com>
15949
15950 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15951 set tls_segment_ or relro_segment_.
15952 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15953 when appropriate.
15954 * output.h (Output_section::clear_is_relro): New function.
15955 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15956 sections specially even when output_data_ is empty.
15957 (Output_segment::maximum_alignment): When first section is relro,
15958 only force alignment for PT_LOAD segments.
15959 * script.cc (script_data_segment_align): New function.
15960 (script_data_segment_relro_end): New function.
15961 * script-c.h (script_data_segment_align): Declare.
15962 (script_data_segment_relro_end): Declare.
15963 * script-sections.h (class Script_sections): Declare
15964 data_segment_align and data_segment_relro_end. Add fields
15965 segment_align_index_ and saw_relro_end_.
15966 * script-sections.cc (class Sections_element): Add set_is_relro
15967 virtual function. Add new bool* parameter to place_orphan_here.
15968 Add get_output_section virtual function.
15969 (class Output_section_definition): Add set_is_relro. Add new
15970 bool* parameter to place_orphan_here. Add get_output_section.
15971 Add is_relro_ field.
15972 (Output_section_definition::Output_section_definition): Initialize
15973 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15974 and is_relro_ fields.
15975 (Output_section_definition::place_orphan_here): Add is_relro
15976 parameter.
15977 (Output_section_definition::set_section_addresses): Set relro for
15978 output section.
15979 (Output_section_definition::alternate_constraint): Likewise.
15980 (class Orphan_output_section): Add new bool* parameter to
15981 place_orphan_here. Add get_output_section.
15982 (Orphan_output_section::place_orphan_here): Add is_relro
15983 parameter.
15984 (Script_sections::Script_sections): Initialize
15985 data_segment_align_index_ and saw_relro_end_.
15986 (Script_sections::data_segment_align): New function.
15987 (Script_sections::data_segment_relro_end): New function.
15988 (Script_sections::place_orphan): Set or clear is_relro.
15989 (Script_sections::set_section_addresses): Force alignment of first
15990 TLS section.
15991 * yyscript.y (exp): Call script_data_segment_align and
15992 script_data_segment_relro_end.
15993 * testsuite/relro_script_test.t: New file.
15994 * testsuite/relro_test.cc (using_script): Declare.
15995 (t1, t2): Test using_script.
15996 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15997 (relro_script_test_SOURCES): Define.
15998 (relro_script_test_DEPENDENCIES): Define.
15999 (relro_script_test_LDFLAGS): Define.
16000 (relro_script_test_LDADD): Define.
16001 (relro_script_test.so): New target.
16002 * testsuite/Makefile.in: Rebuild.
16003
f827c9a9
CC
160042008-08-06 Cary Coutant <ccoutant@google.com>
16005
16006 * archive.cc (Archive::total_archives, Archive::total_members)
16007 (Archive::total_members_loaded): New variables.
16008 (Archive::setup): Add parameter. Add option to preread
16009 archive symbols.
16010 (Archive::read_armap): Add counter.
16011 (Archive::get_file_and_offset): New function.
16012 (Archive::get_elf_object_for_member): New function.
16013 (Archive::read_all_symbols): New function.
16014 (Archive::read_symbols): New function.
16015 (Archive::add_symbols): Add counters.
16016 (Archive::include_all_members): Use armap to find members if it's
16017 already built.
16018 (Archive::include_member): Skip reading symbols if already read.
16019 Factored code into Archive::get_file_and_offset and
16020 Archive::get_elf_object_for_member. Changed call to
16021 Mapfile::report_include_archive_member.
16022 (Archive::print_stats): New function.
16023 * archive.h: Declare Object and Read_symbols_data classes.
16024 (Archive::Archive): Add initializers for new members.
16025 (Archive::setup): Add parameter.
16026 (Archive::print_stats): New function.
16027 (Archive::total_archives, Archive::total_members)
16028 (Archive::total_members_loaded): New variables.
16029 (Archive::get_file_and_offset): New function.
16030 (Archive::get_elf_object_for_member): New function.
16031 (Archive::read_all_symbols): New function.
16032 (Archive::read_symbols): New function.
16033 (Archive::Archive_member): New class.
16034 (Archive::members_): New member.
16035 (Archive::num_members_): New member.
16036 * main.cc: Include archive.h.
16037 (main): Call Archive::print_stats.
16038 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16039 archive parameter; member_name is now the fully-decorated name.
16040 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16041 * options.h: (General_options): Add --preread-archive-symbols option.
16042 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16043 Archive::setup.
16044
de4c45bd
ILT
160452008-08-04 Ian Lance Taylor <iant@google.com>
16046
16047 * symtab.h (Symbol::use_plt_offset): New function.
16048 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16049 * powerpc.cc (Relocate::relocate): Likewise.
16050 * sparc.cc (Relocate::relocate): Likewise.
16051 * x86_64.cc (Relocate::relocate): Likewise.
16052 * testsuite/weak_plt.sh: New test.
16053 * testsuite/weak_plt_main.cc: New test.
16054 * testsuite/weak_plt_shared.cc: New test.
16055 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16056 (check_PROGRAMS): Add weak_plt.
16057 (check_DATA): Add weak_plt_shared.so.
16058 (weak_plt_main_pic.o, weak_plt): New targets.
16059 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16060 * testsuite/Makefile.in: Rebuild.
16061
16062 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16063 gcctestdir/ld.
16064 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16065 * testsuite/Makefile.in: Rebuild.
16066
323ee3f4
AM
160672008-08-04 Alan Modra <amodra@bigpond.net.au>
16068
16069 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16070 * Makefile.in: Regenerate.
16071 * po/POTFILES.in: Regenerate.
16072
7c07ecec
ILT
160732008-07-29 Ian Lance Taylor <iant@google.com>
16074
16075 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16076 symbols before other symbols.
16077 * testsuite/script_test_2.cc (test_addr): Declare.
16078 (test_addr_alias): Declare.
16079 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16080 values.
7c07ecec
ILT
16081 * testsuite/script_test_2.t: Define test_addr_alias and
16082 test_addr.
16083
5778530e
ILT
160842008-07-24 Ian Lance Taylor <iant@google.com>
16085
2a00e4fb
ILT
16086 PR 5990
16087 * descriptors.cc: New file.
16088 * descriptors.h: New file.
16089 * gold-threads.h (class Hold_optional_lock): New class.
16090 * fileread.cc: Include "descriptors.h".
16091 (File_read::~File_read): Release descriptor rather than closing
16092 it.
16093 (File_read::open) [file]: Call open_descriptor rather than open.
16094 Set is_descriptor_opened_.
16095 (File_read::open) [memory]: Assert that descriptor is not open.
16096 (File_read::reopen_descriptor): New function.
16097 (File_read::release): Release descriptor.
16098 (File_read::do_read): Make non-const. Reopen descriptor.
16099 (File_read::read): Make non-const.
16100 (File_read::make_view): Reopen descriptor.
16101 (File_read::do_readv): Likewise.
16102 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16103 Update declarations.
16104 * layout.cc: Include "descriptors.h".
16105 (Layout::create_build_id): Use open_descriptor rather than open.
16106 * output.cc: Include "descriptors.h".
16107 (Output_file::open): Use open_descriptor rather than open.
16108 * archive.cc (Archive::const_iterator): Change Archive to be
16109 non-const.
16110 (Archive::begin, Archive::end): Make non-const.
16111 (Archive::count_members): Likewise.
16112 * archive.h (class Archive): Update declarations.
16113 * object.h (Object::read): Make non-const.
16114 * Makefile.am (CCFILES): Add descriptors.cc.
16115 (HFILES): Add descriptors.h.
16116 * Makefile.in: Rebuild.
16117
801647d1
ILT
16118 PR 6716
16119 * gold.h: Always include <clocale>. Add Solaris workarounds
16120 following code in binutils/sysdep.h.
16121
5edd166e
ILT
16122 PR 6048
16123 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16124 this->eh_frame_hdr_ is NULL before using it.
16125
c89ad728
ILT
16126 * dynobj.cc (Versions::Versions): Update comment.
16127
aa86f06b
ILT
16128 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16129 the base version name.
16130
5778530e
ILT
16131 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16132 array size plus one.
16133 (Stringpool_template::set_string_offsets): Subtract one from key
16134 before using it as an array index.
16135 (Stringpool_template::get_offset_with_length): Likewise.
16136 (Stringpool_template::write_to_buffer): Likewise.
16137 * stringpool.h (Stringpool_template::get_offset_from_key):
16138 Likewise.
16139
057ead22
ILT
161402008-07-23 Ian Lance Taylor <iant@google.com>
16141
7f649c59
ILT
16142 PR 6658
16143 * object.h (Merged_symbol_value::value): Do our best to handle a
16144 negative addend.
16145
057ead22
ILT
16146 PR 6647
16147 * script.cc (Version_script_info::get_versions): Don't add empty
16148 version tag to return value.
16149 (Version_script_info::get_symbol_version_helper): Change return
16150 type to bool. Add pversion parameter. Change all callers.
16151 (script_register_vers_node): Don't require a non-NULL tag.
16152 * script.h (class Version_script_info): Update declarations.
16153 (Version_script_info::get_symbol_version): Change return type to
16154 bool. Add version parameter. Change all callers.
16155 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16156 handling. Handle an empty version from a version script.
16157 (Symbol_table::define_special_symbol): Likewise.
16158 * testsuite/ver_test_10.script: New file.
16159 * testsuite/ver_test_10.sh: New file.
16160 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16161 (check_DATA): Add ver_test_10.syms.
16162 (ver_test_10.syms, ver_test_10.so): New target.
16163 * testsuite/Makefile.in: Rebuild.
16164
58e54ac2
CD
161652008-07-23 Simon Baldwin <simonb@google.com>
16166
16167 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16168 to zero for undefined symbols from dynamic libraries.
16169
95d14cd3
ILT
161702008-07-23 Ian Lance Taylor <iant@google.com>
16171
16172 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16173 Change all callers.
16174 * symtab.h (class Symbol_table): Update declaration.
16175 * testsuite/ver_test_9.cc: New file.
16176 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16177 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16178 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16179 (ver_test_9.so, ver_test_9.o): New targets.
16180 * testsuite/Makefile.in: Rebuild.
16181
92de84a6
ILT
161822008-07-22 Ian Lance Taylor <iant@google.com>
16183
34810851
ILT
16184 * options.h (class General_options): Define --check-sections.
16185 * layout.cc (Layout::set_segment_offsets): Handle
16186 --check-sections.
16187
af6156ef
ILT
16188 * options.h (class General_options): Define -n/--nmagic and
16189 -N/--omagic.
16190 * options.cc (General_options::finalize): For -n/--nmagic or
16191 -N/--omagic, set -static.
16192 * layout.cc (Layout::attach_allocated_section_to_segment): If
16193 -N/--omagic, don't put read-only and read-write sections in
16194 different segments.
16195 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16196 finding a read-only segment.
16197 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16198 don't set the minimum segment alignment to the common page size,
16199 and don't set the file offset to the address modulo the page size.
16200 * script-sections.cc (Script_sections::create_segments): If
16201 -n/--omagic, don't put read-only and read-write sections in
16202 different segments.
16203
92de84a6
ILT
16204 * cref.cc: New file.
16205 * cref.h: New file.
16206 * options.h (class General_options): Add --print-symbol-counts.
16207 * main.cc (main): Issue defined symbol report if requested.
16208 * archive.cc (Archive::interpret_header): Make into a const member
16209 function.
16210 (Archive::add_symbols): Call Input_objects::archive_start and
16211 archive_stop.
16212 (Archive::const_iterator): Define new class.
16213 (Archive::begin, Archive::end): New functions.
16214 (Archive::include_all_members): Rewrite to use iterator.
16215 (Archive::count_members): New function.
16216 * archive.h (class Archive): Update declarations.
16217 (Archive::filename): New function.
16218 * object.cc: Include "cref.h".
16219 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16220 (Sized_relobj::do_get_global_symbol_counts): New function.
16221 (Input_objects::add_object): Add object to cross-referencer.
16222 (Input_objects::archive_start): New function.
16223 (Input_objects::archive_stop): New function.
16224 (Input_objects::print_symbol_counts): New function.
16225 * object.h: Declare Cref and Archive.
16226 (Object::get_global_symbol_counts): New function.
16227 (Object::do_get_global_symbol_counts): New pure virtual function.
16228 (class Sized_relobj): Add defined_count_ field. Update
16229 declarations.
16230 (class Input_objects): Add cref_ field. Update constructor.
16231 Update declarations.
16232 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16233 defined_count_.
16234 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16235 symbol counts.
16236 (Sized_dynobj::do_get_global_symbol_counts): New function.
16237 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16238 defined_count_. Update declarations. Define Symbols typedef.
16239 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16240 parameter. Change all callers.
16241 (Symbol_table::add_from_dynobj): Add sympointers and defined
16242 parameters. Change all callers.
16243 * symtab.h (class Symbol_table): Update declarations.
16244 * Makefile.am (CCFILES): Add cref.cc.
16245 (HFILES): Add cref.h.
16246 * Makefile.in: Rebuild.
16247
3f7c5e1d
CD
162482008-07-22 Simon Baldwin <simonb@google.com>
16249
16250 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16251 to zero when writing undefined symbols.
16252
e0b64032
ILT
162532008-07-22 Ian Lance Taylor <iant@google.com>
16254
16255 * output.cc (Output_section::add_input_section): Don't try to
16256 merge empty merge sections.
16257
096b02cf
CS
162582008-07-21 Craig Silverstein <csilvers@google.com>
16259
16260 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16261 Include symbol version in error message.
cd536b21 16262
1d1f116d
CD
162632008-07-20 Chris Demetriou <cgd@google.com>
16264
cd536b21 16265 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16266 (RANDOM_SEED_CFLAGS): New substituted variable.
16267 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16268 * configure: Rebuild.
16269 * Makefile.in: Likewise.
16270 * testsuite/Makefile.in: Likewise.
16271
a18f591e
ILT
162722008-07-18 Ian Lance Taylor <iant@google.com>
16273
16274 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16275 where we see NAME/NULL and NAME/VERSION as separate symbols.
16276 * testsuite/ver_test_main.cc (main): Call t4.
16277 (t4, t4_2a): Define.
16278 * testsuite/ver_test_2.cc (t4_2): Define.
16279 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16280 * testsuite/ver_test_4.cc (t4_2a): Define.
16281 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16282 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16283
c6e3f6ed
ILT
162842008-07-17 Ian Lance Taylor <iant@google.com>
16285
16286 * dynobj.cc (Versions::add_def): If we give an error about a
16287 missing version, go ahead and create the version anyhow.
16288
ef9beddf
ILT
162892008-07-10 Ian Lance Taylor <iant@google.com>
16290
16291 Handle output sections with more than 0x7fffffff bytes.
16292 * object.h (class Relobj): Change map_to_output_ to
16293 output_sections_, and just keep a section pointer. Change all
16294 uses. Move comdat group support to Sized_relobj.
16295 (Relobj::is_section_specially_mapped): Remove.
16296 (Relobj::output_section): Remove poff parameter. Change all
16297 callers.
16298 (Relobj::output_section_offset): New function.
16299 (Relobj::set_section_offset): Rewrite.
16300 (Relobj::map_to_output): Remove.
16301 (Relobj::output_sections): New function.
16302 (Relobj::do_output_section_offset): New pure virtual function.
16303 (Relobj::do_set_section_offset): Likewise.
16304 (class Sized_relobj): Add section_offsets_ field. Add comdat
16305 group support from Relobj. Update declarations.
16306 (Sized_relobj::get_output_section_offset): New function.
16307 (Sized_relobj::do_output_section_offset): New function.
16308 (Sized_relobj::do_set_section_offset): New function.
16309 * object.cc (Relobj::output_section_address): Remove.
16310 (Sized_relobj::Sized_relobj): Initialize new fields.
16311 (Sized_relobj::include_section_group): Cast find_kept_object to
16312 Sized_relobj.
16313 (Sized_relobj::include_linkonce_section): Likewise.
16314 (Sized_relobj::do_layout): Use separate arrays for output section
16315 and output offset.
16316 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16317 output_sections.
16318 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16319 output_sections and section_offsets.
16320 (Sized_relobj::write_local_symbols): Likewise.
16321 (map_to_kept_section): Compute output address directly.
16322 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16323 output_sections and section_offsets.
16324 (Sized_relobj::write_sections): Likewise.
16325 (Sized_relobj::relocate_sections): Likewise.
16326 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16327 * output.h (class Output_reloc): Update declarations. Change
16328 u2_.relobj to Sized_relobj*.
16329 (class Output_data_reloc): Change add functions to use
16330 Sized_relobj*.
16331 * output.cc (Output_reloc::Output_reloc): Change relobj to
16332 Sized_relobj*.
16333 (Output_reloc::local_section_offset): Change return type to
16334 Elf_Addr. Use get_output_section_offset.
16335 (Output_reloc::get_address): Likewise.
16336 (Output_section::is_input_address_mapped): Don't call
16337 is_section_specially_mapped.
16338 (Output_section::output_offset): Likewise.
16339 (Output_section::output_address): Likewise.
16340 (Output_section::starting_output_address): Likewise.
16341 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16342 parameter to Sized_relobj*.
16343 (Copy_relocs::need_copy_reloc): Likewise.
16344 (Copy_relocs::save): Likewise.
16345 * copy-relocs.h (class Copy_relocs): Update declarations.
16346 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16347 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16348 * target-reloc.h (relocate_for_relocatable): Change
16349 offset_in_output_section type to Elf_Addr. Change code that uses
16350 it as well.
16351 * layout.cc (Layout::layout): Always set *off.
16352 * mapfile.cc (Mapfile::print_input_section): Use
16353 output_section_offset.
16354 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16355 Sized_relobj*.
16356 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16357 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16358 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16359
5cb66f97
ILT
163602008-07-03 Ian Lance Taylor <iant@google.com>
16361
16362 * layout.cc (Layout::include_section): Do not discard unrecognized
16363 SHT_STRTAB sections.
16364
afe47622
CS
163652008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16366
16367 * script.cc (Lex::can_continue_name): Make '?' allowable in
16368 version-script names.
16369 * testsuite/version_script.map: Change glob pattern to use '?'
16370
5adf9721
ILT
163712008-06-30 Manish Singh <yosh@gimp.org>
16372
16373 PR 6585
16374 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16375 Correct typo.
16376
e6fde208
ILT
163772008-06-30 Ian Lance Taylor <iant@google.com>
16378
16379 PR 6660
16380 PR 6682
16381 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16382 versions]: Don't try to read the value in the contents, since we
16383 don't use it. Use the template endianness when writing.
16384
3f2e6a2d
CC
163852008-06-25 Cary Coutant <ccoutant@google.com>
16386
16387 * fileread.cc (File_read::make_view): Assert on zero-length view.
16388 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16389 symbol table when there are no symbols to read.
16390
c43d3a48
CS
163912008-06-23 Craig Silverstein <csilvers@google.com>
16392
16393 * version.cc (version_string): Bump to 1.7
16394
5f494ea0
CS
163952008-06-18 Craig Silverstein <csilvers@google.com>
16396
16397 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16398 constant 0xFFFF to type Valtype.
16399 (Powerpc_relocate_functions::rel16_ha): Likewise.
16400
c42e122e
ILT
164012008-06-17 Ian Lance Taylor <iant@google.com>
16402
f34787f8
ILT
16403 * output.h (Output_section::Input_section): Initialize p2align_ to
16404 zero for Output_section_data constructors.
16405 (Output_section::Input_section::addralign): If not an input
16406 section, return the alignment of the Output_section_data.
16407 * testsuite/copy_test.cc: New file.
16408 * testsuite/copy_test_1.cc: New file.
16409 * testsuite/copy_test_2.cc: New file.
16410 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16411 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16412 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16413 (copy_test_1_pic.o, copy_test_1.so): New targets.
16414 (copy_test_2_pic.o, copy_test_2.so): New targets.
16415 * testsuite/Makefile.in: Rebuild.
16416
c42e122e
ILT
16417 * script-sections.cc (Script_sections::place_orphan): Initialize
16418 local variable exact.
16419
ce3ac18a
DE
164202008-06-13 David Edelsohn <edelsohn@gnu.org>
16421
16422 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16423
42cacb20
DE
164242008-06-12 David Edelsohn <edelsohn@gnu.org>
16425 David S. Miller <davem@davemloft.net>
16426
16427 * powerpc.cc: New file.
16428 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16429 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16430 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16431 * Makefile.in: Rebuild.
16432
7b308235
ILT
164332008-06-09 Ian Lance Taylor <iant@google.com>
16434
16435 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16436 <exception>.
16437 (throwing, orig_terminate): New static variables.
16438 (terminate_handler): New static function.
16439 (t2): Set terminate handler.
16440
f0b886e3
ILT
164412008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16442
16443 PR 6584
cd536b21 16444 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16445 alignment.
16446
3e90f135
CC
164472008-05-30 Cary Coutant <ccoutant@google.com>
16448
16449 * archive.cc (Archive::include_all_members) Correct to step
16450 over symbol table and extended name table in thin archives.
16451
e09ad04a
ILT
164522008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16453
16454 PR 6407
16455 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16456 calculation.
16457
62b01cb5
ILT
164582008-05-28 Caleb Howe <cshowe@google.com>
16459
16460 * reduced_debug_output.cc: New file.
16461 * reduced_debug_output.h: New file.
92de84a6 16462 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16463 * options.cc (General_options::finalize): Add strip_debug_non_line
16464 to the strip heirarchy.
16465 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16466 fields.
16467 * layout.cc: Include "reduced_debug_output.h".
16468 (Layout::Layout): Initialize new fields.
16469 (line_only_debug_sections): New static array.
16470 (is_lines_only_debug_sections): New static inline function.
16471 (Layout::include_section): Handle --strip-debug-non-line.
16472 (Layout::make_output_section): If --strip-debug-non-line, build
16473 new output sections for .debug_abbrev and .debug_info.
16474 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16475 gold. Warn about possible overflow.
16476 (read_signed_LEB_128): Likewise.
16477 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16478 (read_signed_LEB_128): Declare.
16479 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16480 (HFILES): Add reduced_debug_output.h.
16481 * Makefile.in: Rebuild.
16482
7d9e3d98
ILT
164832008-05-21 Ian Lance Taylor <iant@google.com>
16484
16485 * mapfile.cc: New file.
16486 * mapfile.h: New file.
16487 * options.h (class General_options): Add -M/--print-map and -Map.
16488 * options.cc (General_options::finalize): Make -M equivalent to
16489 -Map -.
16490 * main.cc: Include <cstdio> and "mapfile.h".
16491 (main): Open mapfile if requested.
16492 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16493 constructor. Change caller.
16494 (queue_initial_tasks): Add mapfile parameter. Change caller.
16495 (queue_middle_tasks): Likewise.
16496 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16497 declarations.
16498 * archive.cc: Include "mapfile.h".
16499 (Archive::add_symbols): Add mapfile parameter. Change all
16500 callers. Pass mapfile, symbol, and reason to include_member.
16501 (Archive::include_all_members): Add mapfile parameter. Change all
16502 callers.
16503 (Archive::include_member): Add mapfile, sym, and why parameters.
16504 Change all callers. Report inclusion to map file.
16505 * archive.h: Include "fileread.h".
16506 (class Archive): Update declarations.
16507 (Archive::file): New const method.
16508 (class Add_archive_symbols): Add mapfile_ field. Update
16509 constructor. Change all callers.
16510 * readsyms.h (class Read_symbols): Likewise.
16511 (class Finish_group): Likewise.
16512 (class Read_script): Likewise.
16513 * common.cc: Include "mapfile.h".
16514 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16515 all callers.
16516 (Symbol_table::do_allocate_commons): Likewise.
16517 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16518 symbol allocation to mapfile.
16519 * common.h (class Allocate_commons_task): Add mapfile_ field.
16520 Update constructor. Change all callers.
16521 * symtab.h (class Symbol_table): Update declarations.
16522 * layout.cc: Include "mapfile.h".
16523 (Layout_task_runner::run): Print information to mapfile.
16524 (Layout::create_gold_note): Change Output_data_fixed_space to
16525 Output_data_zero_fill.
16526 (Layout::create_build_id): Likewise.
16527 (Layout::print_to_mapfile): New function.
16528 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16529 constructor. Change caller.
16530 (class Layout): Declare print_to_mapfile.
16531 * output.cc (Output_section::Input_section::print_to_mapfile): New
16532 function.
16533 (Output_section::add_input_section): If producing a map, always
16534 add to input_sections_ list.
16535 (Output_section::do_print_to_mapfile): New function.
16536 (Output_segment::print_sections_to_mapfile): New function.
16537 (Output_segment::print_section_list_to_mapfile): New function.
16538 * output.h: Include "mapfile.h".
16539 (Output_data::print_to_mapfile): New function.
16540 (Output_data::do_print_to_mapfile): New virtual function.
16541 (Output_segment_headers::do_print_to_mapfile): New function.
16542 (Output_file_header::do_print_to_mapfile): New function.
16543 (Output_data_const::do_print_to_mapfile): New function.
16544 (class Output_data_const_buffer): Add map_name_ field. Update
16545 constructor. Change all callers. Add do_print_to_mapfile
16546 function.
16547 (class Output_data_fixed_space): Likewise.
16548 (class Output_data_space): Likewise.
16549 (class Output_data_zero_fill): New class.
16550 (Output_data_strtab::do_print_to_mapfile): New function.
16551 (Output_data_reloc_base::do_print_to_mapfile): New function.
16552 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16553 (Output_data_group::do_print_to_mapfile): New function.
16554 (Output_data_got::do_print_to_mapfile): New function.
16555 (Output_data_dynamic::do_print_to_mapfile): New function.
16556 (Output_symtab_xindex::do_print_to_mapfile): New function.
16557 (class Output_section): Declare do_print_to_mapflie. Declare
16558 print_to_mapfile in Input_section.
16559 (class Output_segment): Declare new functions.
16560 * object.h (Sized_relobj::symbol_count): New function.
16561 * script-sections.cc
16562 (Output_section_element_dot_assignment::set_section_addresses):
16563 Change Output_data_fixed_space to Output_data_zero_fill.
16564 (Output_data_expression::do_print_to_mapfile): New function.
16565 * script.cc (read_input_script): Add mapfile parameter. Change
16566 all callers.
16567 * script.h (read_input_script): Update declaration.
16568 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16569 (Eh_frame::do_print_to_mapfile): New function.
16570 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16571 (Output_merge_string::do_print_to_mapfile): New function.
16572 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16573 function.
16574 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16575 function.
16576 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16577 function.
16578 * Makefile.am (CCFILES): Add mapfile.cc.
16579 (HFILES): Add mapfile.h.
16580 * Makefile.in: Rebuild.
16581
9f1d377b
ILT
165822008-05-19 Ian Lance Taylor <iant@google.com>
16583
16584 * options.h (class General_options): Add -z relro.
16585 * layout.cc (Layout::Layout): Initialize relro_segment_.
16586 (Layout::add_output_section_data): Return the output section.
16587 (Layout::make_output_section): Rcognize relro sections and mark
16588 them appropriately.
16589 (Layout::attach_allocated_section_to_segment): Put relro sections
16590 in a PT_GNU_RELRO segment.
16591 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16592 section as relro.
16593 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16594 PT_TLS segments.
16595 (Layout::linkonce_mapping): Map d.rel.ro.local to
16596 .data.rel.ro.local.
16597 (Layout::output_section_name): Us .data.rel.ro.local for any
16598 section which begins with that.
16599 * layout.h (class Layout): Update add_output_section_data
16600 declaration. Add relro_segment_ field.
16601 * output.cc (Output_section::Output_section): Initialize is_relro_
16602 and is_relro_local_ fields.
16603 (Output_segment::add_output_section): Group relro sections.
16604 (Output_segment::is_first_section_relro): New function.
16605 (Output_segment::maximum_alignment): If there is a relro section,
16606 align the segment to the common page size.
16607 (Output_segment::set_section_addresses): Track whether we are
16608 looking at relro sections. If the last section is a relro
16609 section, align to the common page size.
16610 (Output_segment::set_section_list_addresses): Add in_relro
16611 parameter. Change all callers. Align to the page size when
16612 moving from relro to non-relro section.
16613 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16614 segment.
16615 * output.h (class Output_section): Add is_relro_ and
16616 is_relro_local_ fields.
16617 (Output_section::is_relro): New function.
16618 (Output_section::set_is_relro): New function.
16619 (Output_section::is_relro_local): New function.
16620 (Output_section::set_is_relro_local): New function.
16621 (class Output_segment): Update declarations.
16622 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16623 * sparc.cc (Target_sparc::got_section): Likewise.
16624 * x86_64.cc (Target_x86_64::got_section): Likewise.
16625 * testsuite/relro_test_main.cc: New file.
16626 * testsuite/relro_test.cc: New file.
16627 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16628 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16629 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16630 (relro_test.so, relro_test_pic.o): New targets.
16631 * testsuite/Makefile.in: Rebuild.
16632
a984ee1d
ILT
166332008-05-16 Ian Lance Taylor <iant@google.com>
16634
01676dcd
ILT
16635 * output.cc (Output_segment::add_output_section): Remove front
16636 parameter.
16637 * output.h (class Output_segment): Remove
16638 add_initial_output_section and overloaded add_output_section.
16639 Update declaration of remaining add_output_section.
16640 * layout.cc (Layout::create_interp): Call add_output_section
16641 rather than add_initial_output_section.
16642 (Layout::finish_dynamic_section): Likewise.
16643
497897f9
ILT
16644 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16645 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16646 know the dynamic type.
16647 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16648 field. Initialize it in constructor.
16649 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16650 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16651 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16652 reloc.
16653
a984ee1d
ILT
16654 * output.cc (Output_reloc::get_address): Change return type to
16655 Elf_Addr.
16656 * output.h (class Output_reloc): Update get_address declaration.
16657 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16658 for section addresses.
16659
55ba0940
ILT
166602008-05-09 Ian Lance Taylor <iant@google.com>
16661
16662 PR 6493
16663 * gold.cc (gold_nomem): Use return value of write.
16664
75517b77
ILT
166652008-05-08 Ian Lance Taylor <iant@google.com>
16666
16667 * symtab.c (Symbol::init_base_output_data): Add version
16668 parameter. Change all callers.
16669 (Symbol::init_base_output_segment): Likewise.
16670 (Symbol::init_base_constant): Likewise.
16671 (Symbol::init_base_undefined): Likewise.
16672 (Sized_symbol::init_output_data): Likewise.
16673 (Sized_symbol::init_output_segment): Likewise.
16674 (Sized_symbol::init_constant): Likewise.
16675 (Sized_symbol::init_undefined): Likewise.
16676 (Symbol_table::do_define_in_output_data): If the new symbol has a
16677 version, mark it as the default.
16678 (Symbol_table::do_define_in_output_segment): Likewise.
16679 (Symbol_table::do_define_as_constant): Likewise.
16680 * symtab.h (class Symbol): Update declarations.
16681 (class Sized_symbol): Likewise.
16682 * resolve.cc (Symbol::override_version): New function.
c42e122e 16683 (Symbol::override_base): Call override_version.
75517b77
ILT
16684 (Symbol::override_base_with_special): Likewise.
16685 * testsuite/ver_script_8.script: New file.
16686 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16687 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16688 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16689 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16690
f1f70eae
ILT
166912008-05-06 Ian Lance Taylor <iant@google.com>
16692
f3e9c5c5
ILT
16693 PR 6049
16694 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16695 functions.
16696 (class General_options): Remove existing --undefined, and add
16697 --no-undefined instead. Add new --undefined as synonym for -u.
16698 * archive.cc (Archive::add_symbols): Check whether symbol was
16699 named with -u.
16700 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16701 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16702 all uses. Add IS_UNDEFINED. Update declarations to split
16703 different versions of init_base. Declare init_base_undefined.
16704 (Symbol::is_defined): Handle IS_UNDEFINED.
16705 (Symbol::is_undefined): Likewise.
16706 (Symbol::is_weak_undefined): Call is_undefined.
16707 (Symbol::is_absolute): Handle IS_CONSTANT.
16708 (class Sized_symbol): Update declarations to split different
16709 versions of init. Declare init_undefined.
16710 (class Symbol_table): Declare new functions.
16711 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16712 Change all callers.
16713 (Symbol::init_base_output_data): Likewise.
16714 (Symbol::init_base_output_segment): Likewise.
16715 (Symbol::init_base_constant): Likewise.
16716 (Symbol::init_base_undefined): New function.
16717 (Sized_symbol::init_object): Rename from init. Change all
16718 callers.
16719 (Sized_symbol::init_output_data): Likewise.
16720 (Sized_symbol::init_output_segment): Likewise.
16721 (Sized_symbol::init_constant): Likewise.
16722 (Sized_symbol::init_undefined): New function.
16723 (Symbol_table::add_undefined_symbols_from_command_line): New
16724 function.
16725 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16726 function.
16727 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16728 (Symbol::output_section): Likewise.
16729 (Symbol::set_output_section): Likewise.
16730 (Symbol_table::sized_finalize_symbol): Likewise.
16731 (Symbol_table::sized_write_globals): Likewise.
16732 * resolve.cc (Symbol_table::should_override): Likewise.
16733 (Symbol::override_base_with_special): Likewise.
16734
8bdcdf2c
ILT
16735 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16736 symbol, change it to have default visibility.
16737 * testsuite/protected_1.cc: New file.
16738 * testsuite/protected_2.cc: New file.
16739 * testsuite/protected_3.cc: New file.
16740 * testsuite/protected_main_1.cc: New file.
16741 * testsuite/protected_main_2.cc: New file.
16742 * testsuite/protected_main_3.cc: New file.
16743 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16744 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16745 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16746 (protected_1.so): New target.
16747 (protected_1_pic.o, protected_2_pic.o): New targets.
16748 (protected_3_pic.o): New target.
16749 (check_PROGRAMS): Add protected_2.
16750 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16751 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16752 * testsuite/Makefile.in: Rebuild.
16753
2b706932
ILT
16754 * options.h (DEFINE_var): Add set_user_set_##varname__.
16755 (DEFINE_bool_alias): New macro.
16756 (class General_options): Define -Bstatic using DEFINE_bool_alias
16757 rather than DEFINE_special. Add --undefined as an alias for -z
16758 defs.
16759 * options.cc (General_options::parse_Bstatic): Remove.
16760
d82a5bcc
ILT
16761 * options.h (class General_options): Add --fatal-warnings.
16762 * main.cc (main): Implement --fatal-warnings.
16763 * errors.h (Errors::warning_count): New function.
16764
f1f70eae
ILT
16765 * options.h (class General_options): Add -Bsymbolic-functions.
16766 * symtab.h (Symbol::is_preemptible): Check for
16767 -Bsymbolic-functions.
16768
8825ac63
ILT
167692008-05-05 Ian Lance Taylor <iant@google.com>
16770
d98bc257
ILT
16771 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16772 as noVARNAME rather than no-VARNAME.
16773 (class General_options): Add option -z combreloc.
16774 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16775 get_address.
16776 (Output_reloc::sort_before) [SHT_REL]: New function.
16777 (Output_reloc::sort_before) [SHT_RELA]: New function.
16778 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16779 Sort_relocs_comparison.
16780 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16781 parameter. Change all callers.
16782 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16783 sort_relocs parameter. Change all callers.
16784 * output.cc (Output_reloc::get_address): New function, broken out
16785 of write_rel.
16786 (Output_reloc::write_rel): Call it.
16787 (Output_reloc::compare): New function.
16788 (Output_data_reloc_base::do_write): Optionally sort relocs.
16789
60b2b4e7
ILT
16790 * configure.ac: If targ_extra_obj is set, link it in.
16791 * configure.tgt: Initialize all variables.
16792 (x86_64*): Set targ_extra_obj and targ_extra_size.
16793 * configure: Rebuild.
16794
8825ac63
ILT
16795 * object.cc (Sized_relobj::include_section_group): Adjust section
16796 indexes read from group data. Build vector to pass to
16797 layout_group.
16798 * layout.cc (Layout::layout_group): Add flags and shndxes
16799 parameters. Remove contents parameter. Change caller. Update
16800 explicit instantiations.
16801 * layout.h (class Layout): Update layout_group declaration.
16802 * output.cc (Output_data_group::Output_data_group): Add flags and
16803 input_shndxes parameters. Remove contents parameter. Change
16804 caller.
16805 (Output_data_group::do_write): Change input_sections_ to
16806 input_shndxes_.
16807 * output.h (class Output_data_group): Update constructor
16808 declaration. Rename input_sections_ to input_shndxes_.
16809 * testsuite/many_sections_test.cc: Add template.
16810
e94cf127
CC
168112008-04-30 Cary Coutant <ccoutant@google.com>
16812
4418b2d5
CC
16813 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16814
e94cf127
CC
16815 * layout.cc (Layout::include_section): Refactored check for debug
16816 info section.
16817 (Layout::add_comdat): Add new parameters. Change type
16818 of signature parameter. Add object and shndx to signatures table.
16819 (Layout::find_kept_object): New function.
16820 * layout.h: Include <cstring>.
16821 (Layout::is_debug_info_section): New function.
16822 (Layout::add_comdat): Add new parameters.
16823 (Layout::find_kept_object): New function.
16824 (Layout::Kept_section): New struct.
16825 (Layout::Signatures): Change type of map range.
16826 * object.cc (Relobj::output_section_address): New function.
16827 (Sized_relobj::include_section_group): Add new parameters. Change
16828 calls to Layout::add_comdat. Change to build table of kept comdat
16829 groups and table mapping discarded sections to kept sections.
16830 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16831 (Sized_relobj::do_layout): Change calls to include_section_group and
16832 include_linkonce_section.
16833 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16834 value to zero when section is discarded.
16835 (Sized_relobj::map_to_kept_section): New function.
16836 * object.h (Relobj::output_section_address): New function.
16837 (Relobj::Comdat_group): New type.
16838 (Relobj::find_comdat_group): New function.
16839 (Relobj::Comdat_group_table): New type.
16840 (Relobj::Kept_comdat_section): New type.
16841 (Relobj::Kept_comdat_section_table): New type.
16842 (Relobj::add_comdat_group): New function.
16843 (Relobj::set_kept_comdat_section): New function.
16844 (Relobj::get_kept_comdat_section): New function.
16845 (Relobj::comdat_groups_): New field.
16846 (Relobj::kept_comdat_sections_): New field.
16847 (Symbol_value::input_value): Update comment.
16848 (Sized_relobj::map_to_kept_section) New function.
16849 (Sized_relobj::include_linkonce_section): Add new parameter.
16850 * target-reloc.h (Comdat_behavior): New type.
16851 (get_comdat_behavior): New function.
16852 (relocate_section): Add code to map a discarded section to the
16853 corresponding kept section when applying a relocation.
16854
e4e5049b
CS
168552008-04-30 Craig Silverstein <csilvers@google.com>
16856
16857 * dwarf_reader.cc (next_generation_count): New static var.
16858 (Addr2line_cache_entry): New struct.
16859 (addr2line_cache): New static var.
16860 (Dwarf_line_info::one_addr2line): Added caching.
16861 (Dwarf_line_info::clear_addr2line_cache): New function.
16862 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16863 cache-size parameter.
16864 (Dwarf_line_info::one_addr2line_cache): New function.
16865 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16866 new cache-size argument to one_addr2line(), and clear cache.
16867
d09e9154
CC
168682008-04-28 Cary Coutant <ccoutant@google.com>
16869
16870 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16871 R_386_PC8 relocations.
16872
7ef73768
ILT
168732008-04-23 Ian Lance Taylor <iant@google.com>
16874
55438702
ILT
16875 * object.cc (Sized_relobj::include_section_group): Check for
16876 invalid section group.
16877
c165fb93
ILT
16878 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16879 header size.
16880
7ef73768
ILT
16881 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16882 than read for file header.
16883 * archive.cc (Archive::include_member): Likewise.
16884
6194aaab
L
168852008-04-23 Paolo Bonzini <bonzini@gnu.org>
16886
16887 * aclocal.m4: Regenerate.
16888 * configure: Regenerate.
16889
d491d34e
ILT
168902008-04-19 Ian Lance Taylor <iant@google.com>
16891
5ea2bac6
ILT
16892 * version.cc (version_string): Bump to 1.6.
16893
7bc3e21a
ILT
16894 * testsuite/Makefile.am (many_sections_r_test): New target.
16895 (many_sections_r_test_SOURCES): Remove.
16896 (many_sections_r_test_DEPENDENCIES): Remove.
16897 (many_sections_r_test_LDFLAGS): Remove.
16898 (many_sections_r_test_LDADD): Remove.
16899
7fcd3aa9
ILT
16900 * object.cc (Sized_relobj::do_add_symbols): Always pass
16901 local_symbol_count_ to add_from_relobj.
16902
4c94d6ae
ILT
16903 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16904 every thousand variables.
16905 * testsuite/Makefile.in: Rebuild.
16906
d491d34e
ILT
16907 * object.cc (Xindex::initialize_symtab_xindex): New function.
16908 (Xindex::read_symtab_xindex): New function.
16909 (Xindex::sym_xindex_to_shndx): New function.
16910 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16911 available.
16912 (Sized_relobj::do_initialize_xindex): New function.
16913 (Sized_relobj::do_read_symbols): Adjust section links.
16914 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16915 parameter. Change all callers.
16916 (Sized_relobj::include_section_group): Adjust section links and
16917 symbol section indexes.
16918 (Sized_relobj::do_layout): Adjust section links.
16919 (Sized_relobj::do_count_local_symbols): Adjust section links and
16920 symbol section indexes.
16921 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16922 ordinary and special symbols.
16923 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16924 dynsym_xindex parameters. Change all callers. Adjust section
16925 links. Use SHN_XINDEX when needed.
16926 (Sized_relobj::get_symbol_location_info): Adjust section links.
16927 Don't get fooled by special symbols.
16928 * object.h (class Xindex): Define.
16929 (class Object): Add xindex_ parameter. Declare virtual functoin
16930 do_initialize_xindex.
16931 (Object::adjust_sym_shndx): New function.
16932 (Object::set_xindex): New protected function.
16933 (class Symbol_value): Add is_ordinary_shndx_ field.
16934 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16935 (Symbol_value::value): Assert ordinary section.
16936 (Symbol_value::initialize_input_to_output_map): Likewise.
16937 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16938 Change all callers.
16939 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16940 all callers.
16941 (class Sized_relobj): Update declarations.
16942 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16943 parameter. Change all callers.
16944 (Sized_relobj::adjust_shndx): New function.
16945 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16946 field.
16947 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16948 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16949 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16950 (Sized_dynobj::read_dynsym_section): Adjust section links.
16951 (Sized_dynobj::read_dynamic): Likewise.
16952 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16953 section links.
16954 (Sized_dynobj::do_initialize_xindex): New function.
16955 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16956 do_initialize_xindex.
16957 (Sized_dynobj::adjust_shndx): New function.
16958 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16959 dynsym_xindex_ fields.
16960 (Layout::finalize): Add a call to set_section_indexes before
16961 creating the symtab sections.
16962 (Layout::set_section_indexes): Don't do anything if the section
16963 already has a section index.
16964 (Layout::create_symtab_sections): Add shnum parameter. Change
16965 caller. Create .symtab_shndx section if needed.
16966 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16967 caller.
16968 (Layout::allocated_output_section_count): New function.
16969 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16970 needed.
16971 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16972 fields. Update declarations.
16973 (Layout::symtab_xindex): New function.
16974 (Layout::dynsym_xindex): New function.
16975 (class Write_symbols_task): Add layout_ field.
16976 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16977 Change caller.
16978 * output.cc (Output_section_headers::Output_section_headers): Add
16979 shstrtab_section parameter. Change all callers.
16980 (Output_section_headers::do_sized_write): Store overflow values
16981 for section count and section string table section index in
16982 section header zero.
16983 (Output_file_header::do_sized_write): Check for overflow of
16984 section count and section string table section index.
16985 (Output_symtab_xindex::do_write): New function.
16986 (Output_symtab_xindex::endian_do_write): New function.
16987 * output.h (class Output_section_headers): Add shstrtab_section_.
16988 Update declarations.
16989 (class Output_symtab_xindex): Define.
16990 (Output_section::has_out_shndx): New function.
16991 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16992 field.
16993 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16994 Change all callers.
16995 (Sized_symbol::init): Likewise.
16996 (Symbol::output_section): Check for ordinary symbol.
16997 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16998 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16999 callers.
17000 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17001 Change all callers. Simplify handling of symbols from sections
17002 not included in the link.
17003 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17004 distinction.
17005 (Weak_alias_sorter::operator()): Assert that symbols are
17006 ordinary.
17007 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17008 distinction.
17009 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17010 parameters. Change all callers.
17011 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17012 symbol distinction. Use SHN_XINDEX when needed.
17013 (Symbol_table::write_section_symbol): Add symtab_xindex
17014 parameter. Change all callers.
17015 (Symbol_table::sized_write_section_symbol): Likewise. Use
17016 SHN_XINDEX when needed.
17017 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17018 declarations.
17019 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17020 (Symbol::is_defined): Check is_ordinary.
17021 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17022 (Symbol::is_absolute, Symbol::is_common): Likewise.
17023 (class Sized_symbol): Update declarations.
17024 (class Symbol_table): Update declarations.
17025 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17026 parameters. Change all callers.
17027 (Sized_symbol::override): Likewise.
17028 (Symbol_table::override): Likewise.
17029 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17030 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17031 is_ordinary, and orig_st_shndx parameters. Change all callers.
17032 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17033 to be in an ordinary section.
17034 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17035 object and is_ordinary parameters. Change all callers.
17036 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17037 Change all callers. Don't add undefined or non-ordinary symbols
17038 to reloc_map_.
17039 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17040 Change all callers.
17041 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17042 declarations.
17043 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17044 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17045 (Sized_relobj::relocate_sections): Likewise.
17046 * target-reloc.h (scan_relocs): Adjust section symbol index.
17047 (scan_relocatable_relocs): Likewise.
17048 * i386.cc (Scan::local): Check for ordinary symbols.
17049 * sparc.cc (Scan::local): Likewise.
17050 * x86_64.cc (Scan::local): Likewise.
17051 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17052 to symbol_section_and_value.
17053 * testsuite/many_sections_test.cc: New file.
17054 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17055 (check_PROGRAMS): Add many_sections_test.
17056 (many_sections_test_SOURCES): Define.
17057 (many_sections_test_DEPENDENCIES): Define.
17058 (many_sections_test_LDFLAGS): Define.
17059 (BUILT_SOURCES): Add many_sections_define.h.
17060 (many_sections_define.h): New target.
17061 (BUILT_SOURCES): Add many_sections_check.h.
17062 (many_sections_check.h): New target.
17063 (check_PROGRAMS): Add many_sections_r_test.
17064 (many_sections_r_test_SOURCES): Define.
17065 (many_sections_r_test_DEPENDENCIES): Define.
17066 (many_sections_r_test_LDFLAGS): Define.
17067 (many_sections_r_test_LDADD): Define.
17068 (many_sections_r_test.o): New target.
17069 * testsuite/Makefile.in: Rebuild.
17070
c5818ff1
CC
170712008-04-17 Cary Coutant <ccoutant@google.com>
17072
17073 * errors.cc (Errors::info): New function.
17074 (gold_info): New function.
17075 * errors.h (Errors::info): New function.
17076 * gold.h (gold_info): New function.
17077 * object.cc (Input_objects::add_object): Print trace output.
17078 * options.cc (options::parse_set): New function.
17079 (General_options::parse_wrap): Deleted.
17080 (General_options::General_options): Deleted initializer.
17081 * options.h (options::String_set): New typedef.
17082 (options::parse_set): New function.
17083 (DEFINE_set): New macro.
17084 (General_options::wrap): Changed to use DEFINE_set. Changed
17085 callers of any_wrap_symbols and is_wrap_symbol.
17086 (General_options::trace, General_options::trace_symbol):
17087 New options.
17088 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17089 (General_options::wrap_symbols_): Deleted.
17090 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17091
b5be4a7c
DM
170922008-04-17 David S. Miller <davem@davemloft.net>
17093
17094 * options.cc (General_options::parse_V): New function.
17095 * options.h: Add entries for -V and -Qy.
17096
155a0dd7
ILT
170972008-04-17 Ian Lance Taylor <iant@google.com>
17098
17099 * common.cc (Symbol_table::allocate_commons): Remove options
17100 parameter. Change caller.
17101 (Symbol_table::do_allocate_commons): Remove options parameter.
17102 Change caller. Just call do_allocate_commons_list twice.
17103 (Symbol_table::do_allocate_commons_list): New function, broken out
17104 of do_allocate_commons.
17105 * common.h (class Allocate_commons_task): Remove options_ field.
17106 Update constructor.
17107 * symtab.cc (Symbol_table::Symbol_table): Initialize
17108 tls_commons_.
17109 (Symbol_table::add_from_object): Put TLS common symbols on
17110 tls_commons_ list.
17111 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17112 which are IN_OUTPUT_DATA.
17113 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17114 allocate_commons and do_allocate_commons declarations. Declare
17115 do_allocate_commons_list.
17116 * gold.cc (queue_middle_tasks): Update creation of
17117 Allocate_commons_task to not pass options.
17118 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17119 (TLS_TEST_C_FLAGS): New variable.
17120 (tls_test_c_pic.o): New target.
17121 (tls_test_shared.so): Link in tls_test_c_pic.o.
17122 (tls_test_c_pic_ie.o): New target.
17123 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17124 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17125 (tls_test_c.o): New target.
17126 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17127 (tls_pic_test_LDADD): Likewise.
17128 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17129 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17130 (tls_test_c_gnu2.o): New target.
17131 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17132 tls_test_c_gnu2.o.
17133 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17134 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17135 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17136 * testsuite/tls_test.cc: Include "config.h".
17137 (t_last): Call t11_last.
17138 * testsuite/tls_test.h (t11, t11_last): Declare.
17139 * testsuite/tls_test_c.c: New file.
17140 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17141 * configure.ac: Check for OpenMP support.
17142 * configure, config.in, Makefile.in: Rebuild.
17143 * testsuite/Makefile.in: Rebuild.
17144
edfbb029
CC
171452008-04-16 Cary Coutant <ccoutant@google.com>
17146
17147 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17148 (Target_i386::tls_base_symbol_defined_): New field.
17149 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17150 (Target_i386::Scan::global): Likewise.
17151 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17152 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17153 (Target_x86_64::tls_base_symbol_defined_): New field.
17154 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17155 (Target_x86_64::Scan::global): Likewise.
17156
f3c69fca
CC
171572008-04-16 Cary Coutant <ccoutant@google.com>
17158
17159 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17160 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17161 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17162 building shared libraries.
17163 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17164 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17165 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17166 * testsuite/Makefile.in: Rebuild.
17167 * testsuite/weak_undef.h: New file.
17168 * testsuite/weak_undef_file1.cc: Add extra test cases.
17169 * testsuite/weak_undef_file2.cc: Likewise.
17170 * testsuite/weak_undef_test.cc: Likewise.
17171
7c414435
DM
171722008-04-16 David S. Miller <davem@davemloft.net>
17173
32b769e1
DM
17174 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17175 Add issued_non_pic_error_ field. Declare check_non_pic.
17176 (Target_sparc::Scan::check_non_pic): New function.
17177 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17178 (Target_sparc::Scan::global): Likewise.
17179
11936fb1
DM
17180 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17181 * configure: Rebuild.
17182
7c414435
DM
17183 * options.h (DEFINE_enable): New macro.
17184 (new_dtags): New enable option.
17185 (initfirst, interpose, loadfltr, nodefaultlib,
17186 nodelete, nodlopen, nodump): New -z options.
17187 * layout.cc (Layout:finish_dynamic_section): If new
17188 dtags enabled, emit DT_RUNPATH. Also, emit a
17189 DT_FLAGS_1 containing any specified -z flags.
17190
85c7bf8b
ILT
171912008-04-16 Ian Lance Taylor <iant@google.com>
17192
12c0daef
ILT
17193 * copy-relocs.cc: New file.
17194 * copy-relocs.h: New file.
17195 * reloc.cc: Remove Copy_relocs code.
17196 * reloc.h: Likewise.
17197 * reloc-types.h (struct Reloc_types) [both versions]: Add
17198 get_reloc_addend_noerror.
17199 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17200 variants of add_global which take an addend which must be zero.
17201 * i386.cc: Include "copy-relocs.h".
17202 (class Target_i386): Change type of copy_relocs_ to variable,
17203 update initializer.
17204 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17205 Change all callers.
17206 (Target_i386::do_finalize_sections): Change handling of
17207 copy_relocs_.
17208 * sparc.cc: Include "copy-relocs.h".
17209 (class Target_sparc): Change type of copy_relocs_ to variable,
17210 update initializer.
17211 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17212 Change all callers.
17213 (Target_sparc::do_finalize_sections): Change handling of
17214 copy_relocs_.
17215 * x86_64.cc: Include "copy-relocs.h".
17216 (class Target_x86_64): Change type of copy_relocs_ to variable,
17217 update initializer.
17218 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17219 class. Change all callers.
17220 (Target_x86_64::do_finalize_sections): Change handling of
17221 copy_relocs_.
17222 * Makefile.am (CCFILES): Add copy-relocs.cc.
17223 (HFILES): Add copy-relocs.h.
17224
4f4995b6
ILT
17225 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17226
85c7bf8b
ILT
17227 * testsuite/script_test_4.sh: Permit leading zeroes.
17228
4f2a9edd
ILT
172292008-04-15 Ian Lance Taylor <iant@google.com>
17230
e6188289
ILT
17231 * script-sections.cc (Script_sections::create_segments): Use
17232 header_size_adjustment even when there is enough room for the
17233 headers.
17234 * testsuite/script_test_4.sh: New file.
17235 * testsuite/script_test_4.t: New file.
17236 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17237 (check_DATA): Add script_test_4.stdout.
17238 (MOSTLYCLEANFILES): Likewise.
17239 (script_test_4): New target.
17240 (script_test_4.stdout): New target.
17241 * testsuite/Makefile.in: Rebuild.
17242
4f2a9edd
ILT
17243 * sparc.cc: Add definitions for Output_data_plt_sparc class
17244 constants.
17245
f5314dd5
DM
172462008-04-14 David S. Miller <davem@davemloft.net>
17247
17248 * sparc.cc: New file.
17249 * Makefile.am (TARGETSOURCES): Add sparc.cc
17250 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17251 * configure.tgt: Document targ_extra_size and
17252 targ_extra_big_endian. Add entries for sparc-* and
17253 sparc64-*.
17254 * configure.ac: Handle targ_extra_size and
17255 targ_extra_big_endian.
17256 * Makefile.in: Rebuild.
17257 * configure: Likewise.
17258 * po/POTFILES.in: Likewise.
17259 * po/gold.pot: Likewise.
17260
154e0e9a
ILT
172612008-04-14 Ian Lance Taylor <iant@google.com>
17262
17263 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17264 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17265 in the name/type/flags to section mapping. Don't call
17266 allocate_output_section.
17267 (Layout::choose_output_section): Change parameter from adjust_name
17268 to is_input_section. Don't permit input sections after sections
17269 are attached to segments. Don't call allocate_output_section.
17270 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17271 not write_enable_output_section.
17272 (Layout::make_output_section): Don't push to
17273 unattached_section_list_ nor call attach_to_segment. Call
17274 attach_section_to_segment if sections are attached.
17275 (Layout::attach_sections_to_segments): New function.
17276 (Layout::attach_section_to_segment): New function.
17277 (Layout::attach_allocated_section_to_segment): Rename from
17278 attach_to_segment. Remove flags parameter.
17279 (Layout::allocate_output_section): Remove function.
17280 (Layout::write_enable_output_section): Remove function.
17281 * layout.h (class Layout): Update for above changes. Add new
17282 field sections_are_attached_.
17283 * output.h (Output_section::update_flags_for_input_section): New
17284 function.
17285 * output.cc (Output_section::add_input_section): Call
17286 update_flags_for_input_section.
17287 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17288
009a67a2
CC
172892008-04-11 Cary Coutant <ccoutant@google.com>
17290
17291 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17292 thought unnecessary.
17293 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17294
759b1a24
ILT
172952008-04-11 Ian Lance Taylor <iant@google.com>
17296
17297 * output.h (class Output_section_data): Remove inline definition
17298 of set_addralign.
17299 * output.cc (Output_section_data::set_addralign): New function.
17300
c2b45e22
CC
173012008-04-11 Cary Coutant <ccoutant@google.com>
17302
17303 Add support for TLS descriptors for i386 and x86_64.
17304 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17305 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17306 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17307 GOT_TYPE_TLS_DESC.
17308 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17309 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17310 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17311 relocations.
17312 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17313 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17314 Fix problem with initial-exec relocations.
17315 (Target_i386::Relocate::relocate_tls): Likewise.
17316 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17317 relaxation.
17318 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17319 support for section-plus-offset dynamic table entries.
17320 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17321 (Output_data_dynamic::Dynamic_entry): Add support for
17322 section-plus-offset dynamic table entries.
17323 (Output_data_dynamic::Classification): Likewise.
17324 (Output_data_dynamic::classification_): Renamed offset_.
17325 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17326 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17327 (Target_x86_64::make_plt_section): New function.
17328 (Target_x86_64::reserve_tlsdesc_entries): New function.
17329 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17330 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17331 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17332 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17333 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17334 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17335 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17336 add extra PLT entry for TLS descriptors.
17337 (Output_data_plt_x86_64::got_): New field.
17338 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17339 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17340 fields.
17341 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17342 descriptors.
17343 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17344 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17345 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17346 R_386_TLS_DESC_CALL relocations.
17347 (Target_x86_64::Scan::global): Likewise.
17348 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17349 for TLS descriptors.
17350 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17351 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17352 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17353 GD-to-IE relaxation.
17354 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17355 and TLS_DESCRIPTORS.
17356 * Makefile.in: Rebuild.
17357 * configure: Rebuild.
17358 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17359 (tls_test_shared2.so): New target.
17360 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17361 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17362 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17363 (tls_shared_gd_to_ie_test_LDADD): New variable.
17364 (tls_shared_gnu2_gd_to_ie_test): New target.
17365 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17366 New targets.
17367 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17368 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17369 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17370 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17371 (tls_shared_gnu2_test): New target.
17372 (tls_test_gnu2_shared.so): New target.
17373 (tls_shared_gnu2_test_SOURCES): New variable.
17374 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17375 (tls_shared_gnu2_test_LDFLAGS): New variable.
17376 (tls_shared_gnu2_test_LDADD): New variable.
17377 * testsuite/Makefile.in: Rebuild.
17378 * testsuite/Makefile.
17379
83bfb6b7
ILT
173802008-04-11 Ian Lance Taylor <iant@google.com>
17381
17382 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17383 justsyms.t.
17384 * testsuite/Makefile.in: Rebuild.
17385
17386 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17387 long.
17388 * testsuite/script_test_2.cc (main): Adjust test.
17389
706e1f5e
ILT
173902008-04-11 David S. Miller <davem@davemloft.net>
17391 Ian Lance Taylor <iant@google.com>
17392
17393 * options.h (General_options): Add entries for '-Y' and
17394 '-relax'.
17395 * options.cc (General_options:finalize): If -Y was used, add those
17396 entries to the library path instead of the default "/lib" and
17397 "/usr/lib".
17398
7c98e6bb
DM
173992008-04-11 David S. Miller <davem@davemloft.net>
17400
17401 * testsuite/justsyms.t: Start at 0x100.
17402 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17403 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17404 long.
17405 * testsuite/script_test_2.cc: Adjust string and section length
17406 checks.
7c98e6bb 17407
99a37bfd
ILT
174082008-04-09 Ian Lance Taylor <iant@google.com>
17409
2cefc357
ILT
17410 PR gold/5996
17411 * script-sections.cc (Sections_element::allocate_to_segment): Add
17412 orphan parameter.
17413 (Output_section_definition::allocate_to_segment): Likewise.
17414 (Orphan_output_section::allocate_to_segment): Likewise.
17415 (Script_sections::attach_sections_using_phdrs_clause): Don't
17416 propagate non-PT_LOAD segments to orphan sections.
17417 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17418 readelf rather than objdump.
17419 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17420 .interp section and PT_INTERP segment are the same size.
17421 * testsuite/Makefile.in: Rebuild.
17422
99a37bfd
ILT
17423 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17424 aliases for symbols defined in the same object.
17425 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17426 (weak_alias_test_SOURCES): New variable.
17427 (weak_alias_test_DEPENDENCIES): New variable.
17428 (weak_alias_test_LDFLAGS): New variable.
17429 (weak_alias_test_LDADD): New variable.
17430 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17431 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17432 (weak_alias_test_3.o): New target.
17433 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17434 * testsuite/weak_alias_test_main.cc: New file.
17435 * testsuite/weak_alias_test_1.cc: New file.
17436 * testsuite/weak_alias_test_2.cc: New file.
17437 * testsuite/weak_alias_test_3.cc: New file.
17438
780e49c5
ILT
174392008-04-08 Ian Lance Taylor <iant@google.com>
17440
cdb0b8f5
ILT
17441 * options.h (class General_options): Add --noinhibit-exec option.
17442 * main.cc (main): Check --noinhibit-exec.
17443
0864d551
ILT
17444 * options.h (class General_options): Define --wrap as a special
17445 option. Add wrap_symbols_ field.
17446 (General_options::any_wrap_symbols): New function.
17447 (General_options::is_wrap_symbol): New function.
17448 * options.cc (General_options::parse_wrap): New function.
17449 (General_options::General_options): Initialize wrap_symbols_.
17450 * symtab.cc (Symbol_table::wrap_symbol): New function.
17451 (Symbol_table::add_from_object): Handle --wrap.
17452 * symtab.h (class Symbol_table): Declare wrap_symbol.
17453 * target.h (Target::wrap_char): New function.
17454 (Target::Target_info): Add wrap_char field.
17455 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17456 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17457 * testsuite/testfile.cc (Target_test::test_target_info):
17458 Likewise.
17459
789aa6de
ILT
17460 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17461 there is one.
17462
2c38906f
ILT
17463 * layout.h (class Layout): Add added_eh_frame_data_ field.
17464 * layout.cc (Layout::Layout): Initialize new field.
17465 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17466 output section until we find a section we merged successfully.
17467 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17468 that the size be non-zero.
17469
780e49c5
ILT
17470 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17471 qualifier.
17472
7fcd0256
ILT
174732008-04-08 Craig Silverstein <csilvers@google.com>
17474
17475 * configure.ac: Export new conditional variable HAVE_ZLIB.
17476 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17477 on HAVE_ZLIB.
17478 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17479 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17480
6835af53
ILT
174812008-04-07 Ian Lance Taylor <iant@google.com>
17482
e24f324c
ILT
17483 * version.cc (version_string): Set to "1.5".
17484
a036edd8
ILT
17485 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17486 Add issued_non_pic_error_ field. Declare check_non_pic.
17487 (Target_x86_64::Scan::check_non_pic): New function.
17488 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17489 (Target_x86_64::Scan::global): Likewise.
17490
624f8810
ILT
17491 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17492 addend parameter. Change caller. Handle merge sections.
17493 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17494 Address to Addend. Don't add in the result of
17495 local_section_offset, pass down the addend and use the returned
17496 value.
17497 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17498 Update declarations of local_section_offset and symbol_value.
17499 * testsuite/two_file_test_1.cc (t18): New function.
17500 * testsuite/two_file_test_2.cc (f18): New function.
17501 * testsuite/two_file_test_main.cc (main): Call t18.
17502 * testsuite/two_file_test.h (t18, f18): Declare.
17503
6835af53
ILT
17504 * configure.ac: Don't test for objdump, c++filt, or readelf.
17505 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17506 conditionals.
17507 (TEST_READELF): New variable.
17508 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17509 (check_PROGRAMS): Add two_file_strip_test.
17510 (two_file_strip_test): New target.
17511 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17512 (two_file_same_shared_strip_test_SOURCES): New variable.
17513 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17514 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17515 (two_file_same_shared_strip_test_LDADD): New variable.
17516 (two_file_shared_strip.so): New target.
17517 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17518 (ver_test_5.syms, ver_test_7.syms): Likewise.
17519 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17520 (strip_test_3.stdout): Use TEST_OBJDUMP.
17521 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17522
86925eef
CC
175232008-04-04 Cary Coutant <ccoutant@google.com>
17524
17525 * symtab.h (Symbol::is_weak_undefined): New function.
17526 (Symbol::is_strong_undefined): New function.
17527 (Symbol::is_absolute): New function.
17528 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17529 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17530 absolute symbols.
17531 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17532 (weak_undef_test): New target.
17533 * testsuite/Makefile.in: Rebuild.
17534 * testsuite/weak_undef_file1.cc: New file.
17535 * testsuite/weak_undef_file2.cc: New file.
17536 * testsuite/weak_undef_test.cc: New file.
17537
126f3ece
ILT
175382008-04-03 Craig Silverstein <csilvers@google.com>
17539
17540 * compressed_output.h (class Output_compressed_section): Use
17541 unsigned buffer.
17542 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17543 add zlib header.
17544 (zlib_compressed_suffix): Removed.
17545 (Output_compressed_section::set_final_data_size): Use unsigned
17546 buffers.
17547 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17548 Fix linker invocation.
17549 (flagstest_o_specialfile_and_compress_debug_sections):
17550 Likewise.
17551 * testsuite/Makefile.in: Regenerated.
17552
deae2a14
DM
175532008-04-02 David S. Miller <davem@davemloft.net>
17554
17555 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17556 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17557
70752818
ILT
175582008-04-02 Craig Silverstein <csilvers@google.com>
17559
17560 * TODO: New file.
17561
39d0cb0e
ILT
175622008-04-02 Ian Lance Taylor <iant@google.com>
17563
17564 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17565 parameters. Update for new key type to views_. Change all
17566 callers.
17567 (File_read::read): Adjust for byteshift in returned view.
17568 (File_read::add_view): New function, broken out of
17569 find_and_make_view.
17570 (File_read::make_view): New function, broken out of
17571 find_and_make_view.
17572 (File_read::find_or_make_view): Add offset and aligned
17573 parameters. Rewrite accordingly. Change all callers.
17574 (File_read::get_view): Add offset and aligned parameters. Adjust
17575 for byteshift in return value.
17576 (File_read::get_lasting_view): Likewise.
17577 * fileread.h (class File_read): Update declarations.
17578 (class File_read::View): Add byteshift_ field. Add byteshift to
17579 constructor. Add byteshift method.
17580 * archive.h (Archive::clear_uncached_views): New function.
17581 (Archive::get_view): Add aligned parameter. Change all callers.
17582 * object.h (Object::get_view): Add aligned parameter. Change all
17583 callers.
17584 (Object::get_lasting_view): Likewise.
17585
17586 * fileread.cc (File_read::release): Don't call clear_views if
17587 there are multiple objects.
17588 * fileread.h (File_read::clear_uncached_views): New function.
17589 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17590 on the archive.
17591
a1207466
CC
175922008-03-31 Cary Coutant <ccoutant@google.com>
17593
17594 Add thin archive support.
17595 * archive.cc (Archive::armagt): New const.
17596 (Archive::setup): Remove task parameter and calls to unlock.
17597 (Archive::unlock_nested_archives): New function.
17598 (Archive::read_header): Add nested_off parameter. Change
17599 all callers.
17600 (Archive::interpret_header): Likewise.
17601 (Archive::include_all_members): Change to handle thin
17602 archives.
17603 (Archive::include_member): Likewise.
17604 * archive.h (Archive::Archive): Add new parameters and
17605 initializers.
17606 (Archive::armagt): New const.
17607 (Archive::setup): Remove task parameter.
17608 (Archive::unlock_nested_archives): New function.
17609 (Archive::read_header): Add nested_off parameter.
17610 (Archive::interpret_header): Likewise.
17611 (Archive::Nested_archive_table): New typedef.
17612 (Archive::is_thin_archive_): New field.
17613 (Archive::nested_archives_): New field.
17614 (Archive::options_): New field.
17615 (Archive::dirpath_): New field.
17616 (Archive::task_): New field.
17617 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17618 for thin archives. Pass additional parameters to
17619 Archive::Archive. Unlock the archive file after calling
17620 Archive::setup.
cd536b21 17621
479f6503
ILT
176222008-03-29 Ian Lance Taylor <iant@google.com>
17623
686c8caf
ILT
17624 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17625 version symbol to be local.
17626 * testsuite/ver_test_4.sh: New file.
17627 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17628 (check_DATA): Add ver_test_4.syms.
17629 (ver_test_4.syms): New target.
17630 * testsuite/Makefile.in: Rebuild.
17631
ab794b6b
ILT
17632 * output.cc
17633 (Output_section::Input_section_sort_entry::has_priority): New
17634 function.
17635 (Output_section::Input_section_sort_entry::match_file_name): New
17636 function.
17637 (Output_section::Input_section_sort_entry::match_section_name):
17638 Remove.
17639 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17640 Remove.
17641 (Output_section::Input_section_sort_entry::match_section_file):
17642 Remove.
17643 (Output_section::Input_section_sort_compare::operator()): Rewrite
17644 using new Input_section_sort_entry functions. Sort crtbegin and
17645 crtend first. Sort sections with no priority before sections with
17646 a priority.
17647 * testsuite/initpri1.c (d3): Check j != 4.
17648 (cd5): New constructor/destructor function.
17649 (main): Check j != 2.
17650
479f6503
ILT
17651 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17652 new symbol when resolving, don't call set_is_default.
17653 * testsuite/ver_test_7.cc: New file.
17654 * testsuite/ver_test_7.sh: New file.
17655 * testsuite/Makefile.am (ver_test_7.so): New target.
17656 (ver_test_7.o): New target.
17657 (check_SCRIPTS): Add ver_test_7.sh.
17658 (check_DATA): Add ver_test_7.syms.
17659 (ver_test_7.syms): New target.
17660
2fd32231
ILT
176612008-03-28 Ian Lance Taylor <iant@google.com>
17662
17663 * layout.cc (Layout::layout): If we see an input section with a
17664 name that needs sorting, set the must_sort flag for the output
17665 section.
17666 (Layout::make_output_section): If the name of the output section
17667 indicates that it might require sorting, set the may_sort flag.
17668 * output.h (Output_section::may_sort_attached_input_sections): New
17669 function.
17670 (Output_section::set_may_sort_attached_input_sections): New
17671 function.
17672 (Output_section::must_sort_attached_input_sections): New
17673 function.
17674 (Output_section::set_must_sort_attached_input_sections): New
17675 function.
17676 (class Output_section): Declare Input_section_sort_entry. Define
17677 Input_section_sort_compare. Declare
17678 sort_attached_input_sections. Add new fields:
17679 may_sort_attached_input_sections_,
17680 must_sort_attached_input_sections_,
17681 attached_input_sections_are_sorted_.
17682 * output.cc (Output_section::Output_section): Initialize new
17683 fields.
17684 (Output_section::add_input_section): Add an entry to
17685 input_sections_ if may_sort or must_sort are true.
17686 (Output_section::set_final_data_size): Call
17687 sort_attached_input_sections if necessary.
17688 (Output_section::Input_section_sort_entry): Define new class.
17689 (Output_section::Input_section_sort_compare::operator()): New
17690 function.
17691 (Output_section::sort_attached_input_sections): New function.
17692 * configure.ac: Check whether the compiler supports constructor
17693 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17694 * testsuite/initpri1.c: New file.
17695 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17696 CONSTRUCTOR_PRIORITY.
17697 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17698 (initpri1_LDFLAGS): New variable.
17699 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17700
18e6b24e
ILT
177012008-03-27 Ian Lance Taylor <iant@google.com>
17702
49bdd526
ILT
17703 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17704 * testsuite/common_test_1.c: New file.
17705 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17706 (common_test_1_SOURCES): New variable.
17707 (common_test_1_DEPENDENCIES): New variable.
17708 (common_test_1_LDFLAGS): New variable.
17709
18e6b24e
ILT
17710 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17711 and commons_ correctly when NAME/VERSION does not override
17712 NAME/NULL.
17713 * testsuite/ver_test_6.c: New file.
17714 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17715 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17716 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17717
04bf7072
ILT
177182008-03-26 Ian Lance Taylor <iant@google.com>
17719
5871526f
ILT
17720 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17721 of an undefined symbol from a version script.
17722 * testsuite/Makefile.am (ver_test_5.so): New target.
17723 (ver_test_5.o): New target.
17724 (check_SCRIPTS): Add ver_test_5.sh.
17725 (check_DATA): Add ver_test_5.syms.
17726 (ver_test_5.syms): New target.
17727 * testsuite/ver_test_5.cc: New file.
17728 * testsuite/ver_test_5.script: New file.
17729 * testsuite/ver_test_5.sh: New file.
17730 * Makefile.in, testsuite/Makefile.in: Rebuild.
17731
04bf7072
ILT
17732 PR gold/5986
17733 Fix problems building gold with gcc 4.3.0.
17734 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17735 (gold_error_at_location, gold_warning_at_location): Use it.
17736 * configure.ac: Check whether we can compile and use a template
17737 function with a printf attribute.
17738 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17739 when jumping over bytes.
17740 * object.cc: Instantiate Object::read_section_data.
17741 * debug.h: Include <cstring>
17742 * dwarf_reader.cc: Include <algorithm>
17743 * main.cc: Include <cstring>.
17744 * options.cc: Include <cstring>.
17745 * output.cc: Include <cstring>.
17746 * script.cc: Include <cstring>.
17747 * script.h: Include <string>.
17748 * symtab.cc: Include <cstring> and <algorithm>.
17749 * target-select.cc: Include <cstring>.
17750 * version.cc: Include <string>.
17751 * testsuite/testmain.cc: Include <cstdlib>.
17752 * configure, config.in: Rebuild.
17753
874c5b28
ILT
177542008-03-25 Ian Lance Taylor <iant@google.com>
17755
819d6c3a
ILT
17756 * options.cc: Include "../bfd/bfdver.h".
17757 (options::help): Print bug reporting address.
17758
f4b2c6f5
ILT
17759 * version.cc (print_version): Adjust output for current value of
17760 BFD_VERSION_STRING.
17761
17762 * NEWS: New file.
17763
e96caa79
ILT
17764 * options.cc (options::help): Print list of supported targets.
17765 * target-select.h: Include <vector>.
17766 (class Target_selector): Make machine_, size_, and is_big_endian_
17767 fields const. Add bfd_name_ and instantiated_target_ fields.
17768 (Target_selector::Target_selector): Add bfd_name parameter.
17769 (Target_selector::recognize): Make non-virtual, call
17770 do_recognize.
17771 (Target_selector::recognize_by_name): Make non-virtual, call
17772 do_recognize_by_name.
17773 (Target_selector::supported_names): New function.
17774 (Target_selector::bfd_name): New function.
17775 (Target_selector::do_instantiate_target): New pure virtual
17776 function.
17777 (Target_selector::do_recognize): New virtual function.
17778 (Target_selector::do_recognize_by_name): New virtual function.
17779 (Target_selector::instantiate_target): New private function.
17780 (supported_target_names): Declare.
17781 * target-select.cc (Target_selector::Target_selector): Update for
17782 new parameter and fields.
17783 (select_target_by_name): Check that the name matches before
17784 calling recognize_by_name.
17785 (supported_target_names): New function.
17786 * i386.cc (class Target_selector_i386): Update Target_selector
17787 constructor call. Remove recognize and recognize_by_name. Add
17788 do_instantiate_target.
17789 * x86_64.cc (class Target_selector_x86_64): Likewise.
17790 * testsuite/testfile.cc (class Target_selector_test): Update for
17791 changes to Target_selector.
17792
874c5b28
ILT
17793 * README: Rewrite, with some notes on unsupported features.
17794
0a65a3a7
CC
177952008-03-24 Cary Coutant <ccoutant@google.com>
17796
17797 * i386.cc (Target_i386::Got_type): New enum declaration.
17798 (Target_i386::Scan::local): Updated callers of Output_data_got
17799 member functions.
17800 (Target_i386::Scan::global): Likewise.
17801 (Target_i386::Relocate::relocate): Likewise.
17802 (Target_i386::Relocate::relocate_tls): Likewise.
17803 * object.h (Got_offset_list): New class.
17804 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17805 (Sized_relobj::local_got_offset): Likewise.
17806 (Sized_relobj::set_local_got_offset): Likewise.
17807 (Sized_relobj::local_has_tls_got_offset): Removed.
17808 (Sized_relobj::local_tls_got_offset): Removed.
17809 (Sized_relobj::set_local_tls_got_offset): Removed.
17810 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17811 * output.cc (Output_data_got::add_global): Added got_type parameter.
17812 (Output_data_got::add_global_with_rel): Likewise.
17813 (Output_data_got::add_global_with_rela): Likewise.
17814 (Output_data_got::add_global_pair_with_rel): New function.
17815 (Output_data_got::add_global_pair_with_rela): New function.
17816 (Output_data_got::add_local): Added got_type parameter.
17817 (Output_data_got::add_local_with_rel): Likewise.
17818 (Output_data_got::add_local_with_rela): Likewise.
17819 (Output_data_got::add_local_pair_with_rel): New function.
17820 (Output_data_got::add_local_pair_with_rela): New function.
17821 (Output_data_got::add_global_tls): Removed.
17822 (Output_data_got::add_global_tls_with_rel): Removed.
17823 (Output_data_got::add_global_tls_with_rela): Removed.
17824 (Output_data_got::add_local_tls): Removed.
17825 (Output_data_got::add_local_tls_with_rel): Removed.
17826 (Output_data_got::add_local_tls_with_rela): Removed.
17827 * output.h (Output_data_got::add_global): Added got_type parameter.
17828 (Output_data_got::add_global_with_rel): Likewise.
17829 (Output_data_got::add_global_with_rela): Likewise.
17830 (Output_data_got::add_global_pair_with_rel): New function.
17831 (Output_data_got::add_global_pair_with_rela): New function.
17832 (Output_data_got::add_local): Added got_type parameter.
17833 (Output_data_got::add_local_with_rel): Likewise.
17834 (Output_data_got::add_local_with_rela): Likewise.
17835 (Output_data_got::add_local_pair_with_rel): New function.
17836 (Output_data_got::add_local_pair_with_rela): New function.
17837 (Output_data_got::add_global_tls): Removed.
17838 (Output_data_got::add_global_tls_with_rel): Removed.
17839 (Output_data_got::add_global_tls_with_rela): Removed.
17840 (Output_data_got::add_local_tls): Removed.
17841 (Output_data_got::add_local_tls_with_rel): Removed.
17842 (Output_data_got::add_local_tls_with_rela): Removed.
17843 * resolve.cc (Symbol::override_base_with_special): Removed
17844 reference to has_got_offset_ field.
17845 * symtab.cc (Symbol::init_fields): Replaced initialization
17846 of got_offset_ with got_offsets_. Removed initialization
17847 of has_got_offset_
53fcba31 17848 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17849 (Symbol::got_offset): Likewise.
17850 (Symbol::set_got_offset): Likewise.
17851 (Symbol::has_tls_got_offset): Removed.
17852 (Symbol::tls_got_offset): Removed.
17853 (Symbol::set_tls_got_offset): Removed.
17854 (Symbol::got_offset_): Removed.
17855 (Symbol::tls_mod_got_offset_): Removed.
17856 (Symbol::tls_pair_got_offset_): Removed.
17857 (Symbol::got_offsets_): New field.
17858 (Symbol::has_got_offset): Removed.
17859 (Symbol::has_tls_mod_got_offset): Removed.
17860 (Symbol::has_tls_pair_got_offset): Removed.
17861 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17862 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17863 member functions.
17864 (Target_x86_64::Scan::global): Likewise.
17865 (Target_x86_64::Relocate::relocate): Likewise.
17866 (Target_x86_64::Relocate::relocate_tls): Likewise.
17867
bd52eafb
BE
178682008-03-25 Ben Elliston <bje@au.ibm.com>
17869
17870 * yyscript.y: Fix spelling error in comment.
17871
8b105e34
ILT
178722008-03-24 Ian Lance Taylor <iant@google.com>
17873
8ed814a9
ILT
17874 * options.h (class General_options): Define build_id option.
17875 * layout.h (class Layout): Declare write_build_id, create_note,
17876 create_build_id. Add build_id_note_ member.
17877 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17878 "libiberty.h", "md5.h", "sha1.h".
17879 (Layout::Layout): Initialize eh_frame_data_,
17880 eh_frame_hdr_section_, and build_id_note_.
17881 (Layout::finalize): Call create_build_id.
17882 (Layout::create_note): New function, broken out of
17883 Layout::create_gold_note.
17884 (Layout::create_gold_note): Call create_note.
17885 (Layout::create_build_id): New function.
17886 (Layout::write_build_id): New function.
17887 (Close_task_runner::run): Call write_build_id.
17888
8b105e34
ILT
17889 * x86_64.cc: Correct license to GPLv3.
17890
086a1841
ILT
178912008-03-23 Ian Lance Taylor <iant@google.com>
17892
17893 * options.cc: Include "demangle.h".
17894 (parse_optional_string): New function.
17895 (parse_long_option): Handle takes_optional_argument.
17896 (parse_short_option): Update dash_z initializer. Handle
17897 takes_optional_argument.
17898 (General_options::General_options): Initialize do_demangle_.
17899 (General_options::finalize): Set do_demangle_. Handle demangling
17900 style.
17901 * options.h (parse_optional_string): Declare.
17902 (struct One_option): Add optional_arg field. Update constructor.
17903 Update call constructor calls. Add takes_optional_argument
17904 function.
17905 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17906 (DEFINE_optional_string): Define.
17907 (General_options::demangle): Change from DEFINE_bool to
17908 DEFINE_optional_string.
17909 (General_options::no_demangle): New function.
17910 (General_options::do_demangle): New function.
17911 (General_options::set_do_demangle): New function.
17912 (General_options::execstack_status_): Move definition to end of
17913 class definition.
17914 (General_options::static_): Likewise.
17915 (General_options::do_demangle_): New field.
17916 * object.cc (big_endian>::get_symbol_location_info): Call
17917 Options::do_demangle, not Options::demangle.
17918 * symtab.cc (demangle): Likewise.
17919
cbb93e63
ILT
179202008-03-22 Ian Lance Taylor <iant@google.com>
17921
17922 * gold.h: Include <cstddef> and <sys/types.h>
17923 * options.h: Include <cstring>.
17924
ec531623
ILT
179252008-03-21 Ian Lance Taylor <iant@google.com>
17926
17927 * Added source code to GNU binutils.
752937aa 17928\f
b90efa5b 17929Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17930
17931Copying and distribution of this file, with or without modification,
17932are permitted in any medium without royalty provided the copyright
17933notice and this notice are preserved.
17934
17935Local Variables:
17936mode: change-log
17937left-margin: 8
17938fill-column: 74
17939version-control: never
17940End:
This page took 1.181378 seconds and 4 git commands to generate.