[LD][AARCH64]Add test cases for big-endian.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
26f187cd
NC
12015-10-30 Nick Clifton <nickc@redhat.com>
2
3 * po/zh_CN.po: New (simplified) Chinese translation.
4
41e83f2b
L
52015-10-29 H.J. Lu <hongjiu.lu@intel.com>
6
7 PR gold/19184
8 * incremental.cc (Got_plt_view_info): Add got_entry_size.
9 (Local_got_offset_visitor::visit): Replace got_entry_size_
10 with info_.got_entry_size.
11 (Local_got_offset_visitor::got_entry_size_): Removed.
12 (Global_got_offset_visitor::visit): Replace got_entry_size_
13 with info_.got_entry_size.
14 (Global_got_offset_visitor::got_entry_size_): Removed.
15 (Output_section_incremental_inputs::write_got_plt): Initialize
16 view_info.got_entry_size.
17 * target.h (Sized_target::got_entry_size): New virtual function.
18 * x86_64.cc (Target_x86_64::got_entry_size): New function.
19
238830c6
MK
202015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
21
22 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
23 * testsuite/script_test_12a.c: Likewise.
24 * testsuite/script_test_1a.cc: Likewise.
25 * testsuite/script_test_2.cc: Likewise.
26
bd890911
MK
272015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
28
29 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
30
a817ff49
MK
312015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
32
33 PR gold/18959
34 * stringpool.cc (Stringpool_template::new_key_offset): Align all
35 strings, even zero-length.
36 (Stringpool_template::set_string_offsets): Likewise.
37
e79a4bad
MK
382015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
39
40 * s390.cc: New file.
41 * Makefile.am (TARGETSOURCES): Add s390.cc.
42 (ALL_TARGETOBJS): Add s390.o.
43 * Makefile.in: Regenerate.
44 * configure.ac: Add s390 support.
45 * configure: Regenerate.
46 * configure.tgt: Add s390-*-* and s390x-*-*.
47 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
48 support.
49
6f97897d
MK
502015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
51
52 * archive.cc (Archive::sym64name): New const.
53 (Archive::setup): Add support for SYM64 armap.
54 (Archive::read_armap): Likewise.
55 (Archive::interpret_header): Likewise.
56 (Archive::const_iterator::read_next_header): Likewise.
57 * archive.h (Archive::sym64name): New const.
58 (Archive::read_armap): Add mapsize template parameter.
59
8d9743bd
MK
602015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
61
62 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
63 target-specific entry size.
64 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
65 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
66 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
67 hash_entry_size.
68 * target.h (Target::hash_entry_size): New method.
69 (Target::Target_info::hash_entry_size): New data member.
70
71 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
72 * arm.cc (Target_arm::arm_info): Likewise.
73 (Target_arm_nacl::arm_nacl_info): Likewise.
74 * i386.cc (Target_i386::i386_info): Likewise.
75 (Target_i386_nacl::i386_nacl_info): Likewise.
76 (Target_iamcu::iamcu_info): Likewise.
77 * mips.cc (Target_mips::mips_info): Likewise.
78 (Target_mips_nacl::mips_nacl_info): Likewise.
79 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
80 * sparc.cc (Target_sparc::sparc_info): Likewise.
81 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
82 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
83 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
84 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
85
3043c1ab
L
862015-10-28 H.J. Lu <hongjiu.lu@intel.com>
87
88 PR gold/19177
89 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
90 and R_386_GOT32X relocations without base register.
91
4d2f5d58
HS
922015-10.27 Han Shen <shenhan@google.com>
93
94 PR gold/19042 - unsupported reloc 311/312.
95
96 * aarch64.cc (Target_aarch64::Scan::local): Add support for
97 reloc 311/312.
98
2891b491
L
992015-10-22 H.J. Lu <hongjiu.lu@intel.com>
100
101 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
102 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
103 as R_X86_64_GOTPCREL.
104 (Target_x86_64<size>::Scan::local): Likewise.
105 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
106 Likewise.
107 (Target_x86_64<size>::Scan::global): Likewise.
108 (Target_x86_64<size>::Relocate::relocate): Likewise.
109 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
110 Likewise.
111
493d4b48
L
1122015-10-22 H.J. Lu <hongjiu.lu@intel.com>
113
114 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
115 R_386_GOT32X the same as R_386_GOT32.
116 (Target_i386::Scan::local): Likewise.
117 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
118 (Target_i386::Scan::global): Likewise.
119 (Target_i386::Relocate::relocate): Likewise.
120 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
121 Likewise.
122
0fd15345
L
1232015-10-20 H.J. Lu <hongjiu.lu@intel.com>
124
125 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
126 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
127 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
128 x86_64_mov_to_lea1.o.
129 * testsuite/Makefile.in: Regenerated.
130
64571972
L
1312015-10-16 H.J. Lu <hongjiu.lu@intel.com>
132
133 PR gold/19119
134 * options.h (General_options): Remove "obsolete" from -m.
135 * parameters.cc (set_parameters_target): Check if input target
136 is compatible with output emulation set by "-m emulation".
137
01f573ad
L
1382015-10-13 H.J. Lu <hongjiu.lu@intel.com>
139
140 PR gold/19118
141 * i386.cc (Target_iamcu): New class.
142 (Target_selector_iamcu): Likewise.
143 (Target_iamcu::iamcu_info): New variable.
144 (target_selector_iamcu): Likewise.
145
3b0357da
AS
1462015-10-07 Andreas Schwab <schwab@suse.de>
147
148 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
149
9eacb935
CC
1502015-10-06 Cary Coutant <ccoutant@gmail.com>
151
152 PR gold/18855
153 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
154 parameter.
155 (Sparc_relocate_functions::gdop_lox10): Likewise.
156 (Target_sparc::Relocate::relocate): Use addend when computing
157 symbol value for R_SPARC_GOTDATA_OP*.
158
3d4fde69
CC
1592015-09-07 Cary Coutant <ccoutant@gmail.com>
160
161 PR gold/18930
162 PR gold/18886
163 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
164 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
165
358de988
L
1662015-09-02 H.J. Lu <hongjiu.lu@intel.com>
167
168 PR gold/18886
169 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
170 shared libraries into normal FUNC symbols.
171 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
172 symbols aren't from shared libraries.
173
d49044c7
AM
1742015-09-02 Alan Modra <amodra@gmail.com>
175
176 PR 18878
177 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
178 (Target_powerpc::Branch_info::make_stub): Determine whether long
179 branch stub is for save/restore function.
180 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
181 (Stub_table): Add need_save_res_.
182 (Stub_table:clear_stubs): Clear need_save_res_.
183 (Stub_table:set_address_and_size): Add save/restore section size.
184 (Stub_table::add_long_branch_entry): Add save_res param. Set
185 need_save_res_, but don't add space for save/restore stubs.
186 (Stub_table::find_long_branch_entry): Return offset to local copy
187 of save/restore func.
188 (Stub_table::do_write): Don't output save/restore stubs. Instead
189 copy the save/restore functions.
190 (Output_data_save_res:contents): New accessor.
191 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
192
7c61d651
CC
1932015-08-25 Cary Coutant <ccoutant@gmail.com>
194
195 PR gold/18847
196 * script-sections.cc (Memory_region::set_address): New method.
197 (Script_sections::find_memory_region): Add explicit_only parameter.
198 (Output_section_definition::set_section_addresses): Handle case where
199 script specifies both address and vma region.
200 * script-sections.h (Script_sections::find_memory_region): Add
201 explicit_only parameter.
202
4bfacfd3
CC
2032015-08-25 Cary Coutant <ccoutant@gmail.com>
204
205 PR gold/18859
206 * object.cc (Input_objects::add_object): Store objects in a map,
207 indexed by soname; update as-needed flag when necessary.
208 * object.h (Object::clear_as_needed): New method.
209 (Input_objects::so_names_): Change from set to map.
210
1757d35c
CC
2112015-08-25 Cary Coutant <ccoutant@gmail.com>
212
213 PR gold/14746
214 * expression.cc (Expression::Expression_eval_info): Add
215 is_valid_pointer field.
216 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
217 Adjust all callers.
218 (Addr_expression::value_from_output_section): Check whether address
219 is valid.
220 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
221 if evaluation failed due to address that is not yet valid.
222 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
223 parameter.
224
3ac0a36c
CC
2252015-08-25 Cary Coutant <ccoutant@gmail.com>
226
227 PR gold/18866
228 PR gold/18703
229 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
230
9215b98b
AM
2312015-08-20 Alan Modra <amodra@gmail.com>
232
233 PR gold/18846
234 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
235 Subtract os->address() from addend.
236 * powerpc.cc (relocate_relocs): Likewise.
237
40fc1451
SD
2382015-08-12 Simon Dardis <simon.dardis@imgtec.com>
239
240 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
241 lazy_stub_normal_1, lazy_stub_normal_1_n64,
242 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
243 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
244 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
245 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
246 of 'addu/daddu'.
247
37a42ee9
L
2482015-07-27 H.J. Lu <hongjiu.lu@intel.com>
249
250 * configure: Regenerated.
251
ab3b14b0
DK
2522015-07-26 Doug Kwan <dougkwan@google.com>
253
254 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
255 disassembler output format.
256
cdb06167
HS
2572015-07-23 Ian Coolidge <icoolidge@google.com>
258 Plumb --pic-veneer option for gold.
259
260 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
261 generation.
262 * options.h (General_options): Add --pic-veneer option.
263
5b2af7dd
L
2642015-07-22 H.J. Lu <hongjiu.lu@intel.com>
265
266 PR gold/18663
267 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
268 script_test_1a.cc script_test_1b.cc.
269 (script_test_11_r.o): Replace script_test_11.o with
270 script_test_11a.o script_test_11b.o.
271 (script_test_11.o): Removed.
272 (script_test_11a.o): New.
273 (script_test_11b.o): Likewise.
274 * testsuite/Makefile.in: Regenerated.
275 * testsuite/script_test_1.h: New file.
276 * testsuite/script_test_1b.cc: Likewise.
277 * testsuite/script_test_11.h: Likewise.
278 * testsuite/script_test_11b.c: Likewise.
279 * testsuite/script_test_1.cc: Renamed to ...
280 * testsuite/script_test_1a.cc: This.
281 Include "script_test_1.h".
282 (main): Call check_int and check_ptr.
283 * testsuite/script_test_11.c: Renamed to ...
284 * testsuite/script_test_11a.c: This.
285 Include "script_test_11.h".
286 (main): Call ptr_equal.
287
cd78ea77
L
2882015-07-22 H.J. Lu <hongjiu.lu@intel.com>
289
290 PR gold/18628
291 * testsuite/ifuncdep2.c (global): Change protected to hidden.
292 * testsuite/ifuncmod1.c (global): Likewise.
293 * testsuite/ifuncmod5.c (global): Likewise.
294
f945ba50
AM
2952015-07-22 Alan Modra <amodra@gmail.com>
296
297 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
298
5417c94d
CC
2992015-07-21 Cary Coutant <ccoutant@gmail.com>
300
301 PR gold/18548
302 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
303 forced local symbol even when oldsym != NULL.
304 (Symbol_table::do_define_in_output_segment): Likewise.
305 (Symbol_table::do_define_as_constant): Likewise.
306
cb5cf5e2
CC
3072015-07-21 Cary Coutant <ccoutant@gmail.com>
308
b8c6c5ef 309 PR gold/18698
cb5cf5e2
CC
310 * archive.cc (Library_base::should_include_member): Don't use entry
311 point for relocatable links, or if target is not yet valid.
312 * parameters.cc (Parameters::entry): Check target_valid().
313
0ef3814f
HS
3142015-07-20 Han Shen <shenhan@google.com>
315
316 Optimize erratum 843419 fix.
317
318 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
319 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
320 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
321 (E843419_stub): New sub-class of Erratum_stub.
322 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
323 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
324 (AArch64_relobj::create_erratum_stub): Add 1 argument.
325 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
326
2bca0377
HS
3272015-07-20 Han Shen <shenhan@google.com>
328
329 Fix arm elf header flags wrt hardfp bit.
330
331 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
332
f54f5e31
L
3332015-07-20 H.J. Lu <hongjiu.lu@intel.com>
334
335 PR gold/18689
336 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
337 from input group section for relocatable link.
338 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
339 (check_DATA): Add pr18689.stdout.
340 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
341 (pr18689.stdout): New rule.
342 (pr18689a.o): Likewise.
343 (pr18689b.o): Likewise.
344 (pr18689.o): Likewise.
345 * testsuite/pr18689.c: New file.
346 * testsuite/pr18689.sh: Likewise.
347 * testsuite/Makefile.in: Regenerated.
348
c20ceeb2
YW
3492015-07-20 Yiran Wang <yiran@google.com>
350 Cary Coutant <ccoutant@gmail.com>
351
352 PR gold/15574
353 * resolve.cc (Symbol_table): Remove warning about references
354 from shared objects to hidden symbols.
355 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
356 * testsuite/Makefile.in: Regenerate.
357 * testsuite/hidden_test.sh: Check dynamic symbol table; update
358 expected error messages.
359
19a7fe52
L
3602015-07-14 H.J. Lu <hongjiu.lu@intel.com>
361
362 * compressed_output.cc (Output_compressed_section::set_final_data_size):
363 Make --compress-debug-sections=zlib the same as
364 --compress-debug-sections=zlib-gabi.
365 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
366 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
367 ".zdebug_".
368 * testsuite/Makefile.in: Regenerated.
369
fb8b9dbc
L
3702015-07-12 H.J. Lu <hongjiu.lu@intel.com>
371
372 PR gold/18322
373 * compressed_output.cc (zlib_compress): Add argument for
374 compression header size. Set header size to compression header
375 size if it isn't 0. Don't write out the zlib header here.
376 (Output_compressed_section::set_final_data_size): Support
377 zlib-gnu and zlib-gabi compressions. Pass compression header
378 size to zlib_compress and write out compression header. Set
379 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
380 clear the SHF_COMPRESSED bit
381 * options.h (compress_debug_sections): Add zlib-gnu and
382 zlib-gabi.
383 * output.h (Output_section::set_flags): New.
384 * testsuite/Makefile.am (check_PROGRAMS): Add
385 flagstest_compress_debug_sections_none,
386 flagstest_compress_debug_sections_gnu and
387 flagstest_compress_debug_sections_gabi.
388 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
389 flagstest_compress_debug_sections.stdout,
390 flagstest_compress_debug_sections.cmp,
391 flagstest_compress_debug_sections.check,
392 flagstest_compress_debug_sections_gnu.stdout,
393 flagstest_compress_debug_sections_gnu.cmp,
394 flagstest_compress_debug_sections_gnu.check,
395 flagstest_compress_debug_sections_gabi.stdout,
396 flagstest_compress_debug_sections_gabi.cmp and
397 flagstest_compress_debug_sections_gabi.check.
398 (flagstest_compress_debug_sections_none): New.
399 (flagstest_compress_debug_sections_none.stdout): Likewise.
400 (flagstest_compress_debug_sections.stdout): Likewise.
401 (flagstest_compress_debug_sections.check): Likewise.
402 (flagstest_compress_debug_sections.cmp): Likewise.
403 (flagstest_compress_debug_sections_gnu): Likewise.
404 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
405 (flagstest_compress_debug_sections_gnu.check): Likewise.
406 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
407 (flagstest_compress_debug_sections_gabi): Likewise.
408 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
409 (flagstest_compress_debug_sections_gnu.check): Likewise.
410 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
411 * testsuite/Makefile.in: Regenerated.
412
48058663
L
4132015-07-12 H.J. Lu <hongjiu.lu@intel.com>
414
415 PR gold/18321
416 * compressed_output.h (decompress_input_section): Add arguments
417 for ELF class, big endian and sh_flags.
418 * compressed_output.cc (decompress_input_section): Likewise.
419 Support the SHF_COMPRESSED section.
420 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
421 functions.
422 * plugin.h (Pluginobj): Likewise.
423 * layout.cc (Layout::get_output_section_flags): Also clear the
424 SHF_COMPRESSED bit.
425 * object.h (Compressed_section_info): Add flag to store sh_flags.
426 (Object): Add pure virtual elfsize and is_big_endian member
427 functions.
428 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
429 prefix here.
430 (build_compressed_section_map): Check SHF_COMPRESSED for
431 uncompressed size. Store sh_flags in Compressed_section_info.
432 Pass size, big_endian and sh_flags to decompress_input_section.
433 Skip the ".debug"/".zdebug" prefix when passing section name to
434 need_decompressed_section.
435 (Sized_relobj_file<size, big_endian>::do_find_special_section):
436 Don't check ".zdebug_*" sections.
437 (Object::decompressed_section_contents): Pass ELF class, big
438 endian and sh_flags to decompress_input_section.
439 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
440 Likewise.
441 * testsuite/Makefile.am (check_DATA): Add
442 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
443 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
444 gdb_index_test_2_gabi.stdout.
445 (debug_msg_cdebug_gabi.o): New.
446 (odr_violation1_cdebug_gabi.o): Likewise.
447 (odr_violation2_cdebug_gabi.o): Likewise.
448 (debug_msg_cdebug_gabi.err): Likewise.
449 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
450 (gdb_index_test_cdebug_gabi.o): Likewise.
451 (gdb_index_test_2_gabi): Likewise.
452 (gdb_index_test_2_gabi.stdout): Likewise.
453 * testsuite/gdb_index_test_2_gabi.sh: New file.
454 * testsuite/Makefile.in: Regenerated.
455
73854cdd
HS
4562015-07-09 Han Shen <shenhan@google.com>
457
458 Use "gold_info" instead of "gold_warning" for erratum fix.
459
460 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
461 'gold_info'.
462 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
463
61163dfa
HS
4642015-07-09 Han Shen <shenhan@google.com>
465
466 Drop missing symbol warning for arm/aarch64.
467
468 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
469 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
470 symbol warning.
471
b91deca9
HS
4722015-07-07 Han Shen <shenhan@google.com>
473
474 Make gold aarch64 accept long form of mapping symbols.
475
476 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
477 of mapping symbols.
478
15162bef
DK
4792015-06-29 Doug Kwan <dougkwan@google.com>
480
481 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
482 at address expected by test.
483 * testsuite/arm_cortex_a8_b.s: Ditto.
484 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
485 * testsuite/arm_cortex_a8_bl.s: Ditto.
486 * testsuite/arm_cortex_a8_blx.s: Ditto.
487 * testsuite/arm_cortex_a8_local.s: Ditto.
488 * testsuite/arm_fix_v4bx.s: Ditto.
489 * testsuite/arm_unaligned_reloc.s: Ditto.
490 * testsuite/thumb_bl_out_of_range.s: Ditto.
491 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
492 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 493
56b06706
HS
4942015-06-29 Han Shen <shenhan@google.com>
495
496 Patch for erratum 843419 internal error.
497
72f4393d
L
498 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
499 (Erratum_stub::update_erratum_insn): New method.
500 (Stub_table::relocate_stubs): Modified to place relocated insn.
501 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 502
2f0c79aa
HS
5032015-06-12 Han Shen <shenhan@google.com>
504
505 Fix erratum 835769.
506
72f4393d
L
507 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
508 defintion outside class definition.
509 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
510 (AArch64_insn_utilities::aarch64_op31): New member.
511 (AArch64_insn_utilities::aarch64_ra): New member.
512 (AArch64_insn_utilities::aarch64_mac): New member.
513 (AArch64_insn_utilities::aarch64_mlxl): New member.
514 (ST_E_835769): New global enum member.
515 (Stub_table::relocate_stubs): Add 835769 handler.
516 (Stub_template_repertoire::Stub_template_repertoire): Install new
517 stub type.
518 (AArch64_relobj::scan_errata): This func is renamed from
519 scan_erratum_843419.
520 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
521 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
522 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
523 (Target_aarch64::scan_erratum_835769_span): New method.
524 (Target_aarch64::create_erratum_stub): New method.
525 (Target_aarch64::is_erratum_835769_sequence): New method.
526 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
527 code into create_erratum_stub.
528 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 529
5d7908e0
CC
5302015-06-11 Cary Coutant <ccoutant@gmail.com>
531
532 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
533 outside class body.
534 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
535
dd68f8fa
CC
5362015-06-11 Cary Coutant <ccoutant@gmail.com>
537
538 PR gold/17731
539 * layout.cc (corresponding_uncompressed_section_name): New function.
540 (Layout::choose_output_section): Call it.
541 * layout.h (corresponding_uncompressed_section_name): New function.
542 * script-sections.cc (Input_section_info::set_section_name): Check
543 for compressed debug section (.zdebug style).
544
a3a0c391
JY
5452015-06-11 Jing Yu <jingyu@google.com>
546
547 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
548 * testsuite/Makefile.in: Regenerate.
549
970cdef2
DI
5502015-06-11 Davide Italiano <dccitaliano@gmail.com>
551
552 * gold.h (is_cident): Correct typo.
553
a48d0c12
HS
5542015-06-10 Han Shen <shenhan@google.com>
555 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
556
557 Now fixing for 843419 is fully functional.
558
559 The first part of the erratum fix CL is here -
560 https://sourceware.org/ml/binutils/2015-04/msg00229.html
561
562 * aarch64.cc(global enum): New constants representing stub types.
563 (Stub_template): New POD struct.
564 (Stub_template_repertoire): New class.
565 (Stub_base): New class.
566 (Erratum_stub): New class.
567 (Reloc_stub): Refactored to be a subclass of Stub_base.
568 (Reloc_stub::Stub_type): Removed.
569 (Reloc_stub::offset): Moved to Stub_base.
570 (Reloc_stub::set_offset): Moved to Stub_base.
571 (Reloc_stub::destination_address): Moved to Stub_base.
572 (Reloc_stub::set_destination_address): Moved to Stub_base.
573 (Reloc_stub::reset_destination_address): Moved to Stub_base.
574 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
575 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
576 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
577 (Reloc_stub::write): Moved to Stub_base.
578 (Reloc_stub::invalid_offset): Moved to Stub_base.
579 (Reloc_stub::invalid_address): Moved to Stub_base.
580 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
581 (Reloc_stub::stub_insns_): Moved to Stub_base.
582 (Reloc_stub::offset_): Moved to Stub_base.
583 (Reloc_stub::destination_address_): Moved to Stub_base.
584 (Stub_table::The_aarch64_relobj): New typedef.
585 (Stub_table::The_erratum_stub): New typedef.
586 (Stub_table::The_erratum_stub_less): New typedef.
587 (Stub_table::The_erratum_stub_set): New typedef.
588 (Stub_table::The_erratum_stub_set_iter): New typedef.
589 (Stub_table::empty): Added emptiness testing for erratum stubs.
590 (Stub_table::add_erratum_stub): New method to add an erratum stub.
591 (Stub_table::find_erratum_stub): New method.
592 (Stub_table::find_erratum_stubs_for_input_section): New method.
593 (Stub_table::erratum_stub_address): New method.
594 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
595 (Stub_table::do_addralign): Modified to handle erratum stubs.
596 (Stub_table::erratum_stubs_): New member.
597 (Stub_table::erratum_stub_size_): New member.
598 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
599 (Stub_table::do_write): Modified to handle erratum stubs.
600 (AArch64_relobj::The_erratum_stub): New typedef.
601 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
602 (AArch64_relobj::fix_errata): New method.
603 (Target_aarch64::The_reloc_stub_type): Removed.
604 (Target_aarch64::The_erratum_stub): New typede.
605 (AArch64_relocate_functions::construct_b): New method.
606
1e1b2efc
NC
6072015-06-08 Nick Clifton <nickc@redhat.com>
608
609 * po/fr.po: New French Translation.
610
b8cf5075
CC
6112015-06-07 Cary Coutant <ccoutant@gmail.com>
612
613 PR gold/18288
614 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
615 callers. Don't use STT_COMMON to check for common symbols.
616 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
617 symbol that's not in a common section.
618 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
619 common symbols.
620
bdd2d2b7
CC
6212015-06-04 Cary Coutant <ccoutant@gmail.com>
622
623 PR gold/18200
624 * Makefile.am (diststuff): Add target.
625 * Makefile.in: Regenerate.
626
cd3c333f
CC
6272015-06-04 Cary Coutant <ccoutant@gmail.com>
628
629 PR gold/17498
630 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
631 temporary locals in merge sections.
632 * options.cc (General_options::parse_discard_all): New method.
633 (General_options::parse_discard_locals): New method.
634 (General_options::parse_discard_none): New method.
635 (General_options::General_options): Initialize discard_locals_.
636 * options.h (--discard-all): Convert to special option.
637 (--discard-locals): Likewise.
638 (--discard-none): New option.
639 (General_options::discard_all): New method.
640 (General_options::discard_locals): New method.
641 (General_options::discard_sec_merge): New method.
642 (General_options::Discard_locals): New enum.
643 (General_options::discard_locals_): New data member.
644
8086551f
CC
6452015-06-03 Cary Coutant <cary@google.com>
646
647 * script-sections.cc (Script_sections::Script_sections): Initialize
648 segments_created_.
649 (Script_sections::create_note_and_tls_segments): Set flag when
650 segments are created.
651 (Script_sections::expected_segment_count): Count PT_INTERP.
652 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
653 segments are created.
654 * script-sections.h (Script_sections::segments_created_): New data
655 member.
656
374082df
CC
6572015-06-03 Cary Coutant <ccoutant@gmail.com>
658
659 PR gold/15370
660 * script-sections.cc
661 (Output_section_element_input::set_section_addresses): When there
662 are several patterns with no sort spec, put all sections in the same
663 bin.
664 * testsuite/Makefile.am (script_test_12): New testcase.
665 (script_test_12i): New testcase.
666 * testsuite/Makefile.in: Regenerate.
667 * testsuite/script_test_12.t: New test linker script.
668 * testsuite/script_test_12i.t: New test linker script.
669 * testsuite/script_test_12a.c: New test source file.
670 * testsuite/script_test_12b.c: New test source file.
671
775ed62e
CC
6722015-06-02 Cary Coutant <ccoutant@gmail.com>
673
674 * nacl.h (Sniff_file): Switch parameters to get_view to get an
675 aligned view.
676
9c7fe3c5
CC
6772015-06-03 Cary Coutant <ccoutant@gmail.com>
678
72f4393d
L
679 PR gold/17819
680 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
681 separate task to schedule the build id computation.
682 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
683 add Output_file and offset.
684 (Hash_task::run): Get and release the input views.
685 (Hash_task::is_runnable): Always return NULL (always runnable).
686 (Layout::queue_build_id_tasks): Remove.
687 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
688 parameters; use them instead of class members.
689 (Build_id_task_runner::run): New function.
690 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
691 to write_build_id.
692 * layout.h (Layout::queue_build_id_tasks): Remove.
693 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
694 parameters.
695 (Layout::array_of_hashes_): Remove.
696 (Layout::size_of_array_of_hashes_): Remove.
697 (Layout::input_view_): Remove.
698 (Build_id_task_runner): New class.
699 (Close_task_runner::Close_task_runner): Add array_of_hashes and
700 size_of_hashes parameters.
701 (Close_task_runner::array_of_hashes_): New data member.
702 (Close_task_runner::size_of_hashes_): New data member.
703 * testsuite/Makefile.am
704 (flagstest_compress_debug_sections_and_build_id_tree): New test.
705 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 706
400f8944
RÁE
7072015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
708
709 * merge.cc (get_input_merge_map): Update for data structure change.
710 (get_or_make_input_merge_map): Update for data structure change.
711 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
712 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
713
bbec1a5d
AM
7142015-05-16 Alan Modra <amodra@gmail.com>
715
716 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
717 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
718 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
719 (lis_0): Rename from lis_0_0.
720
efc6fa12
CC
7212015-04-29 Cary Coutant <cary@google.com>
722 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
723
724 * gc.h (Garbage_collection::is_section_garbage): Change Object*
725 to Relobj*.
726 (Garbage_collection::add_reference): Likewise.
727 (Garbage_collection::gc_process_relocs): Likewise. Don't push
728 object/shndx pair onto *secvec for dynamic objects. Don't follow
729 relocations pointing to dynamic objects for GC.
730 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
731 (Icf::unfold_section): Likewise.
732 (Icf::is_section_folded): Likewise.
733 (Icf::get_folded_section): Likewise.
734 * icf.h: (Icf::get_folded_section): Likewise.
735 (Icf::unfold_section): Likewise.
736 (Icf::is_section_folded): Likewise.
737 (Icf::section_has_function_pointers): Likewise.
738 (Icf::set_section_has_function_pointers): Likewise.
739 * object.h (Section_id): Likewise.
740 (Const_section_id): Likewise.
741 * output.cc (Output_section::update_section_layout): Likewise.
742 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
743 Likewise.
744 * plugin.cc (update_section_order): Likewise.
745 (unique_segment_for_sections): Likewise.
746 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
747 (Target_powerpc::do_gc_add_reference): Likewise.
748 (Target_powerpc::gc_process_relocs): Likewise.
749 (Target_powerpc::do_gc_add_reference): Likewise.
750 * symtab.cc (Symbol_table::is_section_folded): Likewise.
751 (Symbol_table::gc_mark_symbol): Likewise.
752 * symtab.h: (Symbol_table::is_section_folded): Likewise.
753 * target.h: (Sized_target::gc_add_reference): Likewise.
754 (Sized_target::do_gc_add_reference): Likewise.
755
f9d3ecaa
NC
7562015-04-29 Nick Clifton <nickc@redhat.com>
757
758 * po/fi.po: Updated Finnish translation.
759
faa2211d
AM
7602015-04-28 Alan Modra <amodra@gmail.com>
761
762 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
763 than unsigned int for find_global_entry result temp. Compare
764 against invalid_address.
765 (Target_powerpc::do_plt_address_for_global): Likewise.
766 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
767 on plt call stub existence for debug info. Do assert for plt
768 and global entry stub existence if an alloc section.
769
6ec65f28
AM
7702015-04-28 Alan Modra <amodra@gmail.com>
771
772 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
773 on missing global entry stub due to bogus debug info.
774
7a2a1c79
HS
7752015-04-27 Han Shen <shenhan@google.com>
776
777 * options.h (--fix-cortex-a53-843419): Rename option.
778 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
779 option.
780 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
781
cfbf0e3c
RÁE
7822015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
783
784 PR gold/18327
785 * output.cc (Output_section::is_input_address_mapped): Assume a missing
786 entry is mapped.
787 * testsuite/Makefile.am: Add the eh_test test.
788 * testsuite/Makefile.in: Regenerate.
789 * testsuite/eh_test_a.cc: New test.
790 * testsuite/eh_test_b.cc: New test.
791
6ec65f28
AM
7922015-04-23 Sriraman Tallam <tmsriram@google.com>
793
a100d66f
ST
794 * options.h (--weak-unresolved-symbols): New option.
795 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
796 binding to weak with new option.
797 * symtab.h (is_weak_undefined): Check for new option.
798 (is_strong_undefined): Check for new option.
799 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
800 * testsuite/Makefile.in: Regenerate.
801 * testsuite/weak_unresolved_symbols_test.cc: New file.
802
4b889c30
IC
8032015-04-20 Ian Coolidge <icoolidge@google.com>
804
805 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
806 GNU_UNIQUE.
807
4277535c
RÁE
8082015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
809
810 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
811 push_back.
812 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
813 * object.cc (Sized_relobj_file::do_layout): Use push_back.
814 * powerpc.cc (process_gc_mark): Use push_back.
815 (Target_powerpc::do_gc_mark_symbol): Use push_back.
816 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
817
7a2a1c79 8182015-04-16 Han Shen <shenhan@google.com>
5019d64a 819
6ec65f28
AM
820 * aarch64.cc (AArch64_insn_utilities): New utility class.
821 (AArch64_relobj::Mapping_symbol_position): New struct.
822 (AArch64_relobj::Mapping_symbol_info): New typedef.
823 (AArch64_relobj::do_count_local_symbols): New function overriding
824 parent's implementation.
825 (AArch64_relobj::mapping_symbol_info_): New member
826 (AArch64_relobj::scan_erratum_843419): New method.
827 (Target_aarch64::scan_erratum_843419_span): New method.
828 (Target_aarch64::is_erratum_843419_sequence): New method.
829 * options.h (fix_cortex_a53): New option.
5019d64a 830
a6a17750
CC
8312015-04-09 Cary Coutant <ccoutant@google.com>
832
833 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
834 in a PIE link.
835 * testsuite/Makefile.am (tls_pie_test.sh): New test.
836 * testsuite/Makefile.in: Regenerate.
837 * testsuite/tls_pie_test.sh: New.
838
437ddf0c
CC
8392015-04-09 Cary Coutant <ccoutant@google.com>
840
841 * debug.h (DEBUG_LOCATION): New.
842 (DEBUG_ALL): Include DEBUG_LOCATION.
843 (debug_string_to_enum): Add DEBUG_LOCATION.
844 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
845 output to print correct context.
846 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
847 up to 4 more locations at the beginning of the function.
848 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
849 result before sorting list of line numbers.
850 * testsuite/debug_msg.sh: Allow range of line numbers for
851 canonical results on optimized code.
852
24491327
HS
8532015-04-07 HC Yen <hc.yen@mediatek.com>
854
855 Add AArch32 support for gold linker.
856 gold/
857 * arm.cc: Add V8 arch combine table.
858
7fa5525f
RÁE
8592015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
860
861 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
862
5368dcf2
RÁE
8632015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
864
865 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
866 to find by using the return value of insert.
867
9dbb4b02
RÁE
8682015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
869
870 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
871 constructor call.
872
1fa29f10
IT
8732015-04-06 Ilya Tocar <ilya.tocar@intel.com>
874
875 PR gold/17641
876 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
877 (Target_x86_64::Scan::local): Don't create GOT entry, when we
878 can convert mov to lea.
879 (Target_x86_64::Scan::global): Ditto.
880 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
881 %reg to lea foo(%rip), %reg if possible.
882 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
883 * testsuite/x86_64_mov_to_lea1.s: New.
884 * testsuite/x86_64_mov_to_lea2.s: Ditto.
885 * testsuite/x86_64_mov_to_lea3.s: Ditto.
886 * testsuite/x86_64_mov_to_lea4.s: Ditto.
887 * testsuite/x86_64_mov_to_lea.sh: Ditto.
888
39f3de7c
L
8892015-04-02 H.J. Lu <hongjiu.lu@intel.com>
890
891 * configure: Regenerated.
892
c4fc4724
IT
8932015-04-01 Ilya Tocar <ilya.tocar@intel.com>
894
895 PR gold/17640
896 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
897 (Target_i386::Scan::local): Don't create GOT entry, when we
898 can convert GOT to GOTOFF.
899 (Target_i386::Scan::global): Ditto.
900 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
901 lea foo@GOTOFF(%reg), %reg if possible.
902 * testsuite/Makefile.am (i386_mov_to_lea): New test.
903 * testsuite/i386_mov_to_lea1.s: New.
904 * testsuite/i386_mov_to_lea2.s: Ditto.
905 * testsuite/i386_mov_to_lea3.s: Ditto.
906 * testsuite/i386_mov_to_lea4.s: Ditto.
907 * testsuite/i386_mov_to_lea5.s: Ditto.
908 * testsuite/i386_mov_to_lea.sh: Ditto.
909
918357b9
L
9102015-04-01 H.J. Lu <hongjiu.lu@intel.com>
911
912 * Makefile.am (ZLIB): New.
913 (ZLIBINC): Likewise.
914 (AM_CFLAGS): Add $(ZLIBINC).
915 (AM_CXXFLAGS): Likewise.
916 (ldadd_varldadd_var): Add $(ZLIB).
917 (incremental_dump_LDADD): Likewise.
918 (dwp_LDADD): Likewise.
919 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
920 <zlib.h>.
921 (zlib_compress): Don't check HAVE_ZLIB_H.
922 (zlib_decompress): Likewise.
923 * options.h (compress_debug_sections): Likewise.
924 * configure.ac (AM_CONDITIONAL): Removed.
925 * testsuite/Makefile.am (ZLIB): New.
926 (LDADD): Add $(ZLIB).
927 Don't check HAVE_ZLIB.
928 * Makefile.in: Regenerated.
929 * config.in: Likewise.
930 * configure: Likewise.
931 * testsuite/Makefile.in: Likewise.
932
6b0ad2eb
JY
9332015-03-30 Jing Yu <jingyu@google.com>
934
935 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
936 TLSLD_ADD_DTPREL_LO12_NC.
937 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
938 _TLS_MODULE_BASE_ point to the start of tls segment.
939 (Target_aarch64::optimize_tls_reloc): Add cases for
940 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
941 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
942 (Target_aarch64::Scan::local): Likewise.
943 (Target_aarch64::Scan::global): Likewise.
944 (Target_aarch64::Relocate::relocate): Likewise.
945 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
946 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
947 relocations.
948
0916f9e7
RÁE
9492015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
950
951 * merge.cc (Object_merge_map::add_mapping): call
952 Object_merge_map::Input_merge_map::add_mapping.
953 (Object_merge_map::Input_merge_map::add_mapping): New.
954 (Output_merge_data::do_add_input_section): Call
955 get_or_make_input_merge_map before a loop.
956 (Output_merge_string<Char_type>::finalize_merged_data): Call
957 get_or_make_input_merge_map before a loop.
958 * merge.h (Object_merge_map): Make Input_merge_map public.
959 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
960 (Relobj::get_or_create_merge_map): New.
961 * object.h (Relobj::get_or_create_merge_map): New.
962
282c9750
AM
9632015-03-24 Alan Modra <amodra@gmail.com>
964
965 PR 18147
966 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
967 relocation errors for branches to strong undefined symbols.
968
67f95b96
RÁE
9692015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
970
971 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
972 (Object_merge_map::is_merge_section_for): Remove.
973 (Object_merge_map::find_merge_section): New.
974 * merge.h (Object_merge_map::is_merge_section_for): Remove.
975 (Object_merge_map::find_merge_section): New.
976 (Object_merge_map::get_input_merge_map): Add a const version.
977 * object.cc (Relobj::is_merge_section_for): Remove.
978 (Relobj::find_merge_section): New.
979 * object.h (Relobj::is_merge_section_for): Remove.
980 (Relobj::find_merge_section): New.
981 * output.cc
982 (Output_section::Input_section::is_merge_section_for): Remove.
983 (Output_section::add_merge_input_section): Don't call
984 add_merge_input_section.
985 (Output_section::find_merge_section): Return const. Use
986 object->find_merge_section.
987 (Output_section::build_lookup_maps): Don't build a map for
988 merge sections.
989 (Output_section::is_input_address_mapped): Return false if
990 section is not found.
991 (Output_section::find_starting_output_address): Use
992 find_merge_section instead of is_merge_section_for.
993 (Output_section::add_script_input_section): Don't build a map for
994 merge sections.
995 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
996 (Output_section_lookup_maps::find_merge_section): Remove.
997 (Output_section_lookup_maps::add_merge_input_section) Remove.
998 (Output_section::find_merge_section): Return const.
999
152f7024
CC
10002015-03-22 Cary Coutant <cary@google.com>
1001
1002 PR gold/18106
1003 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1004 non-SIB form of lea, with nop after the call.
1005
bccffdfd
CC
10062015-03-21 Cary Coutant <cary@google.com>
1007
1008 PR gold/14217
1009 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1010 .tdata section.
1011 (Output_segment::set_section_addresses): Don't align size of relro
1012 segment for .tbss.
1013
1c582fe7
CC
10142015-03-21 Cary Coutant <cary@google.com>
1015
1016 PR gold/18010
1017 * stringpool.cc (Stringpool_template): Don't optimize if section
1018 alignment is greater than sizeof(char).
1019
410da591
CC
10202015-03-21 Cary Coutant <cary@google.com>
1021
1022 PR gold/18048
1023 * script-c.h (script_include_directive): Add first_token parameter.
1024 * script.cc (script_include_directive): Add first_token parameter, and
1025 pass it to read_script_file.
1026 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1027 (PARSING_MEMORY_DEF): New tokens.
1028 (top): Add new productions for INCLUDE files.
1029 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1030 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1031 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1032 (section_cmd): Pass PARSING_SECTION_CMDS.
1033 (file_or_sections_cmd): Remove.
1034 (memory_def): Pass PARSING_MEMORY_DEF.
1035 * testsuite/Makefile.am (memory_test_2): New test.
1036 * testsuite/Makefile.in: Regenerate.
1037 * testsuite/memory_test_inc.t: New script file.
1038 * testsuite/memory_test_inc_1.t.src: New script file.
1039 * testsuite/memory_test_inc_2.t.src: New script file.
1040 * testsuite/memory_test_inc_3.t.src: New script file.
1041
0d5bbdb0
CC
10422015-03-21 Cary Coutant <cary@google.com>
1043
1044 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1045 (Sized_relobj_dwo::setup): Build compressed section map.
1046 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1047 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1048 section map.
1049 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1050 compressed_sections_ field.
1051 (build_compressed_section_map): Take Object instead of
1052 Sized_relobj_file parameter; add decompress_if_needed parameter.
1053 (Sized_relobj_file::do_find_special_sections): Store compressed
1054 section map in parent Object.
1055 (Sized_relobj_file::do_decompressed_section_contents): Move
1056 implementation to Object::decompressed_section_contents.
1057 (Sized_relobj_file::do_discard_decompressed_sections): Move
1058 implementation to Object::discard_decompressed_sections.
1059 * object.h (build_compressed_section_map): Declare.
1060 (Object::Object): Add compressed_sections_ field.
1061 (Object::section_is_compressed): Move implementation here.
1062 (Object::decompressed_section_contents): De-virtualize.
1063 (Object::discard_decompressed_sections): De-virtualize.
1064 (Object::do_section_is_compressed): Delete.
1065 (Object::do_decompressed_section_contents): Delete.
1066 (Object::set_compressed_sections): New method.
1067 (Object::compressed_sections): New method.
1068 (Object::compressed_sections_): New data member.
1069 (Compressed_section_info, Compressed_section_map): Move to top of file.
1070 (Sized_relobj_file::do_section_is_compressed): Delete.
1071 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1072 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1073 (Sized_relobj_file::compressed_sections_): Move to Object class.
1074
bd9e0d46
CC
10752015-03-21 Cary Coutant <ccoutant@google.com>
1076
1077 PR gold/18152
1078 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1079 deferred objects.
1080
943c8b43
CC
10812015-03-11 Cary Coutant <ccoutant@google.com>
1082
1083 * options.cc (General_options::finalize): Don't allow -z relro
1084 with incremental linking.
1085 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1086 (incremental_test_2): Likewise.
1087 (incremental_test_3): Likewise.
1088 (incremental_test_4): Likewise.
1089 (incremental_test_5): Likewise.
1090 (incremental_test_6): Likewise.
1091 (incremental_copy_test): Likewise.
1092 (incremental_common_test_1): Likewise.
1093 (incremental_comdat_test_1): Likewise.
1094 * testsuite/Makefile.in: Regenerate.
1095
e1663197
CC
10962015-03-09 Cary Coutant <ccoutant@google.com>
1097
1098 PR gold/14675
1099 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1100 return enum indicating whether .eh_frame section is empty, optimizable,
1101 unrecognized, or an end marker. Adjust explicit instantiations.
1102 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1103 (Eh_frame::add_ehframe_input_section): Change return type.
1104 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1105 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1106 to the .eh_frame output section until we see the end marker.
1107 (Layout::finalize_eh_frame_section): New.
1108 * layout.h: (Layout::finalize_eh_frame_section): New.
1109
beb8418f
L
11102015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1111
1112 * output.cc (Relobj::initialize_input_to_output_map<size>):
1113 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1114
48c73428
CC
11152015-03-04 Cary Coutant <ccoutant@google.com>
1116
1117 * parameters.cc (Parameters::set_target_once): Call
1118 Target::select_as_default_target just once from here...
1119 (set_parameters_target): ...instead of from here.
1120
11212015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1122
1123 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1124 Output_section_data instead of a Merge_map.
1125 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1126 (Eh_frame::read_cie): Use add_merge_mapping instead of
1127 Merge_map::add_mapping.
1128 (Eh_frame::read_fde): Ditto.
1129 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1130 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1131 merge_map_->get_output_offset.
1132 (Eh_frame::do_is_merge_section_for): Delete.
1133 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1134 instead of a Merge_map.
1135 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1136 Merge_map.
1137 (Eh_frame::do_is_merge_section_for): Delete.
1138 (Eh_frame::merge_map_): Delete.
1139 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1140 and use a Output_section_data instead of a Merge_map.
1141 (Object_merge_map::add_mapping): Ditto.
1142 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1143 (Object_merge_map::is_merge_section_for): Pass in and use a
1144 Output_section_data instead of a Merge_map.
1145 (Merge_map): Delete.
1146 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1147 of merge_map_.get_output_offset.
1148 (Output_merge_base::do_is_merge_section_for): Delete.
1149 (Output_merge_data::do_add_input_section): Use
1150 object->add_merge_mapping instead of add_mapping.
1151 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1152 * merge.h (Merge_map): Delete forward declaration.
1153 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1154 instead of a Merge_map.
1155 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1156 (Object_merge_map::is_merge_section_for): Pass in and use a
1157 Output_section_data instead of a Merge_map.
1158 (Input_merge_map::Object_merge_map::merge_map): Replace with
1159 output_data.
1160 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1161 Output_section_data instead of a Merge_map.
1162 (Merge_map): Delete.
1163 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1164 (Output_merge_base::do_is_merge_section_for): Delete.
1165 (Output_merge_base::add_mapping): Delete.
1166 (Output_merge_base::merge_map_): Delete.
1167 * object.cc (Relobj::initialize_input_to_output_map): New.
1168 (Relobj::initialize_input_to_output_map): New.
1169 (Relobj::merge_output_offset): New.
1170 (Relobj::is_merge_section_for): New.
1171 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1172 bits.
1173 * object.h (Relobj::merge_map): Delete.
1174 (initialize_input_to_output_map): New.
1175 (set_merge_map): Delete.
1176 (add_merge_mapping): New.
1177 (merge_output_offset): New.
1178 (is_merge_section_for): New.
1179 * output.cc (Output_section::Input_section::is_merge_section_for):
1180 Use object->is_merge_section_for.
1181 * output.h (Output_section_data::is_merge_section_for): Delete.
1182 (Output_section_data::do_is_merge_section_for): Delete.
1183 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1184 Use object->initialize_input_to_output_map.
1185 (Merged_symbol_value<size>::value_from_output_section): Use
1186 object->merge_output_offset.
1187
48c73428 11882015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1189 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1190
1191 * output.cc (Output_section::add_merge_input_section): Do not
1192 attempt to merge sections with an entsize of 0.
1193
48c73428 11942015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1195
1196 * attributes.h (class Output_attributes_section_data ): Add
1197 do_print_to_mapfile function.
1198
ec86f434
AM
11992015-02-24 Alan Modra <amodra@gmail.com>
1200
1201 PR 18010
1202 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1203 complain if value is not a multiple of four.
1204 (Target_powerpc::Relocate::relocate): Correct handling of
1205 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1206
be66981e
L
12072015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1208
1209 * configure.ac (default_size): Set to 32 for x32.
1210 * configure: Regenerated.
1211
e3ee8ed4
AM
12122015-02-18 Alan Modra <amodra@gmail.com>
1213
1214 PR 17954
1215 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1216 visibility.
1217
3a935c6c
RÁE
12182015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1219
1220 * gc.h (Garbage_collection::add_reference): Don't use find.
1221
e0a1e121
RÁE
12222015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1223
1224 * object.cc (write_local_symbols): avoid std::vector copy.
1225
45a4fb1a
RÁE
12262015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1227
1228 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1229
2d9afefe
MW
12302015-02-09 Mark Wielaard <mjw@redhat.com>
1231
1232 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1233 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1234
e9c1bdad
CC
12352015-02-16 Cary Coutant <ccoutant@google.com>
1236
1237 PR gold/13577
1238 PR gold/16992
1239 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1240 DF_SYMBOLIC if --dynamic-list option is used.
1241 * options.cc (General_options::finalize): --dynamic-list is not
1242 mutually exclusive with -Bsymbolic.
1243 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1244 listed in --dynamic-list.
1245 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1246 -Bsymbolic-functions.
1247 * testsuite/Makefile.in: Regenerate.
1248
0ed4b0bf
CC
12492015-02-16 Cary Coutant <ccoutant@google.com>
1250
1251 PR gold/17971
1252 * incremental.cc: Remove redundant include of "output.h".
1253
1a920511
JY
12542015-02-12 Jing Yu <jingyu@google.com>
1255
1256 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1257 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1258 New relocation.
1259 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1260 TLSLE_MOVW_* relocations.
1261 (Target_aarch64::Scan::global): Likewise.
1262 (Target_aarch64::Relocate::relocate): Likewise.
1263 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1264 for new TLSLE_MOVW_* relocations.
1265
07f107f3
WN
12662015-02-11 Will Newton <will.newton@linaro.org>
1267
1268 PR gold/13321
1269 * arm.cc (Target_arm::make_plt_section): Create an ARM
1270 state mapping symbol at the start of the PLT.
1271
e051a5b5
L
12722015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1273
1274 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1275 Replace two_file_shared_2.so with two_file_shared_1.so.
1276 * testsuite/Makefile.in: Regenerated.
1277
dddcc5b9
AM
12782015-02-09 Alan Modra <amodra@gmail.com>
1279
1280 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1281 plugin_test_thin.a and defsym_test.
1282 * testsuite/Makefile.in: Regenerate.
1283
b39b8b9d
RÁE
12842015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1285
1286 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1287 body.
1288
b66d1c52
CC
12892015-02-04 Peter Collingbourne <pcc@google.com>
1290
1291 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1292 forwarding symbols when computing symbol resolution info for plugins.
1293 * plugin.h (Plugin_manager::symtab): New method.
1294 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1295
23081de0
CC
12962015-02-03 Cary Coutant <ccoutant@google.com>
1297 Peter Collingbourne <pcc@google.com>
1298
1299 PR gold/15660
1300 * archive.cc (Thin_archive_object_unlocker): New class.
1301 (Archive::include_member): Unlock external members of thin archives.
1302 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1303 (plugin_test_2): Likewise.
1304 (plugin_test_3): Likewise.
1305 (plugin_test_4): Likewise.
1306 (plugin_test_5): Likewise.
1307 (plugin_test_6): Likewise.
1308 (plugin_test_7): Likewise.
1309 (plugin_test_8): Likewise.
1310 (plugin_test_9): Likewise.
1311 (plugin_test_10): Likewise.
1312 (plugin_test_11): New test case.
1313 * testsuite/Makefile.in: Regenerate.
1314 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1315 file to decide whether to claim file.
1316 (all_symbols_read_hook): Likewise.
1317 * testsuite/plugin_test_1.sh: Adjust expected output.
1318 * testsuite/plugin_test_2.sh: Likewise.
1319 * testsuite/plugin_test_3.sh: Likewise.
1320 * testsuite/plugin_test_6.sh: Likewise.
1321 * testsuite/plugin_test_tls.sh: Likewise.
1322 * testsuite/plugin_test_11.sh: New testcase.
1323
13242015-02-03 Cary Coutant <ccoutant@google.com>
1325
1326 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1327 file descriptors when debugging enabled. Add debug output.
1328 (Descriptors::release): Add debug output.
1329 (Descriptors::close_some_descriptor): Likewise.
1330 (Descriptors::close_all): Likewise.
1331 * fileread.cc (File_read::lock): Likewise.
1332 (File_read::unlock): Likewise.
1333
24dd5808
CC
13342015-02-02 Cary Coutant <ccoutant@google.com>
1335
1336 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1337 executable output file.
1338
fa89cc82
HS
13392015-01-22 Han Shen <shenhan@google.com>
1340
1341 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1342 (Target_arm::do_plt_address_for_global): New method.
1343 (Target_arm::do_plt_address_for_local): New method.
1344 (Target_arm::rel_irelative_section): New method.
1345 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1346 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1347 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1348 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1349 (Target_arm::Scan::check_non_pic): Add ifunc support.
1350 (Target_arm::Scan::local): Add ifunc support.
1351 (Target_arm::Scan::global): Add ifunc support.
1352 (Target_arm::make_plt_section): New method.
1353 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1354 (Target_arm::make_local_ifunc_plt_entry): New method.
1355 (Target_arm::got_irelative_): New member.
1356 (Target_arm::rel_irelative_): New member.
1357 (Target_arm::got_section): Add creation for got_irelative_.
1358 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1359 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1360 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1361 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1362 (Output_data_plt_arm::IRelative_data): New type.
1363 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1364 (Output_data_plt_arm::add_entry): Add more parameters.
1365 (Output_data_plt_arm::add_relocation): New method.
1366 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1367 (Output_data_plt_arm::rel_irelative): New method.
1368 (Output_data_plt_arm::entry_count): Modified.
1369 (Output_data_plt_arm::address_for_global): New method.
1370 (Output_data_plt_arm::address_for_local): New method.
23081de0 1371gold/
fa89cc82
HS
1372 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1373 (Output_data_plt_arm::insert_irelative_data): New method.
1374 (Output_data_plt_arm::irelative_rel_): New member.
1375 (Output_data_plt_arm::got_): New member.
1376 (Output_data_plt_arm::got_irelative_): New member.
1377 (Output_data_plt_arm::irelative_count_): New member.
1378 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1379 (Output_data_plt_arm::irelative_data_vec_): New member.
1380 (Output_data_plt_arm::do_write): Write out irelative entries.
1381 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1382 more parameters to ctor.
1383 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1384 more parameters to ctor.
1385 * output.h (Output_data_reloc::add_local_relative): New method.
1386 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1387
0f81d3f0
AM
13882015-01-29 Alan Modra <amodra@gmail.com>
1389
1390 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1391 and GOT_TLSGD to LE optimization.
1392
65d92137
CC
13932015-01-28 Cary Coutant <ccoutant@google.com>
1394
1395 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1396 for undef TLS symbols.
1397 (Target_x86_64::Relocate::relocate_tls): Likewise.
1398 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1399
5485698a
CC
14002015-01-25 Cary Coutant <ccoutant@google.com>
1401
1402 * output.cc (Output_segment::set_section_addresses): Fix calculation
1403 of size of relro segment.
1404
b01a4b04
AM
14052015-01-22 Alan Modra <amodra@gmail.com>
1406
1407 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1408 condition for need of ifunc plt entry.
1409 (Target_powerpc::Scan::global <got relocs>): Likewise.
1410
3d0064a9
CC
14112015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1412
1413 * mips.cc (reloc_high): Add r_sym.
1414 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1415 reloc_high constructor.
1416 (Mips_relocate_functions::relgot16_local): Likewise.
1417 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1418 r_type to decide whether LO16 matches HI16.
1419 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1420 rello16 and relgot16_local.
1421
a5cd8f05
CC
14222015-01-09 Cary Coutant <ccoutant@google.com>
1423
1424 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1425 unless alignment is larger than page size.
1426
4fc1b9d4
L
14272015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1428 Cary Coutant <ccoutant@google.com>
1429
1430 PR gold/17729
1431 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1432 (DEFAULT_TARGET_X32): Set for x32.
1433 * x86_64.cc (cmp_insn_32): New.
1434 (lea_r10_insn_32): Likewise.
1435 (lea_r11_insn_32): Likewise.
1436 (cmp_insn_64): Likewise.
1437 (lea_r10_insn_64): Likewise.
1438 (lea_r11_insn_64): Likewise.
1439 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1440 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1441 (check_DATA): Add split_x32 files.
1442 (split_x32_[1234n].o): New targets.
1443 (split_x32_[124]): New targets.
1444 (split_x32_[1234r].stdout): New targets.
1445 * testsuite/split_x32.sh: New file.
1446 * testsuite/split_x32_1.s: Likewise.
1447 * testsuite/split_x32_2.s: Likewise.
1448 * testsuite/split_x32_3.s: Likewise.
1449 * testsuite/split_x32_4.s: Likewise.
1450 * testsuite/split_x32_n.s: Likewise.
1451 * configure: Regenerated.
1452 * testsuite/Makefile.in: Likewise.
1453
e749cab8
L
14542015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1455
1456 PR gold/17809
1457 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1458 x32.
1459
af759df0
AM
14602015-01-02 Alan Modra <amodra@gmail.com>
1461
1462 * version.cc (print_version): Just print current year.
1463 * dwp.cc (print_version): Likewise.
1464
b90efa5b
AM
14652015-01-01 Alan Modra <amodra@gmail.com>
1466
1467 Update year range in copyright notice of all files.
1468
f12d1e8a
AM
14692014-12-25 Alan Modra <amodra@gmail.com>
1470
1471 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1472 new enums.
1473 (Target_arm::merge_object_attributes, ): Likewise.
1474
5c294fee
TG
14752014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1476
1477 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1478 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1479 AEABI_VFP_args_vfp to check that.
1480 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1481 value and replace hardcoded values by enum values.
1482
e30880c2
CC
14832014-12-22 Cary Coutant <ccoutant@google.com>
1484
1485 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1486
bd040da1
L
14872014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1488
1489 PR gold/14608
1490 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1491 to "return i * i * 3;".
1492
e02a4046
CC
14932014-12-16 Cary Coutant <ccoutant@google.com>
1494
1495 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1496 (Mapfile::print_output_data): Use current_data_size() to avoid
1497 assert for sections requiring postprocessing; if address is not valid,
1498 print 0.
1499 (Mapfile::print_output_section): Use current_data_size(); print note
1500 that addresses and sizes are before compression.
1501
add6016b
L
15022014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1503
1504 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1505 Cast current_group_size to unsigned long when reporting error.
1506
0bf32ea9
JY
15072014-12-10 Jing Yu <jingyu@google.com>
1508
1509 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1510 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1511 Update error message.
1512 (Target_aarch64::do_relax): Use absolute value of option
1513 stub_group_size. Replace local variable with class member
1514 stub_group_size_.
1515
cbcb23fa
AM
15162014-12-04 Alan Modra <amodra@gmail.com>
1517
1518 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1519 addend of PLTREL24 reloc when not generating a plt stub. Make
1520 max_branch_offset an "Address".
fbad6518 1521 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1522 (Target_powerpc::Relocate::relocate): Likewise.
1523
1611bc4a
AM
15242014-12-04 Alan Modra <amodra@gmail.com>
1525
1526 PR 17670
1527 * symtab.cc (Symbol::set_undefined): Remove assertion.
1528 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1529 on symbols defined in discarded sections, instead return false.
1530 Rearrange params, update all callers.
1531 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1532 branches to syms in discarded sections.
1533 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1534 undefined and flag as discarded.
1535 (Target_powerpc::Relocate::relocate): Localize variable.
1536
4759c34e
L
15372014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1538
1539 PR gold/17675
1540 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1541 * testsuite/Makefile.in: Regenerated.
1542
1f98a074
AM
15432014-12-03 Alan Modra <amodra@gmail.com>
1544
1545 PR 17566
1546 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1547 when adding dynamic relocations against section symbols.
1548
fb257835
DI
15492014-12-01 Dimitry Ivanov <dimitry@google.com>
1550
1551 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1552 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1553 * options.h (General_options): New -z option (global).
1554
d8e60314
CC
15552014-12-01 Cary Coutant <ccoutant@google.com>
1556
1557 PR gold/17578
1558 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1559 is given.
1560 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1561 given but some inputs require executable stack.
1562
982bbd97
CC
15632014-11-26 Cary Coutant <ccoutant@google.com>
1564
1565 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1566 .debug_str_offsets; strip .debug_gnu_pubnames and
1567 .debug_gnu_pubtypes.
1568 (lines_only_debug_sections): Strip all four new sections.
1569
bb779192
HS
15702014-11-26 Jing Yu <jingyu@google.com>
1571
1572 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1573 register to be x0 when to relax TLSDESC_LD64_LO12.
1574
a3e60ddb
AM
15752014-11-26 Alan Modra <amodra@gmail.com>
1576
1577 * powerpc.cc (struct Stub_table_owner): New.
1578 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1579 unsigned int vector. Update all references.
1580 (powerpc_relobj::set_stub_table): Take an unsigned int param
1581 rather than a Stub_table. Update callers.
1582 (Powerpc_relobj::clear_stub_table): New function.
1583 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1584 stub_group_size_ vars.
1585 (Target_powerpc::new_stub_table): Delete.
1586 (max_branch_delta): New function, extracted from..
1587 (Target_powerpc::Relocate::relocate): ..here..
1588 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1589 status on whether stub created successfully.
1590 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1591 default sizing to..
1592 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1593 reduce on relax failure.
1594 (Target_powerpc::group_sections): Add "no_size_errors" param.
1595 Use stub_group_size_. Set up group info in a temp vector,
1596 before building Stub_table vector. Account for input sections
1597 possibly already converted to relaxed sections.
1598 (Stub_table::init): Delete. Merge into..
1599 (Stub_table::Stub_table): ..here.
1600 (Stub_table::can_reach_stub): New function.
1601 (Stub_table::add_plt_call_entry): Add "from" parameter and
1602 return true iff stub could be reached.
1603 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1604 param too.
1605 (Stub_table::clear_stubs): Add "all" param.
1606
a20605cf
AM
16072014-11-26 Alan Modra <amodra@gmail.com>
1608
1609 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1610 (Target_powerpc::group_sections): Use it.
1611
43b64deb
CC
16122014-11-25 Cary Coutant <ccoutant@google.com>
1613
1614 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1615 (Binary_to_elf::write_symbol): Add st_size parameter.
1616 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1617
c924eb67
CC
16182014-11-25 Cary Coutant <ccoutant@google.com>
1619
1620 PR gold/17639
1621 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1622 (Sized_relobj_file::do_layout): Handle deferred sections properly
1623 during GC pass 1. Don't add reloc sections to deferred list twice.
1624 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1625 (Sized_relobj_file::is_deferred_layout_): New data member.
1626
9d585188
L
16272014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1628
1629 PR gold/17619
1630 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1631 Check PC-relative offset overflow in PLT entry.
1632
3ffaac20
AM
16332014-11-21 Alan Modra <amodra@gmail.com>
1634
1635 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1636 for undefined weaks.
1637
0cfb0717
AM
16382014-11-20 Alan Modra <amodra@gmail.com>
1639
1640 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1641 from --stub-group-size parameter divided by 1024.
1642 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1643 template parameter. Update all uses.
1644 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1645 has_stub_value. Set for long branches. Don't report overflow for
1646 branch to undefined weak symbols. Print info message on
1647 overflowing branch to stub.
1648
f9dffbf0
AM
16492014-11-20 Alan Modra <amodra@gmail.com>
1650
1651 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1652
e88ba8d5
L
16532014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1654
1655 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1656 entry for R_X86_64_GOTPLT64.
1657 (Target_x86_64<size>::Relocate::relocate): Update comments for
1658 R_X86_64_GOTPLT64.
1659
d37ffe25
ED
16602014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1661
1662 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1663 * plugin.h: add lock definition
1664
9726c3c1
HS
16652014-10-29 Han Shen <shenhan@google.com>
1666 Jing Yu <jingyu@google.com>
1667
1668 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1669 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1670 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1671 Symbol::TLS_REF.
1672 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1673 method.
1674 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1675 (Target_aarch64::tls_ld_to_le): New method.
1676 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1677 for 64bit targets.
1678 (Output_data_plt_aarch64::irelative_rel_): New data member.
1679 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1680 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1681 (Output_data_plt_aarch64::add_relocation): New method.
1682 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1683 offset. Add got_irelative size to got size.
1684 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1685 type string with the new typename.
1686 (AArch64_relocate_functions::update_adr): Replace parameter x with
1687 immed.
1688 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1689 (AArch64_relocate_functions::reloc_common): New method.
1690 (AArch64_relocate_funcsions::rela_general): Extract common part out
1691 into reloc_common method.
1692 (AArch64_relocate_functions::rela_general): Likewise.
1693 (AArch64_relocate_functions::pcrela_general): Likewise.
1694 (AArch64_relocate_functions::adr): New method.
1695 (AArch64_relocate_functions::adrp): Calculate immed before calling
1696 update_adr.
1697 (AArch64_relocate_functions::adrp): Likewise.
1698 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1699 comparing x to 0. Calculate immed from ~x when x < 0.
1700 (Target_aarch64::optimize_tls_reloc): Add new cases for
1701 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1702 TLSLD_MOVW_DTPREL_G0_NC.
1703 (Target_aarch64::possible_function_pointer_reloc): Implement this
1704 method.
1705 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1706 comment.
1707 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1708 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1709 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1710 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1711 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1712 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1713 (Target_aarch64::make_plt_entry): Call add_entry with two more
1714 parameters.
1715 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1716 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1717 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1718 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1719 (Target_aarch64::Relocate::relocate_tls): Add cases for
1720 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1721 TLSLD_MOVW_DTPREL_G0_NC.
1722 * testsuite/icf_safe_so_test.cc: Correct test comment.
1723 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1724
80272b8c
AM
17252014-10-22 Alan Modra <amodra@gmail.com>
1726
1727 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1728 thread_starter.
1729
998a69f4
AS
17302014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1731
1732 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1733
aed56ec5
CC
17342014-10-17 Cary Coutant <ccoutant@google.com>
1735
1736 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1737 Add "typename" keyword.
1738
bb779192 17392014-10-15 Han Shen <shenhan@google.com>
72f4393d 1740 Jing Yu <jingyu@google.com>
83a01957
HS
1741
1742 Patch for gold aarch64 backend to support relaxation.
1743 * aarch64-reloc.def: Change format.
1744 * aarch64.cc (class Reloc_stub): New class.
1745 (class Stub_table): New class.
1746 (class AArch64_relobj): New class.
1747 (class AArch64_input_section): New class.
1748 (class AArch64_output_section): New class.
1749 (Target_aarch64::new_stub_table): New method.
1750 (Target_aarch64::new_aarch64_input_section): New method.
1751 (Target_aarch64::find_aarch64_input_section): New method.
1752 (Target_aarch64::scan_section_for_stubs): New method.
1753 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1754 (Target_aarch64::relocate_stub): New method.
1755 (Target_aarch64::current_target): New method.
1756 (Target_aarch64::do_make_elf_object): New method.
1757 (Target_aarch64::do_may_relax): New method.
1758 (Target_aarch64::do_relax): New method.
1759 (Target_aarch64::group_sections): New method.
1760 (Target_aarch64::scan_reloc_for_stub): New method.
1761 (Target_aarch64::do_make_output_section): New method.
1762 (Target_aarch64::stub_tables_): New data member.
1763 (Target_aarch64::aarch64_input_section_map_): New data member.
1764 (AArch64_relocate_functions::maybe_apply_stub): New method.
1765
db4c9594
CC
17662014-09-30 Cary Coutant <ccoutant@google.com>
1767
1768 PR gold/17432
1769 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1770
cd6da036
KC
17712014-09-30 Kito Cheng <kito@0xlab.org>
1772
1773 PR gold/13597
1774 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1775 hash table before sysv-style hash table.
1776
5f772412
ST
17772014-09-29 Sriraman Tallam <tmsriram@google.com>
1778
1779 * options.h (--pic-executable): Add negative to alias to -no-pie.
1780
5efeedf6
CC
17812014-09-26 Cary Coutant <ccoutant@google.com>
1782
1783 PR gold/16773
1784 * object.cc (Sized_relobj_file): Compute value of section symbols
1785 for TLS sections the same as TLS symbols.
1786
1707f183
CC
17872014-09-25 Cary Coutant <ccoutant@google.com>
1788
1789 PR gold/17432
1790 * resolve.cc (Symbol_table::resolve): Override common placeholder
1791 symbols, but adjust sizes.
1792 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1793 symbols to common lists.
1794
00cac886
AM
17952014-09-24 Alan Modra <amodra@gmail.com>
1796
1797 * po/POTFILES.in: Regenerate.
1798
635aa30e 17992014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1800 Cary Coutant <ccoutant@google.com>
635aa30e 1801
71b9b91b 1802 PR gold/14860
635aa30e
CC
1803 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1804 on input_sections_blocker.
1805 * layout.cc (Write_sections_task::locks): Unblock
1806 input_sections_blocker_.
1807 * layout.h (Write_sections_task::Write_sections_task): Add
1808 input_sections_blocker.
1809 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1810 to DEPENDENCIES.
1811 * testsuite/Makefile.in: Regenerate.
1812
c0c71592
RÁE
18132014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1814
1815 * testsuite/Makefile.am (plugin_test_10): New test.
1816 * testsuite/Makefile.in: Regenerate
1817 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1818 * testsuite/plugin_test_10.sh: New file.
1819
6168c2a1
RÁE
18202014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1821
1822 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1823 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1824 during the replacement phase.
1825
3a531937
JY
18262014-09-17 Han Shen <shenhan@google.com>
1827 Jing Yu <jingyu@google.com>
1828
1829 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1830 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1831 * aarch64.cc (Target_aarch64): Add data members
1832 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1833 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1834 constructor.
1835 (Target_aarch64::do_reloc_symbol_index): New method.
1836 (Target_aarch64::do_reloc_addend): New method.
1837 (Target_aarch64::add_tlsdesc_info): New method.
1838 (Target_aarch64::do_dynsym_value): New method.
1839 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1840 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1841 (Target_aarch64::make_data_plt): Add new parameters: got,
1842 got_irelative. Pass them to do_make_data_plt.
1843 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1844 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1845 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1846 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1847 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1848 (Target_aarch64::got_tlsdesc_section): New method.
1849 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1850 (Target_aarch64::define_tls_base_symbol): New method.
1851 (Target_aarch64::reserve_tlsdesc_entries): New method.
1852 (Target_aarch64::got_mod_index_entry): New method.
1853 (Target_aarch64::rela_tlsdesc_section): New method.
1854 (Target_aarch64::rela_irelative_section): New method.
1855 (Target_aarch64::Tlsdesc_info): New struct.
1856 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1857 relocations and tlsdesc relocations.
1858 (Target_aarch64::optimize_tls_reloc): Implement method.
1859 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1860 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1861 in constructor.
1862 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1863 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1864 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1865 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1866 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1867 (Output_data_plt_aarch64::rela_irelative): New method.
1868 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1869 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1870 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1871 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1872 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1873 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1874 (Output_data_plt_aarch64_standard): New member variables:
1875 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1876 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1877 New parameter: got, got_irelative.
1878 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1879 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1880 (Output_data_plt_aarch64::do_write): Replace got_address with
1881 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1882 (AArch64_relocate_functions::update_movnz): New method.
1883 (AArch64_relocate_functions): Correct format.
1884 (AArch64_relocate_functions::movnz): New method.
1885 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1886 before the switch. Add new cases to switch.
00cac886 1887 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1888 tlsgd tlsdesc cases.
1889 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1890 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1891 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1892 Call reloc_name_in_error_message to print unsupported reloc.
1893 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1894 make_data_plt.
1895 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1896 relocs. Fill in some more dynamic tags.
1897 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1898 Skip call tls_get_addr when tlsgd is relaxed.
1899 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1900 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1901 tlsdesc->ie relaxation.
1902
62661c93
SS
19032014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1904
1905 * mips.cc (Target_mips_nacl): New class.
1906 (Target_selector_mips_nacl): New class.
1907 (target_selector_mips32): Rename from target_selector_mips32be and use
1908 Target_selector_mips_nacl instead of Target_selector_mips.
1909 (target_selector_mips32el): Rename from target_selector_mips32 and use
1910 Target_selector_mips_nacl instead of Target_selector_mips.
1911 (target_selector_mips64): Rename from target_selector_mips64be and use
1912 Target_selector_mips_nacl instead of Target_selector_mips.
1913 (target_selector_mips64el): Rename from target_selector_mips64 and use
1914 Target_selector_mips_nacl instead of Target_selector_mips.
1915 (Target_mips::mips_info): Add const attribute.
1916
54674d38
CC
19172014-09-02 Cary Coutant <ccoutant@google.com>
1918
1919 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1920 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1921 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1922 (Sized_incr_dynobj::do_section_name): Likewise.
1923 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1924 (Sized_incr_dynobj::do_section_name): Likewise.
1925 * object.h (Object::section_name): Likewise.
1926 (Object::do_section_name): Likewise.
1927 (Sized_relobj_file::do_section_name): Likewise.
1928 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1929 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1930
9860cbcf
CC
19312014-09-02 Cary Coutant <ccoutant@google.com>
1932
1933 PR gold/17005
1934 * ehframe.cc (Fde::write): Add output_offset parameter.
1935 (Cie::write): Likewise.
1936 (Eh_frame::set_final_data_size): Account for offset within output
1937 section.
1938 (Eh_frame::do_sized_write): Likewise.
1939 * ehframe.h (Fde::write): Add output_offset parameter.
1940 (Cie::write): Likewise.
1941 * output.cc (Output_section::Input_section_sort_entry): Remove
1942 section_has_name_; add output_section_name parameter. Use
1943 output section name for non-input sections.
1944 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1945 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1946 (Output_section::Input_section_sort_compare): Remove logic for
1947 sections without names.
1948 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1949 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1950 Likewise.
1951 (Output_section::Input_section_sort_section_name_compare): Likewise.
1952
8e33481e
HS
19532014-08-29 Han Shen <shenhan@google.com>
1954 Jing Yu <jingyu@google.com>
1955
1956 * aarch64-reloc-property.cc
1957 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1958 reference reloc property in the table.
1959 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1960 3 other entries.
1961 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1962 2 new overloaded methods.
1963 (Output_data_got_aarch64::do_write): Add code to write out
1964 static relocs.
1965 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1966 static relocs.
1967 (Output_data_got_aarch64::static_relocs): New vector to
1968 hold static relocs.
1969 (Target_aarch64::TCB_SIZE): New const static memeber.
1970 (Target_aarch64::tcb_size): New method.
1971 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1972 (Target_aarch64::Relocate::relocate_tls): New method.
1973 (Target_aarch64::Scan::local): Add code handling new reloc types.
1974 (Target_aarch64::Scan::global): Add code handling new reloc types.
1975
81233653
ST
19762014-08-13 Sriraman Tallam <tmsriram@google.com>
1977
1978 * options.h (-no-pie): Add option.
1979
9363c7c3
JY
19802014-08-08 Jing Yu <jingyu@google.com>
1981 Han Shen <shenhan@google.com>
1982
1983 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1984 (DEFFILES): add aarch64-reloc.def.
1985 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1986 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1987 * Makefile.in: Regenerate.
1988 * aarch64-reloc-property.cc: New file.
1989 * aarch64-reloc-property.h: New file.
1990 * aarch64-reloc.def: New file.
1991 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1992 with tab to make the format consistent.
1993 (Output_data_got_aarch64::symbol_table_): New method.
1994 (Target_aarch64::do_plt_address_for_global): New method.
1995 (Target_aarch64::do_plt_address_for_local): New method.
1996 (Target_aarch64::do_select_as_default_target): New method.
1997 (Target_aarch64::do_make_data_plt): New method.
1998 (Target_aarch64::make_data_plt): New method.
1999 (Output_data_plt_aarch64::has_irelative_section): New method.
2000 (Output_data_plt_aarch64::address_for_global): New method.
2001 (Output_data_plt_aarch64::address_for_local): New method.
2002 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2003 (Output_data_plt_aarch64::add_entry): Implement contents.
2004 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2005 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2006 the got_pov entry to plt0.
2007 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2008 Implement contents.
2009 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2010 (AArch64_howto): New struct.
2011 (aarch64_howto[]): New static const array.
2012 (AArch64_relocate_functions): New class.
2013 (Target_aarch64::Scan::get_reference_flags): Remove method.
2014 (Target_aarch64::Scan::local): Implement to support a few relocations.
2015 (Target_aarch64::Scan::global): Implement to support a few relocations.
2016 (Target_aarch64::make_plt_section): Implement contents.
2017 (Target_aarch64::make_plt_entry): Implement contents.
2018 (Target_aarch64::do_finalize_sections): Implement contents.
2019 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2020 (Target_aarch64::relocate_section): Implement contents.
2021
ad9fe6c1
AM
20222014-08-06 Alan Modra <amodra@gmail.com>
2023
2024 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2025
7cd4e5b7
AM
20262014-08-06 Alan Modra <amodra@gmail.com>
2027
2028 PR 13227
2029 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2030
5ad9b0a7
ST
20312014-07-21 Sriraman Tallam <tmsriram@google.com>
2032
2033 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2034 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2035
e051745c
CC
20362014-07-08 Cary Coutant <ccoutant@google.com>
2037
2038 * expression.cc (struct Expression::Expression_eval_info): Add
2039 new fields type_pointer, vis_pointer, and nonvis_pointer.
2040 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2041 nonvis_pointer parameters. Adjust all calls.
2042 (Symbol_expression::value): Update type, visibility, and nonvis bits
2043 in caller.
2044 * script.cc (Symbol_assignment::sized_finalize): Update type,
2045 visibility, and remaining st_other bits for new symbol.
2046 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2047 vis_pointer, and nonvis_pointer parameters.
2048 * symtab.h (Symbol::set_type): New method.
2049
2050 * testsuite/Makefile.am (defsym_test): New test.
2051 * testsuite/Makefile.in: Regenerate.
2052 * testsuite/defsym_test.c: New file.
2053 * testsuite/defsym_test.sh: New file.
2054
f35c4853
CC
20552014-07-08 Cary Coutant <ccoutant@google.com>
2056
2057 PR gold/15639
2058 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2059 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2060 (Sized_dynobj::base_read_symbols): ...new method.
2061 * object.h (Sized_relobj_file::base_read_symbols): New method.
2062 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2063 (Sized_relobj_file::base_read_symbols): ...new method.
2064 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2065 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2066 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2067
2900af2d
AM
20682014-07-04 Alan Modra <amodra@gmail.com>
2069
2070 * po/POTFILES.in: Regenerate.
2071
053a4d68
JY
20722014-07-02 Jing Yu <jingyu@google.com>
2073
2074 * aarch64.cc: New file
2075 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2076 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2077 * Makefile.in: Regenerate.
2078 * configure.tgt: Add entries for aarch64*.
2079 * configure.ac: Likewise.
2080 * configure: Likewise.
2081
7b549045
AM
20822014-06-27 Alan Modra <amodra@gmail.com>
2083
2084 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2085
cb818dbf
CC
20862014-06-24 Cary Coutant <ccoutant@google.com>
2087
2088 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2089 sections.
2090 (Dwo_file::sized_read_unit_index): Likewise.
2091
9810d34d
SS
20922014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2093
2094 * mips.cc: New file.
2095 * Makefile.am (TARGETSOURCES): Add mips.cc
2096 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2097 * configure.tgt: Add entries for mips*.
2098 * configure.ac: Likewise.
2099 * Makefile.in: Regenerate.
2100 * configure: Likewise.
2101
9baa787b
CC
21022014-06-09 Cary Coutant <ccoutant@google.com>
2103
2104 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2105 unit_length is within section bounds.
2106
8f89af0a
CC
21072014-06-09 Cary Coutant <ccoutant@google.com>
2108
2109 PR gold/16980
2110 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2111 map.
2112
a47622ac
AM
21132014-06-07 Alan Modra <amodra@gmail.com>
2114
2115 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2116
4320c691
CC
21172014-06-06 Cary Coutant <ccoutant@google.com>
2118
2119 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2120 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2121 (Dwarf_pubnames_table::read_header): Likewise.
2122 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2123 .debug_gnu_pubtypes.
2124
270c9937
JB
21252014-06-05 Joel Brobecker <brobecker@adacore.com>
2126
2127 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2128 * Makefile.in, configure: Regenerate.
2129
397998fc
AM
21302014-06-03 Alan Modra <amodra@gmail.com>
2131
2132 * powerpc.cc (addis_12_2): Define.
2133 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2134
61f5c66f
AM
21352014-06-03 Alan Modra <amodra@gmail.com>
2136
2137 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2138 st_other output.
2139
f6971787
AM
21402014-06-02 Alan Modra <amodra@gmail.com>
2141
2142 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2143 Only ignore relocs on ELFv1.
2144 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2145
f6fb8322
CC
21462014-05-30 Cary Coutant <ccoutant@google.com>
2147
2148 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2149 * testsuite/Makefile.in: Regenerate.
2150 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2151
c23dd342
L
21522014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2153
2154 PR gold/16945
2155 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2156 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2157
5fe7ffdc
AM
21582014-05-15 Alan Modra <amodra@gmail.com>
2159
2160 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2161 Compare FDE contents with DW_CFA_nop rather than 0.
2162
a82bef93
ST
21632014-05-13 Sriraman Tallam <tmsriram@google.com>
2164
2165 * symtab.h (may_need_copy_reloc): Remove check for position independent
2166 code.
2167 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2168 position independence before pc absolute may_need_copy_reloc call.
2169 Add check for executable output befor pc relative may_need_copy_reloc
2170 call.
2171 * i386.cc: Ditto.
2172 * arm.cc: Ditto.
2173 * sparc.cc: Ditto.
2174 * tilegx.cc: Ditto.
2175 * powerpc.cc: Add check for no position independence before
2176 may_need_copy_reloc calls.
2177 * testsuite/pie_copyrelocs_test.cc: New file.
2178 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2179 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2180 * Makefile.in: Regenerate.
a82bef93 2181
53c66605
ML
21822014-05-08 Martin Liška <mliska@suse.cz>
2183
2184 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2185
57b2284c
CC
21862014-05-06 Cary Coutant <ccoutant@google.com>
2187
2188 PR gold/16900
2189 * i386.cc (Output_data_got_plt_i386): New class.
2190 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2191 parameter. Change all callers.
2192 (Output_data_plt_i386::layout_): Remove.
2193 (Output_data_plt_i386::got_plt_): Change type.
2194 (Target_i386::got_plt_): Change type. Change all references.
2195 (Target_i386::got_section): Create instance of new class.
2196 (Output_data_got_plt_i386::do_write): New function.
2197 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2198 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2199 parameter. Change all callers.
2200 (Output_data_plt_x86_64::layout_): Remove.
2201 (Output_data_plt_x86_64::got_plt_): Change type.
2202 (Target_x86_64::got_plt_): Change type. Change all references.
2203 (Target_x86_64::got_section): Create instance of new class.
2204 (Output_data_got_plt_x86_64::do_write): New function.
2205 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2206 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2207 class.
2208
6b97515d 22092014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2210
6b97515d
CC
2211 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2212 if we have pubnames/pubtypes.
2213
d1bddd3c
CC
22142014-05-02 Cary Coutant <ccoutant@google.com>
2215
5fe7ffdc
AM
2216 * defstd.cc (in_segment): Define __ehdr_start here...
2217 * layout.cc (Layout::finalize): ...Instead of here. Set the
2218 output segment when known.
2219 * resolve.cc (Symbol::override_base_with_special): Remember
2220 the original binding.
2221 * symtab.cc (Symbol::set_output_segment): New function.
2222 (Symbol::set_undefined): New function.
2223 * symtab.h (Symbol::is_weak_undefined): Check original undef
2224 binding.
2225 (Symbol::is_strong_undefined): New function.
2226 (Symbol::set_output_segment): New function.
2227 (Symbol::set_undefined): New function.
2228 * target-reloc.h (is_strong_undefined): Remove.
2229 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2230 Check for hidden undefs.
2231 (relocate_section): Call Symbol::is_strong_undefined.
2232
2233 * testsuite/Makefile.am (ehdr_start_test_1)
2234 (ehdr_start_test_2, ehdr_start_test_3)
2235 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2236 * testsuite/Makefile.in: Regenerate.
2237 * testsuite/ehdr_start_def.cc: New source file.
2238 * testsuite/ehdr_start_test.cc: New source file.
2239 * testsuite/ehdr_start_test.t: New linker script.
2240 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2241
7849f6d8
CC
22422014-04-23 Cary Coutant <ccoutant@google.com>
2243
bf2cc635 2244 PR gold/16870
7849f6d8
CC
2245 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2246
99fd8cff
CC
22472014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2248
2249 * layout.cc (Layout::include_section): Allow a target to decide
2250 whether to include a section.
2251 * target.h (Target::should_include_section): New function.
2252 (Target::do_should_include_section): New function.
2253
91f43acd
CC
22542014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2255
2256 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2257 inline into ...
2258 (Copy_relocs::emit): ... here.
2259 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2260 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2261 (Copy_reloc_entry::entries_): Change from private to protected.
2262
c4eb27e1
ST
22632014-04-02 Sriraman Tallam <tmsriram@google.com>
2264
2265 * icf.cc (get_section_contents): Replace copies of reloc
2266 vectors with const references.
2267
ae447ddd
CC
22682014-04-02 Cary Coutant <ccoutant@google.com>
2269
2270 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2271 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2272 * configure: Regenerate.
2273 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2274 -fno-use-linker-plugin.
2275 (LINK1, CXXLINK1): Add it to the link command.
2276 * testsuite/Makefile.in: Regenerate.
2277
fa47fa92
AM
22782014-03-12 Alan Modra <amodra@gmail.com>
2279
2280 * Makefile.in: Regenerate.
2281
9b12c500
CC
22822014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2283
2284 * symtab.h (Symbol::set_nonvis): New function.
2285
beacaa96
CC
22862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2287
2288 * symtab.cc (Sized_symbol<32>::init_output_data):
2289 Instantiate the template.
2290 (Sized_symbol<64>::init_output_data): Likewise.
2291
800d9823
CC
22922014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2293
2294 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2295 adjust dynamic symbol value.
2296 * target.h (Target::adjust_dyn_symbol): New function.
2297 (Target::do_adjust_dyn_symbol): New function.
2298
918fc1f8 22992014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2300
918fc1f8
CC
2301 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2302 Get the value of DYNAMIC_CUSTOM dynamic entry.
2303 * output.h (Output_data_dynamic::add_custom): New function.
2304 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2305 dynamic entry.
2306 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2307 * target.h (Target::dynamic_tag_custom_value): New function.
2308 (Target::do_dynamic_tag_custom_value): New function.
2309
98ff9231
CC
23102014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2311
2312 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2313 dynsym indexes.
2314 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2315 (Target::do_has_custom_set_dynsym_indexes): New function.
2316 (Target::set_dynsym_indexes): New function.
2317 (Target::do_set_dynsym_indexes): New function.
2318
b80eed39
AM
23192014-03-07 Alan Modra <amodra@gmail.com>
2320
2321 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2322 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2323 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2324 (Powerpc_relocate_functions::has_overflow_bitfield,
2325 overflowed): Use the above.
2326 (Target_powerpc::Relocate::relocate): Correct overflow checking
2327 for a number of relocations. Modify overflow test for 16-bit
2328 fields in instructions to signed/unsigned according to whether
2329 the field takes a signed or unsigned value.
2330
4b95cf5c
AM
23312014-03-05 Alan Modra <amodra@gmail.com>
2332
2333 Update copyright years.
2334
45965137
AM
23352014-03-05 Alan Modra <amodra@gmail.com>
2336
2337 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2338 R_PPC64_ADDR64_LOCAL.
2339 (Target_powerpc::Relocate::relocate): Likewise.
2340
2c80b753
AM
23412014-03-03 Alan Modra <amodra@gmail.com>
2342
2343 * dwp.cc (print_version): Update copyright year to current.
2344
c1c69e83
AM
23452014-02-10 Alan Modra <amodra@gmail.com>
2346
2347 * po/gold.pot: Regenerate.
2348
dd0c4e70
CC
23492014-02-06 Cary Coutant <ccoutant@google.com>
2350
2351 Fix problem where -u is ignored when a weak undef is seen.
2352
2353 * archive.cc (Library_base::should_include_member): Reorder
2354 code to check for -u option if a weak undef has already been seen.
2355 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2356 * testsuite/Makefile.in: Regenerate.
2357 * testsuite/weak_undef_file3.cc: New file.
2358 * testsuite/weak_undef_file4.cc: New file.
2359 * testsuite/weak_undef_test_2.cc: New file.
2360
1a221d3d
CC
23612014-02-05 Cary Coutant <ccoutant@google.com>
2362
2363 Fix issues with gold undefined symbol diagnostics.
2364
2365 PR binutils/15435
2366 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2367 check to here.
2368 * target-reloc.h (is_strong_undefined): New function.
2369 (relocate_section): Move undef vtable symbol check from here.
2370 Check for is_strong_undefined.
2371
e889f0a4 23722014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2373
e889f0a4
CC
2374 Fix problems with the --dynamic-list option.
2375
2376 PR gold/13577
2377 * options.cc (General_options::parse_dynamic_list):
2378 Set have_dynamic_list_.
2379 (General_options::General_options): Initialize have_dynamic_list_.
2380 (General_options::finalize): Turn off -Bsymbolic and
2381 -Bsymbolic-functions if --dynamic-list provided.
2382 * options.h (General_options::have_dynamic_list): New function.
2383 (General_options::have_dynamic_list_): New data member.
2384 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2385 correctly.
5fe7ffdc 2386
e889f0a4
CC
2387 PR gold/16530
2388 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2389 in --dynamic-list, mark it.
5fe7ffdc 2390
e889f0a4
CC
2391 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2392 (dynamic_list_2): New test case.
2393 * testsuite/Makefile.in: Regenerate.
2394 * testsuite/dynamic_list_2.cc: New file.
2395 * testsuite/dynamic_list_2.t: New file.
2396 * testsuite/dynamic_list_lib1.cc: New file.
2397 * testsuite/dynamic_list_lib2.cc: New file.
2398 * testsuite/gc_dynamic_list_test.c: New file.
2399 * testsuite/gc_dynamic_list_test.sh: New file.
2400 * testsuite/gc_dynamic_list_test.t: New file.
2401
ec673e64
CC
24022014-01-28 Cary Coutant <ccoutant@google.com>
2403
2404 Add .gdb_index version 7 support.
2405
2406 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2407 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2408 debug sections.
2409 (Dwarf_ranges_table::read_ranges_table): Likewise.
2410 (Dwarf_pubnames_table::read_section): Check for GNU-style
2411 sections, and for compressed debug sections.
2412 (Dwarf_pubnames_table::read_header): Compute end address of table.
2413 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2414 for end of list by offset, not by offset == 0.
2415 (Dwarf_info_reader::do_read_string_table): Check for compressed
2416 debug sections.
2417 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2418 Initialize new data members.
2419 (Dwarf_pubnames_table::next_name): return flag_byte.
2420 (Dwarf_pubnames_table::end_of_table_): New data member.
2421 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2422 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2423 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2424 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2425 read skeleton type unit DIEs.
2426 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2427 (Gdb_index::do_write): Write flag_byte.
2428 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2429 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2430 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2431 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2432
221fd5d5
L
24332014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2434
2435 * version.cc (print_version): Update copyright year to 2014.
2436
6c09fb0b
ILT
24372013-12-19 Dimitry Andric <dimitry@andric.com>
2438
2439 * stringpool.cc (Stringpool_template::reserve): Add
2440 HAVE_UNORDERED_MAP case.
2441 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2442
8356f2d0
CC
24432013-12-18 Cary Coutant <ccoutant@google.com>
2444
2445 * configure.ac: Check for <unordered_set> and <unordered_map>.
2446 * config.in: Regenerate.
2447 * configure: Regenerate.
2448 * system.h: Use <unordered_set> and <unordered_map> if available.
2449
f2c7d7ee
RM
24502013-12-10 Roland McGrath <mcgrathr@google.com>
2451
2452 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2453 with $(INSTALL_PROGRAM_ENV).
2454 * Makefile.in: Regenerate.
2455
6632e8cc
CC
24562013-11-22 Cary Coutant <ccoutant@google.com>
2457
2458 * configure.ac: Add check for which library is needed for
2459 dlopen.
2460 * configure: Regenerate.
2461
0c075858
CC
24622013-11-22 Cary Coutant <ccoutant@google.com>
2463
2464 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2465 assembler.
2466 * testsuite/Makefile.in: Regenerate.
2467
f49fe902
L
24682013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2469
2470 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2471 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2472 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2473 (Target_x86_64<size>::Scan::local): Likewise.
2474 (Target_x86_64<size>::Scan::global): Likewise.
2475 (Target_x86_64<size>::Relocate::relocate): Likewise.
2476 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2477 Likewise.
2478 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2479 R_X86_64_PC32_BND.
2480
2481 * testsuite/Makefile.am (check_PROGRAMS): Add
2482 exception_x86_64_bnd_test.
2483 (exception_x86_64_bnd_test_SOURCES): New macro.
2484 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2485 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2486 (exception_x86_64_bnd_test_LDADD): Likewise.
2487 (exception_x86_64_bnd_1.o): New rule.
2488 (exception_x86_64_bnd_2.o): Likewise.
2489 * testsuite/Makefile.in: Regenerated.
2490
9055360d
AM
24912013-11-15 Alan Modra <amodra@gmail.com>
2492
2493 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2494 accessor.
2495 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2496 Only call ppc64_local_entry_offset for 64-bit. Restrict
2497 symval_for_branch lookup to ELFv1.
2498 (Stub_table::add_plt_call_entry): Use unsigned int off.
2499 (Output_data_glink::Address, invalid_address): New.
2500 (Output_data_glink::add_eh_frame): Move out of line. Add
2501 support for ELFv2.
2502 (Output_data_glink::add_global_entry, find_global_entry,
2503 global_entry_address): New functions.
2504 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2505 ge_size): New variables.
2506 (Output_data_glink::set_final_data_size): Add global entry
2507 stub sizing.
2508 (Output_data_glink::do_write): Write global entry stubs.
2509 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2510 parameter. Return true for ELFv2. Adjust callers.
2511 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2512 ELFv1. Similarly for ifunc and dynamic relocation processing
2513 specific to ELFv1. Recognize that symbols are defined on
2514 their plt entries for ELFv2.
2515 (Target_powerpc::symval_for_branch): Assert if called for
2516 ELFv2 or ppc32.
2517 (Target_powerpc::Relocate::relocate): Use global entry plt
2518 stub for symbol value if such exists on ELFv2.
2519 (Target_powerpc::Relocate::relocate): Don't call
2520 symval_for_branch when ELFv2. Do adjust for local entry
2521 offset when ELFv2.
2522 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2523 plt stub for ELFv2.
2524 (Target_powerpc::do_plt_address_for_global): Similarly.
2525
cafdd569
CC
25262013-11-14 Cary Coutant <ccoutant@google.com>
2527
2528 Revert patch -- this did not fix the problem, and there is
2529 no race there.
2530
2531 2013-11-14 Cary Coutant <ccoutant@google.com>
2532
2533 PR gold/14860
2534 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2535 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2536 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2537 updating fde_offsets_.
2538 (Eh_frame_hdr::lock_): New data member.
2539
94e49e16
CC
25402013-11-14 Cary Coutant <ccoutant@google.com>
2541
2542 * dwp.cc (Dwo_file_entry): New type.
2543 (File_list): Use Dwo_file_entry.
2544 (Dwo_file::verify): New function.
2545 (Dwo_file::verify_dwo_list): New function.
2546 (Dwo_file::sized_verify_dwo_list): New function.
2547 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2548 list.
2549 (Dwp_options): New enum type.
2550 (dwp_options): Add --verify-only.
2551 (usage): Likewise.
2552 (main): Likewise.
2553 * dwp.h (gold_info): Add declaration.
2554
7cdd7d57
CC
25552013-11-14 Cary Coutant <ccoutant@google.com>
2556
2557 PR gold/14860
2558 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2559 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2560 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2561 updating fde_offsets_.
2562 (Eh_frame_hdr::lock_): New data member.
2563
1d946cb3
CC
25642013-11-06 Cary Coutant <ccoutant@google.com>
2565
2566 PR gold/15758
2567 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2568 before reloc sections.
2569
4f65b40e
AM
25702013-11-04 Alan Modra <amodra@gmail.com>
2571
2572 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2573 (Symbol::needs_dynamic_reloc): Test new flag.
2574 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2575 (Target_powerpc::Scan::get_reference_flags): Add target param.
2576 Return FUNC_DESC_ABI for 64-bit ELFv1.
2577 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2578 call.
2579 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2580 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2581
908794a9
CC
25822013-10-31 Cary Coutant <ccoutant@google.com>
2583
2584 Restore support for dwp v2 DWARF package file format.
2585
2586 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2587 tu_length parameter. Adjust all callers.
2588 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2589 * dwp.cc: Include dwarf.h.
2590 (Section_bounds): New struct type.
2591 (Unit_set): New struct type.
2592 (Dwo_file::Dwo_file): Initialize new data member.
2593 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2594 Combine and rename to...
2595 (Dwo_file::read_unit_index): ...this.
2596 (Dwo_file::sized_read_compunit_index)
2597 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2598 (Dwo_file::sized_read_unit_index): ...this.
2599 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2600 parameters; add section_id parameter.
2601 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2602 (Dwo_file::add_unit_set): ...this.
2603 (Dwo_file::shndx_map_): Remove.
2604 (Dwo_file::sect_offsets_): New data member.
2605 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2606 (Dwp_output_file::add_section): Rename to...
2607 (Dwp_output_file::add_contribution): ...this.
2608 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2609 (Dwp_output_file::add_tu_set): Likewise.
2610 (Dwp_output_file::Contribution): New type.
2611 (Dwp_output_file::Section::contributions): New data member.
2612 (Dwp_output_file::Cu_or_tu_set): Remove.
2613 (Dwp_output_file::Section::Section): New ctor.
2614 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2615 (Dwp_output_file::Dwp_index::Section_table): New type.
2616 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2617 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2618 parameter.
2619 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2620 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2621 (Dwp_output_file::Dwp_index::section_table): New member function.
2622 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2623 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2624 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2625 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2626 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2627 (Dwp_output_file::Dwp_index::section_table_): New data member.
2628 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2629 (Dwp_output_file::add_output_section): New member function.
2630 (Dwp_output_file::write_new_section): New member function.
2631 (Dwp_output_file::write_contributions): New member function.
2632 (Dwp_output_file::section_id_map_): New data member.
2633 (class Dwo_id_info_reader): Remove.
2634 (class Unit_reader): New class.
2635 (get_dwarf_section_name): New function.
2636 (Dwo_file::read_executable): Adjust initializations of class data.
2637 (Dwo_file::read): Add support for v2 package file format.
2638 (Dwo_file::read_unit_index): Likewise.
2639 (Dwo_file::sized_read_unit_index): Likewise.
2640 (Dwo_file::copy_section): Likewise.
2641 (Dwo_file::add_unit_set): Likewise.
2642 (Dwp_output_file::add_output_section): Likewise.
2643 (Dwp_output_file::add_contribution): Likewise.
2644 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2645 for empty slot.
2646 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2647 file format.
2648 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2649 slot.
2650 (Dwp_output_file::initialize): Remove unused function.
2651 (Dwp_output_file::finalize): Add support for v2 package file format.
2652 (Dwp_output_file::write_index): Likewise.
2653 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2654 function prototype.
2655
2500c017
CC
26562013-10-31 Cary Coutant <ccoutant@google.com>
2657
2658 * configure.ac: Fix check for -fmerge-constants.
2659 * configure.ac: Regenerate.
2660
dd0845d7
RM
26612013-10-30 Roland McGrath <mcgrathr@google.com>
2662
2663 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2664 Correct 9-byte nop sequence to match what the assembler generates.
2665
b4f7960d
AM
26662013-10-30 Alan Modra <amodra@gmail.com>
2667
2668 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2669 ppc64_local_entry_offset, ppc64_local_entry_offset,
2670 do_read_symbols): New functions.
2671 (Powerpc_relobj::e_flags_, st_other_): New vars.
2672 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2673 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2674 (Powerpc_relobj::e_flags_): New var.
2675 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2676 and adjust for ELFv2.
2677 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2678 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2679 (Powerpc_dynobj::do_find_special_sections): Likewise.
2680 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2681 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2682 to ELFv2 local entry.
2683 (Target_powerpc::do_relax): No thread safe barriers needed for
2684 ELFv2.
2685 (Output_data_plt_powerpc::initial_plt_entry_size_,
2686 plt_entry_size): Delete. Replace all uses with
2687 first_plt_entry_offset() and plt_entry_size().
2688 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2689 reserved_size parm. Update callers.
2690 (Output_data_plt_powerpc::entry_count): Update.
2691 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2692 and use Target_powerpc::first_plt_entry_offset().
2693 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2694 rename to plt_entry_size.
2695 (Output_data_plt_powerpc::add_ifunc_entry,
2696 add_local_ifunc_entry): Adjust reloc for ELFv2.
2697 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2698 (glink_eh_frame_fde_64v2): New.
2699 (Stub_table::plt_call_size): Support ELFv2 sizing.
2700 (Output_data_glink::add_eh_frame): Use the new FDE.
2701 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2702 (Stub_table::do_write): Write ELFv2 stubs and glink.
2703 (Target_powerpc::Relocate::relocate): Replaces nop after call
2704 with ld 2,24(1) and adjust local offset destination for ELFv2.
2705
f9c6b907
AM
27062013-10-30 Alan Modra <amodra@gmail.com>
2707
2708 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2709 (Target_powerpc::Scan::global, local): Likewise.
2710 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2711 on all ppc64 @h and @ha relocs.
2712
e84fe78f
AM
27132013-10-14 Alan Modra <amodra@gmail.com>
2714
2715 * output.h (Output_data_got::add_constant): Tidy.
2716 (Output_data_got::add_constant_pair): New function.
2717 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2718 methods used so as to first call reserve_ent().
2719
679e4abf
RM
27202013-10-11 Roland McGrath <mcgrathr@google.com>
2721
44dcb735
RM
2722 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2723 add_got_entry and add_got_entry_pair.
2724
13323c49
RM
2725 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2726 (HAVE_PUBNAMES): Likewise.
2727 * configure: Regenerate.
2728
1496b446
RM
2729 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2730 * testsuite/Makefile.in: Regenerate.
2731
cc84c10b
RM
2732 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2733 Remove const from declaration.
2734 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2735 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2736 * output.h (Output_file_header): Remove const from member target_
2737 and corresponding constructor argument.
2738 * output.cc (Output_file_header::Output_file_header): Update prototype.
2739 (Output_file_header::do_sized_write): Use this->target_ in place
2740 of parameters()->target().
2741
52f66a2c
RM
2742 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2743
2b64b551
RM
2744 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2745 * configure: Regenerate.
2746 * Makefile.in: Regenerate.
2747 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2748 * testsuite/merge_string_literals_2.c: Likewise.
2749 * testsuite/Makefile.am
2750 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2751 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2752 literal -fmerge-constants.
2753 * testsuite/Makefile.in: Regenerate.
2754
43819297
RM
2755 * i386.cc (Target_i386): Remove unused member dynbss_.
2756 * arm.cc (Target_arm): Likewise.
2757 * powerpc.cc (Target_powerpc): Likewise.
2758 * sparc.cc (Target_sparc): Likewise.
2759 * tilegx.cc (Target_tilegx): Likewise.
2760 * x86_64.cc (Target_x86_64): Likewise.
2761 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2762 type_signature_, type_offset_.
2763 * plugin.h (Plugin_hook): Remove unused member layout_.
2764 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2765 mapfile_.
2766 (Read_member): Remove unused members input_objects_, symtab_,
2767 mapfile_, layout_.
2768 (Check_library): Remove unused member symtab_.
2769 * archive.h (Lib_group): Remove unused member lib_.
2770 * archive.cc (Lib_group::Lib_group): Update initializer.
2771 * incremental.h (Incremental_binary): Remove unused member target_.
2772 (Incremental_script_entry): Removed unused member script_.
2773 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2774 * icf.h (Icf): Remove unused member num_tracked_relocs.
2775
39d9ead7
RM
2776 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2777 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2778 its only use.
2779 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2780
679e4abf
RM
2781 * archive.h: Use struct rather than class for forward declaration
2782 of Read_symbols_data.
2783
54de2ea6
CC
27842013-10-07 Cary Coutant <ccoutant@google.com>
2785
2786 PR gold/16010
2787 * testsuite/Makefile.am (icf_test): Fix dependencies.
2788 (icf_safe_test): Likewise.
2789 (icf_safe_so_test): Likewise.
2790 (large_symbol_alignment): Add empty _LDADD rule.
2791 * testsuite/Makefile.in: Regenerate.
2792
b14016f0
L
27932013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2794
2795 PR gold/15927
2796 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2797 relocation for R_X86_64_32 on x32.
2798
eb426534
RM
27992013-08-27 Roland McGrath <mcgrathr@google.com>
2800
2801 * output.cc (Output_segment::set_section_addresses): Take new
2802 Target* argument. If target->isolate_execinstr() and the segment
2803 is executable and starts at a target->abi_pagesize() boundary,
2804 pad its end out to a target->abi_pagesize() boundary with code fill.
2805 * output.h (Output_segment::set_section_addresses): Update decl.
2806 * layout.h (Layout::check_output_data_for_reset_values): Take new
2807 argument RELAX_OUTPUTS.
2808 (Layout): New member relax_output_list_.
2809 (Layout::add_relax_output): New method.
2810 * layout.cc (Layout::Layout): Update constructor.
2811 (Layout::reset_relax_output): New method.
2812 (Layout::clean_up_after_relaxation): Call it.
2813 (Layout::prepare_for_relaxation): Update caller.
2814 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2815 Call reset_relax_output before re-processing segments for
2816 isolate_execinstr case.
2817 (Layout::write_data): Handle relax_output_list_.
2818 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2819 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2820
9aff4b7a
NC
28212013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2822
2823 PR binutils/15834
2824 * object.h: Fix typos.
2825
93f8221c
RM
28262013-08-16 Roland McGrath <mcgrathr@google.com>
2827
2828 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2829 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2830
e44c3715
CC
28312013-08-07 Cary Coutant <ccoutant@google.com>
2832
2833 Revert support for v2 DWP files:
2834
2835 2013-03-01 Cary Coutant <ccoutant@google.com>
2836
2837 Add dwp support for v2 DWARF package file format.
2838 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2839 tu_length parameter. Adjust all callers.
2840 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2841 * dwp.cc: Include dwarf.h.
2842 (Section_bounds): New struct type.
2843 (Unit_set): New struct type.
2844 (Dwo_file::Dwo_file): Initialize new data member.
2845 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2846 Combine and rename to...
2847 (Dwo_file::read_unit_index): ...this.
2848 (Dwo_file::sized_read_compunit_index)
2849 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2850 (Dwo_file::sized_read_unit_index): ...this.
2851 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2852 parameters; add section_id parameter.
2853 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2854 (Dwo_file::add_unit_set): ...this.
2855 (Dwo_file::shndx_map_): Remove.
2856 (Dwo_file::sect_offsets_): New data member.
2857 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2858 (Dwp_output_file::add_section): Rename to...
2859 (Dwp_output_file::add_contribution): ...this.
2860 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2861 (Dwp_output_file::add_tu_set): Likewise.
2862 (Dwp_output_file::Contribution): New type.
2863 (Dwp_output_file::Section::contributions): New data member.
2864 (Dwp_output_file::Cu_or_tu_set): Remove.
2865 (Dwp_output_file::Section::Section): New ctor.
2866 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2867 (Dwp_output_file::Dwp_index::Section_table): New type.
2868 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2869 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2870 parameter.
2871 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2872 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2873 (Dwp_output_file::Dwp_index::section_table): New member function.
2874 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2875 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2876 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2877 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2878 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2879 (Dwp_output_file::Dwp_index::section_table_): New data member.
2880 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2881 (Dwp_output_file::add_output_section): New member function.
2882 (Dwp_output_file::write_new_section): New member function.
2883 (Dwp_output_file::write_contributions): New member function.
2884 (Dwp_output_file::section_id_map_): New data member.
2885 (class Dwo_id_info_reader): Remove.
2886 (class Unit_reader): New class.
2887 (get_dwarf_section_name): New function.
2888 (Dwo_file::read_executable): Adjust initializations of class data.
2889 (Dwo_file::read): Add support for v2 package file format.
2890 (Dwo_file::read_unit_index): Likewise.
2891 (Dwo_file::sized_read_unit_index): Likewise.
2892 (Dwo_file::copy_section): Likewise.
2893 (Dwo_file::add_unit_set): Likewise.
2894 (Dwp_output_file::add_output_section): Likewise.
2895 (Dwp_output_file::add_contribution): Likewise.
2896 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2897 for empty slot.
2898 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2899 file format.
2900 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2901 slot.
2902 (Dwp_output_file::initialize): Remove unused function.
2903 (Dwp_output_file::finalize): Add support for v2 package file format.
2904 (Dwp_output_file::write_index): Likewise.
2905 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2906 function prototype.
2907
c6905c28
CC
29082013-07-31 Cary Coutant <ccoutant@google.com>
2909
2910 * object.cc (Sized_relobj::do_output_section_address): New function.
2911 (Sized_relobj): Instantiate explicitly.
2912 * object.h (Object::output_section_address): New function.
2913 (Object::do_output_section_address): New function.
2914 (Sized_relobj::do_output_section_address): New function.
2915 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2916
29172013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2918 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2919
2920 * parameters.cc (Parameters::entry): Return target-specific entry
2921 symbol name.
2922 * target.h (Target::entry_symbol_name): New function.
2923 (Target_info::entry_symbol_name): New data member.
2924
2925 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2926 * i386.cc (Target_i386::i386_info): Likewise.
2927 (Target_i386_nacl::i386_nacl_info): Likewise.
2928 * sparc.cc (Target_sparc::sparc_info): Likewise.
2929 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2930 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2931 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2932 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2933
234d4ab8
SA
29342013-07-22 Sterling Augustine <saugustine@google.com>
2935
2936 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2937 Convert parameter shndx to local variable. Add parameters symtab
2938 and symtab_size. Scan over section names. Find relocation
2939 section corresponding to current section. Create and initialize
2940 reloc_mapper_ and reloc_type_.
2941 (Dwarf_pubnames_table::read_header): Add assertion. Change
2942 unit_length to off_t. Initialize member unit_length_. Fill in field
2943 cu_offset_.
2944 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2945 Initialize new fields unit_length_ and cu_offset_.
2946 (Dwarf_pubnames_table::read_section): Update prototype.
2947 (Dwarf_pubnames_table::cu_offset): New member function.
2948 (Dwarf_pubnames_table::subsection_size): Likewise.
2949 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2950 New fields.
2951 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2952 member functions public.
2953 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2954 Update comment. Rework logic. Move repeated parts to...
2955 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2956 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2957 pubtypes_table_, and stmt_list_offset.
2958 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2959 Gdb_index::find_pubtype_offset,
2960 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2961 (Gdb_index::pubnames_read): Update prototype and rework logic.
2962 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2963 Forward declare.
2964 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2965 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2966 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2967 Gdb_index::map_pubtable_to_dies):
2968 Declare functions.
2969 (Gdb_index::pubnames_read): Update declaration.
2970 (Gdb_index::Pubname_offset_map): New type.
2971 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2972 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2973 Gdb_index::stmt_list_offset): Declare.
2974 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2975 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2976 Gdb_index::pubtypes_offset_): Remove.
2977
a3ed37d8
RM
29782013-07-19 Roland McGrath <mcgrathr@google.com>
2979
2980 * options.h (General_options): Add -Trodata-segment option.
2981 * parameters.cc (Parameters::check_rodata_segment): New function.
2982 (Parameters::set_target_once): Call it.
2983 * parameters.h (Parameters): Declare it (private member function).
2984 * layout.cc (load_seg_unusable_for_headers): New function, broken
2985 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2986 then validate rodata segment rather than text segment.
2987 (relaxation_loop_body): Call that.
2988 (is_text_segment): New function. Don't admit a non-executable
2989 segment if TARGET->isolate_execinstr().
2990 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2991
eb5b4ded
CC
29922013-07-15 Shawn Landden <shawnlandden@gmail.com>
2993
2994 PR gold/15070
2995 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2996 * nacl.h (Sniff_file::View::View): Request aligned view.
2997
4d5effb9
CC
29982013-07-11 Cary Coutant <ccoutant@google.com>
2999
3000 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3001 correct BRLT entry size.
3002
ba8ca3e7
AM
30032013-07-03 Alan Modra <amodra@gmail.com>
3004
3005 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3006 comment.
3007
267257d2
CC
30082013-07-01 Cary Coutant <ccoutant@google.com>
3009
3010 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3011 reloc_type_.
3012 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3013 (Dwarf_ranges_table::lookup_reloc): New function.
3014 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3015 reloc_type_.
3016 (Dwarf_ranges_table::lookup_reloc): New function.
3017 (Dwarf_ranges_table::reloc_type_): New data member.
3018
06f30c9d
CC
30192013-06-27 Jing Yu <jingyu@google.com>
3020
3021 PR gold/15662
3022 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3023 function.
3024 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3025 (Target_powerpc::do_relax): Call the above.
3026
a2d7bf59
AM
30272013-06-27 Cary Coutant <ccoutant@google.com>
3028
3029 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3030 on garbage collected .opd section.
3031
30322013-06-27 Alan Modra <amodra@gmail.com>
3033
3034 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3035 is non-zero.
3036 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3037 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3038
32364e50
CC
30392013-06-14 Cary Coutant <ccoutant@google.com>
3040
3041 * resolve.cc (Symbol::override_base): Don't override st_type
3042 from plugin placeholder symbols.
3043 (Symbol_table::resolve): Likewise.
3044 (Symbol_table::should_override): Don't complain about TLS mismatch
3045 if the TO symbol is a plugin placeholder.
3046 * testsuite/Makefile.am (plugin_test_tls): New test.
3047 * testsuite/Makefile.in: Regenerate.
3048 * testsuite/plugin_test_tls.sh: New test script.
3049 * testsuite/two_file_test_2_tls.cc: New test source.
3050 * testsuite/two_file_test_tls.cc: New test source.
3051
7fb47cc9
CC
30522013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3053
3054 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3055 the maximum segment alignment is larger than the page size.
3056 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3057 correctly aligns the symbols with large alignemnt.
3058 * testsuite/Makefile.in: Regenerate.
3059 * testsuite/large_symbol_alignment.cc: New file.
3060
6934001a
CC
30612013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3062 Sriraman Tallam <tmsriram@google.com>
3063
3064 * options.h (sort_section): New option.
3065 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3066 Rename from Input_section_sort_section_name_special_ordering_compare.
3067 (Input_section_sort_section_name_compare): New struct.
3068 * output.cc (Output_section::Input_section_sort_section_name_compare::
3069 operator()): New function.
3070 (Output_section::sort_attached_input_sections): Use new sort function
3071 for .text if --sort-section=name is specified.
3072 * layout.cc (Layout::make_output_section):
3073 Add sorting by name when --sort-section=name is specified.
3074 * testsuite/Makefile.am (text_section_grouping): Test option
3075 --sort-section=name.
3076 * testsuite/Makefile.in: Regenerate.
3077 * testsuite/section_sorting_name.cc: New file.
3078 * testsuite/section_sorting_name.sh: New file.
3079
93acabad
CC
30802013-05-21 Cary Coutant <ccoutant@google.com>
3081
3082 * symtab.h (Symbol::is_cxx_vtable): New function.
3083 * target-reloc.h (relocate_section): Check for vtable symbol.
3084 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3085 * testsuite/Makefile.in: Regenerate.
3086 * testsuite/missing_key_func.cc: New test source.
3087 * testsuite/missing_key_func.sh: New test script.
3088
60e8b3fc
CC
30892013-05-21 Cary Coutant <ccoutant@google.com>
3090
2b64b551
RM
3091 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3092 type of enclosing symbol.
3093 (Relocate_info::location): Check symbol type when describing symbol.
3094 * object.h (Symbol_location_info): Remove unused line_number;
3095 add enclosing_symbol_type.
3096 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3097
9df9de2c
CC
30982013-05-13 Cary Coutant <ccoutant@google.com>
3099
2b64b551
RM
3100 * configure.ac: Export DEFAULT_TARGET.
3101 * configure: Regenerate.
3102 * Makefile.in: Regenerate.
3103 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3104 * testsuite/Makefile.in: Regenerate.
3105 * testsuite/debug_msg.sh: Delete duplicate tests.
3106 Don't check undef_int error message match for powerpc where the
3107 source file and line number aren't available.
9df9de2c 3108
bbc5ae17
RM
31092013-05-10 Roland McGrath <mcgrathr@google.com>
3110
3111 * options.h (General_options): Add --rosegment-gap option.
3112 * options.cc (finalize): --rosegment-gap implies --rosegment.
3113 * layout.cc (set_segment_offsets): Let user option override
3114 target->rosegment_gap().
3115
0c6e6c39
RM
31162013-05-10 Roland McGrath <mcgrathr@google.com>
3117
3118 * options.h (General_options): Remove leading space from help
3119 messages for -nostdlib and --rosegment.
3120
cde7cb01
MR
31212013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3122
3123 PR ld/15365
3124 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3125
f31ae5b8
AM
31262013-05-03 Alan Modra <amodra@gmail.com>
3127
3128 * merge.cc (Output_merge_string::do_add_input_section): Correct
3129 scan for number of strings. Rename vars to avoid shadowing.
3130 Include missing terminator in input_size_.
3131
d3a7cd45
L
31322013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3133
3134 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3135 Restore empty string handling.
3136
6ad3daba
CC
31372013-05-01 Cary Coutant <ccoutant@google.com>
3138
3139 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3140 uninitialized warning.
3141
e31908b6
CC
31422013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3143
3144 * output.cc (Output_section::add_merge_input_section): Allow
3145 to merge sections if the alignment is more than character size.
3146 * merge.h (Output_merge_string::Output_merge_string): Remove
3147 assert.
3148 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3149 only not-null strings. Check the alignment of strings.
3150 * stringpool.h
3151 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3152 alignment as the argument.
3153 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3154 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3155 Align non-zero length strings according to the addralign_.
3156 (Stringpool_template<Stringpool_char>::set_string_offsets):
3157 Updating offsets according to the given alignment.
3158 * testsuite/Makefile.am (text_section_grouping): Test if string
3159 literals are getting merged.
3160 * testsuite/Makefile.in: Regenerate.
3161 * testsuite/merge_string_literals_1.c: New file.
3162 * testsuite/merge_string_literals_2.c: Ditto.
3163 * testsuite/merge_string_literals.sh: Ditto.
3164
0e804863
ILT
31652013-04-26 Ian Lance Taylor <iant@google.com>
3166
3167 * target-reloc.h (relocate_section): If the reloc offset is out of
3168 range, pass VIEW as NULL to relocate.relocate.
3169 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3170 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3171 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3172 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3173 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3174 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3175
e7c5ea40
CC
31762013-04-26 Geoff Pike <gpike@chromium.org>
3177
3178 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3179 * layout.cc (Hash_task): New class.
3180 (Layout::queue_build_id_tasks): New function.
3181 (Layout::write_build_id): Handle single-thread portion of build ID
3182 computation. (In some cases, all of it is single-threaded.) Replace
3183 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3184 functionality in fewer lines of code.
3185 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3186 * options.h (General_options): make "--build-id" default to tree
3187 rather than sha1. Add two new options related to --build-id=tree:
3188 --build-id-chunk-size-for-treehash and
3189 --build-id-min-file-size-for-treehash.
3190 * Makefile.am: add testing of --build-id=tree and related new options
3191 (these tests will be invoked by "make check").
3192 * Makefile.in: Regenerate.
3193
49926cd0
AM
31942013-04-25 Alan Modra <amodra@gmail.com>
3195
3196 * configure.tgt: Add powerpcle and powerpc64le.
3197
a4034750
AM
31982013-04-22 Alan Modra <amodra@gmail.com>
3199
3200 PR gold/15355
3201 * layout.cc (Layout::segment_precedes): Allow more than one
3202 segment with the same type and flags.
3203
e79c84aa
CC
32042013-04-15 Cary Coutant <ccoutant@google.com>
3205
3206 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3207 allocate space in file for BSS sections.
3208
2199fbe7
CC
32092013-04-15 Cary Coutant <ccoutant@google.com>
3210
3211 * script-sections.cc (Orphan_output_section): Reset address
3212 to zero after each orphaned section for relocatable links.
3213
502e8a84
CC
32142013-04-15 Cary Coutant <ccoutant@google.com>
3215
a4034750
AM
3216 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3217 section starting address for relocatable link.
3218 * testsuite/Makefile.am (script_test_11): New test.
3219 * testsuite/Makefile.in: Regenerate.
3220 * testsuite/script_test_11.c: New source file.
3221 * testsuite/script_test_11.t: New linker script.
502e8a84 3222
0cfdc767
AM
32232013-04-13 Alan Modra <amodra@gmail.com>
3224
3225 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3226 owner when sections are not adjacent and exceed group size.
3227 (Target_powerpc::group_sections): Handle corner case.
3228 (Target_powerpc::Branch_info::make_stub): Handle case where
3229 stub table doesn't exist due to branches in non-exec sections.
3230 (Target_powerpc::Relocate::relocate): Likewise.
3231
6830ee24
AM
32322013-04-11 Alan Modra <amodra@gmail.com>
3233
3234 PR gold/15354
3235 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3236 .branch_lt to match bfd ld. Adjust comments throughout file.
3237
54a3d865
ILT
32382013-04-04 Ian Lance Taylor <iant@google.com>
3239
3240 GCC PR c++/56840
3241 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3242 sections before checking whether they are included in the link.
3243
9993ba11
ST
32442013-03-29 Sriraman Tallam <tmsriram@google.com>
3245
3246 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3247 object before calling the plugin claim_file handler. Pass the elf
3248 object of the archive to the plugin. Delete the elf object if the
3249 plugin claims the file.
3250
ebacd51e
AM
32512013-03-21 Alan Modra <amodra@gmail.com>
3252
3253 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3254 segment when omagic.
3255
117be58f
AM
32562013-03-21 Alan Modra <amodra@gmail.com>
3257
3258 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3259 comparison warning.
3260 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3261 uninitialized" warning.
3262
32e2b61d
AM
32632013-03-20 Alan Modra <amodra@gmail.com>
3264
3265 * symtab.h (Symbol::clear_version): New function.
3266 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3267 is_needed by weak references. Clear version for symbols defined
3268 in as-needed objects that are not needed.
3269
b3ccdeb5
AM
32702013-03-15 Alan Modra <amodra@gmail.com>
3271
3272 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3273 static and public. Add report_err param. Return false for data refs.
3274 (Target_powerpc::rela_dyn_section): New overloaded function.
3275 (Target_powerpc::plt_, iplt_): Elucidate.
3276 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3277 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3278 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3279 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3280 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3281 push_branch and make_plt_entry for ifunc syms when
3282 reloc_needs_plt_for_ifunc.
3283 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3284 for ifunc unless reloc_needs_plt_for_ifunc.
3285
ad3d8a2f
AM
32862013-03-15 Alan Modra <amodra@gmail.com>
3287
3288 * gc.h (gc_process_relocs): Don't look through function descriptors.
3289 * icf.cc (get_section_contents): Do so here instead.
3290
4d9aa155
AM
32912013-03-13 Alan Modra <amodra@gmail.com>
3292
3293 * powerpc.cc (is_branch_reloc): Forward declare.
3294 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3295 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3296 false for 64-bit, true for 32-bit non-branch relocs.
3297 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3298 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3299 nm output.
3300 (icf_safe_test): Generate linker map file as well as nm output.
3301 (icf_safe_so_test): Likewise.
3302 * testsuite/Makefile.in: Regenerate.
3303 * testsuite/icf_test.sh: Parse linker map file to determine
3304 section folding.
3305 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3306 * testsuite/icf_safe_so_test.sh: Likewise.
3307 (X86_32_or_ARM_specific_safe_fold): Merge into..
3308 (arch_specific_safe_fold): ..this.
3309 (X86_64_specific_safe_fold): Delete unused function.
3310
57420c20
AM
33112013-03-12 Alan Modra <amodra@gmail.com>
3312
3313 * gc.h (gc_process_relocs): Look through function descriptors
3314 to determine shndx, symvalue and addend used by ICF. Tidy
3315 variable duplication.
3316
dc3714f3
AM
33172013-03-11 Alan Modra <amodra@gmail.com>
3318
3319 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3320 * layout.cc (Layout_task_runner::run): ..to here.
3321 * symtab.h (struct Symbol_location): Extract from..
3322 (class Symbol_table): ..here.
3323 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3324 * target.h (class Target): Add function_location and
3325 do_function_location functions.
3326 (class Sized_target): Add do_function_location.
3327 * object.h (class Sized_relobj_file): Move find_shdr..
3328 (class Object): ..to here.
3329 * object.cc: Likewise. Update to suit. Instantiate.
3330 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3331 * powerpc.cc (class Powerpc_dynobj): New.
3332 (Target_powerpc::do_function_location): New function.
3333 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3334 (Powerpc_dynobj::do_read_symbols): New function.
3335 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3336
956b03bb
ILT
33372013-03-08 Ian Lance Taylor <iant@google.com>
3338
3339 * options.cc (General_options::string_to_object_format): Accept
3340 "default".
3341
4bead2d5
AM
33422013-03-08 Alan Modra <amodra@gmail.com>
3343
3344 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3345 pointer to Post_fde.
3346 (struct Post_fde): Move definition to here..
3347 * ehframe.cc (struct Post_fde): ..from here.
3348 (Cie::write): Don't alloc Post_fde.
3349 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3350
02e60bf7
AM
33512013-03-07 Alan Modra <amodra@gmail.com>
3352
3353 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3354 relocation referencing .LC0.
3355 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3356
8343f03a
AM
33572013-03-07 Alan Modra <amodra@gmail.com>
3358
3359 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3360 always_inline. Add assembly for powerpc to avoid GOT.
3361
3366d57c
AM
33622013-03-07 Alan Modra <amodra@gmail.com>
3363
3364 * testsuite/script_test_10.sh: Don't test .bss section
3365 header number.
3366
6c77229c
AM
33672013-03-06 Alan Modra <amodra@gmail.com>
3368
3369 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3370 (Target_powerpc::symval_for_branch): Add symtab param. Update
3371 all callers. Handle folded sections.
3372 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3373 to Powerpc_relobj.
3374 (Global_symbol_visitor_opd::operator()): Likewise.
3375
a39e4af6
AM
33762013-03-04 Alan Modra <amodra@gmail.com>
3377
3378 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3379 * testsuite/Makefile.in: Regenerate.
3380
d5834edb
CC
33812013-03-01 Cary Coutant <ccoutant@google.com>
3382
3383 Add dwp support for v2 DWARF package file format.
3384 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3385 tu_length parameter. Adjust all callers.
3386 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3387 * dwp.cc: Include dwarf.h.
3388 (Section_bounds): New struct type.
3389 (Unit_set): New struct type.
3390 (Dwo_file::Dwo_file): Initialize new data member.
3391 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3392 Combine and rename to...
3393 (Dwo_file::read_unit_index): ...this.
3394 (Dwo_file::sized_read_compunit_index)
3395 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3396 (Dwo_file::sized_read_unit_index): ...this.
3397 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3398 parameters; add section_id parameter.
3399 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3400 (Dwo_file::add_unit_set): ...this.
3401 (Dwo_file::shndx_map_): Remove.
3402 (Dwo_file::sect_offsets_): New data member.
3403 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3404 (Dwp_output_file::add_section): Rename to...
3405 (Dwp_output_file::add_contribution): ...this.
3406 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3407 (Dwp_output_file::add_tu_set): Likewise.
3408 (Dwp_output_file::Contribution): New type.
3409 (Dwp_output_file::Section::contributions): New data member.
3410 (Dwp_output_file::Cu_or_tu_set): Remove.
3411 (Dwp_output_file::Section::Section): New ctor.
3412 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3413 (Dwp_output_file::Dwp_index::Section_table): New type.
3414 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3415 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3416 parameter.
3417 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3418 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3419 (Dwp_output_file::Dwp_index::section_table): New member function.
3420 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3421 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3422 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3423 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3424 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3425 (Dwp_output_file::Dwp_index::section_table_): New data member.
3426 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3427 (Dwp_output_file::add_output_section): New member function.
3428 (Dwp_output_file::write_new_section): New member function.
3429 (Dwp_output_file::write_contributions): New member function.
3430 (Dwp_output_file::section_id_map_): New data member.
3431 (class Dwo_id_info_reader): Remove.
3432 (class Unit_reader): New class.
3433 (get_dwarf_section_name): New function.
3434 (Dwo_file::read_executable): Adjust initializations of class data.
3435 (Dwo_file::read): Add support for v2 package file format.
3436 (Dwo_file::read_unit_index): Likewise.
3437 (Dwo_file::sized_read_unit_index): Likewise.
3438 (Dwo_file::copy_section): Likewise.
3439 (Dwo_file::add_unit_set): Likewise.
3440 (Dwp_output_file::add_output_section): Likewise.
3441 (Dwp_output_file::add_contribution): Likewise.
3442 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3443 for empty slot.
3444 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3445 file format.
3446 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3447 slot.
3448 (Dwp_output_file::initialize): Remove unused function.
3449 (Dwp_output_file::finalize): Add support for v2 package file format.
3450 (Dwp_output_file::write_index): Likewise.
3451 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3452 function prototype.
3453
a68a081d
CC
34542013-03-01 Cary Coutant <ccoutant@google.com>
3455
3456 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3457 function into class definition in header file.
3458 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3459 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3460 New function.
3461 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3462
9d5781f8
AM
34632013-02-28 Alan Modra <amodra@gmail.com>
3464
3465 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3466 * target.cc (Target::do_plt_fde_location): New function.
3467 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3468 accessor function, and constructor param.
3469 (struct Post_fde, Post_fdes): Declare.
3470 (Cie::write): Add post_fdes param.
3471 * ehframe.cc (Fde::write): Use plt_fde_location.
3472 (struct Post_fde): Define.
3473 (Cie::write): Stash FDEs added post merge mapping.
3474 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3475 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3476 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3477 other FDEs.
3478 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3479 (Target_powerpc::has_glink): New function.
3480 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3481 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3482 glink_eh_frame_fde_32, default_fde): New data.
3483 (Stub_table::eh_frame_added_): New var.
3484 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3485 Make const.
3486 (Stub_table::add_eh_frame): New function.
3487 (Output_data_glink::add_eh_frame): New function.
3488 (Target_powerpc::make_glink_section): Call add_eh_frame.
3489
214383dd
ILT
34902013-02-15 Ian Lance Taylor <iant@google.com>
3491
3492 * options.h (DEFINE_uint64_alias): Define.
3493 (class General_options): Add -Ttext-segment as an alias for
3494 -Ttext.
3495
91c2b899
AM
34962013-02-15 Alan Modra <amodra@gmail.com>
3497
3498 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3499 (Stub_table::do_write): ..here, two places.
3500 (Stub_table::plt_call_size): Use it here too.
3501
20e2a8aa
ILT
35022013-02-11 Ian Lance Taylor <iant@google.com>
3503
3504 * descriptors.cc (Descriptors::close_all): New function.
3505 * descriptors.h (class Descriptors): Declare close_all.
3506 (close_all_descriptors): New inline function.
3507 * plugin.cc: Include "descriptors.h".
3508 (Plugin_manager::cleanup): Call close_all_descriptors.
3509
8952bc69
AM
35102013-02-06 Alan Modra <amodra@gmail.com>
3511
3512 * README: Update coding style link.
3513
29bd8b6b
CC
35142013-01-28 Cary Coutant <ccoutant@google.com>
3515
a4034750
AM
3516 * dwp.cc (File_list): New typedef.
3517 (Dwo_name_info_reader): New class.
3518 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3519 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3520 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3521 (Dwo_file::read_executable): New function.
3522 (Dwo_file::read): Move common setup code to ...
3523 (Dwo_file::make_object): ... here.
3524 (dwp_options): Add --exec/-e.
3525 (usage): Likewise.
3526 (main): Likewise.
29bd8b6b 3527
c6ac678d
ST
35282013-01-24 Sriraman Tallam <tmsriram@google.com>
3529
3530 * layout.cc (Layout::layout): Check for option text_reorder.
3531 (Layout::make_output_section): Ditto.
3532 * options.h (text_reorder): New option.
3533 * output.cc (Input_section_sort_compare): Remove special ordering
3534 of section names.
3535 (Output_section::
3536 Input_section_sort_section_name_special_ordering_compare::
3537 operator()): New function.
3538 (Output_section::sort_attached_input_sections): Use new sort function
3539 for .text.
3540 * output.h (Input_section_sort_section_name_special_ordering_compare):
3541 New struct.
3542 * testsuite/Makefile.am (text_section_grouping): Test option
3543 --no-text-reorder
3544 * testsuite/Makefile.in: Regenerate.
3545 * testsuite/text_section_grouping.sh: Check order of functions without
3546 default text reordering.
3547
50701cc1
MF
35482013-01-18 Mike Frysinger <vapier@gentoo.org>
3549
3550 * options.h (General_options): Change default to true for new_dtags.
3551
b1b00fcc
MF
35522013-01-18 Mike Frysinger <vapier@gentoo.org>
3553
3554 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3555 when enable_new_dtags is false. Only add DT_RUNPATH when
3556 enable_new_dtags is true.
3557
ec5b8187
AM
35582013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3559
3560 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3561 used in declaration and definition consistent.
3562 (Target_powerpc::symval_for_branch): Ditto.
3563
a880d4c4
ST
35642013-01-16 Sriraman Tallam <tmsriram@google.com>
3565
3566 * testsuite/plugin_final_layout.cc: Fix comment.
3567
7c381248
ST
35682013-01-16 Sriraman Tallam <tmsriram@google.com>
3569
3570 * layout.cc (Layout::layout): Do not do default sorting for
3571 text sections when section ordering is specified.
3572 (make_output_section): Ditto.
3573 * testsuite/plugin_final_layout.cc: Name the function sections
3574 to catch reordering issues.
3575
e2458743
AM
35762013-01-15 Alan Modra <amodra@gmail.com>
3577
3578 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3579 plt-thread-safe.
3580
431ed302
AM
35812013-01-15 Alan Modra <amodra@gmail.com>
3582
3583 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3584 * testsuite/Makefile.in: Regenerate.
3585
0ec6429b
AM
35862013-01-14 Alan Modra <amodra@gmail.com>
3587
3588 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3589 * testsuite/Makefile.in: Regenerate.
3590
0bf402d5
ILT
35912013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3592
36af3926 3593 PR bfd/14430
0bf402d5
ILT
3594 Fix mingw gold build with plugins enabled
3595 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3596 * configure.ac: Export DLOPEN_LIBS and add headers check.
3597 * plugin.cc: Handle non-dlfcn case.
3598 * Makefile.in: Regenerate.
3599 * config.in: Regenerate.
3600 * configure: Regenerate.
3601 * testsuite/Makefile.in: Regenerate.
3602
9e9143bc
ST
36032013-01-09 Sriraman Tallam <tmsriram@google.com>
3604
3605 * output.h (sort_attached_input_sections): Change to be public.
3606 * script-sections.cc
3607 (Output_section_definition::set_section_addresses): Sort
3608 attached input sections according to section order before linker
3609 script assigns section addresses.
3610 (Orphan_output_section::set_section_addresses): Sort
3611 attached input sections according to section order before linker
3612 script assigns section addresses.
3613 * Makefile.am (final_layout.sh): Use a simple linker script to
3614 check if section ordering still works.
3615 * Makefile.in: Regenerate.
3616
679af368
ILT
36172013-01-09 Ben Cheng <bccheng@google.com>
3618
3619 * arm.cc (Target_arm::attributes_accept_div): New function.
3620 (Target_arm::attributes_forbid_div): New function.
3621 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3622 attribute using the same new functions as what bfd/elf32_arm.c
3623 does.
3624
3136a00e
CC
36252013-01-07 Cary Coutant <ccoutant@google.com>
3626
3627 PR gold/14993
3628 * output.cc (Output_section::add_input_section): For incremental
3629 updates, don't track input sections that are allocated from patch
3630 space.
3631
f2a6224b
L
36322013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3633 Ian Lance Taylor <iant@google.com>
3634
3635 PR gold/14897
3636 * configure.ac (--enable-ld): Removed.
3637 (install_as_default): Set to yes only for --enable-gold=default
3638 or --disable-ld.
3639 * configure: Regenerated.
3640
4f46f626
L
36412013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3642
3643 * options.h (General_options): Add -fuse-ld= for GCC linker
3644 option compatibility.
3645
26e4ef59
CC
36462013-01-04 Cary Coutant <ccoutant@google.com>
3647
3648 * configure.ac: Fix typo restoring CXXFLAGS.
3649 * configure: Regenerate.
3650
3d587466
CC
36512013-01-04 Cary Coutant <ccoutant@google.com>
3652
4f46f626
L
3653 * testsuite/Makefile.am (CXXLINK_S): New macro.
3654 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3655 * testsuite/Makefile.in: Regenerate.
3d587466 3656
44db6695
L
36572013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3658
3659 * version.cc (print_version): Update copyright year to 2013.
3660
edcac0c1
ILT
36612012-12-20 Ian Lance Taylor <iant@google.com>
3662
3663 * layout.cc (Layout::special_ordering_of_input_section): New
3664 function.
3665 (Layout::layout): If input section requires special ordering, must
3666 sort input sections.
3667 (Layout::make_output_section): May sort .text input sections.
3668 (Layout::is_section_name_prefix_grouped): Remove.
3669 * layout.h (class Layout): Declare
3670 special_ordering_of_input_section. Don't declare
3671 is_section_name_prefix_grouped.
3672 * output.cc (Output_section::add_input_section): Revert last
3673 change.
3674 (Output_section::Input_section_sort::match_file_name): Don't crash
3675 if called on output section data.
3676 (Output_section::Input_section_sort_compare): Sort based on
3677 special ordering.
3678 (Output_section::Input_section_sort_section_order_index_compare):
3679 Revert last patch.
3680 (Output_section::sort_attached_input_sections): Likewise.
3681
28f2a4ac
ST
36822012-12-18 Sriraman Tallam <tmsriram@google.com>
3683
edcac0c1 3684 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3685 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3686 * output.cc (Output_section::add_input_section): Check if section
3687 name contains special prefix. Keep input sections to sort such
3688 sections.
3689 (Output_section::Input_section_sort_section_order_index_compare
3690 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3691 (Output_section::sort_attached_input_sections): Add condition to
3692 Input_section_entry constructor call.
28f2a4ac
ST
3693 * testsuite/Makefile.am (text_section_grouping): New test.
3694 * testsuite/Makefile.in: Regenerate.
3695 * testsuite/text_section_grouping.cc: New file.
3696 * testsuite/text_section_grouping.sh: New file.
3697
5bf135a7
NC
36982012-12-17 Nick Clifton <nickc@redhat.com>
3699
3700 * Makefile.am: Add copyright notice.
3701 * NEWS: Likewise.
3702 * README: Likewise.
3703 * configure.ac: Likewise.
3704 * ftruncate.c: Likewise.
3705 * Makefile.in: Regenerate.
3706
59965708
CC
37072012-12-14 Cary Coutant <ccoutant@google.com>
3708
a4034750
AM
3709 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3710 --no-as-needed flag.
3711 (exception_separate_shared_12_test): Likewise.
3712 (incremental_copy_test): Likewise.
3713 * testsuite/Makefile.in: Regenerate.
59965708 3714
2a77e2ab
CC
37152012-12-14 Cary Coutant <ccoutant@google.com>
3716
3717 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3718 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3719
e3deeb9c
AM
37202012-12-12 Alan Modra <amodra@gmail.com>
3721
3722 * powerpc.cc (class Track_tls): New.
3723 (class Relocate, class Scan): Inherit Track_tls.
3724 (Target_powerpc::Scan::local, global): Track tls optimization
3725 and avoid creating plt entry for __tls_get_addr if all uses
3726 are optimized away.
3727 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3728
d8f5a274
AM
37292012-12-12 Alan Modra <amodra@gmail.com>
3730
3731 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3732 Replace no_toc_optimize with toc_optimize.
3733 * output.h (Output_section::input_sections): Provide non-const variant.
3734 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3735 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3736 accessors.
3737 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3738 (class Sort_toc_sections): New.
3739 (Target_powerpc::do_finalize_sections): Sort toc sections.
3740 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3741
4c8a1de1
RM
37422012-12-10 Roland McGrath <mcgrathr@google.com>
3743
3744 * testsuite/binary_unittest.cc (read_all): New function.
3745 (Sized_binary_test): Use it instead of ::read.
3746 * fileread.cc (do_read): Don't assume pread always reads the whole
3747 amount in a single call.
3748
edc27beb
AM
37492012-12-10 Alan Modra <amodra@gmail.com>
3750
3751 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3752 Set EM_PPC64 or EM_PPC here.
3753 (Target_selector_powerpc::do_recognize): Delete.
3754
906b9150
AM
37552012-12-10 Alan Modra <amodra@gmail.com>
3756
3757 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3758 stub_table_.
3759 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3760
418c15ae
RM
37612012-12-07 Roland McGrath <mcgrathr@google.com>
3762
3763 * testsuite/binary_unittest.cc (Sized_binary_test):
3764 Use open_descriptor rather than ::open.
3765
decdd3bc
AM
37662012-12-07 Alan Modra <amodra@gmail.com>
3767
3768 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3769 typedef and invalid_address constant.
3770 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3771 instantiate constants.
3772
db399005
ILT
37732012-12-06 Roland McGrath <mcgrathr@google.com>
3774
3775 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3776 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3777 * aclocal.m4: Regenerate.
3778 * configure: Regenerate.
3779 * Makefile.in: Regenerate.
3780 * testsuite/Makefile.in: Regenerate.
3781
aba6bc71
AM
37822012-12-07 Alan Modra <amodra@gmail.com>
3783
3784 * options.h (General_options): Add no_toc_optimize.
3785 * powerpc.cc (ok_lo_toc_insn): New function.
3786 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3787
9e69ed50
AM
37882012-12-06 Alan Modra <amodra@gmail.com>
3789
3790 * options.h (General_options): Add plt_align, plt_static_chain,
3791 plt_thread_safe. Update stub_group_size help text.
3792 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3793 for new plt_thread_safe_ var.
3794 (use_plt_offset): Correct comments.
3795 (Target_powerpc::do_relax): Look for thread creation symbols to
3796 determine default plt_thread_safe value. Clear plt call stubs
3797 as well as branch stubs each iteration.
3798 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3799 insn constants.
3800 (l, hi, ha, write_insn): Move earlier.
3801 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3802 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3803 plt stubs too.
3804 (Stub_table::update_size): Adjust.
3805 (Stub_table::prev_size, set_prev_size): Delete.
3806 (Stub_table::stub_align): Let --plt-align affect result.
3807 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3808 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3809 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3810 (Stub_table::do_write): Support more stub variants.
3811
f43ba157
AM
38122012-12-04 Alan Modra <amodra@gmail.com>
3813
3814 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3815 (Target_powerpc::do_define_standard_symbols): New function.
3816
34171bc5
AM
38172012-12-03 Alan Modra <amodra@gmail.com>
3818
3819 * output.h: Formatting, whitespace.
3820
dc9589e9 38212012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3822
3823 * layout.h (Layout::get_executable_sections): Declare.
3824 * layout.cc (Layout::get_executable_sections): New function.
3825 * arm.cc (Target_arm::group_sections): Use it.
3826 (Arm_output_section::group_sections): Delete now redundant test.
3827 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3828 param to handle relative relocs.
3829 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3830 (Output_data_reloc::add_absolute): Adjust.
3831 (Output_data_reloc::add_relative): New function.
3832 (Output_data::reset_data_size): New function.
3833 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3834 (Output_section::set_addralign): New function.
3835 (Output_section::checkpoint_set_addralign): New function.
3836 (Output_section::clear_section_offsets_need_adjustment): New function.
3837 (Output_section::input_sections): Make public.
3838 * powerpc.cc (class Output_data_brlt_powerpc): New.
3839 (class Stub_table, class Stub_control): New.
3840 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3841 stub_table_, set_stub_table, stub_table): New vectors and accessor
3842 functions.
3843 (Target_powerpc::do_may_relax, do_relax, push_branch,
3844 new_stub_table, stub_tables, brlt_section, group_sections,
3845 add_branch_lookup_table, find_branch_lookup_table,
3846 write_branch_lookup_table, make_brlt_section): New functions.
3847 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3848 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3849 branch_info_): New vars.
3850 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3851 make call stubs here.
3852 (Output_data_glink): Remove all call stub handling from this class.
3853 (Target_powerpc::Scan::local, global): Save interesting branch
3854 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3855 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3856 functions on final link.
3857 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3858 Handle long branch destinations too.
3859 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3860 do_plt_address_for_local): Adjust lookup of plt call stubs.
3861
627b30b7
AM
38622012-11-30 Alan Modra <amodra@gmail.com>
3863
3864 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3865 relocs against protected symbols when building 32-bit shared libs.
3866
40b469d7
AM
38672012-11-30 Alan Modra <amodra@gmail.com>
3868
3869 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3870 param. Call got_section() to make .got. Update all callers
3871 and their callers and so on.
3872
bb66a627
AM
38732012-11-30 Alan Modra <amodra@gmail.com>
3874
3875 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3876 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3877 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3878 value if it already exists.
3879
d2cf1c6c
L
38802012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3881
3882 PR gold/14858
3883 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3884
edccdf7c
RM
38852012-11-14 Roland McGrath <mcgrathr@google.com>
3886
3887 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3888 than bfc instruction for data sandboxing.
3889
6febeb74
AM
38902012-11-08 Alan Modra <amodra@gmail.com>
3891
3892 * po/POTFILES.in: Regenerate.
3893
0a6f1bf2
AM
38942012-11-05 Alan Modra <amodra@gmail.com>
3895
3896 * configure.ac: Apply 2012-09-10 change to config.in here.
3897 * configure: Regenerate.
3898
26a4e9cb
AM
38992012-11-05 Alan Modra <amodra@gmail.com>
3900
3901 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3902 (struct Opd_ent): Use "Address" rather than "Offset".
3903 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3904 (Target_powerpc::got_section): Make public.
3905 (Target_powerpc::scan_relocs): Move code setting symbols..
3906 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3907 Create _SDA_BASE_ only when referenced.
3908
cc928013
RM
39092012-11-02 Roland McGrath <mcgrathr@google.com>
3910
3911 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3912 from last change.
3913
50ed5eb1
RM
39142012-11-01 Roland McGrath <mcgrathr@google.com>
3915
62fe925a
RM
3916 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3917 for offset_in_output_section parameter.
3918 (Sized_target::relocate_special_relocatable): Likewise.
3919 * arm.cc (Target_arm::relocate_relocs): Likewise.
3920 (Target_arm::relocate_special_relocatable): Likewise.
3921 * i386.cc (Target_i386::relocate_relocs): Likewise.
3922 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3923 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3924 * target-reloc.h (relocate_relocs): Likewise.
3925 * testsuite/testfile.cc (Target_test): Likewise.
3926 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3927 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3928
3929 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3930 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3931
3932 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3933 parameter, which is unused in the [!F_SETFD] case.
3934
50ed5eb1
RM
3935 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3936 SYMNDX to off_t before comparing it to this->data_size().
3937 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3938 * incremental.cc (Output_section_incremental_inputs::do_write):
3939 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3940
2cadc0bf
RM
3941 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3942
3bfcb652
NC
39432012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3944
3945 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3946 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3947 in EABI_VER5.
3948
c1a8d56e
CC
39492012-10-29 Cary Coutant <ccoutant@google.com>
3950
3951 * dwp.cc (usage): Add file and exit status parameters;
3952 add --help and --version options.
3953 (print_version): New function.
3954 (main): Add --help and --version options.
3955
b2490a7b
L
39562012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3957
3958 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3959 final_layout_sequence.txt.
3960 * testsuite/Makefile.in: Regenerated.
3961
aa543512
L
39622012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3963
3964 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3965 COMPILE generated by automake.
3966 (LINK1): Likewise.
3967 (CXXCOMPILE1): Likewise.
3968 (CXXLINK1): Likewise.
3969 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3970 (LINK): Likewise.
3971 (CXXCOMPILE): Likewise.
3972 (CXXLINK): Likewise.
3973 * testsuite/Makefile.in: Regenerated.
3974
d361fafb
L
39752012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3976
3977 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3978 on bad fwrite return.
3979
598c7410
L
39802012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3981
3982 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3983 on val.
3984
35c813e2
CC
39852012-10-23 Cary Coutant <ccoutant@google.com>
3986
3987 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3988 * testsuite/Makefile.in: Regenerate.
3989 * testsuite/dwp_test.h: New source file.
3990 * testsuite/dwp_test_1.cc: New source file.
3991 * testsuite/dwp_test_1.s: New source file.
3992 * testsuite/dwp_test_1.sh: New source file.
3993 * testsuite/dwp_test_1b.cc: New source file.
3994 * testsuite/dwp_test_1b.s: New source file.
3995 * testsuite/dwp_test_2.cc: New source file.
3996 * testsuite/dwp_test_2.s: New source file.
3997 * testsuite/dwp_test_2.sh: New source file.
3998 * testsuite/dwp_test_main.cc: New source file.
3999 * testsuite/dwp_test_main.s: New source file.
4000
77429909
CC
40012012-10-23 Cary Coutant <ccoutant@google.com>
4002
4003 * dwp.h: New header file.
4004 * dwp.cc: New source file.
4005 * gold.h: Move shared declarations to system.h.
4006 * system.h: New header file.
4007 * Makefile.am: Add dwp.
4008 * Makefile.in: Regenerate.
4009
ed5d6712
CC
40102012-10-23 Cary Coutant <ccoutant@google.com>
4011
4012 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4013 Dwarf_info_reader::read_from_pointer.
4014 (Dwarf_pubnames_table::read_header): Likewise.
4015 (Dwarf_pubnames_table::next_name): Likewise.
4016 (Dwarf_die::read_attributes): Likewise.
4017 (Dwarf_die::skip_attributes): Likewise.
4018 (Dwarf_info_reader::read_from_pointer): New function template.
4019 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4020 (Dwarf_pubnames_table): Likewise.
4021 (Dwarf_info_reader::read_from_pointer): New function template.
4022 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4023 Dwarf_pubnames_table ctor.
4024
8787852d
CC
40252012-10-23 Cary Coutant <ccoutant@google.com>
4026
4027 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4028 abbrev_shndx.
4029 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4030 abbrev_shndx_.
4031 (Dwarf_info_reader::set_abbrev_shndx): New method.
4032 (Dwarf_info_reader::abbrev_shndx_): New data member.
4033
9fc236f3
CC
40342012-10-23 Cary Coutant <ccoutant@google.com>
4035
4036 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4037 from object, not parameters.
4038 (Dwarf_info_reader::parse): Likewise.
4039 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4040 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4041 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4042 methods.
4043
effe8365
CC
40442012-10-23 Cary Coutant <ccoutant@google.com>
4045
4046 * fileread.cc (Input_file::Input_file): New constructor.
4047 * fileread.h (class Input_file): Add new constructor.
4048
1698990d
AM
40492012-10-18 Alan Modra <amodra@gmail.com>
4050
4051 PR gold/14727
4052 * object.cc (Relobj::is_section_name_included): Also match
4053 .sdata personality section.
4054
168a4726
AM
40552012-10-18 Alan Modra <amodra@gmail.com>
4056
4057 * target-reloc.h (class Default_comdat_behavior): New, package up..
4058 (get_comdat_behaviour): ..this.
4059 (relocate_section): Add Relocate_comdat_behavior template arg,
4060 adjust code to suit.
4061 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4062 (Target_arm::scan_reloc_section): Likewise.
4063 * i386.cc (Target_i386::relocate_section): Likewise.
4064 * sparc.cc (Target_sparc::relocate_section): Likewise.
4065 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4066 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4067 * powerpc.cc (class Relocate_comdat_behavior): New.
4068 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4069 gold::relocate_section with new template arg.
4070
acc276d8
AM
40712012-10-18 Alan Modra <amodra@gmail.com>
4072
4073 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4074 dynamic relocs for GOT_TPREL got entries, without symbol if
4075 resolving locally.
4076 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4077 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4078 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4079
e10f9870
AM
40802012-10-17 Alan Modra <amodra@gmail.com>
4081
4082 PR gold/14726
4083 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4084
ae034989
ST
40852012-10-16 Sriraman Tallam <tmsriram@google.com>
4086
4087 * layout.cc (Layout::include_section): Keep sections marked
4088 SHF_EXCLUDE when doing relocatable links.
4089
f3a0ed29
AM
40902012-10-16 Alan Modra <amodra@gmail.com>
4091
4092 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4093 (Target_powerpc::do_finalize_sections): Call it.
4094 (Output_data_save_res): New class and supporting functions.
4095 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4096 normal symbols defined in object files.
4097
c6de8ed4
AM
40982012-10-12 Alan Modra <amodra@gmail.com>
4099
4100 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4101 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4102 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4103 section if scan_opd_relocs not yet called.
4104 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4105
03e25981
AM
41062012-10-12 Alan Modra <amodra@gmail.com>
4107
4108 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4109 add_local_ifunc_entry): Revert last change.
4110 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4111
c9824451
AM
41122012-10-05 Alan Modra <amodra@gmail.com>
4113
4114 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4115 do_plt_address_for_global): New functions.
4116 (Output_data_got_powerpc::do_write): Don't segfault when linking
4117 statically.
4118 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4119 add_local_ifunc_entry): Return true on adding entry..
4120 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4121 glink->add_entry call. Remove unused symtab param. Adjust calls.
4122 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4123 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4124 set up symbols here.
4125 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4126 syms here. Do so even when no .iplt. Don't segfault when linking
4127 statically.
4128 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4129 new variants without reloc param.
4130 (Glink_sym_ent::Glink_sym_ent): Likewise.
4131 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4132 reloc when refs will resolve to plt call stub.
4133 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4134 R_PPC_PLTREL24 to resolve locally.
4135 (Target_powerpc::Scan::global): Correct ifunc handling.
4136 (Target_powerpc::Relocate::relocate): Correct local sym glink
4137 lookup. Don't destroy "value" when we have a plt call stub,
4138 and when checking plt call validity.
4139 (Target_powerpc::do_dynsym_value): Simplify.
4140
19fec8c1
AM
41412012-10-05 Alan Modra <amodra@gmail.com>
4142
4143 * i386.cc (Output_data_plt_i386::address_for_global,
4144 address_for_local): Add plt offset to returned value. Adjust uses.
4145 * sparc.cc (Output_data_plt_sparc::address_for_global,
4146 address_for_local): Likewise.
4147 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4148 address_for_local): Likewise.
4149 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4150 address_for_local): Likewise.
4151 * target.h (Target::plt_address_for_global, plt_address_for_local):
4152 Update comment.
4153 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4154 (Output_data_got::Got_entry::write): Nor here.
4155 * output.h: Comment fix.
4156
e867b647
WL
41572012-10-02 Jiong Wang <jiwang@tilera.com>
4158
4159 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4160 global_offset_table_ value for larget got.
4161 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4162
e5d5f5ed
AM
41632012-09-29 Alan Modra <amodra@gmail.com>
4164
4165 * powerpc.cc (Target_powerpc::iplt_): New output section.
4166 (Target_powerpc::iplt_section, make_iplt_section,
4167 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4168 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4169 Target_powerpc::plt_entry_count): Count iplt entries too.
4170 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4171 reloc section in constructor. New params.
4172 (Target_powerpc::make_plt_section): Create reloc section here instead.
4173 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4174 functions.
4175 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4176 (Output_data_glink::add_entry, find_entry): New functions to
4177 deal with local syms.
4178 (Glink_sym_ent): Add support for local syms.
4179 (Output_data_glink::do_write): Handle ifunc plt entries.
4180 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4181 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4182 (Target_powerpc::Relocate::relocate): Likewise.
4183 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4184
ec4dbad3
AM
41852012-09-25 Alan Modra <amodra@gmail.com>
4186
4187 * object.h (Sized_relobj_file::adjust_local_symbol,
4188 do_adjust_local_symbol): New functions.
4189 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4190 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4191 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4192 and irregular opd entry spacing.
4193 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4194 (Global_symbol_visitor_opd): New functor.
4195 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4196 on deleted opd entries.
4197
5c0b3823
WL
41982012-09-15 Jiong Wang <jiwang@tilera.com>
4199
4200 * tilegx.cc: New file.
4201 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4202 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4203 * configure.tgt: Add entries for tilegx*.
4204 * configure.ac: Likewise.
4205 * Makefile.in: Rebuild.
4206 * configure: Likewise.
4207 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4208 tilegx.
4209
bfdfa4cd
AM
42102012-09-13 Alan Modra <amodra@gmail.com>
4211
4212 * target-reloc.h (scan_relocs): Call scan.local for relocs
4213 against symbols in discarded sections. Pass is_discarded
4214 param.
4215 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4216 Add is_discarded param.
4217 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4218 is_discarded to flag opd entry as discarded. Don't emit dyn
4219 relocs on such entries.
4220 (Target_powerpc::Scan::global): Similarly detect and handle
4221 such opd entries.
4222 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4223 opd_ent_. Update all uses.
4224 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4225 (Target_powerpc::relocate_section): Zero out discarded opd
4226 entry relocs.
4227
d77a0555
ILT
42282012-09-12 Ian Lance Taylor <iant@google.com>
4229
4230 PR gold/14570
4231 * output.cc: Rename Output_data_got template parameter from size
4232 to got_size for all functions. Compile all variants of
4233 Output_data_got.
4234 (Output_data_got::Got_entry::write): Correct use of size for
4235 symbol value. Use local_is_tls rather than casting to
4236 Sized_relobj_file.
4237 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4238 (class Sized_relobj_file): Add do_local_is_tls.
4239 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4240
815a1205
AM
42412012-09-11 Alan Modra <amodra@gmail.com>
4242
4243 PR gold/14566
4244 * layout.cc (Layout::set_segment_offsets): When using
4245 common-page-size alignment, ensure we are on a new max-page-size
4246 page.
4247 * output.cc (Output_segment::set_section_addresses): Use
4248 abi_pagesize, not common_pagesize for relro boundary.
4249 (Output_segment::set_offset): Likewise.
4250
bd73a62d
AM
42512012-09-11 Alan Modra <amodra@gmail.com>
4252
4253 * output.h (Output_data_got::add_global_tls, add_local_tls,
4254 add_local_tls_pair): New functions.
4255 (Output_data_got::add_local_pair_with_rel): Remove second
4256 reloc param. Expand comment.
4257 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4258 use_plt_or_tls_offset_, similarly for constructor param.
4259 (Output_data_got::Got_entry::write): Add got_index param.
4260 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4261 add_local_tls_pair): New functions.
4262 (Output_data_got::Got_entry::write): Handle tls symbols
4263 with use_plt_or_tls_offset_ set specially.
4264 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4265 (Output_data_got::do_write): Replace iterator with index, pass
4266 index to entry write function.
4267 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4268 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4269 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4270 call.
4271 * i386.cc (Target_i386::Scan::local): Likewise.
4272 * sparc.cc (Target_sparc::Scan::local): Likewise.
4273 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4274 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4275 do_tls_offset_for_global): New functions.
4276 (Target_powerpc::Scan::local): Correct TLS relocations and got
4277 entry values.
4278 (Target_powerpc::Scan::global): Don't emit unnecessary
4279 dynamic relocations on TLS GOT entries.
4280
00716ab1
AM
42812012-09-10 Matthias Klose <doko@ubuntu.com>
4282
4283 * config.in: Disable sanity check for kfreebsd.
4284
c891b3f9
SA
42852012-09-10 Sterling Augustine <saugustine@google.com>
4286
4287 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4288 (Gdb_index::pubtypes_read): New parameter.
4289 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4290 to calls.
4291 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4292 pubtypes_object_.
4293
e81fea4d
AM
42942012-09-09 Alan Modra <amodra@gmail.com>
4295
4296 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4297 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4298 * gc.h (gc_process_relocs): Call target gc_add_reference.
4299 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4300 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4301 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4302 unnecessary cast.
4303 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4304 to cater for when we don't need code offset. Update use.
4305 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4306 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4307 set_opd_valid): New functions.
4308 (Target_powerpc::do_gc_add_reference): New function.
4309 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4310 stashed refs.
4311 (Target_powerpc::do_gc_mark_symbol): New function.
4312
d2d60eef
CC
43132012-09-06 Cary Coutant <ccoutant@google.com>
4314
4315 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4316 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4317 (Dwarf_die::skip_attributes): Likewise.
4318 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4319 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4320 (main): Call it.
4321 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4322
32ed4573
L
43232012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4324
4325 * testsuite/script_test_3.t: Add .got.plt output section
4326 statement.
4327 * testsuite/script_test_4.t: Likewise.
4328
f4baf0d4
AM
43292012-09-05 Alan Modra <amodra@gmail.com>
4330
4331 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4332 update all uses and lose "enum" when using type.
4333
864a1b56
AM
43342012-09-05 Alan Modra <amodra@gmail.com>
4335
4336 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4337 * configure: Regenerate.
4338 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4339 (plugin_final_layout.stdout): Likewise.
4340 (memory_test): Set page sizes to 0x1000.
4341 * testsuite/Makefile.in: Regenerate.
4342 * testsuite/discard_locals_test.sh: Add FIXME comment.
4343 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4344 * testsuite/pr14265.t: Add .got output section statement.
4345 * testsuite/script_test_2.t: Likewise.
4346 * testsuite/script_test_3.t: Likewise.
4347 * testsuite/script_test_4.t: Likewise.
4348 * testsuite/script_test_5.t: Likewise.
4349 * testsuite/script_test_6.t: Likewise.
4350 * testsuite/script_test_7.t: Likewise.
4351 * testsuite/script_test_9.t: Likewise.
4352
3ea0a085
AM
43532012-09-05 Alan Modra <amodra@gmail.com>
4354
4355 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4356 (Powerpc_relocate_functions::Status): New typedef.
4357 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4358 (Target_powerpc::Scan::local): Handle REL64.
4359 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4360 for REL32 and REL64.
4361 (Target_powerpc::symval_for_branch): New function, extracted from..
4362 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4363 checks. Report overflow errors.
4364
7404fe1b
AM
43652012-09-05 Alan Modra <amodra@gmail.com>
4366
4367 * object.h (Sized_relobj_file::emit_relocs): Delete.
4368 (Sized_relobj_file::emit_relocs_reltype): Delete.
4369 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4370 relocate_relocs for --emit-relocs.
4371 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4372 * output.h: Update comment.
4373 (Output_segment::first_section): New function.
4374 (Output_segment::first_section_load_address): Use first_section.
4375 * output.cc (Output_segment::first_section): New function extracted..
4376 (Output_segment::first_section_load_address): ..from here. Delete.
4377 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4378 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4379 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4380 adjust call to target.h function.
4381 * i386.cc (Target_i386): Likewise.
4382 * sparc.cc (Target_sparc): Likewise.
4383 * x86_64.cc (Target_x86_64): Likewise.
4384 * powerpc.cc (Target_powerpc): Likewise.
4385 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4386 first tls section has section symbol for optimised local dynamic
4387 output relocs.
4388 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4389 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4390 optimised tls code.
4391 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4392 Rename to relocate_relocs. Update error message.
4393
957564c9
AS
43942012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4395
4396 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4397 --just-symbols.
4398
dd93cd0a
AM
43992012-08-31 Alan Modra <amodra@gmail.com>
4400
4401 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4402 (Powerpc_relobj::toc_base_offset): New stub function.
4403 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4404 got_mod_index_offset to tlsld_got_offset. Update all refs.
4405 (Target_powerpc::Relocate::enum skip_tls): New.
4406 (Target_powerpc::call_tls_get_addr_): New var.
4407 (Target_powerpc::is_branch_reloc): Move to file scope.
4408 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4409 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4410 New functions.
4411 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4412 (powerpc_info): Correct common_pagesize for ppc64.
4413 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4414 (Powerpc_relocate_functions): Add overflow check enums and functions.
4415 Add non-shift version of rela, rela_ua. Delete all rel public
4416 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4417 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4418 addr16_ha3, addr14 functions.
4419 (Output_data_got_powerpc::add_constant_pair): New function.
4420 (Output_data_got_powerpc::got_base_offset): Likewise.
4421 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4422 (instruction constants): Sort, add some more.
4423 (Output_data_glink::do_write): Add and use Address typedef. Use
4424 object->toc_base_offset() stub for 64-bit.
4425 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4426 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4427 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4428 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4429 Always treat .opd relocs as against locally defined symbol.
4430 Correct condition for RELATIVE relocs.
4431 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4432 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4433 for 32-bit syms with a plt entry. Correct ppc64 toc base
4434 calculations. Handle TLS relocs, and more. Add overflow
4435 checking and adjust for Powerpc_relocate_functions changes.
4436 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4437 Reinstate --emit-relocs code with FIXME.
4438
a1373b60
AM
44392012-08-30 Alan Modra <amodra@gmail.com>
4440
4441 * layout.cc (Layout::set_segment_offsets): Set p_align to
4442 abi_pagesize, not common_pagesize.
4443 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4444 to determine whether file header can go in segment.
4445
703d02da
AM
44462012-08-30 Alan Modra <amodra@gmail.com>
4447
4448 * output.h (Output_reloc::Output_reloc <output section>): Add
4449 is_relative param. Adjust calls.
4450 (Output_reloc::add_output_section_relative): New functions.
4451 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4452 is_relative.
4453 (Output_reloc::symbol_value): Handle SECTION_CODE.
4454
16164a6b
ST
44552012-08-24 Sriraman Tallam <tmsriram@google.com>
4456
4457 * gold.cc (queue_middle_tasks): Call layout again when unique
4458 segments for sections is desired.
4459 * layout.cc (Layout::Layout): Initialize new members.
4460 (Layout::get_output_section_flags): New function.
4461 (Layout::choose_output_section): Call get_output_section_flags.
4462 (Layout::layout): Make output section for mapping to a unique segment.
4463 (Layout::insert_section_segment_map): New function.
4464 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4465 output sections marked so.
16164a6b
ST
4466 (Layout::segment_precedes): Check for unique segments when sorting.
4467 * layout.h (Layout::Unique_segment_info): New struct.
4468 (Layout::Section_segment_map): New typedef.
4469 (Layout::insert_section_segment_map): New function.
4470 (Layout::get_output_section_flags): New function.
4471 (Layout::is_unique_segment_for_sections_specified): New function.
4472 (Layout::set_unique_segment_for_sections_specified): New function.
4473 (Layout::unique_segment_for_sections_specified_): New member.
4474 (Layout::section_segment_map_): New member.
4475 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4476 Rename is_gc_pass_one to is_pass_one.
4477 Rename is_gc_pass_two to is_pass_two.
4478 Rename is_gc_or_icf to is_two_pass.
4479 Check for which pass based on whether symbols data is present.
4480 Make it two pass when unique segments for sections is desired.
4481 * output.cc (Output_section::Output_section): Initialize new
4482 members.
4483 * output.h (Output_section::is_unique_segment): New function.
4484 (Output_section::set_is_unique_segment): New function.
4485 (Output_section::is_unique_segment_): New member.
4486 (Output_section::extra_segment_flags): New function.
4487 (Output_section::set_extra_segment_flags): New function.
4488 (Output_section::extra_segment_flags_): New member.
4489 (Output_section::segment_alignment): New function.
4490 (Output_section::set_segment_alignment): New function.
4491 (Output_section::segment_alignment_): New member.
4492 (Output_segment::Output_segment): Initialize is_unique_segment_.
4493 (Output_segment::is_unique_segment): New function.
4494 (Output_segment::set_is_unique_segment): New function.
4495 (Output_segment::is_unique_segment_): New member.
4496 * plugin.cc (allow_unique_segment_for_sections): New function.
4497 (unique_segment_for_sections): New function.
4498 (Plugin::load): Add new functions to transfer vector.
4499 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4500 * Makefile.in: Regenerate.
4501 * testsuite/plugin_final_layout.sh: Check if unique segment
4502 functionality works.
4503 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4504 are available.
4505 (allow_unique_segment_for_sections): New global.
4506 (unique_segment_for_sections): New global.
4507 (claim_file_hook): Call allow_unique_segment_for_sections.
4508 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4509
1e2bee4f
CC
45102012-08-22 Cary Coutant <ccoutant@google.com>
4511
4512 * layout.cc (Layout::include_section): Don't assert on GROUP
4513 sections with --emit-relocs.
4514
1d5dfe78
CC
45152012-08-21 Cary Coutant <ccoutant@google.com>
4516
4517 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4518 if --export-dynamic-symbol names an undef symbol.
4519
c9269dff
AM
45202012-08-18 Alan Modra <amodra@gmail.com>
4521
4522 * powerpc.cc: Formatting and white space.
4523 (Powerpc_relobj): Rename got2_section_ to special_.
4524 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4525 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4526 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4527 (Target_powerpc): Add Address typedef and invalid_address. Use
4528 throughout.
4529 (Target_powerpc::is_branch_reloc): New function.
4530 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4531 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4532 for dst_mask, value and addend.
4533 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4534 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4535 (Output_data_glink::do_write): Correct toc base. Don't try to use
4536 uint16_t for 24-bit offset. Use get_output_section_offset and
4537 check return.
4538 (Target_powerpc::Scan::local): Handle more relocs.
4539 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4540 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4541 Plug in toc restoring insn after plt calls. Translate branches
4542 to function descriptor symbols to corresponding entry point.
4543 (Target_powerpc::relocate_for_relocatable): Check return from
4544 get_output_section_offset.
4545 * symtab.h: Comment typo.
4546
b1759dce
ILT
45472012-08-14 Ian Lance Taylor <iant@google.com>
4548
4549 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4550 unsupported_relocal_local to call unsupported_reloc_global.
4551
b9b2ae8b
NC
45522012-08-14 Nick Clifton <nickc@redhat.com>
4553
4554 PR ld/14265
4555 * script-sections.cc (Sections_element::output_section_name): Add
4556 keep return parameter.
4557 (Output_section_element::match_name): Add keep return parameter.
4558 Return the value of the keep_ member.
4559 * script-sections.h (class Output_section): Update
4560 output_section_name prototype.
4561 * layout.cc (Layout::keep_input_section): New public member
4562 function.
4563 (Layout::choose_output_section): Pass keep parameter to
4564 output_section_name.
4565 * layout.h (class Layout): Add keep_input_section.
4566 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4567 sections.
4568 * testsuite/Makefile.am: Add a test.
4569 * testsuite/Makefile.in: Regenerate.
4570 * testsuite/pr14265.c: Source file for the test.
4571 * testsuite/pr14265.t: Linker script for the test.
4572 * testsuite/pr14265.sh: Shell script for the test.
4573
921b5322
AM
45742012-08-14 Alan Modra <amodra@gmail.com>
4575
4576 * target.h (Target::output_section_name): New function.
4577 (Target::do_output_section_name): New function.
4578 * layout.cc (Layout::choose_output_section): Call the above.
4579 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4580
6ce78956
AM
45812012-08-14 Alan Modra <amodra@gmail.com>
4582
4583 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4584 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4585 for replace_constant call.
4586 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4587 (Output_data_glink::do_print_to_mapfile): New function.
4588 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4589 (Target_powerpc::Relocate::relocate): Likewise.
4590
d1a8cabd
AM
45912012-08-14 Alan Modra <amodra@gmail.com>
4592
4593 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4594 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4595 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4596 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4597 all references to shndx_. Handle special case for R_PPC_PLTREL24
4598 here.
4599 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4600 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4601 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4602 here.
4603 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4604 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4605
d83ce4e3
AM
46062012-08-12 Alan Modra <amodra@gmail.com>
4607
4608 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4609 (glink insn constants): Use uint32_t.
4610 (Output_data_glink::add_entry): Use insert, not [] operator.
4611
cf43a2fe
AM
46122012-08-11 Alan Modra <amodra@gmail.com>
4613
4614 * object.h (Sized_relobj_file::find_shdr): New function.
4615 (Sized_relobj_file::find_special_sections): New function.
4616 * object.cc (Sized_relobj_file::find_shdr): New function.
4617 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4618 (Sized_relobj_file::find_special_sections): New function, split out..
4619 (Sized_relobj_file::do_read_symbols): ..from here.
4620 * output.h (Output_data_got::replace_constant): New function.
4621 (Output_data_got::num_entries): New function.
4622 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4623 (Output_data_got::got_offset): Protected rather than private.
4624 (Output_data_got::replace_got_entry): New function.
4625 * output.cc (Output_data_got::replace_got_entry): New function.
4626 * powerpc.cc (class Powerpc_relobj): New.
4627 (class Powerpc_relocate_functions): Delete all psymval variants or
4628 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4629 Implement _ha functions using corresponding _hi function.
4630 (Powerpc_relobj::find_special_sections): New function.
4631 (Target_powerpc::do_make_elf_object): New function.
4632 (class Output_data_got_powerpc): New.
4633 (class Output_data_glink): New.
4634 (class Powerpc_scan_relocatable_reloc): New.
4635 Many more changes througout file.
4636
3c892704
NC
46372012-08-09 Nick Clifton <nickc@redhat.com>
4638
4639 * po/vi.po: Updated Vietnamese translation.
4640
82435b3b
ILT
46412012-08-07 Ian Lance Taylor <iant@google.com>
4642
4643 * layout.cc (Layout::add_target_dynamic_tags): If
4644 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4645 plt_rel.
4646
a6dc81d2
NC
46472012-07-30 Nick Clifton <nickc@redhat.com>
4648
4649 * po/gold.pot: Updated template.
4650 * po/es.po: Updated Spanish translation.
4651
f1415016
CC
46522012-07-18 Cary Coutant <ccoutant@google.com>
4653
4654 PR gold/14344
4655 * configure.ac: Add check for -gpubnames support.
4656 * configure: Regenerate.
4657 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4658 support; force -gno-pubnames.
4659 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4660 support.
4661 (gdb_index_test_4): New test.
4662 * testsuite/Makefile.in: Regenerate.
4663 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4664 * testsuite/gdb_index_test_2.sh: Likewise.
4665 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4666 * testsuite/gdb_index_test_4.sh: New script.
4667 * testsuite/gdb_index_test_comm.sh: New script with common code;
4668 don't look for space after colon.
4669
b7fd7c37
ST
46702012-07-16 Sriraman Tallam <tmsriram@google.com>
4671
4672 * gold.cc (queue_middle_tasks): Update function order only after
4673 deferred objects due to plugins are processed.
4674
1f3212db
ILT
46752012-07-11 Ian Lance Taylor <iant@google.com>
4676
4677 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4678 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4679 (Target_arm::scan_reloc_for_stub): Likewise.
4680 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4681 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4682 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4683 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4684 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4685
81c82a68
ILT
46862012-07-10 Dodji Seketeli <dodji@redhat.com>
4687 Ian Lance Taylor <iant@google.com>
4688
4689 PR gold/14309
4690 * configure.ac: Test whether std::tr1::hash<off_t> works.
4691 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4692 needed.
4693 * output.h (class Output_fill): Add virtual destructor.
4694 * configure, config.in: Rebuild.
4695
eabc84f4
RM
46962012-06-22 Roland McGrath <mcgrathr@google.com>
4697
4698 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4699
370e30b6
RÁE
47002012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4701
4702 * plugin.cc (Plugin::load): Handle position independent executables.
4703
fb1b895d
CC
47042012-06-06 Cary Coutant <ccoutant@google.com>
4705
4706 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4707 add .debug_macro.
4708 (lines_only_debug_sections): Likewise.
4709 (gdb_fast_lookup_sections): New static array.
4710 (is_gdb_debug_section): Rename formal parameter.
4711 (is_lines_only_debug_section): Likewise.
4712 (is_gdb_fast_lookup_section): New function.
4713 (Layout::include_section): Check for ".zdebug_" prefix; pass
4714 section name suffix to is_gdb_debug_section, et al.; check for
4715 fast-lookup sections when building .gdb_index.
4716 * options.h (--strip-debug-gdb): Update GDB version number.
4717
7c0640fa
CC
47182012-06-06 Cary Coutant <ccoutant@google.com>
4719
4720 * configure.ac: Add check for fallocate.
4721 * configure: Regenerate.
4722 * config.in: Regenerate.
4723
4724 * options.h (class General_options): Add --mmap-output-file and
4725 --posix-fallocate options.
4726 * output.cc: (posix_fallocate): Remove; replace with...
4727 (gold_fallocate): New function.
4728 (Output_file::map_no_anonymous): Call gold_fallocate.
4729 (Output_file::map): Check --mmap-output-file option.
4730
2a49eb69
DK
47312012-06-05 Jing Yu <jingyu@google.com>
4732
4733 * gold.h (textdomain): Add do {} to empty while(0).
4734 (bindtextdomain): Likewise.
4735
fad072ac
CC
47362012-06-04 Cary Coutant <ccoutant@google.com>
4737
4738 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4739 has_dynsym_index.
4740
8cc69fb6
ST
47412012-05-25 Sriraman Tallam <tmsriram@google.com>
4742
4743 * symtab.cc (Symbol_table::define_special_symbol):
4744 Initialize *poldsym to prevent uninitialized variable errors.
4745
1be75daa
CC
47462012-05-23 Cary Coutant <ccoutant@google.com>
4747
4748 * layout.cc (Layout::section_name_mapping): Add rules to handle
4749 exact match on .data.rel.ro.local or .data.rel.ro.
4750 (Layout::output_section_name): Check for exact matches.
4751
9b689de0
CC
47522012-05-23 Cary Coutant <ccoutant@google.com>
4753
4754 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4755 more carefully.
4756
b24fdbf5
CC
47572012-05-22 Cary Coutant <ccoutant@google.com>
4758
4759 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4760 object before exporting symbol.
4761
e550e1a2
L
47622012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4763
4764 * testsuite/tls_test.cc: Include "config.h" first.
4765 * testsuite/tls_test_c.c: Likewise.
4766
df7b86aa
NC
47672012-05-17 Daniel Richard G. <skunk@iskunk.org>
4768 Nick Clifton <nickc@redhat.com>
4769
4770 PR 14072
4771 * configure.in: Add check that sysdep.h has been included before
4772 any system header files.
4773 * configure: Regenerate.
4774 * config.in: Regenerate.
4775
1007b503
CC
47762012-05-14 Cary Coutant <ccoutant@google.com>
4777
4778 * layout.cc (Layout::make_output_section): Mark .tdata section
4779 as RELRO.
4780 * testsuite/relro_test.cc: Add a TLS variable.
4781
fd885f3a
L
47822012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4783
4784 PR gold/14091
4785 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4786 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4787 R_X86_64_64.
4788
80f5885c
CC
47892012-05-08 Cary Coutant <ccoutant@google.com>
4790
4791 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4792 (lines_only_debug_sections): Likewise.
4793
2e702c99
RM
47942012-05-02 Roland McGrath <mcgrathr@google.com>
4795
4796 * nacl.cc: New file.
4797 * nacl.h: New file.
4798 * Makefile.am (CCFILES, HFILES): Add them.
4799 * Makefile.in: Regenerate.
4800 * i386.cc (Output_data_plt_i386_nacl): New class.
4801 (Output_data_plt_i386_nacl_exec): New class.
4802 (Output_data_plt_i386_nacl_dyn): New class.
4803 (Target_i386_nacl): New class.
4804 (Target_selector_i386_nacl): New class.
4805 (target_selector_i386): Use it instead of Target_selector_i386.
4806 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4807 (Target_x86_64_nacl): New class.
4808 (Target_selector_x86_64_nacl): New class.
4809 (target_selector_x86_64, target_selector_x32): Use it instead of
4810 Target_selector_x86_64.
4811 * arm.cc (Output_data_plt_arm_nacl): New class.
4812 (Target_arm_nacl): New class.
4813 (Target_selector_arm_nacl): New class.
4814 (target_selector_arm, target_selector_armbe): Use it instead of
4815 Target_selector_arm.
4816
4817 * target-select.cc (select_target): Take new Input_file* and off_t
4818 arguments, pass them on to recognize method of selector.
4819 * object.cc (make_elf_sized_object): Update caller.
4820 * parameters.cc (parameters_force_valid_target): Likewise.
4821 * incremental.cc (make_sized_incremental_binary): Likewise.
4822 * target-select.h: Update decl.
4823 (Target_selector::recognize): Take new Input_file* argument,
4824 pass it on to do_recognize.
4825 (Target_selector::do_recognize): Take new Input_file* argument.
4826 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4827 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4828 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4829 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4830
4831 * target.h (Target::Target_info): New members isolate_execinstr
4832 and rosegment_gap.
4833 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4834 * arm.cc (Target_arm::arm_info): Update initializer.
4835 * i386.cc (Target_i386::i386_info): Likewise.
4836 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4837 * sparc.cc (Target_sparc::sparc_info): Likewise.
4838 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4839 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4840 * layout.cc (Layout::attach_allocated_section_to_segment):
4841 Take new const Target* argument. If target->isolate_execinstr(), act
4842 like --rosegment.
4843 (Layout::find_first_load_seg): Take new const Target* argument;
4844 if target->isolate_execinstr(), reject PF_X segments.
4845 (Layout::relaxation_loop_body): Update caller.
4846 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4847 reset file offset to zero when we hit LOAD_SEG, and then do a second
4848 loop over the segments before LOAD_SEG to reassign offsets after
4849 addresses have been determined. Handle target->rosegment_gap().
4850 (Layout::attach_section_to_segment): Take new const Target* argument;
4851 pass it to attach_allocated_section_to_segment.
4852 (Layout::make_output_section): Update caller.
4853 (Layout::attach_sections_to_segments): Take new const Target* argument;
4854 pass it to attach_section_to_segment.
4855 * gold.cc (queue_middle_tasks): Update caller.
4856 * layout.h (Layout): Update method decls with new arguments.
4857
4858 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4859 Target_info pointer to use.
4860 (Target_arm::do_make_data_plt): New virtual method.
4861 (Target_arm::make_data_plt): New method that calls it.
4862 (Target_arm::make_plt_entry): Use it.
4863 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4864 for the section alignment.
4865 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4866 method.
4867 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4868 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4869 method.
4870 (Output_data_plt_arm::get_plt_entry_size): Call it.
4871 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4872 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4873 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4874 method.
4875 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4876 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4877 method instead of sizeof(plt_entry).
4878 (Output_data_plt_arm::add_entry): Likewise.
4879 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4880 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4881 than static method.
4882 (Target_arm::plt_entry_size): Likewise.
4883 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4884 Move to ...
4885 (Output_data_plt_arm_standard): ... here, new class.
4886 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4887 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4888 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4889
4890 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4891 Take additional argument for the PLT entry size.
4892 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4893 Use get_plt_entry_size method rather than plt_entry_size variable.
4894 (Output_data_plt_x86_64::reserve_slot): Likewise.
4895 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4896 (Output_data_plt_x86_64::add_entry): Likewise.
4897 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4898 (Output_data_plt_x86_64::address_for_global): Likewise.
4899 (Output_data_plt_x86_64::address_for_local): Likewise.
4900 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4901 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4902 Make method non-static.
4903 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4904 method.
4905 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4906 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4907 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4908 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4909 virtual method.
4910 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4911 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4912 virtual method.
4913 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4914 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4915 virtual method.
4916 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4917 (Output_data_plt_x86_64::plt_entry_size)
4918 (Output_data_plt_x86_64::first_plt_entry)
4919 (Output_data_plt_x86_64::plt_entry)
4920 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4921 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4922 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4923 (Output_data_plt_x86_64_standard): ... here, new class.
4924 (Target_x86_64::Target_x86_64): Take optional argument for the
4925 Target_info pointer to use.
4926 (Target_x86_64::do_make_data_plt): New virtual method.
4927 (Target_x86_64::make_data_plt): New method to call it.
4928 (Target_x86_64::init_got_plt_for_update): Use that.
4929 Call this->plt_->add_eh_frame method here.
4930 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4931 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4932 rather than static method.
4933 (Target_x86_64::plt_entry_size): Likewise.
4934 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4935 rather than plt_entry_size variable. Move guts of PLT filling to...
4936 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4937 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4938 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4939
4940 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4941 additional argument for the section alignment.
4942 Don't do add_eh_frame_for_plt here.
4943 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4944 non-static. Use get_plt_entry_size method rather than plt_entry_size
4945 variable.
4946 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4947 method.
4948 (Output_data_plt_i386::get_plt_entry_size): Call it.
4949 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4950 (Output_data_plt_i386::add_eh_frame): New method to call it.
4951 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4952 method.
4953 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4954 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4955 method.
4956 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4957 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4958 method instead of plt_entry_size.
4959 (Output_data_plt_i386::plt_entry_size)
4960 (Output_data_plt_i386::plt_eh_frame_fde_size)
4961 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4962 (Output_data_plt_i386_standard): ... here, new class.
4963 (Output_data_plt_i386_exec): New class.
4964 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4965 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4966 (Output_data_plt_i386::exec_plt_entry): Move to ...
4967 (Output_data_plt_i386_exec::plt_entry): ... here.
4968 (Output_data_plt_i386_dyn): New class.
4969 (Output_data_plt_i386::first_plt_entry): Move to ...
4970 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4971 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4972 (Output_data_plt_i386_dyn::plt_entry): ... here.
4973 (Target_i386::Target_i386): Take optional argument for the Target_info
4974 pointer to use.
4975 (Target_i386::do_make_data_plt): New virtual method.
4976 (Target_i386::make_data_plt): New method to call it.
4977 (Target_i386::make_plt_section): Use that.
4978 Call this->plt_->add_eh_frame method here.
4979 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4980 rather than plt_entry_size variable.
4981 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4982 (Output_data_plt_i386::address_for_local): Likewise.
4983 (Output_data_plt_i386::do_write): Likewise.
4984 Move guts of PLT filling to...
4985 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4986 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4987 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4988 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4989
b9b9f2ee
CC
49902012-05-01 Cary Coutant <ccoutant@google.com>
4991
4992 * dwarf_reader.cc (Dwarf_die::read_attributes)
4993 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4994 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4995 * reduced_debug_output.cc
4996 (Output_reduced_debug_info_section::get_die_end): Remove
4997 DW_FORM_GNU_ref_index. Add default case.
4998
57923f48
MW
49992012-04-26 Mark Wielaard <mjw@redhat.com>
5000
5001 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5002 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5003 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5004 DW_AT_high_pc as offset from DW_AT_low_pc.
5005
5006 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5007 * testsuite/Makefile.in: Regenerate.
5008 * testsuite/gdb_index_test_3.c: New test source file.
5009 * testsuite/gdb_index_test_3.sh: New test source file.
5010
2c54b4f4
ILT
50112012-04-25 Ian Lance Taylor <iant@google.com>
5012
5013 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5014 pointer.
5015 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5016 as a class, not a struct.
5017 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5018 (Target_arm::apply_cortex_a8_workaround): Likewise.
5019 * gc.h: Declare Reloc_types as a struct, not a class.
5020 * object.h: Declare Symbols_data as a struct.
5021 * reloc.h: Declare Read_relocs_data as a struct.
5022 * target.h: Declare Relocate_info as a struct.
5023
a5a5f7a3
DM
50242012-04-24 David S. Miller <davem@davemloft.net>
5025
5026 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5027 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5028 and R_SPARC_WPLT30.
5029
f038d496
CC
50302012-04-24 Cary Coutant <ccoutant@google.com>
5031
5032 * incremental-dump.cc (find_input_containing_global): Replace
5033 magic number with symbolic constant.
5034 (dump_incremental_inputs): Update version number.
5035 * incremental.cc (Output_section_incremental_inputs): Update version
5036 number; import symbolic constants from Incremental_inputs_reader.
5037 (Incremental_inputs::create_data_sections): Align relocations
5038 section correctly for 64-bit targets.
5039 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5040 constants; add padding.
5041 (Output_section_incremental_inputs::write_header): Add assert for
5042 header_size.
5043 (Output_section_incremental_inputs::write_input_files): Add assert
5044 for input_entry_size.
5045 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5046 add assert for object_info_size, input_section_entry_size,
5047 global_sym_entry_size.
5048 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5049 for data structure sizes; use them.
5050 (Incremental_input_entry_reader): Import symbolic constants from
5051 Incremental_inputs_reader; use them.
5052
a4d85145
DM
50532012-04-23 David S. Miller <davem@davemloft.net>
5054
5055 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5056 and elf_flags_set_.
5057 (Target_sparc::Target_sparc): Initialize new fields.
5058 (Target_sparc::do_make_elf_object): New function.
5059 (Target_sparc::do_adjust_elf_header): New function.
5060
1d509098
CC
50612012-04-23 Cary Coutant <ccoutant@google.com>
5062
5063 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5064 CU range table of gdb index.
5065
7ebeff7f
DM
50662012-04-20 David S. Miller <davem@davemloft.net>
5067
5068 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5069 instead of false.
5070
13cf9988
DM
50712012-04-16 David S. Miller <davem@davemloft.net>
5072
2a1079e8
DM
5073 * sparc.cc (Target_sparc::got_address): New function.
5074 (Sparc_relocate_functions::gdop_hix22): New function.
5075 (Sparc_relocate_functions::gdop_lox10): New function.
5076 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5077 relocs.
5078 (Target_sparc::Scan::local): Likewise if the global symbol is not
5079 preemptible and is not IFUNC.
5080 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5081 transformations for local and non-preemptible non-IFUNC global
5082 symbols.
5083
0bc964fc
DM
5084 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5085 writing out 64-bit part of ranges.
5086
661d7a80
DM
5087 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5088 -fpic and -fpie respectively.
5089 * Makefile.in: Regenerate.
5090
8c2bf391
DM
5091 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5092 (Target_sparc::Target_sparc): Initialize new field.
5093 (Target_sparc::do_plt_section_for_global): New function.
5094 (Target_sparc::do_plt_section_for_local): New function.
5095 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5096 (Target_sparc::make_plt_section): New function, broken out of
5097 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5098 (Target_sparc::make_plt_entry): Call make_plt_section.
5099 (Target_sparc::make_local_ifunc_plt_entry): New function.
5100 (Target_sparc::rela_ifunc_section): New function.
5101 (Target_sparc::plt_section): Remove const.
5102 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5103 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5104 and ifunc_count_ fields.
5105 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5106 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5107 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5108 (Output_data_plt_sparc::rela_ifunc): New function.
5109 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5110 (Output_data_plt_sparc::has_ifunc_section): New function.
5111 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5112 (Output_data_plt_sparc::address_for_global): New function.
5113 (Output_data_plt_sparc::address_for_local): New function.
5114 (Output_data_plt_sparc::plt_index_to_offset): New function.
5115 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5116 and entry_count.
5117 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5118 entry_count.
5119 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5120 R_SPARC_JMP_IREL to switch.
5121 (Target_sparc::Scan::check_non_pic): Likewise.
5122 (Target_sparc::Scan::local): Handle IFUNC symbols.
5123 (Target_sparc::Scan::local): Likewise.
5124 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5125 and plt_address_for_local.
5126 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5127 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5128
13cf9988
DM
5129 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5130 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5131 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5132 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5133 global relocs too.
5134 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5135 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5136 calls.
5137 * sparc.cc (Target_sparc::Scan::global): Likewise.
5138 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5139
31821be0
CC
51402012-04-16 Cary Coutant <ccoutant@google.com>
5141
5142 * archive.cc (Library_base::should_include_member): Check for
5143 --export-dynamic-symbol.
5144 * options.h (class General_options): Add --export-dynamic-symbol.
5145 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5146 --export-dynamic-symbol.
5147 (Symbol_table::gc_mark_undef_symbols): Likewise.
5148 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5149
2615994e
DM
51502012-04-12 David S. Miller <davem@davemloft.net>
5151
5152 * sparc.cc (Reloc::wdisp10): New relocation method.
5153 (Reloc::h34): Likewise.
5154 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5155 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5156 R_SPARC_WDISP10.
5157 (Target_sparc::Scan::local): Likewise.
5158 (Target_sparc::Scan::global): Likewise.
5159 (Target_sparc::Relocate::relocate): Likewise.
5160
6782735d
CC
51612012-04-09 Cary Coutant <ccoutant@google.com>
5162
5163 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5164 low_pc == 0.
5165
8c7a0b00
ILT
51662012-04-06 Ian Lance Taylor <iant@google.com>
5167
5168 * timer.cc: #include <unistd.h>.
5169
58797674
RM
51702012-04-06 Roland McGrath <mcgrathr@google.com>
5171
5172 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5173 * config.in: Regenerate.
5174 * configure: Regenerate.
5175
44350750
NC
51762012-04-05 Nick Clifton <nickc@redhat.com>
5177
5178 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5179 (AM_LC_MESSAGES): Add.
5180 * aclocal.m4: Regenerate.
5181 * config.in: Regenerate.
5182 * configure: Regenerate.
5183
c1027032
CC
51842012-03-21 Cary Coutant <ccoutant@google.com>
5185
5186 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5187 * Makefile.in: Regenerate.
5188 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5189 (Sized_elf_reloc_mapper::symbol_section): New function.
5190 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5191 (make_elf_reloc_mapper): New function.
5192 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5193 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5194 (Dwarf_abbrev_table::do_get_abbrev): New function.
5195 (Dwarf_ranges_table::read_ranges_table): New function.
5196 (Dwarf_ranges_table::read_range_list): New function.
5197 (Dwarf_pubnames_table::read_section): New function.
5198 (Dwarf_pubnames_table::read_header): New function.
5199 (Dwarf_pubnames_table::next_name): New function.
5200 (Dwarf_die::Dwarf_die): New function.
5201 (Dwarf_die::read_attributes): New function.
5202 (Dwarf_die::skip_attributes): New function.
5203 (Dwarf_die::set_name): New function.
5204 (Dwarf_die::set_linkage_name): New function.
5205 (Dwarf_die::attribute): New function.
5206 (Dwarf_die::string_attribute): New function.
5207 (Dwarf_die::int_attribute): New function.
5208 (Dwarf_die::uint_attribute): New function.
5209 (Dwarf_die::ref_attribute): New function.
5210 (Dwarf_die::child_offset): New function.
5211 (Dwarf_die::sibling_offset): New function.
5212 (Dwarf_info_reader::check_buffer): New function.
5213 (Dwarf_info_reader::parse): New function.
5214 (Dwarf_info_reader::do_parse): New function.
5215 (Dwarf_info_reader::do_read_string_table): New function.
5216 (Dwarf_info_reader::lookup_reloc): New function.
5217 (Dwarf_info_reader::get_string): New function.
5218 (Dwarf_info_reader::visit_compilation_unit): New function.
5219 (Dwarf_info_reader::visit_type_unit): New function.
5220 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5221 Sized_elf_reloc_mapper.
5222 (Sized_dwarf_line_info::symbol_section): Remove function.
5223 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5224 (Sized_dwarf_line_info::read_line_mappings): Remove object
5225 parameter, adjust callers.
5226 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5227 * dwarf_reader.h: Include <sys/types.h>.
5228 (class Track_relocs): Remove forward declaration.
5229 (class Elf_reloc_mapper): New class.
5230 (class Sized_elf_reloc_mapper): New class.
5231 (class Dwarf_abbrev_table): New class.
5232 (class Dwarf_range_list): New class.
5233 (class Dwarf_ranges_table): New class.
5234 (class Dwarf_pubnames_table): New class.
5235 (class Dwarf_die): New class.
5236 (class Dwarf_info_reader): New class.
5237 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5238 (Sized_dwarf_line_info::symbol_section): Remove member function.
5239 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5240 base class.
5241 * gdb-index.cc: New source file.
5242 * gdb-index.h: New source file.
5243 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5244 and .debug_types sections, call Layout::add_to_gdb_index.
5245 (Sized_relobj_incr::do_section_name): Implement.
5246 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5247 return type; Implement.
5248 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5249 return type.
5250 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5251 parameter list and return type.
5252 (Sized_incr_dynobj::do_section_contents): Likewise.
5253 * layout.cc: Include gdb-index.h.
5254 (Layout::Layout): Initialize gdb_index_data_.
5255 (Layout::init_fixed_output_section): Check for .gdb_index section.
5256 (Layout::add_to_gdb_index): New function. Instantiate.
5257 * layout.h: Add forward declaration for class Gdb_index.
5258 (Layout::add_to_gdb_index): New member function.
5259 (Layout::gdb_index_data_): New data member.
5260 * main.cc: Include gdb-index.h.
5261 (main): Print statistics for gdb index.
5262 * object.cc (Object::section_contents): Move code into
5263 do_section_contents.
5264 (need_decompressed_section): Check for sections needed when building
5265 gdb index.
5266 (build_compressed_section_map): Likewise.
5267 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5268 gdb index.
5269 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5270 sections; call Layout::add_to_gdb_index.
5271 (Sized_relobj_file::do_decompressed_section_contents): Call
5272 do_section_contents directly.
5273 * object.h (Object::do_section_contents): Adjust parameter list and
5274 return type.
5275 (Object::do_decompressed_section_contents): Call do_section_contents
5276 directly.
5277 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5278 return type.
5279 * options.h (class General_options): Add --gdb-index option.
5280 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5281 list and return type.
5282 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5283 * reloc.h (Track_relocs::checkpoint): New function.
5284 (Track_relocs::reset): New function.
5285
5286 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5287 New test cases.
5288 * testsuite/Makefile.in: Regenerate.
5289 * testsuite/gdb_index_test.cc: New test source file.
5290 * testsuite/gdb_index_test_1.sh: New test source file.
5291 * testsuite/gdb_index_test_2.sh: New test source file.
5292
647f1574
DK
52932012-03-19 Doug Kwan <dougkwan@google.com>
5294
5295 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5296 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5297 __exidx_start and __exidx_end. Make symbol table parameter
5298 anonymous as it is not used.
5299 * gold.cc (queue_middle_tasks): Call target hook to define any
5300 target-specific symbols.
5301 * target.h (Target::define_standard_symbols): New method.
5302 (Target::do_define_standard_symbols): Same.
5303 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5304 * testsuite/Makefile.in: Regenerate.
5305 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5306 and __exidx_end.
5307 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5308 relocations are generated for __exidx_start and __exidx_end.
5309
7c6109da
DK
53102012-03-16 Doug Kwan <dougkwan@google.com>
5311
5312 * testsuite/Makefile.am: Disable test initpri3b.
5313 * testsuite/Makefile.in: Regenerate.
5314
7b8957f8
DK
53152012-03-15 Doug Kwan <dougkwan@google.com>
5316
5317 * arm.cc (Target_arm::got_section): Make .got section read-only
5318 if -z now is given.
5319
14dc9ef7
ILT
53202012-03-15 Ian Lance Taylor <iant@google.com>
5321
5322 PR gold/13850
5323 * layout.cc (Layout::make_output_section): Correctly mark
5324 SHT_INIT_ARRAY, et. al., as relro.
5325
fa40b62a
DK
53262012-03-14 Doug Kwan <dougkwan@google.com>
5327
5328 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5329 dynamic relocations for protected symbols in shared objects.
5330
fd325007
ILT
53312012-03-13 Ian Lance Taylor <iant@google.com>
5332
5333 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5334 keep the larger alignment.
5335
e8dd54e1
CC
53362012-03-12 Cary Coutant <ccoutant@google.com>
5337
5338 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5339 handling of DW_LNE_define_file.
5340
feb5f3b0
CC
53412012-03-12 Cary Coutant <ccoutant@google.com>
5342
5343 * reduced_debug_output.cc
5344 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5345 codes to switch.
5346
a1fb4256
CC
53472012-02-29 Cary Coutant <ccoutant@google.com>
5348
5349 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5350
5dd8762a
CC
53512012-02-29 Cary Coutant <ccoutant@google.com>
5352
5353 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5354 Call Object::decompressed_section_contents.
5355 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5356 New dtor.
5357 (Sized_dwarf_line_info::buffer_start_): New data member.
5358 * merge.cc (Output_merge_data::do_add_input_section): Call
5359 Object::decompressed_section_contents.
5360 (Output_merge_string::do_add_input_section): Likewise.
5361 * object.cc (need_decompressed_section): New function.
5362 (build_compressed_section_map): Decompress sections needed later.
5363 (Sized_relobj_file::do_decompressed_section_contents): New function.
5364 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5365 * object.h (Object::decompressed_section_contents): New function.
5366 (Object::discard_decompressed_sections): New function.
5367 (Object::do_decompressed_section_contents): New function.
5368 (Object::do_discard_decompressed_sections): New function.
5369 (Compressed_section_info): New type.
5370 (Compressed_section_map): Include decompressed section contents.
5371 (Sized_relobj_file::do_decompressed_section_contents): New function.
5372 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5373
7b5de7ee
CC
53742012-02-16 Cary Coutant <ccoutant@google.com>
5375
5376 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5377 * testsuite/Makefile.in: Regenerate.
5378
f9fa4a63
CC
53792012-02-14 Cary Coutant <ccoutant@google.com>
5380
5381 * options.cc (General_options::finalize): Disallow -pie and -static.
5382
2c175ebc
DK
53832012-02-03 Doug Kwan <dougkwan@google.com>
5384
5385 * arm.cc (Arm_relocate_functions::abs8,
5386 Arm_relocate_functions::abs16): Use
5387 Bits::has_signed_unsigned_overflow32.
5388 (Arm_relocate_functions::thm_abs8): Correct range of
5389 overflow check.
5390 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5391 in assertions.
5392
90cff06f
DK
53932012-02-02 Doug Kwan <dougkwan@google.com>
5394
5395 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5396 position independent outputs, not just shared objects.
5397
63887f3d
L
53982012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5399
5400 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5401 * configure: Regenerated.
5402
bef2b434
ILT
54032012-01-27 Ian Lance Taylor <iant@google.com>
5404
5405 * reloc.h (Bits): New class with static functions, copied from
5406 namespace utils in arm.cc.
5407 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5408 instead.
5409
c335b55d
L
54102012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5411
5412 * incremental.cc (write_info_blocks): Correct relocation offset.
5413
41194d9f
L
54142012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5415
5416 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5417 (Relocate::tls_gd_to_le): Likewise.
5418
1bae613c
L
54192012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5420
5421 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5422
24482ca0
L
54232012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5424
5425 * configure.ac: Check if -mcmodel=medium works.
5426 * configure: Regenerated.
5427
c2c7840a
CC
54282012-01-24 Cary Coutant <ccoutant@google.com>
5429
5430 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5431 definition and ...
5432 (read_unsigned_LEB_128_x): ... this new function.
5433 (read_signed_LEB_128): Replaced with inline definition and ...
5434 (read_signed_LEB_128_x): ... this new function.
5435 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5436 (read_unsigned_LEB_128): Add inline definition.
5437 (read_signed_LEB_128_x): New function.
5438 (read_signed_LEB_128): Add inline definition.
5439 * testsuite/Makefile.am (leb128_unittest): New unit test.
5440 * testsuite/Makefile.in: Regenerate.
5441 * testsuite/leb128_unittest.cc: New unit test.
5442
833de760 54432012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5444
5445 PR gold/13617
5446 * i386.cc (Target_i386::do_code_fill): When using a jmp
5447 instruction, pad with nop instructions.
5448 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5449
618d6666
L
54502012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5451
5452 * x86_64.cc (gc_process_relocs): Add typename on types used in
5453 template.
5454 (scan_relocs): Likewise.
5455 (relocate_section): Likewise.
5456 (apply_relocation): Likewise.
5457
3660ff06
L
54582012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5459
5460 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5461 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5462 under x32.
5463
fc51264f
L
54642012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5465
5466 * x86_64.cc: Initial support for x32.
5467
dd74ae06
CC
54682012-01-03 Cary Coutant <ccoutant@google.com>
5469
5470 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5471 Use abstract base class for GOT.
5472 * gold/output.h (class Output_data_got_base): New abstract base class.
5473 (class Output_data_got): Derive from new base class, adjust ctors.
5474 (Output_data_got::reserve_slot): Make virtual; rename to
5475 do_reserve_slot; Adjust callers.
5476 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5477 pointer to abstract base class.
5478 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5479
83896202
ILT
54802011-12-18 Ian Lance Taylor <iant@google.com>
5481
5482 * object.h (Relobj::local_symbol_value): New function.
5483 (Relobj::local_plt_offset): New function.
5484 (Relobj::local_has_got_offset): New function.
5485 (Relobj::local_got_offset): New function.
5486 (Relobj::set_local_got_offset): New function.
5487 (Relobj::do_local_symbol_value): New pure virtual function.
5488 (Relobj::do_local_plt_offset): Likewise.
5489 (Relobj::do_local_has_got_offset): Likewise.
5490 (Relobj::do_local_got_offset): Likewise.
5491 (Relobj::do_set_local_got_offset): Likewise.
5492 (Sized_relobj::do_local_has_got_offset): Rename from
5493 local_has_got_offset.
5494 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5495 (Sized_relobj::do_set_local_got_offset): Rename from
5496 set_local_got_offset.
5497 (Sized_relobj_file::do_local_plt_offset): Rename from
5498 local_plt_offset.
5499 (Sized_relobj_file::do_local_symbol_value): New function.
5500 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5501 local_plt_offset.
5502 * output.cc (Output_data_got::Got_entry::write): Change object to
5503 Relobj. Use local_symbol_value.
5504 (Output_data_got::add_global_with_rel): Change rel_dyn to
5505 Output_data_reloc_generic*. Use add_global_generic.
5506 (Output_data_got::add_global_with_rela): Remove. Change all
5507 callers to use add_global_with_rel.
5508 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5509 Output_data_reloc_generic*. Use add_global_generic.
5510 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5511 callers to use add_global_pair_with_rel.
5512 (Output_data_got::add_local): Change object to Relobj*.
5513 (Output_data_got::add_local_plt): Likewise.
5514 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5515 change rel_dyn to Output_data_reloc_generic*. Use
5516 add_local_generic.
5517 (Output_data_got::add_local_with_rela): Remove. Change all
5518 callers to use all_local_with_rel.
5519 (Output_data_got::add_local_pair_with_rel): Change object to
5520 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5521 add_output_section_generic.
5522 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5523 callers to use add_local_pair_with_rel.
5524 (Output_data_got::reserve_local): Change object to Relobj*.
5525 * output.h: (class Output_data_reloc_generic): Add pure virtual
5526 declarations for add_global_generic, add_local_generic,
5527 add_output_section_generic.
5528 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5529 functions for Output_data_reloc_generic. Update declarations for
5530 changes listed in output.cc.
5531 (class Output_data_got): Change template parameter to got_size.
5532 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5533 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5534 function.
5535 (Sized_relobj_incr::do_local_plt_offset): New function.
5536 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5537 add_global_generic.
5538
76677ad0
CC
55392011-12-17 Cary Coutant <ccoutant@google.com>
5540
5541 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5542 * resolve.cc (Symbol_table::resolve): Likewise.
5543 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5544 arrays.
5545 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5546
8b8dd8d5
ILT
55472011-12-16 Ian Lance Taylor <iant@google.com>
5548
5549 * output.h (Output_data_reloc_generic::add): Only call
5550 add_dynamic_reloc if this is a dynamic reloc section.
5551
d55525b9
L
55522011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5553
5554 PR gold/13505
5555 * target-reloc.h (apply_relocation): Replace <64, false> with
5556 <size, big_endian>.
5557
ff81c7c1
NC
55582011-11-25 Nick Clifton <nickc@redhat.com>
5559
5560 * po/it.po: New Italian translation.
5561
628f39be
SA
55622011-11-17 Sterling Augustine <saugustine@google.com>
5563
5564 * script.cc (script_include_directive): Implement.
5565 (read_script_file): New local variables name and search_path. Update
5566 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5567 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5568 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5569
98ef3ea4
SA
55702011-11-11 Sterling Augustine <saugustine@google.com>
5571
5572 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5573 (file_or_sections_cmd): Likewise.
5574
f4a8b6d7
DK
55752011-11-11 Doug Kwan <dougkwan@google.com>
5576
5577 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5578 if --just-symbols is given.
5579
29ab395d
DK
55802011-11-10 Doug Kwan <dougkwan@google.com>
5581
5582 PR gold/13362
5583 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5584 when processing data relocs.
5585 * reloc.h (Relocate_functions::rel_unaligned): New method.
5586 (Relocate_functions::pcrel_unaligned): Ditto.
5587 (Relocate_functions::rel32_unaligned): Ditto.
5588 (Relocate_functions::pcrel32_unaligned): Ditto.
5589
2c339f71
DK
55902011-11-09 Doug Kwan <dougkwan@google.com>
5591
5592 PR gold/13362
5593 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5594 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5595 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5596 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5597 (Relocate_functions::rel_unaligned): New.
5598 (Relocate_functions::rel32_unaligned): New.
5599 * target-reloc.h (relocate_for_relocatable): Add code to handle
5600 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5601 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5602 arm_unaligned_reloc_r): New targets.
5603 * testsuite/Makefile.in: Regenerate.
5604 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5605 linking.
5606
3f3cddf1
ILT
56072011-11-02 Ian Lance Taylor <iant@google.com>
5608
5609 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5610 NATIVE_LINKER.
5611 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5612 * options.cc (General_options::finalize): Use library search path
5613 from configure script if specified. If not native and no sysroot,
5614 only search TOOLLIBDIR.
5615 * options.h (Search_directory::Search_directory): Change name to
5616 const std::string&.
5617 (General_options::add_to_library_path_with_sysroot): Change arg to
5618 const std::string&.
5619 * configure, Makefile.in, config.in: Rebuild.
5620
a8e2273b
ILT
56212011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5622
5623 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5624 we are working around the ARM1176 Erratum.
5625 * options.h (General_options::fix_arm1176): Add option.
5626 * testsuite/Makefile.am: Add testcases, and keep current ones
5627 working.
5628 * testsuite/Makefile.in: Regenerate.
5629 * testsuite/arm_fix_1176.s: New file.
5630 * testsuite/arm_fix_1176.sh: Likewise.
5631
cd6eab1c
ILT
56322011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5633
5634 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5635 may_use_blx_.
5636 (Target_arm::may_use_blx): Remove method.
5637 (Target_arm::set_may_use_blx): Likewise.
5638 (Target_arm::may_use_v4t_interworking): New method.
5639 (Target_arm::may_use_v5t_interworking): Likewise.
5640 (Target_arm::may_use_blx_): Remove member variable.
5641 (Arm_relocate_functions::arm_branch_common): Check for v5T
5642 interworking.
5643 (Arm_relocate_functions::thumb_branch_common): Likewise.
5644 (Reloc_stub::stub_type_for_reloc): Likewise.
5645 (Target_arm::do_finalize_sections): Correct interworking checks.
5646 * testsuite/Makefile.am: Add new tests.
5647 * testsuite/Makefile.in: Regenerate.
5648 * testsuite/arm_farcall_arm_arm.s: New test.
5649 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5650 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5651 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5652 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5653 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5654 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5655 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5656
286adcf4
CC
56572011-10-31 Cary Coutant <ccoutant@google.com>
5658
5659 PR gold/13023
5660 * expression.cc (Expression::eval_with_dot): Add
5661 is_section_dot_assignment parameter.
5662 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5663 absolute and assigning to dot within a section.
5664 * script-sections.cc
5665 (Output_section_element_assignment::set_section_addresses): Pass
5666 dot_section to set_if_absolute.
5667 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5668 as is_section_dot_assignment flag to eval_with_dot.
5669 (Output_section_element_dot_assignment::set_section_addresses):
5670 Likewise.
5671 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5672 parameter. Also set value if relative to dot_section; set the
5673 symbol's output_section.
5674 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5675 parameter. Adjust all callers.
5676 (Expression::eval_maybe_dot): Likewise.
5677 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5678 Adjust all callers.
5679 * testsuite/script_test_2.t: Test assignment of an absolute value
5680 to dot within an output section element.
5681
9634ed06
CC
56822011-10-31 Cary Coutant <ccoutant@google.com>
5683
5684 * options.h (class General_options): Add --[no-]gnu-unique options.
5685 * symtab.cc (Symbol_table::sized_write_globals): Convert
5686 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5687
de4101c7
CC
56882011-10-31 Cary Coutant <ccoutant@google.com>
5689
5690 PR gold/13359
5691 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5692 unnecessary assertion.
5693 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5694
7257cc92
ST
56952011-10-31 Sriraman Tallam <tmsriram@google.com>
5696
5697 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5698 gc_mark_symbol.
5699 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5700 gc_mark_symbol.
5701 Change to just keep the section associated with symbol.
5702 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5703 they are externally visible and --export-dynamic is turned on.
5704 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5705
bfc34b3f
ILT
57062011-10-19 Ian Lance Taylor <iant@google.com>
5707
5708 PR gold/13163
5709 * script-sections.cc
5710 (Output_section_element_dot_assignment::needs_output_section): New
5711 function.
5712
ea0d8c47
ILT
57132011-10-19 Ian Lance Taylor <iant@google.com>
5714
5715 PR gold/13204
5716 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5717 --section-start option was seen.
5718 * options.h (General_options::any_section_start): New function.
5719
abd242a9
DM
57202011-10-18 David S. Miller <davem@davemloft.net>
5721
5722 PR binutils/13301
5723 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5724 member to track relocation locations that have moved during TLS
5725 reloc optimizations.
5726 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5727 (Target_sparc::Relocate::relocate): Adjust view down by 4
5728 bytes if it matches reloc_adjust_addr_.
5729 (Target_sparc::Relocate::relocate_tls): Always move the
5730 __tls_get_addr call delay slot instruction forward 4 bytes when
5731 performing relaxation.
5732
bab9090f
CC
57332011-10-18 Cary Coutant <ccoutant@google.com>
5734
5735 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5736 (Output_file::map_no_anonymous): Check for non-zero
5737 return code from posix_fallocate.
5738
f7c5b166
CC
57392011-10-17 Cary Coutant <ccoutant@google.com>
5740
5741 PR gold/13245
5742 * plugin.cc (is_visible_from_outside): Check for symbols
5743 referenced from dynamic objects.
5744 * resolve.cc (Symbol_table::resolve): Don't count references
5745 from dynamic objects as references from real ELF files.
5746 * testsuite/plugin_test_2.sh: Adjust expected result.
5747
b490c0bb
CC
57482011-10-17 Cary Coutant <ccoutant@google.com>
5749
5750 * gold.cc: Include timer.h.
5751 (queue_middle_tasks): Stamp time.
5752 (queue_final_tasks): Likewise.
5753 * main.cc (main): Store timer in parameters. Print timers
5754 for each pass.
5755 * parameters.cc (Parameters::Parameters): Initialize timer_.
5756 (Parameters::set_timer): New function.
5757 (set_parameters_timer): New function.
5758 * parameters.h (Parameters::set_timer): New function.
5759 (Parameters::timer): New function.
5760 (Parameters::timer_): New data member.
5761 (set_parameters_timer): New function.
5762 * timer.cc (Timer::stamp): New function.
5763 (Timer::get_pass_time): New function.
5764 * timer.h (Timer::stamp): New function.
5765 (Timer::get_pass_time): New function.
5766 (Timer::pass_times_): New data member.
5767
f475cf7b
CC
57682011-10-17 Cary Coutant <ccoutant@google.com>
5769
5770 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5771 task for members of lib groups.
5772
cdd7e244
CC
57732011-10-17 Cary Coutant <ccoutant@google.com>
5774
5775 PR gold/13288
4f95c8b4 5776 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5777 (File_read::make_view): Move bounds check (replace with assert)...
5778 (File_read::find_or_make_view): ... to here.
5779
dfb45471
CC
57802011-10-12 Cary Coutant <ccoutant@google.com>
5781
4f95c8b4 5782 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5783 ::read returns less than requested size.
5784
53bbcc1b
CC
57852011-10-10 Cary Coutant <ccoutant@google.com>
5786
4f95c8b4 5787 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5788 Initialize defined_count_.
5789 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5790 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5791 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5792 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5793 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5794 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5795 member.
5796 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5797 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5798 Return zeroes instead of internal error.
5799
397b129b
CC
58002011-10-10 Cary Coutant <ccoutant@google.com>
5801
5802 PR gold/13249
4f95c8b4 5803 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5804 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5805 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5806 (Output_reloc::type_): Adjust size of bit field.
5807 (Output_reloc::use_plt_offset_): New bit field.
5808 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5809 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5810 flag. Adjust all callers.
4f95c8b4 5811 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5812 creating RELATIVE relocations.
5813
d5698657
NC
58142011-10-10 Nick Clifton <nickc@redhat.com>
5815
5816 * po/es.po: Updated Spanish translation.
5817 * po/fi.po: Updated Finnish translation.
5818
6a59a5c2
DN
58192011-10-03 Diego Novillo <dnovillo@google.com>
5820
5821 * options.cc (parse_uint): Fix dereference of RETVAL.
5822
f0558624
ST
58232011-09-29 Sriraman Tallam <tmsriram@google.com>
5824
5825 * layout.h (section_order_map_): New member.
5826 (get_section_order_map): New member function.
5827 * output.cc (Output_section::add_input_section): Check for patterns
5828 only when --section-ordering-file is specified.
5829 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5830 output_sections have been formed.
5831 * layout.cc (Layout_Layout): Initialize section_order_map_.
5832 * plugin.cc (update_section_order): Store order in order_map. Do not
5833 update the order.
5834 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5835 * testsuite/Makefile.in: Regenerate.
5836 * testsuite/plugin_section_order.c: New file.
5837 * testsuite/plugin_final_layout.cc: New file.
5838 * testsuite/plugin_final_layout.sh: New file.
5839
a7dac153
CC
58402011-09-29 Cary Coutant <ccoutant@google.com>
5841
4f95c8b4 5842 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5843 Check for NULL.
4f95c8b4 5844 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5845 symbols during incremental update.
5846 (Symbol_table::add_from_dynobj): Likewise.
5847
eebd87a5
ILT
58482011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5849 Ian Lance Taylor <iant@google.com>
5850
5851 * symtab.cc (Symbol_table::define_special_symbol): Always
5852 canonicalize version string.
5853
403a3331
CC
58542011-09-26 Cary Coutant <ccoutant@google.com>
5855
4f95c8b4
CC
5856 * gold.cc (queue_initial_tasks): Move option checks ...
5857 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5858 some options; make others fatal.
5859
235061c2
CC
58602011-09-26 Cary Coutant <ccoutant@google.com>
5861
5862 gcc PR lto/47247
5863 * plugin.cc (get_symbols_v2): New function.
5864 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5865 (is_referenced_from_outside): New function.
5866 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5867 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5868 (get_symbols): Pass version parameter.
5869 (get_symbols_v2): New function.
5870 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5871 parameter.
5872 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5873 (onload): Add LDPT_GET_SYMBOLS_V2.
5874 (all_symbols_read_hook): Use get_symbols_v2; check for
5875 LDPR_PREVAILING_DEF_IRONLY_EXP.
5876 * testsuite/plugin_test_3.sh: Update expected results.
5877
dc87f620
ILT
58782011-09-23 Simon Baldwin <simonb@google.com>
5879
5880 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5881 configuration options.
5882 * configure: Regenerate.
5883 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5884 * Makefile.in: Regenerate.
5885 * testsuite/Makefile.in: Regenerate.
5886
a8279f82
ST
58872011-09-19 Sriraman Tallam <tmsriram@google.com>
5888
5889 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5890
0c9350c8
CC
58912011-09-19 Cary Coutant <ccoutant@google.com>
5892
5893 * incremental.cc (can_incremental_update): Fix typo in comment.
5894 * incremental.h (can_incremental_update): Likewise.
5895
aa06ae28
CC
58962011-09-18 Cary Coutant <ccoutant@google.com>
5897
5898 * incremental.cc (can_incremental_update): New function.
5899 * incremental.h (can_incremental_update): New function.
5900 * layout.cc (Layout::init_fixed_output_section): Call it.
5901 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5902 * object.cc (Sized_relobj_file::do_layout): Call
5903 can_incremental_update.
5904
ebb300b2
CC
59052011-09-13 Cary Coutant <ccoutant@google.com>
5906
5907 * configure.ac: Check for glibc support for gnu_indirect_function
5908 support with static linking, setting automake conditional
5909 IFUNC_STATIC.
5910 * Makefile.in: Regenerate.
5911 * configure: Regenerate.
5912
5913 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5914 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5915 for IFUNC_STATIC.
5916 * testsuite/Makefile.in: Regenerate.
5917
1206d0d5
CC
59182011-09-13 Cary Coutant <ccoutant@google.com>
5919
5920 * incremental.cc (Sized_relobj_incr::do_layout): Call
5921 report_comdat_group for kept comdat sections.
5922 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5923 * testsuite/Makefile.in: Regenerate.
5924 * testsuite/incr_comdat_test_1.cc: New source file.
5925 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5926 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5927 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5928
40b29874
ILT
59292011-09-13 Ian Lance Taylor <iant@google.com>
5930
5931 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5932 variable external_symbols_offset.
5933
1b045aac
ILT
59342011-09-12 Ian Lance Taylor <iant@google.com>
5935
5936 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5937 triggered if object has no symbols.
5938
24c6c55a
DM
59392011-09-09 David S. Miller <davem@davemloft.net>
5940
5941 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5942 (Output_fill_debug_line::do_write): Likewise.
5943
66570254
CC
59442011-08-29 Cary Coutant <ccoutant@google.com>
5945
5946 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5947 casts to match formatting specs.
5948 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5949
8ea8cd50
CC
59502011-08-26 Cary Coutant <ccoutant@google.com>
5951
5952 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5953 remaining hole size when allocating.
5954 (Layout::make_output_section): Set fill methods for debug sections.
5955 * layout.h (Free_list::Free_list_node): Move from private to
5956 public.
5957 (Free_list::set_min_hole_size): New function.
5958 (Free_list::begin, Free_list::end): New functions.
5959 (Free_list::min_hole_): New data member.
5960 * output.cc: Include dwarf.h.
5961 (Output_fill_debug_info::do_minimum_hole_size): New function.
5962 (Output_fill_debug_info::do_write): New function.
5963 (Output_fill_debug_line::do_minimum_hole_size): New function.
5964 (Output_fill_debug_line::do_write): New function.
5965 (Output_section::Output_section): Initialize new data member.
5966 (Output_section::set_final_data_size): Ensure patch space is larger
5967 than minimum hole size.
5968 (Output_section::do_write): Fill holes in debug sections.
5969 * output.h (Output_fill): New class.
5970 (Output_fill_debug_info): New class.
5971 (Output_fill_debug_line): New class.
5972 (Output_section::set_free_space_fill): New function.
5973 (Output_section::free_space_fill_): New data member.
5974 * testsuite/Makefile.am (incremental_test_3): Add
5975 --incremental-patch option.
5976 (incremental_test_4): Likewise.
5977 (incremental_test_5): Likewise.
5978 (incremental_test_6): Likewise.
5979 (incremental_copy_test): Likewise.
5980 (incremental_common_test_1): Likewise.
5981 * testsuite/Makefile.in: Regenerate.
5982
7cf80422
NC
59832011-08-26 Nick Clifton <nickc@redhat.com>
5984
5985 * po/es.po: Updated Spanish translation.
5986
c3f7b0e5
CC
59872011-08-01 Cary Coutant <ccoutant@google.com>
5988
5989 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5990 * gold/testsuite/Makefile.in: Regenerate.
5991 * gold/testsuite/justsyms_exec.c: New source file.
5992 * gold/testsuite/justsyms_lib.c: New source file.
5993
9590bf25
CC
59942011-08-01 Cary Coutant <ccoutant@google.com>
5995
5996 * layout.cc (Layout::set_segment_offsets): Don't realign text
5997 segment if -Ttext was specified.
5998 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5999 file type.
6000 * object.h (Sized_relobj_file::e_type): New function.
6001 (Sized_relobj_file::e_type_): New data member.
6002 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6003 base address for ET_EXEC files.
6004 * target.cc (Target::do_make_elf_object_implementation): Allow
6005 ET_EXEC files with --just-symbols option.
6006
dcd8d12e
CC
60072011-07-28 Cary Coutant <ccoutant@google.com>
6008
6009 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6010 Add thread_number parameter.
6011 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6012 * workqueue-threads.cc
6013 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6014 current thread if its thread number is greater than desired thread
6015 count.
6016 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6017 Add thread_number parameter.
6018 (Workqueue::should_cancel_thread): Likewise.
6019 (Workqueue::find_runnable_or_wait): Pass thread_number to
6020 should_cancel_thread.
6021 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6022 parameter.
6023
804eb480
ST
60242011-07-22 Sriraman Tallam <tmsriram@google.com>
6025
6026 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6027 only after checking if it cannot be forced local.
6028 * symtab.h (is_externally_visible): Check if the symbol is not forced
6029 local.
6030
f1ddb600
ILT
60312011-07-15 Ian Lance Taylor <iant@google.com>
6032
6033 * options.h (class General_options): Add --print-output-format.
6034 Move -EL next to -EB, for better --help output.
6035 * target-select.cc: Include <cstdio>, "options.h", and
6036 "parameters.h".
6037 (Target_selector::do_target_bfd_name): New function.
6038 (print_output_format): New function.
6039 * target-select.h (class Target_selector): Update declarations.
6040 (Target_selector::target_bfd_name): New function.
6041 (print_output_format): Declare.
6042 * main.cc: Include "target-select.h".
6043 (main): Handle --print-output-format.
6044 * gold.cc: Include "target-select.h".
6045 (queue_initial_tasks): Handle --print-output-format when there are
6046 no input files.
6047 * parameters.cc (parameters_force_valid_target): Give a better
6048 error message if -EB/-EL does not match target.
6049 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6050 function.
6051
7d172687
ILT
60522011-07-15 Ian Lance Taylor <iant@google.com>
6053
6054 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6055 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6056 (Output_data_plt_i386::do_write): Write address of .dynamic
6057 section to first entry in .got.plt section.
6058 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6059 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6060 Initialize layout_.
6061 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6062 section to first entry in .got.plt section.
6063 * layout.h (Layout::dynamic_section): New function.
6064
e9552f7e
ST
60652011-07-13 Sriraman Tallam <tmsriram@google.com>
6066
6067 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6068 to claim_file call.
6069 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6070 input_section_position_, and input_section_glob_.
6071 (read_layout_from_file): Call function section_ordering_specified.
6072 * layout.h (is_section_ordering_specified): New function.
6073 (section_ordering_specified): New function.
6074 (section_ordering_specified_): New boolean member.
6075 * main.cc(main): Call load_plugins after layout object is defined.
6076 * output.cc (Output_section::add_input_section): Use
6077 function section_ordering_specified to check if section ordering is
6078 needed.
6079 * output.cc (Output_section::add_relaxed_input_section): Use
6080 function section_ordering_specified to check if section ordering is
6081 needed.
6082 (Output_section::update_section_layout): New function.
6083 (Output_section::sort_attached_input_sections): Check if input section
6084 must be reordered.
6085 * output.h (Output_section::update_section_layout): New function.
6086 * plugin.cc (get_section_count): New function.
6087 (get_section_type): New function.
6088 (get_section_name): New function.
6089 (get_section_contents): New function.
6090 (update_section_order): New function.
58797674 6091 (allow_section_ordering): New function.
e9552f7e
ST
6092 (Plugin::load): Add the new interfaces to the transfer vector.
6093 (Plugin_manager::load_plugins): New parameter.
6094 (Plugin_manager::all_symbols_read): New parameter.
6095 (Plugin_manager::claim_file): New parameter. Save the elf object for
6096 unclaimed objects.
6097 (Plugin_manager::get_elf_object): New function.
6098 (Plugin_manager::get_view): Change to directly use the bool to check
6099 if get_view is called from claim_file_hook.
6100 * plugin.h (input_objects): New function
6101 (Plugin__manager::load_plugins): New parameter.
6102 (Plugin_manager::claim_file): New parameter.
6103 (Plugin_manager::get_elf_object): New function.
6104 (Plugin_manager::in_claim_file_handler): New function.
6105 (Plugin_manager::in_claim_file_handler_): New member.
6106 (layout): New function.
6107 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6108 handler with an extra parameter. Make the elf object before calling
6109 claim_file handler.
6110 * testsuite/plugin_test.c (get_section_count): New function pointer.
6111 (get_section_type): New function pointer.
6112 (get_section_name): New function pointer.
6113 (get_section_contents): New function pointer.
6114 (update_section_order): New function pointer.
6115 (allow_section_ordering): New function pointer.
6116 (onload): Check if the new interfaces exist.
6117
9446efde
ILT
61182011-07-13 Ian Lance Taylor <iant@google.com>
6119
6120 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6121 relro section.
6122 * x86_64.cc (Target_x86_64::got_section): Likewise.
6123 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6124 (relro_now_test_SOURCES): New variable.
6125 (relro_now_test_DEPENDENCIES): New variable.
6126 (relro_now_test_LDFLAGS): New variable.
6127 (relro_now_test_LDADD): New variable.
6128 (relro_now_test.so): New target.
6129 * testsuite/Makefile.in: Rebuild.
6130
07aa62f2
ILT
61312011-07-12 Ian Lance Taylor <iant@google.com>
6132
6133 PR gold/12980
6134 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6135 GLOB_DAT relocation rather than a RELATIVE relocation for a
6136 protected symbol when creating a shared library.
6137 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6138 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6139 * testsuite/protected_main_1.cc (main): Test that protected
6140 function has same address.
6141
e2153196
ILT
61422011-07-11 Ian Lance Taylor <iant@google.com>
6143
6144 PR gold/12979
6145 * options.h (class General_options): Add -Bgroup.
6146 * options.cc (General_options::finalize): If -Bgroup is set,
6147 default to --unresolved-symbols=report-all.
6148 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6149 * target-reloc.h (issue_undefined_symbol_error): Handle
6150 --unresolved-symbols=report-all.
6151
6daf5215
ILT
61522011-07-08 Ian Lance Taylor <iant@google.com>
6153
6154 PR gold/11985
6155 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6156 if linker script discards key sections.
6157 (Layout::create_dynamic_symtab): Likewise.
6158 (Layout::assign_local_dynsym_offsets): Likewise.
6159 (Layout::sized_create_version_sections): Likewise.
6160 (Layout::create_interp): Likewise.
6161 (Layout::finish_dynamic_section): Likewise.
6162 (Layout::set_dynamic_symbol_size): Likewise.
6163
beabb2c6
ILT
61642011-07-08 Ian Lance Taylor <iant@google.com>
6165
6166 PR gold/12386
6167 * options.h (class General_options): Add --unresolved-symbols.
6168 * target-reloc.h (issue_undefined_symbol_error): Check
6169 --unresolved-symbols. Add comments.
6170
9c16daf1
ILT
61712011-07-08 Ian Lance Taylor <iant@google.com>
6172
6173 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6174 expression more complex.
6175
191f1a2d
ILT
61762011-07-08 Ian Lance Taylor <iant@google.com>
6177
6178 PR gold/11317
6179 * target-reloc.h (issue_undefined_symbol_error): New inline
6180 function, broken out of relocate_section.
6181 (relocate_section): Call issue_undefined_symbol_error.
6182 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6183 there is no TLS segment if we are about to issue an undefined
6184 symbol error.
6185 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6186
62855347
ILT
61872011-07-08 Ian Lance Taylor <iant@google.com>
6188
6189 PR gold/12279
6190 * resolve.cc (Symbol_table::should_override): Add fromtype
6191 parameter. Change all callers. Give error when linking together
6192 TLS and non-TLS symbol.
6193 (Symbol_table::should_override_with_special): Add fromtype
6194 parameter. Change all callers.
6195 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6196 there is no TLS segment if we have reported some errors.
6197 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6198
67181c72
ILT
61992011-07-08 Ian Lance Taylor <iant@google.com>
6200
6201 PR gold/12372
6202 * target.h (Target::plt_address_for_global): New function.
6203 (Target::plt_address_for_local): New function.
6204 (Target::plt_section_for_global): Remove.
6205 (Target::plt_section_for_local): Remove.
6206 (Target::do_plt_address_for_global): New virtual function.
6207 (Target::do_plt_address_for_local): New virtual function.
6208 (Target::do_plt_section_for_global): Remove.
6209 (Target::do_plt_section_for_local): Remove.
6210 (Target::register_global_plt_entry): Add Symbol_table and Layout
6211 parameters.
6212 * output.cc (Output_data_got::Got_entry::write): Use
6213 plt_address_for_global and plt_address_for_local.
6214 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6215 address of output section.
6216 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6217 got_irelative_, and irelative_count_ fields. Update
6218 declarations.
6219 (Output_data_plt_i386::has_irelative_section): New function.
6220 (Output_data_plt_i386::entry_count): Add irelative_count_.
6221 (Output_data_plt_i386::set_final_data_size): Likewise.
6222 (class Target_i386): Add got_irelative_ and rel_irelative_
6223 fields. Update declarations.
6224 (Target_i386::Target_i386): Initialize new fields.
6225 (Target_i386::do_plt_address_for_global): New function replacing
6226 do_plt_section_for_global.
6227 (Target_i386::do_plt_address_for_local): New function replacing
6228 do_plt_section_for_local.
6229 (Target_i386::got_section): Create got_irelative_.
6230 (Target_i386::rel_irelative_section): New function.
6231 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6232 fields. Don't define __rel_iplt_{start,end}.
6233 (Output_data_plt_i386::add_entry): Add symtab and layout
6234 parameters. Change all callers. Use different PLT and GOT for
6235 IFUNC symbols.
6236 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6237 layout parameters. Change all callers. Use different PLT and
6238 GOT.
6239 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6240 (Output_data_plt_i386::rel_irelative): New function.
6241 (Output_data_plt_i386::address_for_global): New function.
6242 (Output_data_plt_i386::address_for_local): New function.
6243 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6244 IRELATIVE GOT when changing IFUNC GOT entries.
6245 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6246 reloc.
6247 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6248 if we didn't create an IRELATIVE GOT.
6249 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6250 plt_address_for_local.
6251 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6252 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6253 got_irelative_, and irelative_count_ fields. Update
6254 declarations.
6255 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6256 Initialize new fields. Remove symtab parameter. Change all
6257 callers.
6258 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6259 irelative_count_.
6260 (Output_data_plt_x86_64::has_irelative_section): New function.
6261 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6262 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6263 fields. Update declarations.
6264 (Target_x86_64::Target_x86_64): Initialize new fields.
6265 (Target_x86_64::do_plt_address_for_global): New function replacing
6266 do_plt_section_for_global.
6267 (Target_x86_64::do_plt_address_for_local): New function replacing
6268 do_plt_section_for_local.
6269 (Target_x86_64::got_section): Create got_irelative_.
6270 (Target_x86_64::rela_irelative_section): New function.
6271 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6272 all callers. Don't create __rel_iplt_{start,end}.
6273 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6274 parameters. Change all callers. Use different PLT and GOT for
6275 IFUNC symbols.
6276 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6277 layout parameters. Change all callers. Use different PLT and
6278 GOT.
6279 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6280 parameters. Change all callers. Use different PLT and GOT for
6281 IFUNC symbols.
6282 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6283 (Output_data_plt_x86_64::rela_irelative): New function.
6284 (Output_data_plt_x86_64::address_for_global): New function.
6285 (Output_data_plt_x86_64::address_for_local): New function.
6286 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6287 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6288 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6289 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6290 parameters.
6291 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6292 reloc.
6293 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6294 symbols if we didn't create an IRELATIVE GOT.
6295 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6296 plt_address_for_local.
6297 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6298 * testsuite/ifuncvar1.c: New test file.
6299 * testsuite/ifuncvar2.c: New test file.
6300 * testsuite/ifuncvar3.c: New test file.
6301 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6302 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6303 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6304 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6305 * testsuite/Makefile.in: Rebuild.
6306
33c15b45
CC
63072011-07-07 Cary Coutant <ccoutant@google.com>
6308
6309 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6310 (two_file_test_1_ndebug.o): Likewise.
6311 (two_file_test_1b_ndebug.o): Likewise.
6312 (two_file_test_2_ndebug.o): Likewise.
6313 (two_file_test_main_ndebug.o): Likewise.
6314 (incremental_test_2): Link with no-debug versions.
6315
f48b5fb7
CC
63162011-07-06 Cary Coutant <ccoutant@google.com>
6317
6318 * gold/incremental.cc
6319 (Output_section_incremental_inputs::write_info_blocks): Check for
6320 hidden and internal symbols.
6321
221597a5
CC
63222011-07-06 Cary Coutant <ccoutant@google.com>
6323
6324 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6325 Check disposition for startup file.
6326 (Incremental_inputs::report_command_line): Ignore
6327 --incremental-startup-unchanged option.
6328 * options.cc (General_options::parse_incremental_startup_unchanged):
6329 New function.
6330 (General_options::General_options): Initialize new data member.
6331 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6332 (General_options): Add --incremental-startup-unchanged option.
6333 (General_options::incremental_startup_disposition): New function.
6334 (General_options::incremental_startup_disposition_): New data member.
6335
e24719f6
CC
63362011-07-06 Cary Coutant <ccoutant@google.com>
6337
6338 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6339 input file index to Script_info ctor.
6340 (Sized_incremental_binary::do_file_has_changed): Find the
6341 command-line argument for files named in scripts.
6342 * incremental.h (Script_info::Script_info): New ctor
6343 with input file index.
6344 (Script_info::input_file_index): New function.
6345 (Script_info::input_file_index_): New data member.
6346 (Incremental_binary::get_library): Add const.
6347 (Incremental_binary::get_script_info): Add const.
6348 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6349 * testsuite/Makefile.am (incremental_test_5): New test case.
6350 (incremental_test_6): New test case.
6351 * testsuite/Makefile.in: Regenerate.
6352
8f7c81e8
CC
63532011-07-06 Cary Coutant <ccoutant@google.com>
6354
6355 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6356 debug output when command lines differ.
6357
9fbd3822
CC
63582011-07-06 Cary Coutant <ccoutant@google.com>
6359
6360 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6361 --incremental-patch option.
6362 * layout.cc (Free_list::allocate): Extend allocation beyond original
6363 end if enabled.
6364 (Layout::make_output_section): Mark sections that should get
6365 patch space.
6366 * options.cc (parse_percent): New function.
6367 * options.h (parse_percent): New function.
6368 (DEFINE_percent): New macro.
6369 (General_options): Add --incremental-patch option.
6370 * output.cc (Output_section::Output_section): Initialize new data
6371 members.
6372 (Output_section::add_input_section): Print section name when out
6373 of patch space.
6374 (Output_section::add_output_section_data): Likewise.
6375 (Output_section::set_final_data_size): Add patch space when
6376 doing --incremental-full.
6377 (Output_section::do_reset_address_and_file_offset): Remove patch
6378 space.
6379 (Output_segment::set_section_list_addresses): Print debug output
6380 only if --incremental-update.
6381 * output.h (Output_section::set_is_patch_space_allowed): New function.
6382 (Output_section::is_patch_space_allowed_): New data member.
6383 (Output_section::patch_space_): New data member.
6384 * parameters.cc (Parameters::incremental_full): New function.
6385 * parameters.h (Parameters::incremental_full): New function
6386 * testsuite/Makefile.am (incremental_test_2): Add test for
6387 --incremental-patch option.
6388 * testsuite/Makefile.in: Regenerate.
6389 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6390 (t18): Remove function body.
6391
f6cccc2c
DK
63922011-07-05 Doug Kwan <dougkwan@google.com>
6393
6394 PR gold/12771
6395 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6396 Arm_Address type for relocation result.
6397 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6398 overflow check.
6399 (Arm_relocate_functions::abs32): Use unaligned access.
6400 (Arm_relocate_functions::rel32): Ditto.
6401 (Arm_relocate_functions::prel31): Ditto.
6402 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6403 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6404 static data relocations.
6405 * testsuite/Makefile.in: Regnerate.
6406 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6407
28a13fec
ILT
64082011-07-05 Ian Lance Taylor <iant@google.com>
6409
6410 PR gold/12392
6411 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6412 symbols if necessary.
6413 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6414
24d47b34
ILT
64152011-07-05 Ian Lance Taylor <iant@google.com>
6416
6417 PR gold/12952
6418 * resolve.cc (Symbol::override_base_with_special): Simply override
6419 version with special symbol version, ignoring previous version.
6420
41f9cbbe
ILT
64212011-07-05 Ian Lance Taylor <iant@google.com>
6422
6423 * object.cc (Sized_relobj_file::include_section_group): Add
6424 information to comment about signature location.
6425
886288f1
ILT
64262011-07-02 Ian Lance Taylor <iant@google.com>
6427
6428 PR gold/12957
6429 * options.h (class General_options): Add -f and -F.
6430 * options.cc (General_options::finalize): Fatal error if -f/-F
6431 are used without -shared.
6432 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6433
ae3a6d4f
ILT
64342011-07-02 Ian Lance Taylor <iant@google.com>
6435
6436 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6437
21131061
ILT
64382011-07-01 Ian Lance Taylor <iant@google.com>
6439
6440 PR gold/12525
6441 PR gold/12952
6442 * resolve.cc (Symbol::override_base_with_special): Don't override
6443 the version if the overriding symbol has a different name.
6444 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6445 all callers. If we give an error about an undefined version,
6446 define the base version if necessary.
6447 * dynobj.h (class Versions): Update declaration.
6448 * testsuite/weak_alias_test_5.cc: New file.
6449 * testsuite/weak_alias_test.script: New file.
6450 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6451 and versioned_alias have the right value, and call t2.
6452 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6453 weak_alias_test_5.so.
6454 (weak_alias_test_LDADD): Likewise.
6455 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6456 * testsuite/Makefile.in: Rebuild.
6457
611062c0
ILT
64582011-07-01 Ian Lance Taylor <iant@google.com>
6459
6460 PR gold/12525
6461 * options.h (class General_options): Support -z notext.
6462 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6463 -Wl,-z,notext.
6464 (two_file_shared_nonpic.so): Likewise.
6465 (two_file_shared_mixed.so): Likewise.
6466 (two_file_shared_mixed_1.so): Likewise.
6467 (weak_undef_lib_nonpic.so): Likewise.
6468 (alt/weak_undef_lib_nonpic.so): Likewise.
6469 (tls_test_shared_nonpic.so): Likewise.
6470 * testsuite/Makefile.in: Rebuild.
6471
328c7c2f
ILT
64722011-07-01 Ian Lance Taylor <iant@google.com>
6473
6474 PR gold/12525
6475 * configure.ac: Test whether static linking works, setting
6476 the automake conditional HAVE_STATIC.
6477 * testsuite/Makefile.am: Disable tests using -static if
6478 HAVE_STATIC is not true.
6479 * configure, testsuite/Makefile.in: Rebuild.
6480
02d7cd44
ILT
64812011-07-01 Ian Lance Taylor <iant@google.com>
6482
6483 PR gold/12525
6484 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6485 Assert if we see DW_EH_PE_indirect.
6486 * target.h (Target::ehframe_datarel_base): New function.
6487 (Target::do_ehframe_datarel_base): New target function.
6488 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6489 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6490 function.
6491
07a60597
ILT
64922011-07-01 Ian Lance Taylor <iant@google.com>
6493
6494 PR gold/12571
6495 * options.h (class General_options): Add
6496 --ld-generated-unwind-info.
6497 * ehframe.cc (Fde::write): Add address parameter. Change all
6498 callers. If associated with PLT, fill in address and size.
6499 (Cie::set_output_offset): Only add merge mapping if there is an
6500 object.
6501 (Cie::write): Add address parameter. Change all callers.
6502 (Eh_frame::add_ehframe_for_plt): New function.
6503 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6504 input_offset_ fields into union u_, with new plt field.
6505 (Fde::Fde): Adjust for new union field.
6506 (Fde::Fde) [Output_data version]: New constructor.
6507 (Fde::add_mapping): Only add merge mapping if there is an object.
6508 (class Cie): Update declarations.
6509 (class Eh_frame): Declare add_ehframe_for_plt.
6510 * layout.cc (Layout::layout_eh_frame): Break out code into
6511 make_eh_frame_section, and call it.
6512 (Layout::make_eh_frame_section): New function.
6513 (Layout::add_eh_frame_for_plt): New function.
6514 * layout.h (class Layout): Update declarations.
6515 * merge.cc (Merge_map::add_mapping): Add assertion.
6516 * i386.cc: Include "dwarf.h".
6517 (class Output_data_plt_i386): Make first_plt_entry,
6518 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6519 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6520 and plt_eh_frame_fde.
6521 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6522 boundary. Call add_eh_frame_for_plt if appropriate.
6523 * x86_64.cc: Include "dwarf.h".
6524 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6525 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6526 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6527 and plt_eh_frame_fde.
6528 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6529 appropriate.
6530
14788a3f
ILT
65312011-06-29 Ian Lance Taylor <iant@google.com>
6532
6533 PR gold/12629
6534 * object.cc (Sized_relobj_file::layout_section): Change shdr
6535 parameter to be const.
6536 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6537 out of do_layout.
6538 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6539 appropriate. Call layout_eh_frame_section.
6540 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6541 sections.
6542 * object.h (class Sized_relobj_file): Update declarations.
6543
6c21fce1
ILT
65442011-06-29 Ian Lance Taylor <iant@google.com>
6545
37e41b03 6546 PR gold/12652
6c21fce1
ILT
6547 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6548 modifier.
6549 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6550
4d5e4e62
ILT
65512011-06-29 Ian Lance Taylor <iant@google.com>
6552
6553 PR gold/12675
6554 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6555 SHT_X86_64_UNWIND.
6556 * layout.cc (Layout::layout_eh_frame): Likewise.
6557
886f533a
ILT
65582011-06-29 Ian Lance Taylor <iant@google.com>
6559
6560 PR gold/12695
6561 * layout.cc (Layout::symtab_section_shndx): New function.
6562 * layout.h (class Layout): Declare symtab_section_shndx.
6563 * output.cc (Output_section::write_header): Call it.
6564
f3ae1b28
ILT
65652011-06-29 Ian Lance Taylor <iant@google.com>
6566
6567 PR gold/12818
6568 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6569 symbols which are not used in a relocation.
6570
aecf301f
ILT
65712011-06-28 Ian Lance Taylor <iant@google.com>
6572
6573 PR gold/12898
6574 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6575 script create indistinguishable segments.
6576 (Layout::set_segment_offsets): Use stable_sort when sorting
6577 segments. Pass this to Compare_segments constructor.
6578 * layout.h (class Layout): Make segment_precedes non-static.
6579 (class Compare_segments): Change from struct to class. Add
6580 layout_ field. Add constructor.
6581 * script-sections.cc
6582 (Script_sections::attach_sections_using_phdrs_clause): Rename
6583 local orphan to is_orphan. Don't report failure to put empty
6584 section in segment. On attachment failure, report name of
6585 section, and attach to first PT_LOAD segment.
6586
03ef7571
ILT
65872011-06-28 Ian Lance Taylor <iant@google.com>
6588
6589 PR gold/12934
6590 * target-select.cc (Target_selector::Target_selector): Add
6591 emulation parameter. Change all callers.
6592 (select_target_by_bfd_name): Rename from select_target_by_name.
6593 Change all callers.
6594 (select_target_by_emulation): New function.
6595 (supported_emulation_names): New function.
6596 * target-select.h (class Target_selector): Add emulation_ field.
6597 Update declarations.
6598 (Target_selector::recognize_by_bfd_name): Rename from
6599 recognize_by_name. Change all callers.
6600 (Target_selector::supported_bfd_names): Rename from
6601 supported_names. Change all callers.
6602 (Target_selector::recognize_by_emulation): New function.
6603 (Target_selector::supported_emulations): New function.
6604 (Target_selector::emulation): New function.
6605 (Target_selector::do_recognize_by_bfd_name): Rename from
6606 do_recognize_by_name. Change all callers.
6607 (Target_selector::do_supported_bfd_names): Rename from
6608 do_supported_names. Change all callers.
6609 (Target_selector::do_recognize_by_emulation): New function.
6610 (Target_selector::do_supported_emulations): New function.
6611 (select_target_by_bfd_name): Change name in declaration.
6612 (select_target_by_emulation): Declare.
6613 (supported_emulation_names): Declare.
6614 * parameters.cc (parameters_force_valid_target): Try to find
6615 target based on emulation from -m option.
6616 * options.h (class General_options): Change doc string for -m.
6617 * options.cc (help): Print emulations.
6618 (General_options::parse_V): Likewise.
6619 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6620 Add emulation parameter. Change all callers.
6621
200b2bb9
ILT
66222011-06-28 Ian Lance Taylor <iant@google.com>
6623
6624 * target.h (class Target): Add osabi_ field.
6625 (Target::osabi): New function.
6626 (Target::set_osabi): New function.
6627 (Target::Target): Initialize osabi_.
6628 (Target::do_adjust_elf_header): Make pure virtual.
6629 (Sized_target::do_adjust_elf_header): Declare.
6630 * target.cc (Sized_target::do_adjust_elf_header): New function.
6631 (class Sized_target): Instantiate all versions.
6632 * freebsd.h (class Target_freebsd): Remove.
6633 (Target_selector_freebsd::do_recognize): Call set_osabi on
6634 Target.
6635 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6636 (Target_selector_freebsd::set_osabi): Remove.
6637 * i386.cc (class Target_i386): Inherit from Sized_target rather
6638 than Target_freebsd.
6639 * x86_64.cc (class Target_x86_64): Likewise.
6640
b3ce541e
ILT
66412011-06-28 Ian Lance Taylor <iant@google.com>
6642
6643 * target.h (Target::can_check_for_function_pointers): Rewrite.
6644 Make non-virtual.
6645 (Target::can_icf_inline_merge_sections): Likewise.
6646 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6647 (Target::Target_info): Add can_icf_inline_merge_sections field.
6648 (Target::do_can_check_for_function_pointers): New virtual
6649 function.
6650 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6651 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6652 from can_check_for_function_pointers, move in file.
6653 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6654 section_may_have_icf_unsafe_poineters, move in file.
6655 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6656 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6657 Rename from can_check_for_function_pointers, move in file.
6658 (Target_i386::can_icf_inline_merge_sections): Remove.
6659 (Target_i386::i386_info): Initialize
6660 can_icf_inline_merge_sections.
6661 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6662 Initialize can_icf_inline_merge_sections.
6663 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6664 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6665 Rename from can_check_for_function_pointers, move in file.
6666 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6667 (Target_x86_64::x86_64_info): Initialize
6668 can_icf_inline_merge_sections.
6669 * testsuite/testfile.cc (Target_test::test_target_info):
6670 Likewise.
6671 * icf.cc (get_section_contents): Correct formatting.
6672
6d1c4efb
ILT
66732011-06-27 Ian Lance Taylor <iant@google.com>
6674
6675 * symtab.cc (Symbol::versioned_name): New function.
6676 (Symbol_table::add_to_final_symtab): Use versioned_name when
6677 appropriate.
6678 (Symbol_table::sized_write_symbol): Likewise.
6679 * symtab.h (class Symbol): Declare versioned_name.
6680 * stringpool.h (class Stringpool_template): Add variant of add
6681 which takes a std::basic_string.
6682 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6683 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6684 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6685 (ver_test_12.o): New target.
6686 * testsuite/Makefile.in: Rebuild.
6687
57eb9b50
DK
66882011-06-27 Doug Kwan <dougkwan@google.com>
6689
6690 * arm.cc (Arm_relocate_functions::thm_jump8,
6691 Arm_relocate_functions::thm_jump11): Use a wider signed
6692 type to compute offset.
6693 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6694 arm_thm_jump8.
6695 * testsuite/Makefile.in: Regenerate.
6696 * testsuite/arm_branch_in_range.sh: Check test results of
6697 arm_thm_jump11 and arm_thm_jump8.
6698 * testsuite/arm_thm_jump11.s: New test source file.
6699 * testsuite/arm_thm_jump11.t: New linker script.
6700 * testsuite/arm_thm_jump8.s: New test source file.
6701 * testsuite/arm_thm_jump8.t: New linker script.
6702
487b39df
ILT
67032011-06-24 Ian Lance Taylor <iant@google.com>
6704
6705 * layout.cc: Include "object.h".
6706 (ctors_sections_in_init_array): New static variable.
6707 (Layout::is_ctors_in_init_array): New function.
6708 (Layout::layout): Add entry to ctors_sections_in_init_array if
6709 appropriate.
6710 * layout.h (class Layout): Declare is_ctors_in_init_array.
6711 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6712 is_ctors_reverse_view is set.
6713 (Sized_relobj_file::write_sections): Add layout parameter. Change
6714 all callers. Set is_ctors_reverse_view field of View_size.
6715 (Sized_relobj_file::reverse_words): New function.
6716 * object.h (Sized_relobj_file::View_size): Add
6717 is_ctors_reverse_view field.
6718 (class Sized_relobj_file): Update declarations.
6719 * testsuite/initpri3.c: New test.
6720 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6721 initpri3b.
6722 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6723 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6724 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6725 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6726 * testsuite/Makefile.in: Rebuild.
6727
472076e4
CC
67282011-06-24 Cary Coutant <ccoutant@google.com>
6729
6730 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6731 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6732 (debug_msg_cdebug.err): New targets.
6733 * testsuite/Makefile.in: Regenerate.
6734 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6735 Fix checks for link with shared library.
6736
a60af0db
DK
67372011-06-24 Doug Kwan <dougkwan@google.com>
6738
6739 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6740 skip empty text sections.
6741 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6742
5393d741
ILT
67432011-06-22 Ian Lance Taylor <iant@google.com>
6744
6745 PR gold/12910
6746 * options.h (class General_options): Add --ctors-in-init-array.
6747 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6748 friends as SHT_PROGBITS for merging sections.
6749 (Layout::layout): Remove special handling of .init_array and
6750 friends. Don't sort if doing relocatable link. Sort for .ctors
6751 and .dtors if ctors_in_init_array.
6752 (Layout::make_output_section): Force correct section types for
6753 .init_array and friends. Don't sort if doing relocatable link,
6754 Don't sort .ctors and .dtors if ctors_in_init_array.
6755 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6756 (Layout::output_section_name): Add relobj parameter. Change all
6757 callers. Handle .ctors. and .dtors. in code rather than table.
6758 Handle .ctors and .dtors if ctors_in_init_array.
6759 (Layout::match_file_name): New function, moved from output.cc.
6760 * layout.h (class Layout): Update declarations.
6761 * output.cc: Include "layout.h".
6762 (Input_section_sort_entry::get_priority): New function.
6763 (Input_section_sort_entry::match_file_name): Just call
6764 Layout::match_file_name.
6765 (Output_section::Input_section_sort_init_fini_compare::operator()):
6766 Handle .ctors and .dtors. Sort by explicit priority rather than
6767 by name.
6768 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6769 * testsuite/initpri2.c: New test.
6770 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6771 (check_PROGRAMS): Add initpri2.
6772 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6773 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6774 * configure, testsuite/Makefile.in: Rebuild.
6775
e1f74f98
ILT
67762011-06-19 Ian Lance Taylor <iant@google.com>
6777
6778 PR gold/12880
6779 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6780 .interp section to a PT_INTERP segment even if we have seen a
6781 --dynamic-linker option. Don't do it if we have seen a PHDRS
6782 clause in a linker script.
6783 (Layout::finalize): Don't create a .interp section if we've
6784 already create a PT_INTERP segment.
6785 (Layout::create_interp): Always call choose_output_section (revert
6786 patch of 2011-06-17). Don't create PT_INTERP segment.
6787 * script-sections.cc
6788 (Script_sections::create_note_and_tls_segments): Add a .interp
6789 section to a PT_INTERP segment even if we have seen a
6790 --dynamic-linker option.
6791
766f91bb
ILT
67922011-06-18 Ian Lance Taylor <iant@google.com>
6793
6794 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6795 merely because a non-PT_LOAD segment has a dynamic reloc.
6796
0d212c3a
ILT
67972011-06-18 Ian Lance Taylor <iant@google.com>
6798
6799 * layout.cc (Layout::finish_dynamic_section): Don't create
6800 DT_FLAGS entry if not needed.
6801
911a5072
ILT
68022011-06-18 Ian Lance Taylor <iant@google.com>
6803
6804 PR gold/12745
6805 * layout.cc (Layout::layout_eh_frame): Correct handling of
6806 writable .eh_frame section.
6807
534b4e5f
ILT
68082011-06-17 Ian Lance Taylor <iant@google.com>
6809
6810 PR gold/12893
6811 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6812 symbol is redefined with the exact same object and value.
6813
10b4f102
ILT
68142011-06-17 Ian Lance Taylor <iant@google.com>
6815
6816 PR gold/12880
6817 * layout.h (class Layout): Add interp_segment_ field.
6818 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6819 (Layout::attach_allocated_section_to_segment): If making shared
6820 library, put .interp section in PT_INTERP segment.
6821 (Layout::finalize): Also call create_interp if -dynamic-linker
6822 option was used.
6823 (Layout::create_interp): Assert that there is no PT_INTERP
6824 segment. If not using a SECTIONS clause, use make_output_section.
6825 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6826 * script-sections.cc
6827 (Script_sections::create_note_and_tls_segments): If making shared
6828 library, put .interp section in PT_INTERP segment.
6829
a29b0dad
ILT
68302011-06-17 Ian Lance Taylor <iant@google.com>
6831
e588ea8d
ILT
6832 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6833 when making a shared library.
6834
68352011-06-17 Ian Lance Taylor <iant@google.com>
6836
6837 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6838 parameter. Change all callers. Don't issue warning about PC32
6839 against locally defined symbol.
a29b0dad 6840
9d3b0698
ILT
68412011-06-16 Ian Lance Taylor <iant@google.com>
6842
6843 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6844 occurs in same object.
6845
85b0f90c
AM
68462011-06-14 Alan Modra <amodra@gmail.com>
6847
6848 * po/POTFILES.in: Regenerate.
6849
a94907d9
ILT
68502011-06-09 Ian Lance Taylor <iant@google.com>
6851
6852 * script-sections.cc
6853 (Orphan_output_section::set_section_addresses): For a relocatable
6854 link set address to 0.
6855
4fb3a1c3
CC
68562011-06-09 Cary Coutant <ccoutant@google.com>
6857
6858 PR gold/12804
6859 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6860 used with --compress-debug-sections.
6861 * gold/object.cc (Sized_relobj_file::do_layout): Report
6862 uncompressed size of compressed input sections.
6863
61220854
CC
68642011-06-08 Cary Coutant <ccoutant@google.com>
6865
6866 PR gold/12804
6867 * testsuite/two_file_test_2_v1.cc: Change initialization of
6868 v2 to keep it in .data.
6869
e6455dfb
CC
68702011-06-07 Cary Coutant <ccoutant@google.com>
6871
6872 * common.cc (Symbol_table::do_allocate_commons_list): Call
6873 gold_fallback.
6874 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6875 (Errors::fallback): New function.
6876 (gold_fallback): New function.
6877 * errors.h (Errors::fallback): New function.
6878 * gold.cc (gold_exit): Change status parameter to enum; adjust
6879 all callers.
6880 (queue_initial_tasks): Call gold_fallback.
6881 * gold.h: Include cstdlib.
6882 (Exit_status): New enum type.
6883 (gold_exit): Change status parameter to enum.
6884 (gold_fallback): New function.
6885 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6886 (Layout::create_symtab_sections): Likewise.
6887 (Layout::create_shdrs): Likewise.
6888 * main.cc (main): Adjust call to gold_exit.
6889 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6890 (Output_data_got::add_got_entry_pair): Likewise.
6891 (Output_section::add_input_section): Likewise.
6892 (Output_section::add_output_section_data): Likewise.
6893 (Output_segment::set_section_list_addresses): Likewise.
6894 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6895
fb0e076f
CC
68962011-06-07 Cary Coutant <ccoutant@google.com>
6897
6898 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6899 for incremental links.
6900 * output.cc (Output_segment::set_section_list_addresses): Remove
6901 FIXME and test for TLS or BSS.
6902
a5ee4d5d
CC
69032011-06-07 Cary Coutant <ccoutant@google.com>
6904
6905 * testsuite/Makefile.am: Add incremental_copy_test,
6906 incremental_common_test_1.
6907 * testsuite/Makefile.in: Regenerate.
6908 * testsuite/common_test_1_v1.c: New source file.
6909 * testsuite/common_test_1_v2.c: New source file.
6910 * testsuite/copy_test_v1.cc: New source file.
6911
5146f448
CC
69122011-06-07 Cary Coutant <ccoutant@google.com>
6913
6914 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6915 update, allocate common from bss section's free list.
6916 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6917 linker-defined symbols.
6918 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6919 Skip GOT and PLT entries that are no longer referenced.
6920 (Output_section_incremental_inputs::write_info_blocks): Mark
6921 linker-defined symbols.
6922 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6923 * output.cc (Output_section::allocate): New function.
6924 * output.h (Output_section::allocate): New function.
6925 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6926 linker-defined symbols.
6927 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6928 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6929 (Symbol::init_base_output_data): Likewise.
6930 (Symbol::init_base_output_segment): Likewise.
6931 (Symbol::init_base_constant): Likewise.
6932 (Sized_symbol::init_output_data): Likewise.
6933 (Sized_symbol::init_output_segment): Likewise.
6934 (Sized_symbol::init_constant): Likewise.
6935 (Symbol_table::do_define_in_output_data): Likewise.
6936 (Symbol_table::do_define_in_output_segment): Likewise.
6937 (Symbol_table::do_define_as_constant): Likewise.
6938 * symtab.h (Symbol::is_predefined): New function.
6939 (Symbol::init_base_output_data): Add is_predefined parameter.
6940 (Symbol::init_base_output_segment): Likewise.
6941 (Symbol::init_base_constant): Likewise.
6942 (Symbol::is_predefined_): New data member.
6943 (Sized_symbol::init_output_data): Add is_predefined parameter.
6944 (Sized_symbol::init_output_segment): Likewise.
6945 (Sized_symbol::init_constant): Likewise.
6946 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6947
26d3c67d
CC
69482011-06-07 Cary Coutant <ccoutant@google.com>
6949
6950 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6951 instead of emit_copy_reloc.
6952 (Copy_relocs::emit_copy_reloc): Refactor.
6953 (Copy_relocs::make_copy_reloc): New function.
6954 (Copy_relocs::add_copy_reloc): Remove.
6955 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6956 section.
6957 (Copy_relocs::make_copy_reloc): New function.
6958 (Copy_relocs::add_copy_reloc): Remove.
6959 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6960 unchanged input files.
6961 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6962 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6963 Reserve BSS space for COPY relocations.
6964 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6965 (Output_section_incremental_inputs::write_info_blocks): Record
6966 whether a symbol is copied from a shared object.
6967 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6968 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6969 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6970 (Incremental_input_entry_reader::get_output_symbol_index): Add
6971 is_copy parameter.
6972 (Incremental_binary::emit_copy_relocs): New function.
6973 (Incremental_binary::do_emit_copy_relocs): New function.
6974 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6975 new data member.
6976 (Sized_incremental_binary::add_copy_reloc): New function.
6977 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6978 (Sized_incremental_binary::Copy_reloc): New struct.
6979 (Sized_incremental_binary::Copy_relocs): New typedef.
6980 (Sized_incremental_binary::copy_relocs_): New data member.
6981 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6982 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6983 * target.h (Sized_target::emit_copy_reloc): New function.
6984 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6985
7cdb37d9
CC
69862011-06-02 Cary Coutant <ccoutant@google.com>
6987
6988 PR gold/12163
6989 * gold/archive.cc (Archive::Archive): Initialize new data member.
6990 (Archive::include_all_members): Return if archive has already been
6991 included.
6992 * gold/archive.h (Archive::include_all_members_): New data member.
6993
cc643b88
NC
69942011-06-02 Nick Clifton <nickc@redhat.com>
6995
6996 * dynobj.h: Fix spelling mistake in comment.
6997 * output.cc: Likewise.
6998
f62a3ca7 69992011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7000 Asier Llano
f62a3ca7
DK
7001
7002 PR gold/12826
cc643b88 7003 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7004 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7005 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7006 redundant arm_exidx_test.so.
7007 * testsuite/Makefile.in: Regenerate.
7008 (check_SCRIPTS): Add pr12826.sh
7009 (check_DATA): Add pr12826.stdout
7010 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7011 * testsuite/pr12826.sh: New file.
7012 * testsuite/pr12826_1.s: Ditto.
7013 * testsuite/pr12826_1.s: Ditto.
7014
8dbe1edc
ILT
70152011-05-30 Ian Lance Taylor <iant@google.com>
7016
7017 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7018 sections.
7019
c49875be
ILT
70202011-05-29 Ian Lance Taylor <iant@google.com>
7021
7022 PR gold/12804
7023 * testsuite/Makefile.am: Use different file name for two_file_test
7024 temporary file for each incremental test.
7025 * testsuite/Makefile.in: Rebuild.
7026
69d53f7a
ILT
70272011-05-29 Ian Lance Taylor <iant@google.com>
7028
7029 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7030 binary input file is empty.
7031
41d0ab5f
ILT
70322011-05-27 Ian Lance Taylor <iant@google.com>
7033
7034 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7035 (ver_test_9.so): Likewise.
7036 * testsuite/Makefile.in: Rebuild.
7037
89d8a36b
CC
70382011-05-26 Cary Coutant <ccoutant@google.com>
7039
7040 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7041 * incremental.cc (Incremental_inputs::report_input_section): Fix
7042 comment, indentation.
7043 (Incremental_inputs::report_comdat_group): New function.
7044 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7045 of data for incremental input file entry.
7046 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7047 group count, COMDAT group signatures.
7048 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7049 an unchanged input file.
7050 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7051 Initialize new data member.
7052 (Incremental_object_entry::add_comdat_group): New function.
7053 (Incremental_object_entry::get_comdat_group_count): New function.
7054 (Incremental_object_entry::get_comdat_signature_key): New function.
7055 (Incremental_object_entry::groups_): New data member.
7056 (Incremental_inputs::report_comdat_group): New function.
7057 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7058 data for incremental input file entry.
7059 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7060 (Incremental_input_entry_reader::get_input_section): Adjust size of
7061 data for incremental input file entry.
7062 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7063 (Incremental_input_entry_reader::get_comdat_group_signature): New
7064 function.
7065 * object.cc (Sized_relobj::include_section_group): Report kept
7066 COMDAT groups for incremental links.
7067
1706a06f
ILT
70682011-05-24 David Meyer <pdox@google.com>
7069
7070 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7071 with name parameter. Add found_name parameter.
7072 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7073 * dirsearch.h (class Dirsearch): Update declaration.
7074
a10ae760
ILT
70752011-05-24 Ian Lance Taylor <iant@google.com>
7076
7077 * archive.cc (Library_base::should_include_member): Pull in object
7078 from archive if it defines the entry symbol.
7079 * parameters.cc (Parameters::entry): New function.
7080 * parameters.h (class Parameters): Declare entry.
7081 * output.h (class Output_file_header): Remove entry_ field.
7082 * output.cc (Output_file_header::Output_file_header): Remove entry
7083 parameter. Change all callers.
7084 (Output_file_header::entry): Use parameters->entry.
7085 * gold.cc (queue_middle_tasks): Likewise.
7086 * plugin.cc (Plugin_hook::run): Likewise.
7087
aa92d6ed
CC
70882011-05-24 Cary Coutant <ccoutant@google.com>
7089
7090 * gold.cc (queue_initial_tasks): Pass incremental base filename
7091 to Output_file::open_base_file; don't print error message.
7092 * incremental-dump.cc (main): Adjust call to
7093 Output_file::open_for_modification.
7094 * incremental-dump.cc (main): Likewise.
7095 * incremental.cc (Incremental_inputs::report_command_line):
7096 Ignore --incremental-base option when comparing command lines.
7097 Ignore parameter when given as separate argument.
7098 * options.h (class General_options): Add --incremental-base.
7099 * output.cc (Output_file::Output_file):
7100 (Output_file::open_base_file): Add base_name and writable parameters;
7101 read base file into new file; print error message here.
7102 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7103 callers.
7104 * output.h (Output_file::open_for_modification): Rename to...
7105 (Output_file::open_base_file): ...this; add base_name and
7106 writable parameters; adjust all callers.
7107 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7108 callers.
7109 * testsuite/Makefile.am (incremental_test_4): Test
7110 --incremental-base.
7111 * testsuite/Makefile.in: Regenerate.
7112
2eedd706
CC
71132011-05-24 Cary Coutant <ccoutant@google.com>
7114
7115 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7116 incremental_test_4.
7117 * testsuite/Makefile.in: Regenerate.
7118 * testsuite/two_file_test_1_v1.cc: New test source file.
7119 * testsuite/two_file_test_1b_v1.cc: New test source file.
7120 * testsuite/two_file_test_2_v1.cc: New test source file.
7121
0f1c85a6
CC
71222011-05-24 Cary Coutant <ccoutant@google.com>
7123
7124 * dynobj.h (Dynobj::do_dynobj): New function.
7125 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7126 flag and soname for shared objects.
7127 * incremental.cc (Incremental_inputs::report_object): Make
7128 either Incremental_object_entry or Incremental_dynobj_entry; add
7129 soname to string table.
7130 (Incremental_inputs::report_input_section): Add assertion.
7131 (Output_section_incremental_inputs::set_final_data_size): Adjust
7132 type of input file entry for shared libraries; adjust size of
7133 shared library info entry.
7134 (Output_section_incremental_inputs::write_input_files): Write
7135 as_needed flag for shared libraries.
7136 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7137 of input file entry for shared libraries; write soname.
7138 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7139 soname from incremental info.
7140 * incremental.h (enum Incremental_input_flags): Add
7141 INCREMENTAL_INPUT_AS_NEEDED.
7142 (Incremental_input_entry::Incremental_input_entry): Initialize new
7143 data member.
7144 (Incremental_input_entry::set_as_needed): New function.
7145 (Incremental_input_entry::as_needed): New function.
7146 (Incremental_input_entry::do_dynobj_entry): New function.
7147 (Incremental_input_entry::as_needed_): New data member.
7148 (Incremental_object_entry::Incremental_object_entry): Don't check
7149 for shared library.
7150 (Incremental_object_entry::do_type): Likewise.
7151 (class Incremental_dynobj_entry): New class.
7152 (Incremental_input_entry_reader::as_needed): New function.
7153 (Incremental_input_entry_reader::get_soname): New function.
7154 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7155 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7156 size of shared library info entry.
58797674 7157 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7158 incremental link when adding DT_NEEDED entries.
7159 * object.h (Object::Object): Initialize new data member.
7160 (Object::dynobj): New function.
7161 (Object::set_as_needed): New function.
7162 (Object::as_needed): New function.
7163 (Object::do_dynobj): New function.
7164 (Object::as_needed_): New data member.
7165
6fa2a40b
CC
71662011-05-24 Cary Coutant <ccoutant@google.com>
7167
7168 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7169 info; adjust display of GOT entries.
7170 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7171 vector of input objects; remove file_status_.
7172 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7173 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7174 got_plt reader; call target hooks to reserve GOT entries.
7175 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7176 of input file info header and GOT info entry.
7177 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7178 relocation info.
7179 (Got_plt_view_info::got_descriptor): Remove.
7180 (Got_plt_view_info::sym_index): New data member.
7181 (Got_plt_view_info::input_index): New data member.
7182 (Local_got_offset_visitor::visit): Write input file index.
7183 (Global_got_offset_visitor::visit): Write 0 for input file index.
7184 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7185 with sym_index and input_index.
7186 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7187 incremental info GOT entry; replace got_descriptor with input_index.
7188 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7189 map from input file index to object.
7190 (Sized_relobj_incr::do_layout): Replace direct data member reference
7191 with accessor function.
7192 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7193 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7194 Adjust size of input file info header.
7195 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7196 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7197 (Incremental_input_entry_reader::get_input_section): Adjust size of
7198 input file info header.
7199 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7200 of incremental info GOT entry.
7201 (Incremental_got_plt_reader::get_got_desc): Remove.
7202 (Incremental_got_plt_reader::get_got_symndx): New function.
7203 (Incremental_got_plt_reader::get_got_input_index): New function.
7204 (Sized_incremental_binary::Sized_incremental_binary): Remove
7205 file_status_; add input_objects_.
7206 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7207 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7208 (Sized_incremental_binary::file_is_unchanged): Remove.
7209 (Sized_incremental_binary::set_input_object): New function.
7210 (Sized_incremental_binary::input_object): New function.
7211 (Sized_incremental_binary::file_status_): Remove.
7212 (Sized_incremental_binary::input_objects_): New data member.
7213 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7214 references.
7215 (Sized_relobj_incr::invalid_address): Move to base class.
7216 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7217 class.
7218 (Sized_relobj_incr::do_output_section_offset): Likewise.
7219 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7220 (Sized_relobj_incr::section_offsets_): Likewise.
7221 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7222 function.
7223 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7224 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7225 with accessor function.
7226 (Sized_relobj_file::do_layout): Likewise.
7227 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7228 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7229 (Sized_relobj_file::compute_final_local_value): Replace refs to
7230 section_offsets_ with accessor function.
7231 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7232 * object.h (Relobj::Relobj): Initialize new data members.
7233 (Relobj::add_dyn_reloc): New function.
7234 (Relobj::first_dyn_reloc): New function.
7235 (Relobj::dyn_reloc_count): New function.
7236 (Relobj::first_dyn_reloc_): New data member.
7237 (Relobj::dyn_reloc_count_): New data member.
7238 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7239 references.
7240 (Sized_relobj::Address): New typedef.
7241 (Sized_relobj::invalid_address): Move here from child class.
7242 (Sized_relobj::Sized_relobj): Initialize new data members.
7243 (Sized_relobj::sized_relobj): New function.
7244 (Sized_relobj::is_output_section_offset_invalid): Move here from
7245 child class.
7246 (Sized_relobj::get_output_section_offset): Likewise.
7247 (Sized_relobj::local_has_got_offset): Likewise.
7248 (Sized_relobj::local_got_offset): Likewise.
7249 (Sized_relobj::set_local_got_offset): Likewise.
7250 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7251 (Sized_relobj::clear_got_offsets): New function.
7252 (Sized_relobj::section_offsets): Move here from child class.
7253 (Sized_relobj::do_output_section_offset): Likewise.
7254 (Sized_relobj::do_set_section_offset): Likewise.
7255 (Sized_relobj::Local_got_offsets): Likewise.
7256 (Sized_relobj::local_got_offsets_): Likewise.
7257 (Sized_relobj::section_offsets_): Likewise.
7258 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7259 references.
7260 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7261 class.
7262 (Sized_relobj_file::sized_relobj): New function
7263 (Sized_relobj_file::local_has_got_offset): Move to base class.
7264 (Sized_relobj_file::local_got_offset): Likewise.
7265 (Sized_relobj_file::set_local_got_offset): Likewise.
7266 (Sized_relobj_file::get_output_section_offset): Likewise.
7267 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7268 (Sized_relobj_file::do_output_section_offset): Likewise.
7269 (Sized_relobj_file::do_set_section_offset): Likewise.
7270 (Sized_relobj_file::Local_got_offsets): Likewise.
7271 (Sized_relobj_file::local_got_offsets_): Likewise.
7272 (Sized_relobj_file::section_offsets_): Likewise.
7273 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7274 (all constructors).
7275 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7276 (Output_reloc::get_symbol_index): Likewise.
7277 (Output_reloc::local_section_offset): Likewise.
7278 (Output_reloc::get_address): Likewise.
7279 (Output_reloc::symbol_value): Likewise.
7280 (Output_data_got::reserve_slot): Move to class definition.
7281 (Output_data_got::reserve_local): New function.
7282 (Output_data_got::reserve_slot_for_global): Remove.
7283 (Output_data_got::reserve_global): New function.
7284 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7285 (all constructors, two instantiations).
7286 (Output_reloc::get_relobj): New function (two instantiations).
7287 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7288 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7289 (Output_data_reloc::add_global): Adjust type of relobj.
7290 (Output_data_reloc::add_global_relative): Likewise.
7291 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7292 (Output_data_reloc::add_local): Likewise.
7293 (Output_data_reloc::add_local_relative): Likewise.
7294 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7295 (Output_data_reloc::add_local_section): Likewise.
7296 (Output_data_reloc::add_output_section): Likewise.
7297 (Output_data_reloc::add_absolute): Likewise.
7298 (Output_data_reloc::add_target_specific): Likewise.
7299 (Output_data_got::reserve_slot): Move definition here.
7300 (Output_data_got::reserve_local): New function.
7301 (Output_data_got::reserve_global): New function.
7302 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7303 section_offsets_ with accessor function.
7304 (Sized_relobj_file::write_sections): Likewise.
7305 (Sized_relobj_file::do_relocate_sections): Likewise.
7306 * target.h (Sized_target::reserve_local_got_entry): New function.
7307 (Sized_target::reserve_global_got_entry): New function.
7308 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7309 (Target_x86_64::reserve_global_got_entry): New function.
7310 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7311
4829d394
CC
73122011-05-23 Cary Coutant <ccoutant@google.com>
7313
7314 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7315 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7316 bit when checking got_type.
7317 * incremental.cc (Sized_incremental_binary::setup_readers):
7318 Store symbol table and string table locations; initialize bit vector
7319 of file status flags.
7320 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7321 unchanged files.
7322 (Sized_incremental_binary::do_process_got_plt): New function.
7323 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7324 (Output_section_incremental_inputs::set_final_data_size): Record
7325 file index for each input file.
7326 (Output_section_incremental_inputs::write_got_plt): Store file index
7327 instead of input entry offset for each GOT entry.
7328 * incremental.h
7329 (Incremental_input_entry::Incremental_input_entry): Initialize new
7330 data member.
7331 (Incremental_input_entry::set_offset): Store file index.
7332 (Incremental_input_entry::get_file_index): New function.
7333 (Incremental_input_entry::file_index_): New data member.
7334 (Incremental_binary::process_got_plt): New function.
7335 (Incremental_binary::do_process_got_plt): New function.
7336 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7337 data members.
7338 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7339 (Sized_incremental_binary::set_file_is_unchanged): New function.
7340 (Sized_incremental_binary::file_is_unchanged): New function.
7341 (Sized_incremental_binary::do_process_got_plt): New function.
7342 (Sized_incremental_binary::file_status_): New data member.
7343 (Sized_incremental_binary::main_symtab_loc_): New data member.
7344 (Sized_incremental_binary::main_strtab_loc_): New data member.
7345 * output.cc (Output_data_got::Got_entry::write): Add case
7346 RESERVED_CODE.
7347 (Output_data_got::add_global): Call add_got_entry.
7348 (Output_data_got::add_global_plt): Likewise.
7349 (Output_data_got::add_global_with_rel): Likewise.
7350 (Output_data_got::add_global_with_rela): Likewise.
7351 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7352 (Output_data_got::add_global_pair_with_rela): Likewise.
7353 (Output_data_got::add_local): Call add_got_entry.
7354 (Output_data_got::add_local_plt): Likewise.
7355 (Output_data_got::add_local_with_rel): Likewise.
7356 (Output_data_got::add_local_with_rela): Likewise.
7357 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7358 (Output_data_got::add_local_pair_with_rela): Likewise.
7359 (Output_data_got::reserve_slot): New function.
7360 (Output_data_got::reserve_slot_for_global): New function.
7361 (Output_data_got::add_got_entry): New function.
7362 (Output_data_got::add_got_entry_pair): New function.
7363 (Output_section::add_output_section_data): Edit FIXME.
7364 * output.h
7365 (Output_section_data_build::Output_section_data_build): New
7366 constructor with size parameter.
7367 (Output_data_space::Output_data_space): Likewise.
7368 (Output_data_got::Output_data_got): Initialize new data member; new
7369 constructor with size parameter.
7370 (Output_data_got::add_constant): Call add_got_entry.
7371 (Output_data_got::reserve_slot): New function.
7372 (Output_data_got::reserve_slot_for_global): New function.
7373 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7374 (Output_data_got::add_got_entry): New function.
7375 (Output_data_got::add_got_entry_pair): New function.
7376 (Output_data_got::free_list_): New data member.
7377 * target.h (Sized_target::init_got_plt_for_update): New function.
7378 (Sized_target::register_global_plt_entry): New function.
7379 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7380 Initialize new data member; call init; add constructor with PLT count.
7381 (Output_data_plt_x86_64::init): New function.
7382 (Output_data_plt_x86_64::add_relocation): New function.
7383 (Output_data_plt_x86_64::reserve_slot): New function.
7384 (Output_data_plt_x86_64::free_list_): New data member.
7385 (Target_x86_64::init_got_plt_for_update): New function.
7386 (Target_x86_64::register_global_plt_entry): New function.
7387 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7388 incremental updates.
7389 (Output_data_plt_x86_64::add_relocation): New function.
7390 * testsuite/object_unittest.cc (Object_test): Set default options.
7391
ec69d6da
ILT
73922011-05-16 Ian Lance Taylor <iant@google.com>
7393
7394 * options.h (class General_options): Make -i a synonym for -r.
7395
732e31de
ILT
73962011-05-16 Ian Lance Taylor <iant@google.com>
7397
7398 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7399
403676b5
CC
74002011-05-10 Cary Coutant <ccoutant@google.com>
7401
7402 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7403 strip_all (-s).
7404
5b7b7d6e
ILT
74052011-05-06 Ian Lance Taylor <iant@google.com>
7406
7407 * layout.cc (Layout::layout): If the output section flags change,
7408 update the ordering.
7409
f0f9babf
CC
74102011-04-25 Cary Coutant <ccoutant@google.com>
7411
7412 * incremental-dump.cc (dump_incremental_inputs): Print local
7413 symbol info for each input file.
7414 * incremental.cc
7415 (Output_section_incremental_inputs::set_final_data_size): Add local
7416 symbol info to input file entries in incremental info.
7417 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7418 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7419 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7420 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7421 implementation.
7422 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7423 (Sized_incr_relobj::do_relocate): Write the local symbols.
7424 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7425 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7426 Adjust size of input file header.
7427 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7428 (Incremental_inputs_reader::get_local_symbol_count): New function.
7429 (Incremental_inputs_reader::get_input_section): Adjust size of input
7430 file header.
7431 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7432 (Sized_incr_relobj::This): New typedef.
7433 (Sized_incr_relobj::sym_size): New const data member.
7434 (Sized_incr_relobj::Local_symbol): New struct.
7435 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7436 (Sized_incr_relobj::do_local_symbol_offset): New function.
7437 (Sized_incr_relobj::local_symbol_count_): New data member.
7438 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7439 (Sized_incr_relobj::local_symbol_index_): New data member.
7440 (Sized_incr_relobj::local_symbol_offset_): New data member.
7441 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7442 (Sized_incr_relobj::local_symbols_): New data member.
7443 * object.h (Relobj::output_local_symbol_count): New function.
7444 (Relobj::local_symbol_offset): New function.
7445 (Relobj::do_output_local_symbol_count): New function.
7446 (Relobj::do_local_symbol_offset): New function.
7447 (Sized_relobj::do_output_local_symbol_count): New function.
7448 (Sized_relobj::do_local_symbol_offset): New function.
7449
d0a9ace3
ILT
74502011-04-22 Vladimir Simonov <sv@sw.ru>
7451
7452 * descriptors.cc (set_close_on_exec): New function.
7453 (Descriptors::open): Use set_close_on_exec.
7454 * output.cc (S_ISLNK): Define if not defined.
7455
94a3fc8b
CC
74562011-04-22 Cary Coutant <ccoutant@google.com>
7457
7458 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7459 global symbol map.
7460 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7461 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7462 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7463 relocations.
7464 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7465 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7466 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7467 * incremental.h
7468 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7469 function.
7470 (Incremental_binary::apply_incremental_relocs): New function.
7471 (Incremental_binary::do_apply_incremental_relocs): New function.
7472 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7473 data member.
7474 (Sized_incremental_binary::add_global_symbol): New function.
7475 (Sized_incremental_binary::global_symbol): New function.
7476 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7477 (Sized_incremental_binary::symbol_map_): New data member.
7478 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7479 * target.h (Sized_target::apply_relocation): New function.
7480 * target-reloc.h (apply_relocation): New function.
7481 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7482
c87e4302
DK
74832011-04-22 Doug Kwan <dougkwan@google.com>
7484
7485 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7486 flag of a SHT_ARM_EXIDX section.
2e702c99 7487 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7488 * testsuite/Makefile.in: Regenerate.
7489 * testsuite/arm_exidx_test.s: New file.
7490 * testsuite/arm_exidx_test.sh: Same.
7491
e7782cf6
CC
74922011-04-20 Cary Coutant <ccoutant@google.com>
7493
7494 PR gold/12689
7495 * archive.h (Incremental_archive_entry::Archive_member):
7496 Initialize arg_serial_ (second constructor).
7497
308ecdc7
ILT
74982011-04-17 Ian Lance Taylor <iant@google.com>
7499
7500 * object.cc (Relocate_info::location): Simplify location string.
7501 * errors.cc (Errors::error_at_location): Don't print program
7502 name.
7503 (Errors::warning_at_location): Likewise.
7504 (Errors::undefined_symbol): Likewise.
7505 * testsuite/debug_msg.sh: Update accordingly.
7506
bec5b579
CC
75072011-04-14 Cary Coutant <ccoutant@google.com>
7508
7509 * gold/layout.cc (Layout::symtab_section_offset): New function.
7510 * gold/layout.h (Layout::symtab_section_offset): New function.
7511 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7512
88597d34
ILT
75132011-04-12 Ian Lance Taylor <iant@google.com>
7514
7515 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7516 with MREMAP_MAYMOVE.
7517 * output.h (class Output_file): Add map_is_allocated_ field.
7518 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7519 not available, provide stubs. If mremap is not available, #define
7520 it to gold_mremap.
7521 (MREMAP_MAYMOVE): Define if not defined.
7522 (Output_file::Output_file): Initialize map_is_allocated_.
7523 (Output_file::resize): Check map_is_allocated_.
7524 (Output_file::map_anonymous): If mmap fails, use malloc.
7525 (Output_file::unmap): Don't do anything for an anonymous map.
7526 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7527 is not available, provide stubs.
7528 (File_read::View::~View): Use free rather than delete[].
7529 (File_read::make_view): Use malloc rather than new[]. If mmap
7530 fails, use malloc.
7531 (File_read::find_or_make_view): Use malloc rather than new[].
7532 * gold.h: Remove HAVE_REMAP code.
7533 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7534 exists. Rename mremap to gold_mremap. If mmap is not available
7535 don't do anything.
7536 * configure, config.in: Rebuild.
7537
11e361bc
ILT
75382011-04-11 Ian Lance Taylor <iant@google.com>
7539
7540 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7541 initialize local variable v.
7542
cdc29364
CC
75432011-04-11 Cary Coutant <ccoutant@google.com>
7544
7545 * archive.cc (Archive::include_member): Adjust call to
7546 report_object.
7547 (Add_archive_symbols::run): Track argument serial numbers.
7548 (Lib_group::include_member): Likewise.
7549 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7550 * archive.h (Incremental_archive_entry::Archive_member):
7551 Initialize arg_serial_.
7552 (Archive_member::arg_serial_): New data member.
7553 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7554 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7555 incremental link.
7556 (Sized_dynobj::do_for_all_local_got_entries): New function.
7557 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7558 function.
7559 * fileread.cc (get_mtime): New function.
7560 * fileread.h (get_mtime): New function.
7561 * gold.cc (queue_initial_tasks): Check for incremental update.
7562 (process_incremental_input): New function.
7563 (queue_middle_tasks): Don't force valid target for incremental
7564 update.
7565 * incremental-dump.cc (find_input_containing_global): Adjust
7566 size of symbol info entry.
7567 (dump_incremental_inputs): Dump argument serial number and
7568 in_system_directory flag; bias shndx by 1; print symbol names
7569 when dumping per-file symbol lists; use new symbol info readers.
7570 * incremental.cc
7571 (Output_section_incremental_inputs:update_data_size): New function.
7572 (Sized_incremental_binary::setup_readers): Setup input readers
7573 for each input file; build maps for files added from libraries
7574 and scripts.
7575 (Sized_incremental_binary::check_input_args): New function.
7576 (Sized_incremental_binary::do_check_inputs): Build map of argument
7577 serial numbers to input arguments.
7578 (Sized_incremental_binary::do_file_has_changed): Rename
7579 do_file_is_unchanged to this; compare file modification times.
7580 (Sized_incremental_binary::do_init_layout): New function.
7581 (Sized_incremental_binary::do_reserve_layout): New function.
7582 (Sized_incremental_binary::do_get_input_reader): Remove.
7583 (Sized_incremental_binary::get_symtab_view): New function.
7584 (Incremental_checker::can_incrementally_link_output_file): Remove.
7585 (Incremental_inputs::report_command_line): Exclude --debug options.
7586 (Incremental_inputs::report_archive_begin): Add parameter; track
7587 argument serial numbers; don't put input file entry for archive
7588 before archive members.
7589 (Incremental_inputs::report_archive_end): Put input file entry
7590 for archive after archive members.
7591 (Incremental_inputs::report_object): Add parameter; track argument
7592 serial numbers and in_system_directory flag.
7593 (Incremental_inputs::report_script): Add parameter; track argument
7594 serial numbers.
7595 (Output_section_incremental_inputs::set_final_data_size): Adjust
7596 size of symbol info entry; check for forwarding symbols.
7597 (Output_section_incremental_inputs::write_input_files): Write
7598 in_system_directory flag and argument serial number.
7599 (Output_section_incremental_inputs::write_info_blocks): Map section
7600 indices between incremental info and original input file; store
7601 input section index for each symbol.
7602 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7603 change operator() to visit().
7604 (class Global_got_offset_visitor): Likewise.
7605 (class Global_symbol_visitor_got_plt):
7606 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7607 classes.
7608 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7609 (Sized_incr_relobj::do_read_symbols): New function.
7610 (Sized_incr_relobj::do_layout): New function.
7611 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7612 (Sized_incr_relobj::do_add_symbols): New function.
7613 (Sized_incr_relobj::do_should_include_member): New function.
7614 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7615 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7616 (Sized_incr_relobj::do_section_size): New function.
7617 (Sized_incr_relobj::do_section_name): New function.
7618 (Sized_incr_relobj::do_section_contents): New function.
7619 (Sized_incr_relobj::do_section_flags): New function.
7620 (Sized_incr_relobj::do_section_entsize): New function.
7621 (Sized_incr_relobj::do_section_address): New function.
7622 (Sized_incr_relobj::do_section_type): New function.
7623 (Sized_incr_relobj::do_section_link): New function.
7624 (Sized_incr_relobj::do_section_info): New function.
7625 (Sized_incr_relobj::do_section_addralign): New function.
7626 (Sized_incr_relobj::do_initialize_xindex): New function.
7627 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7628 (Sized_incr_relobj::do_read_relocs): New function.
7629 (Sized_incr_relobj::do_gc_process_relocs): New function.
7630 (Sized_incr_relobj::do_scan_relocs): New function.
7631 (Sized_incr_relobj::do_count_local_symbols): New function.
7632 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7633 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7634 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7635 (Sized_incr_relobj::do_relocate): New function.
7636 (Sized_incr_relobj::do_set_section_offset): New function.
7637 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7638 (Sized_incr_dynobj::do_read_symbols): New function.
7639 (Sized_incr_dynobj::do_layout): New function.
7640 (Sized_incr_dynobj::do_add_symbols): New function.
7641 (Sized_incr_dynobj::do_should_include_member): New function.
7642 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7643 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7644 (Sized_incr_dynobj::do_section_size): New function.
7645 (Sized_incr_dynobj::do_section_name): New function.
7646 (Sized_incr_dynobj::do_section_contents): New function.
7647 (Sized_incr_dynobj::do_section_flags): New function.
7648 (Sized_incr_dynobj::do_section_entsize): New function.
7649 (Sized_incr_dynobj::do_section_address): New function.
7650 (Sized_incr_dynobj::do_section_type): New function.
7651 (Sized_incr_dynobj::do_section_link): New function.
7652 (Sized_incr_dynobj::do_section_info): New function.
7653 (Sized_incr_dynobj::do_section_addralign): New function.
7654 (Sized_incr_dynobj::do_initialize_xindex): New function.
7655 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7656 (make_sized_incremental_object): New function.
7657 (Incremental_library::copy_unused_symbols): New function.
7658 (Incremental_library::do_for_all_unused_symbols): New function.
7659 * incremental.h (enum Incremental_input_flags): New type.
7660 (class Incremental_checker): Remove.
7661 (Incremental_input_entry::Incremental_input_entry): Add argument
7662 serial number.
7663 (Incremental_input_entry::arg_serial): New function.
7664 (Incremental_input_entry::set_is_in_system_directory): New function.
7665 (Incremental_input_entry::is_in_system_directory): New function.
7666 (Incremental_input_entry::arg_serial_): New data member.
7667 (Incremental_input_entry::is_in_system_directory_): New data member.
7668 (class Script_info): Move here from script.h.
7669 (Script_info::Script_info): Add filename parameter.
7670 (Script_info::filename): New function.
7671 (Script_info::filename_): New data member.
7672 (Incremental_script_entry::Incremental_script_entry): Add argument
7673 serial number.
7674 (Incremental_object_entry::Incremental_object_entry): Likewise.
7675 (Incremental_object_entry::add_input_section): Build list of input
7676 sections with map to original shndx.
7677 (Incremental_object_entry::get_input_section_index): New function.
7678 (Incremental_object_entry::shndx_): New data member.
7679 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7680 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7681 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7682 serial number.
7683 (Incremental_inputs::report_archive_begin): Likewise.
7684 (Incremental_inputs::report_object): Likewise.
7685 (Incremental_inputs::report_script): Likewise.
7686 (class Incremental_global_symbol_reader): New class.
7687 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7688 and store flags and input file type.
7689 (Incremental_input_entry_reader::arg_serial): New function.
7690 (Incremental_input_entry_reader::type): Extract type from flags.
7691 (Incremental_input_entry_reader::is_in_system_directory): New function.
7692 (Incremental_input_entry_reader::get_input_section_count): Call
7693 accessor function for type.
7694 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7695 function for type; adjust size of global symbol entry.
7696 (Incremental_input_entry_reader::get_global_symbol_count): Call
7697 accessor function for type.
7698 (Incremental_input_entry_reader::get_object_count): Likewise.
7699 (Incremental_input_entry_reader::get_object_offset): Likewise.
7700 (Incremental_input_entry_reader::get_member_count): Likewise.
7701 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7702 (Incremental_input_entry_reader::get_member_offset): Likewise.
7703 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7704 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7705 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7706 (Incremental_input_entry_reader::get_global_symbol_reader): New
7707 function.
7708 (Incremental_input_entry_reader::get_output_symbol_index): New
7709 function.
7710 (Incremental_input_entry_reader::type_): Remove.
7711 (Incremental_input_entry_reader::flags_): New data member.
7712 (Incremental_inputs_reader::input_file_offset): New function.
7713 (Incremental_inputs_reader::input_file_index): New function.
7714 (Incremental_inputs_reader::input_file): Call input_file_offset.
7715 (Incremental_inputs_reader::input_file_at_offset): New function.
7716 (Incremental_relocs_reader::get_r_type): Reformat.
7717 (Incremental_relocs_reader::get_r_shndx): Reformat.
7718 (Incremental_relocs_reader::get_r_offset): Reformat.
7719 (Incremental_relocs_reader::data): New function.
7720 (Incremental_binary::Incremental_binary): Initialize new data members.
7721 (Incremental_binary::check_inputs): Add cmdline parameter.
7722 (Incremental_binary::file_is_unchanged): Remove.
7723 (Input_reader::arg_serial): New function.
7724 (Input_reader::get_unused_symbol_count): New function.
7725 (Input_reader::get_unused_symbol): New function.
7726 (Input_reader::do_arg_serial): New function.
7727 (Input_reader::do_get_unused_symbol_count): New function.
7728 (Input_reader::do_get_unused_symbol): New function.
7729 (Incremental_binary::input_file_count): New function.
7730 (Incremental_binary::get_input_reader): Change signature to use
7731 index instead of filename.
7732 (Incremental_binary::file_has_changed): New function.
7733 (Incremental_binary::get_input_argument): New function.
7734 (Incremental_binary::get_library): New function.
7735 (Incremental_binary::get_script_info): New function.
7736 (Incremental_binary::init_layout): New function.
7737 (Incremental_binary::reserve_layout): New function.
7738 (Incremental_binary::output_file): New function.
7739 (Incremental_binary::do_check_inputs): New function.
7740 (Incremental_binary::do_file_is_unchanged): Remove.
7741 (Incremental_binary::do_file_has_changed): New function.
7742 (Incremental_binary::do_init_layout): New function.
7743 (Incremental_binary::do_reserve_layout): New function.
7744 (Incremental_binary::do_input_file_count): New function.
7745 (Incremental_binary::do_get_input_reader): Change signature.
7746 (Incremental_binary::input_args_map_): New data member.
7747 (Incremental_binary::library_map_): New data member.
7748 (Incremental_binary::script_map_): New data member.
7749 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7750 new data members.
7751 (Sized_incremental_binary::output_section): New function.
7752 (Sized_incremental_binary::inputs_reader): Add const.
7753 (Sized_incremental_binary::symtab_reader): Add const.
7754 (Sized_incremental_binary::relocs_reader): Add const.
7755 (Sized_incremental_binary::got_plt_reader): Add const.
7756 (Sized_incremental_binary::get_symtab_view): New function.
7757 (Sized_incremental_binary::Inputs_reader): New typedef.
7758 (Sized_incremental_binary::Input_entry_reader): New typedef.
7759 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7760 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7761 (Sized_incremental_binary::do_file_has_changed): New function.
7762 (Sized_incremental_binary::do_init_layout): New function.
7763 (Sized_incremental_binary::do_reserve_layout): New function.
7764 (Sized_input_reader::Inputs_reader): Remove.
7765 (Sized_input_reader::Input_entry_reader): Remove.
7766 (Sized_input_reader::do_arg_serial): New function.
7767 (Sized_input_reader::do_get_unused_symbol_count): New function.
7768 (Sized_input_reader::do_get_unused_symbol): New function.
7769 (Sized_incremental_binary::do_input_file_count): New function.
7770 (Sized_incremental_binary::do_get_input_reader): Change signature;
7771 use index instead of filename.
7772 (Sized_incremental_binary::section_map_): New data member.
7773 (Sized_incremental_binary::input_entry_readers_): New data member.
7774 (class Sized_incr_relobj): New class.
7775 (class Sized_incr_dynobj): New class.
7776 (make_sized_incremental_object): New function.
7777 (class Incremental_library): New class.
7778 * layout.cc (Free_list::num_lists): New static data member.
7779 (Free_list::num_nodes): New static data member.
7780 (Free_list::num_removes): New static data member.
7781 (Free_list::num_remove_visits): New static data member.
7782 (Free_list::num_allocates): New static data member.
7783 (Free_list::num_allocate_visits): New static data member.
7784 (Free_list::init): New function.
7785 (Free_list::remove): New function.
7786 (Free_list::allocate): New function.
7787 (Free_list::dump): New function.
7788 (Free_list::print_stats): New function.
7789 (Layout_task_runner::run): Resize output file for incremental updates.
7790 (Layout::Layout): Initialize new data members.
7791 (Layout::set_incremental_base): New function.
7792 (Layout::init_fixed_output_section): New function.
7793 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7794 incremental updates.
7795 (Layout::create_gold_note): Do not create gold note section for
7796 incremental updates.
7797 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7798 for incremental updates.
7799 (Layout::set_section_offsets): For incremental updates, allocate space
7800 from free list.
7801 (Layout::create_symtab_sections): Layout with offsets relative to
7802 start of section; for incremental updates, allocate space from free
7803 list.
7804 (Layout::create_shdrs): For incremental updates, allocate space from
7805 free list.
7806 (Layout::finish_dynamic_section): For incremental updates, do not
7807 check --as-needed (fixed in subsequent patch).
7808 * layout.h (class Free_list): New class.
7809 (Layout::set_incremental_base): New function.
7810 (Layout::incremental_base): New function.
7811 (Layout::init_fixed_output_section): New function.
7812 (Layout::allocate): New function.
7813 (Layout::incremental_base_): New data member.
7814 (Layout::free_list_): New data member.
7815 * main.cc (main): Print Free_list statistics.
7816 * object.cc (Relobj::finalize_incremental_relocs): Add
7817 clear_counts parameter; clear counts only when clear_counts is set.
7818 (Sized_relobj::Sized_relobj): Initialize new base class.
7819 (Sized_relobj::do_layout): Don't report special sections.
7820 (Sized_relobj::do_for_all_local_got_entries): New function.
7821 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7822 symtab_off to all symbol table offsets.
7823 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7824 * object.h (class Got_offset_list): Move to top of file.
7825 (Object::Object): Allow case where input_file == NULL.
7826 (Object::~Object): Likewise.
7827 (Object::input_file): Assert that input_file != NULL.
7828 (Object::lock): Allow case where input_file == NULL.
7829 (Object::unlock): Likewise.
7830 (Object::is_locked): Likewise.
7831 (Object::token): Likewise.
7832 (Object::release): Likewise.
7833 (Object::is_incremental): New function.
7834 (Object::get_mtime): New function.
7835 (Object::for_all_local_got_entries): New function.
7836 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7837 (Object::set_is_in_system_directory): New function.
7838 (Object::is_in_system_directory): New function.
7839 (Object::do_is_incremental): New function.
7840 (Object::do_get_mtime): New function.
7841 (Object::do_for_all_local_got_entries): New function.
7842 (Object::is_in_system_directory_): New data member.
7843 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7844 (class Sized_relobj_base): New class.
7845 (class Sized_relobj): Derive from Sized_relobj_base.
7846 (class Sized_relobj::Symbols): Redeclare from base class.
7847 (class Sized_relobj::local_got_offset_list): Remove.
7848 (class Sized_relobj::Output_sections): Redeclare from base class.
7849 (class Sized_relobj::do_for_all_local_got_entries): New function.
7850 (class Sized_relobj::write_local_symbols): Add offset parameter.
7851 (class Sized_relobj::local_symbol_offset_): Update comment.
7852 (class Sized_relobj::local_dynsym_offset_): Update comment.
7853 * options.cc (Input_arguments::add_file): Remove const.
7854 * options.h (Input_file_argument::Input_file_argument):
7855 Initialize arg_serial_ (all constructors).
7856 (Input_file_argument::set_arg_serial): New function.
7857 (Input_file_argument::arg_serial): New function.
7858 (Input_file_argument::arg_serial_): New data member.
7859 (Input_arguments::Input_arguments): Initialize file_count_.
7860 (Input_arguments::add_file): Remove const.
7861 (Input_arguments::number_of_input_files): New function.
7862 (Input_arguments::file_count_): New data member.
7863 (Command_line::number_of_input_files): Call
7864 Input_arguments::number_of_input_files.
7865 * output.cc (Output_segment_headers::Output_segment_headers):
7866 Set current size.
7867 (Output_section::Input_section::current_data_size): New function.
7868 (Output_section::Output_section): Initialize new data members.
7869 (Output_section::add_input_section): Don't do merge sections for
7870 an incremental link; allocate space from free list for an
7871 incremental update.
7872 (Output_section::add_output_section_data): Allocate space from
7873 free list for an incremental update.
7874 (Output_section::update_data_size): New function.
7875 (Output_section::set_fixed_layout): New function.
7876 (Output_section::reserve): New function.
7877 (Output_segment::set_section_addresses): Remove const.
7878 (Output_segment::set_section_list_addresses): Remove const; allocate
7879 space from free list for an incremental update.
7880 (Output_segment::set_offset): Adjust size of RELRO segment for an
7881 incremental update.
7882 * output.h (Output_data::current_data_size): Move here from
7883 child classes.
7884 (Output_data::pre_finalize_data_size): New function.
7885 (Output_data::update_data_size): New function.
7886 (Output_section_headers::update_data_size): new function.
7887 (Output_section_data_build::current_data_size): Move to Output_data.
7888 (Output_data_strtab::update_data_size): New function.
7889 (Output_section::current_data_size): Move to Output_data.
7890 (Output_section::set_fixed_layout): New function.
7891 (Output_section::has_fixed_layout): New function.
7892 (Output_section::reserve): New function.
7893 (Output_section::update_data_size): New function.
7894 (Output_section::has_fixed_layout_): New data member.
7895 (Output_section::free_list_): New data member.
7896 (Output_segment::set_section_addresses): Remove const.
7897 (Output_segment::set_section_list_addresses): Remove const.
7898 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7899 New function.
7900 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7901 New function.
7902 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7903 parameter when calling Add_symbols constructor; store argument
7904 serial number for members of a lib group.
7905 (Add_symbols::locks): Allow case where token == NULL.
7906 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7907 (Read_member::~Read_member): New function.
7908 (Read_member::is_runnable): New function.
7909 (Read_member::locks): New function.
7910 (Read_member::run): New function.
7911 (Check_script::~Check_script): New function.
7912 (Check_script::is_runnable): New function.
7913 (Check_script::locks): New function.
7914 (Check_script::run): New function.
7915 (Check_library::~Check_library): New function.
7916 (Check_library::is_runnable): New function.
7917 (Check_library::locks): New function.
7918 (Check_library::run): New function.
7919 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7920 (Add_symbols::library_): New data member.
7921 (class Read_member): New class.
7922 (class Check_script): New class.
7923 (class Check_library): New class.
7924 * reloc.cc (Read_relocs::is_runnable): Allow case where
7925 token == NULL.
7926 (Read_relocs::locks): Likewise.
7927 (Scan_relocs::locks): Likewise.
7928 (Relocate_task::locks): Likewise.
7929 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7930 to clear counters.
7931 (Sized_relobj::incremental_relocs_scan): Fix comment.
7932 (Sized_relobj::do_relocate): Pass output file offset to
7933 write_local_symbols.
7934 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7935 from class declaration.
7936 * script.cc (read_input_script): Allocate Script_info; pass
7937 argument serial number to report_script.
7938 * script.h (class Script_info): Move to incremental.h.
7939 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7940 * symtab.h (Symbol_table::add_from_incrobj): New function.
7941 (Symbol_table::set_file_offset): New function.
7942
b961d0d7
CC
79432011-04-05 Cary Coutant <ccoutant@google.com>
7944
7945 * incremental-dump.cc (dump_incremental_inputs): Change signature
7946 to take a Sized_incremental_binary; change caller. Use readers
7947 in Sized_incremental_binary.
7948 * incremental.cc
7949 (Sized_incremental_binary::find_incremental_inputs_sections):
7950 Rename do_find_incremental_inputs_sections to this.
7951 (Sized_incremental_binary::setup_readers): New function.
7952 (Sized_incremental_binary::do_check_inputs): Check
7953 has_incremental_info_ flag; move setup code to setup_readers;
7954 use input readers.
7955 (Sized_incremental_binary::do_file_is_unchanged): New function.
7956 (Sized_incremental_binary::do_get_input_reader): New function.
7957 * incremental.h (class Incremental_binary): Move to end of file.
7958 (Incremental_binary::file_is_unchanged): New function.
7959 (Incremental_binary::do_file_is_unchanged): New function.
7960 (Incremental_binary::Input_reader): New class.
7961 (Incremental_binary::get_input_reader): New function.
7962 (class Sized_incremental_binary): Move to end of file.
7963 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7964 input section reader classes.
7965 (Sized_incremental_binary::has_incremental_info): New function.
7966 (Sized_incremental_binary::inputs_reader): New function.
7967 (Sized_incremental_binary::symtab_reader): New function.
7968 (Sized_incremental_binary::relocs_reader): New function.
7969 (Sized_incremental_binary::got_plt_reader): New function.
7970 (Sized_incremental_binary::do_file_is_unchanged): New function.
7971 (Sized_incremental_binary::Sized_input_reader): New class.
7972 (Sized_incremental_binary::get_input_reader): New function.
7973 (Sized_incremental_binary::find_incremental_inputs_sections):
7974 Rename do_find_incremental_inputs_sections to this.
7975 (Sized_incremental_binary::setup_readers): New function.
7976 (Sized_incremental_binary::has_incremental_info_): New data member.
7977 (Sized_incremental_binary::inputs_reader_): New data member.
7978 (Sized_incremental_binary::symtab_reader_): New data member.
7979 (Sized_incremental_binary::relocs_reader_): New data member.
7980 (Sized_incremental_binary::got_plt_reader_): New data member.
7981 (Sized_incremental_binary::current_input_file_): New data member.
7982
a869183f
PP
79832011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7984
7985 PR gold/12640
7986 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7987 violation.
7988
79892011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7990
7991 * archive.cc (Archive::include_member): Adjust call to report_object.
7992 (Add_archive_symbols::run): Add script_info to call to
7993 report_archive_begin.
7994 (Lib_group::include_member): Adjust call to report_object.
7995 (Add_lib_group_symbols::run): Adjust call to report_object.
7996 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7997 blocks. Add object count for script input files.
7998 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7999 script_info parameter; change all callers.
8000 (Incremental_inputs::report_object): Add script_info parameter;
8001 change all callers.
8002 (Incremental_inputs::report_script): Store backpointer to
8003 incremental info entry.
8004 (Output_section_incremental_inputs::set_final_data_size): Record
8005 additional information for scripts.
8006 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8007 * incremental.h (Incremental_script_entry::add_object): New function.
8008 (Incremental_script_entry::get_object_count): New function.
8009 (Incremental_script_entry::get_object): New function.
8010 (Incremental_script_entry::objects_): New data member; adjust
8011 constructor.
8012 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8013 (Incremental_inputs::report_object): Add script_info parameter.
8014 (Incremental_inputs_reader::get_object_count): New function.
8015 (Incremental_inputs_reader::get_object_offset): New function.
8016 * options.cc (Input_arguments::add_file): Return reference to
8017 new input argument.
8018 * options.h (Input_argument::set_script_info): New function.
8019 (Input_argument::script_info): New function.
8020 (Input_argument::script_info_): New data member; adjust all
8021 constructors.
8022 (Input_file_group::add_file): Return reference to new input argument.
8023 (Input_file_lib::add_file): Likewise.
8024 (Input_arguments::add_file): Likewise.
8025 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8026 * script.cc (Parser_closure::Parser_closure): Add script_info
8027 parameter; adjust all callers.
8028 (Parser_closure::script_info): New function.
8029 (Parser_closure::script_info_): New data member.
8030 (read_input_script): Report scripts earlier to incremental info.
8031 (script_add_file): Set script_info in Input_argument.
8032 (script_add_library): Likewise.
8033 * script.h (Script_options::Script_info): Rewrite class.
8034
a869183f 80352011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8036
8037 * archive.cc (Library_base::should_include_member): Move
8038 method here from class Archive.
8039 (Archive::Archive): Initialize base class.
8040 (Archive::should_include_member): Move to base class.
8041 (Archive::do_for_all_unused_symbols): New function.
8042 (Add_archive_symbols::run): Remove redundant access to
8043 incremental_inputs.
8044 (Lib_group::Lib_group): Initialize base class.
8045 (Lib_group::do_filename): New function.
8046 (Lib_group::include_member): Pass pointer to Lib_group to
8047 report_object.
8048 (Lib_group::do_for_all_unused_symbols): New function.
8049 (Add_lib_group_symbols::run): Report archive information for
8050 incremental links.
8051 * archive.h (class Library_base): New base class.
8052 (class Archive): Derive from Library_base.
8053 (Archive::filename): Move to base class.
8054 (Archive::set_incremental_info): Likewise.
8055 (Archive::incremental_info): Likewise.
8056 (Archive::Should_include): Likewise.
8057 (Archive::should_include_member): Likewise.
8058 (Archive::Armap_entry): Remove.
8059 (Archive::Unused_symbol_iterator): Remove.
8060 (Archive::unused_symbols_begin): Remove.
8061 (Archive::unused_symbols_end): Remove.
8062 (Archive::do_filename): New function.
8063 (Archive::do_get_mtime): New function.
8064 (Archive::do_for_all_unused_symbols): New function.
8065 (Archive::task_): Move to base class.
8066 (Archive::incremental_info_): Likewise.
8067 (class Lib_group): Derive from Library_base.
8068 (Lib_group::do_filename): New function.
8069 (Lib_group::do_get_mtime): New function.
8070 (Lib_group::do_for_all_unused_symbols): New function.
8071 (Lib_group::task_): Move to base class.
8072 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8073 function.
8074 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8075 function.
8076 * incremental.cc (Incremental_inputs::report_archive_begin):
8077 Use Library_base; call library's get_mtime; add incremental inputs
8078 entry before members.
8079 (class Unused_symbol_visitor): New class.
8080 (Incremental_inputs::report_archive_end): Use Library_base; use
8081 visitor class to record unused symbols; don't add incremental inputs
8082 entry after members.
8083 (Incremental_inputs::report_object): Use Library_base.
8084 * incremental.h
8085 (Incremental_archive_entry::Incremental_archive_entry): Remove
8086 unused Archive parameter.
8087 (Incremental_inputs::report_archive_begin): Use Library_base.
8088 (Incremental_inputs::report_archive_end): Likewise.
8089 (Incremental_inputs::report_object): Likewise.
8090 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8091 function.
8092 * object.h (Object::for_all_global_symbols): New function.
8093 (Object::do_for_all_global_symbols): New function.
8094 (Sized_relobj::do_for_all_global_symbols): New function.
8095 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8096 function.
8097 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8098 function.
8099
61ab3e40
ILT
81002011-03-27 Ian Lance Taylor <iant@google.com>
8101
8102 * archive.cc (Archive::interpret_header): Return -1 if something
8103 goes wrong. Change callers accordingly.
8104
30e1f9e6
CC
81052011-03-25 Cary Coutant <ccoutant@google.com>
8106
8107 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8108 * testsuite/Makefile.in: Regenerate.
8109
9370ce59 81102011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8111
8112 * plugin.cc (get_view): New.
8113 (Plugin::load): Pass get_view to the plugin.
8114 (Plugin_manager::get_view): New.
8115
9312bb0a
ILT
81162011-03-21 Ian Lance Taylor <iant@google.com>
8117
8118 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8119 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8120
7e12ba9e
ST
81212011-03-21 Sriraman Tallam <tmsriram@google.com>
8122
8123 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8124 Change == to -eq.
8125 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8126 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8127 Change == to -eq.
8128 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8129 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8130
fd7a005d
ILT
81312011-03-14 Ian Lance Taylor <iant@google.com>
8132
8133 * script-sections.cc (Sort_output_sections::script_compare):
8134 Rename from is_before, change return type.
8135 (Sort_output_sections::operator()): Adjust accordingly.
8136
ed16fd1b
ILT
81372011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8138
8139 PR gold/12572
8140 * testsuite/odr_violation2.cc: Add comment to make all error line
8141 numbers double digits.
8142 * testsuite/debug_msg.sh: Adjust expected errors.
8143
71ff8986
ILT
81442011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8145
8146 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8147 but mark earlier ones as non-canonical
8148 (offset_to_iterator): Update search target and example
8149 (do_addr2line): Return extra lines in a vector*
8150 (format_file_lineno): Extract from do_addr2line
8151 (one_addr2line): Add vector* out-param
8152 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8153 when a lineno entry appeared last for its instruction
8154 (Dwarf_line_info): Add vector* out-param
8155 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8156 * symtab.cc (Odr_violation_compare): Include the lineno in the
8157 comparison again.
8158 (linenos_from_loc): New. Combine the canonical line for an
8159 address with its other lines.
8160 (True_if_intersect): New. Helper functor to make
8161 std::set_intersection a query.
8162 (detect_odr_violations): Compare sets of lines instead of just
8163 one line for each function. This became less deterministic, but
8164 has fewer false positives.
8165 * symtab.h: Declarations.
8166 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8167 mix an optimized and non-optimized object in the same binary
8168 (odr_violation2.so): Same.
8169 * testsuite/Makefile.in: Regenerate from Makefile.am.
8170 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8171 * testsuite/debug_msg.sh: Update line numbers and add
8172 assertions.
8173 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8174 non-optimized context.
8175 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8176 isn't inlined, and use OdrDerived in an optimized context.
8177 * testsuite/odr_header1.h: Defines OdrDerived, where
8178 optimization will change the
8179 first-instruction-in-the-destructor's file and line number.
8180 * testsuite/odr_header2.h: Defines OdrBase.
8181
a19fefdc
ILT
81822011-03-09 Ian Lance Taylor <iant@google.com>
8183
8184 * fileread.cc (File_read::clear_views): Don't delete the whole
8185 file view.
8186
ecb351e9
ILT
81872011-03-08 Ian Lance Taylor <iant@google.com>
8188
8189 PR gold/12525
8190 * fileread.cc: #include <climits>.
8191 (GOLD_IOV_MAX): Define.
8192 (File_read::read_multiple): Limit number of entries by iov_max.
8193 * fileread.h (class File_read): Always set max_readv_entries to
8194 128.
8195
b821d13c
ILT
81962011-03-07 Ian Lance Taylor <iant@google.com>
8197
8198 PR gold/12525
8199 * options.h (class General_options): Add -dy and -dn.
8200
89243142
CC
82012011-03-02 Cary Coutant <ccoutant@google.com>
8202
8203 * testsuite/script_test_9.t: Add TLS segment.
8204
d0773f31
ILT
82052011-03-02 Simon Baldwin <simonb@google.com>
8206
8207 * configure.ac: Add check for gnu_indirect_function support in
8208 the toolchain building binutils.
8209 * configure: Rebuild.
8210
9370ce59 82112011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8212
8213 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8214 plugin only symbols.
8215 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8216 in plugin files as not needed in the symbol table.
8217
4cf7a849
ST
82182011-02-11 Sriraman Tallam <tmsriram@google.com>
8219
8220 * output.cc (Output_section::add_input_section): Delay fill
8221 generation for section ordering.
8222
b578bd7d
ILT
82232011-02-09 Ian Lance Taylor <iant@google.com>
8224
8225 PR gold/12316
8226 * object.h (class Sized_relobj): Remove clear_local_symbols.
8227 * reloc.cc (Sized_relobj::do_relocate): Don't call
8228 clear_local_symbols.
8229
9370ce59 82302011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8231
8232 * plugin.cc (is_visible_from_outside): Return true for symbols
8233 in the -u option.
8234
55382fb7
ILT
82352011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8236
8237 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8238 filename.
8239
4e271fff
ST
82402011-02-02 Sriraman Tallam <tmsriram@google.com>
8241
8242 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8243 to std::string.
4e271fff 8244 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8245 section_name to be std::string.
4e271fff
ST
8246 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8247
d433c3ac
ILT
82482011-01-25 Ian Lance Taylor <iant@google.com>
8249
8250 * script.cc (script_add_extern): Rewrite to use
8251 add_symbol_reference.
8252
880473a6
DK
82532011-01-25 Doug Kwan <dougkwan@google.com>
8254
d433c3ac 8255 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8256
f30f86fa
ILT
82572011-01-24 Ian Lance Taylor <iant@google.com>
8258
8259 * options.h (class General_options): Accept
8260 --no-detect-odr-violations.
8261
8e51a0b9
ILT
82622011-01-24 Ian Lance Taylor <iant@google.com>
8263
8264 * version.cc (version_string): Bump to 1.11.
8265
0f3b89d8
ILT
82662011-01-24 Ian Lance Taylor <iant@google.com>
8267
8268 * plugin.cc (class Plugin_rescan): Define new class.
8269 (Plugin_manager::claim_file): Set any_claimed_.
8270 (Plugin_manager::save_archive): New function.
8271 (Plugin_manager::save_input_group): New function.
8272 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8273 necessary.
8274 (Plugin_manager::new_undefined_symbol): New function.
8275 (Plugin_manager::rescan): New function.
8276 (Plugin_manager::rescannable_defines): New function.
8277 (Plugin_manager::add_input_file): Set any_added_.
8278 * plugin.h (class Plugin_manager): define new fields rescannable_,
8279 undefined_symbols_, any_claimed_, and any_added_. Declare
8280 Plugin_rescan as friend. Declare new functions.
8281 (Plugin_manager::Rescannable): Define type.
8282 (Plugin_manager::Rescannable_list): Define type.
8283 (Plugin_manager::Undefined_symbol_list): Define type.
8284 (Plugin_manager::Plugin_manager): Initialize new fields.
8285 * archive.cc (Archive::defines_symbol): New function.
8286 (Add_archive_symbols::run): Pass archive to plugins if any.
8287 * archive.h (class Archive): Declare defines_symbol.
8288 * readsyms.cc (Input_group::~Input_group): New function.
8289 (Finish_group::run): Pass input_group to plugins if any.
8290 * readsyms.h (class Input_group): Declare destructor.
8291 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8292 any.
8293
3bb951e5
ILT
82942011-01-10 Ian Lance Taylor <iant@google.com>
8295
8296 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8297 section as relro.
8298 (Layout::set_segment_offsets): Reset increase_relro before calling
8299 set_section_addresses a second time.
8300
0aa45fac
CC
83012011-01-04 Cary Coutant <ccoutant@google.com>
8302
8303 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8304 sections before NOBITS sections.
8305
0db46eb4
L
83062011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8307
8308 * version.cc (print_version): Update copyright to 2011.
8309
829c9745
CC
83102010-12-23 Cary Coutant <ccoutant@google.com>
8311
8312 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8313 of OS to this->add. Add OD parameter to second form of the function.
8314
7500420b
ILT
83152010-12-20 Ian Lance Taylor <iant@google.com>
8316
8317 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8318 second of two consecutive entries with same offset.
8319
f8e9a930
RW
83202010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8321
8322 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8323 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8324 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8325 to avoid unneeded links against $(LDADD).
8326 * testsuite/Makefile.in: Regenerate.
8327
2fbb4320
ILT
83282010-12-15 Ian Lance Taylor <iant@google.com>
8329
8330 PR gold/12324
8331 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8332 for R_X86_64_32 and R_X86_64_PC32.
8333 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8334 ver_matching_def_pic.o.
8335 (ver_matching_def_pic.o): New target.
8336
fedb228d
RW
83372010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8338
8339 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8340 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8341 Move definition before File_read::View member definitions.
8342 (File_read::View::~View): Initialize and hold lock before
8343 updating current_mapped_bytes.
8344
9b547ce6
RW
83452010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8346
8347 * dwarf_reader.cc: Remove outdated comment.
8348 * gold-threads.cc: Fix typo in error message.
8349 * archive.cc: Fix typos in comments.
8350 * archive.h: Likewise.
8351 * arm-reloc-property.cc: Likewise.
8352 * arm-reloc-property.h: Likewise.
8353 * arm-reloc.def: Likewise.
8354 * arm.cc: Likewise.
8355 * attributes.h: Likewise.
8356 * cref.cc: Likewise.
8357 * ehframe.cc: Likewise.
8358 * fileread.h: Likewise.
8359 * gold.h: Likewise.
8360 * i386.cc: Likewise.
8361 * icf.cc: Likewise.
8362 * incremental.h: Likewise.
8363 * int_encoding.cc: Likewise.
8364 * layout.h: Likewise.
8365 * main.cc: Likewise.
8366 * merge.h: Likewise.
8367 * object.cc: Likewise.
8368 * object.h: Likewise.
8369 * options.cc: Likewise.
8370 * readsyms.cc: Likewise.
8371 * reduced_debug_output.cc: Likewise.
8372 * reloc.cc: Likewise.
8373 * script-sections.cc: Likewise.
8374 * sparc.cc: Likewise.
8375 * symtab.h: Likewise.
8376 * target-reloc.h: Likewise.
8377 * target.cc: Likewise.
8378 * target.h: Likewise.
8379 * timer.cc: Likewise.
8380 * timer.h: Likewise.
8381 * x86_64.cc: Likewise.
8382
83e17bd5
CC
83832010-12-09 Cary Coutant <ccoutant@google.com>
8384
8385 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8386 stack.
8387 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8388 parameter; change all callers.
8389 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8390 * options.h (warn_execstack): New option.
8391
017257f8
DK
83922010-12-07 Doug Kwan <dougkwan@google.com>
8393
8394 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8395 like function call relocations.
8396
c20cbc06
ILT
83972010-12-07 Ian Lance Taylor <iant@google.com>
8398
8399 * archive.cc (Archive::get_elf_object_for_member): Permit
8400 punconfigured to be NULL.
8401 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8402 (Archive::include_member): Pass NULL to get_elf_object_for_member
8403 if we searched for the archive and this is the first included
8404 object.
8405
4dbfafcc
ILT
84062010-12-01 Ian Lance Taylor <iant@google.com>
8407
8408 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8409 track_relocs_type_ field.
8410 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8411 Set track_relocs_type_.
8412 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8413 contents when using RELA relocs.
8414 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8415 reloc_map_.
8416 * reloc.cc (Track_relocs::next_addend): New function.
8417 * reloc.h (class Track_relocs): Declare next_addend.
8418
e5e19edd
ILT
84192010-12-01 Ian Lance Taylor <iant@google.com>
8420
8421 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8422 virtual destructor.
8423
9a5ce24c
ILT
84242010-12-01 Ian Lance Taylor <iant@google.com>
8425
8426 * README: Update compilers known to work and fail.
8427
c7791212
NC
84282010-11-23 Matthias Klose <doko@ubuntu.com>
8429
8430 * configure.in: For --enable-gold, handle value `default' instead of
8431 `both*'. Always install ld as ld.bfd, install as ld if gold is
8432 not the default.
8433 * configure: Regenerate.
8434
0ad220c9
DK
84352010-11-18 Doug Kwan <dougkwan@google.com>
8436
8437 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8438 and right_alignment to be zero. Store result alignment only if it is
8439 greater than existing alignment.
8440
ab8056e0
CC
84412010-11-16 Cary Coutant <ccoutant@google.com>
8442
8443 PR gold/12220
8444 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8445 Check for ".zdebug_line".
8446
fd064a5b
CC
84472010-11-16 Doug Kwan <dougkwan@google.com>
8448 Cary Coutant <ccoutant@google.com>
8449
8450 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8451 by reference; adjust all callers.
8452 * output.cc (Output_segment::set_section_addresses): Adjust references
8453 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8454 list is empty.
8455 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8456 end at page boundary.
8457
6fc6ea19
CC
84582010-11-16 Cary Coutant <ccoutant@google.com>
8459
8460 PR gold/12220
8461 * layout.cc (Layout::choose_output_section): Transform names of
8462 compressed sections even when using a script with a SECTIONS clause.
8463 (Layout::output_section_name): Remove code to transform
8464 compressed debug section names.
8465 * output.cc (Output_section::add_input_section): Use uncompressed
8466 section size when tracking input sections.
8467
95a2c8d6
RS
84682010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8469
8470 * symtab.h (Symbol::NON_PIC_REF): Remove.
8471 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8472 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8473 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8474 (Symbol::use_plt_offset): Take a flags argument and pass it
8475 directly to needs_dynamic_reloc. Restrict check for undefined
8476 weak symbols to function calls.
8477 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8478 (Target_arm::Scan::global): Use it.
8479 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8480 (Target_arm::Relocate::relocate): Likewise.
8481 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8482 parameter with an r_type parameter. Use get_reference_flags
8483 to get the flags.
8484 (Target_arm::Relocate::relocate): Update accordingly.
8485 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8486 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8487 (Target_i386::Scan::global): Likewise.
8488 (Target_i386::Relocate::relocate): Likewise.
8489 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8490 parameter with an r_type parameter. Use get_reference_flags
8491 to get the flags.
8492 (Target_i386::Relocate::relocate): Update accordingly.
8493 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8494 (Target_powerpc::Scan::global): Use it.
8495 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8496 (Target_powerpc::Relocate::relocate): Likewise.
8497 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8498 (Target_sparc::Scan::global): Use it.
8499 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8500 (Target_sparc::Relocate::relocate): Likewise.
8501 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8502 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8503 (Target_x86_64::Scan::global): Likewise.
8504 (Target_x86_64::Relocate::relocate): Likewise.
8505
f625ae50
DK
85062010-11-08 Doug Kwan <dougkwan@google.com>
8507 Cary Coutant <ccoutant@google.com>
8508
8509 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8510 (Arm_exidx_merge_section::section_contents_): New data member.
8511 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8512 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8513 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8514 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8515 in parameters instead of calling Object::section_contents without
8516 locking.
8517 (Arm_output_section::group_section): New parameter TASK. Pass it
8518 to callees that need locking objects.
8519 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8520 to lock EXIDX input sections. Fix a formatting issue. Call
8521 Arm_exidx_merged_section::build_contents to create merged section
8522 contents.
8523 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8524 to lock object of stub table owner.
8525 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8526 TEXT_SIZE to initialize data member TEXT_SIZE_.
8527 (Arm_exidx_input_section::addralign): Fix typo in comment.
8528 (Arm_exidx_input_section::text_size): New method.
8529 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8530 that require locking objects. Lock objects before scanning for stubs
8531 and updating local symbols.
8532 (Arm_input_section<big_endian>::init): Copy contents of original
8533 input section.
2e702c99 8534 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8535 original input section instead of calling Object::section_contents
8536 without locking.
8537 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8538 size without calling Object::section_size().
8539 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8540 for size. Allocate a buffer for merged EXIDX entries.
8541 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8542 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8543 building code to Arm_exidx_merged_section::build_contetns. Write
8544 out contetns in buffer instead of building it on the fly.
8545 (Arm_relobj::make_exidx_input_section): Also pass text section size
8546 to Arm_exidx_input_section constructor.
8547 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8548 (Arm_dynobj::do_read_symbols): Fix memory leak.
8549 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8550 * target.h: (class Task): Add forward declaration.
8551 (Target::relax): Add new parameter TASK and pass it to
8552 Target::do_relax().
8553 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8554
5f9bcf58
CC
85552010-11-05 Cary Coutant <ccoutant@google.com>
8556
8557 PR gold/10708
8558 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8559 object when reading from the file.
8560 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8561 second layout pass.
8562 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8563 when reading section contents.
8564 (get_section_contents): Likewise.
8565 (icf::find_identical_sections): Likewise.
8566 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8567 object when reading from the file.
8568 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8569 the object when doing deferred section layout.
8570
e597fa08
NC
85712010-11-03 Nick Clifton <nickc@redhat.com>
8572
8573 PR gold/12001
8574 * script.h (class Symbol_assignment: name): New member. Returns
8575 the name of the symbol.
8576 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8577 Returns true if the given symbol name is on the list of
8578 assignments wating to be processed.
8579 * archive.cc (should_incldue_member): If the symbol is undefined,
8580 check to see if it is on the list of symbols pending assignment.
8581
3f9a3278
ILT
85822010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8583
8584 * script-sections.cc (Script_sections::find_memory_region): Check
8585 for a NULL output section pointer.
8586
d06fb4d1
DK
85872010-10-29 Doug Kwan <dougkwan@google.com>
8588
8589 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8590 Output_section::add_relaxed_input_section.
8591 * output.cc (Output_section::add_relaxed_input_section): Add new
8592 arguments LAYOUT and NAME. Set section order index.
8593 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8594 Copy section order index.
8595 * output.h (Output_section::add_relaxed_input_section): Add new
8596 arguments LAYOUT and NAME.
8597
90e24de5
ILT
85982010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8599
8600 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8601 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8602 * testsuite/Makefile.in: Regenerate.
8603
c9484ea5
DK
86042010-10-20 Doug Kwan <dougkwan@google.com>
8605
8606 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8607 without SHF_LINK_ORDER flags.
8608 * layout.cc (Layout::choose_output_section): Do not filter
8609 SHF_LINK_ORDER flag in a relocatable link.
8610
5bc2f5be
CC
86112010-10-17 Cary Coutant <ccoutant@google.com>
8612
8613 * output.h (Output_segment::set_section_addresses): Change function
8614 signature. Update all callers.
8615 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8616 sections.
8617 (Output_segment::set_section_addresses): Align after last TLS
8618 section. Add padding before last relro section instead of after.
8619
0c91cf04
DK
86202010-10-17 Doug Kwan <dougkwan@google.com>
8621
8622 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8623 GOT output section to be writable.
8624
8c21d9d3
CC
86252010-10-14 Cary Coutant <ccoutant@google.com>
8626
8627 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8628 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8629 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8630 mode.
8631 * incremental.cc (report_command_line): Ignore all forms of
8632 --incremental.
8633 * layout.cc (Layout::Layout): Check parameters for incremental link
8634 mode.
8635 * options.cc (General_options::parse_incremental): New function.
8636 (General_options::parse_no_incremental): New function.
8637 (General_options::parse_incremental_full): New function.
8638 (General_options::parse_incremental_update): New function.
8639 (General_options::incremental_mode_): New data member.
8640 (General_options::finalize): Check incremental_mode_.
8641 * options.h (General_options): Update help text for --incremental.
8642 Add --no-incremental, --incremental-full, --incremental-update.
8643 (General_options::Incremental_mode): New enum type.
8644 (General_options::incremental_mode): New function.
8645 (General_options::incremental_mode_): New data member.
8646 * parameters.cc (Parameters::incremental_mode_): New data member.
8647 (Parameters::set_options): Set incremental_mode_.
8648 (Parameters::set_incremental_full): New function.
8649 (Parameters::incremental): New function.
8650 (Parameters::incremental_update): New function.
8651 (set_parameters_incremental_full): New function.
8652 * parameters.h (Parameters::set_incremental_full): New function.
8653 (Parameters::incremental): New function.
8654 (Parameters::incremental_update): New function.
8655 (Parameters::incremental_mode_): New data member.
8656 (set_parameters_incremental_full): New function.
8657 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8658 incremental link mode.
8659 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8660 (Sized_relobj::do_relocate_sections): Likewise.
8661 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8662 option.
8663 * testsuite/Makefile.in: Regenerate.
8664 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8665
bb32aa18 86662010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8667
8668 * script-sections.h (class Script_sections): Make
8669 Sections_elements typedef public.
8670 * script-sections.cc (class Sort_output_sections): Add elements_
8671 field. Add constructor which sets it; change all callers.
8672 (Sort_output_sections::is_before): New function.
8673 (Sort_output_sections::operator()): Call is_before.
8674 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8675 conditional.
8676 * testsuite/script_test_10.sh: New test. Test script section
8677 order.
8678 * testsuite/script_test_10.t: Likewise.
8679 * testsuite/script_test_10.s: Likewise.
8680 * testsuite/Makefile.am: Wrap the cross linker tests and the
8681 common tests into NATIVE_OR_CROSS_LINKER.
8682 (check_SCRIPTS): Add script_test_10.sh.
8683 (check_DATA): Add script_test_10.stdout.
8684 (script_test_10.o, script_test_10): New targets.
8685 (script_test_10.stdout): New target.
8686 * configure, testsuite/Makefile.in: Regenerate.
8687
3cef7179
ILT
86882010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8689
8690 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8691 error for the deprecated relocations.
8692 (Target_arm::Scan::global): Likewise.
8693 (Target_arm::Relocate::relocate): Likewise.
8694
7411e9a8
RS
86952010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8696
8697 * fileread.cc (Input_file::find_file): Initialize *found_name
8698 and *namep when using the fallback search for case 4.
8699
6a9da32a
CC
87002010-10-11 Cary Coutant <ccoutant@google.com>
8701
8702 * options.h (class General_options): Redefine -z lazy as an alias for
8703 the negation of -z now.
8704
ac897c20
ILT
87052010-10-11 Ian Lance Taylor <iant@google.com>
8706
8707 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8708 binding.
8709
ea5cae92
NC
87102010-10-06 Nick Clifton <nickc@redhat.com>
8711
8712 * script-sections.cc(class Memory_region): Remove
8713 current_lma_offset_ field. Rename current_vma_offset_ to
8714 current_offset_. Add last_section_ field.
8715 (Memory_region::get_current_vma_address): Rename to
8716 get_current_address.
8717 (Memory_region::get_current_lma_address): Delete.
8718 (Memory_region::increment_vma_offset): Rename to
8719 increment_offset.
8720 (Memory_region::increment_lma_offset): Delete.
8721 (Memory_region::attributes_compatible): New method. Returns
8722 true if the provided section is compatible with the region.
8723 (Memory_region::get_last_section): New method. Returns the last
8724 section to use the region.
8725 (Memory_region::set_last_section): New method. Stores the last
8726 section to use the region.
8727 (Script_sections::block_in_region): New method. Returns true if
8728 a block of memory is contained within a region.
8729 (Script_sections::find_memory_region): New method. Locates a
8730 memory region to be used to set a VMA or LMA address.
8731 (Output_section_definition::set_section_addresses): Add code to
8732 check for addresses set by memory regions.
8733 (Output_segment::set_section_addresses): Remove memory region
8734 walking code.
8735 (Script_sections::create_segment): Add a warning if a header
8736 segment is created outside of any region.
8737 * script-sections.h (class Script_sections): Add prototypes for
8738 find_memory_region and block_in_region methods.
8739 * testsuite/memory_test.s: Use .long instead of .word.
8740 * testsuite/memory_test.t: Add some more output sections.
8741 * testsuite/memory_test.sh: Update expected output.
8742
a9bfd952
DK
87432010-10-02 Doug Kwan <dougkwan@google.com>
8744
8745 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8746 defintion to symtab.h
8747 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8748 declaration to defintion.
8749
bacff3ab
NC
87502010-10-01 Nick Clifton <nickc@redhat.com>
8751
8752 * expression.cc (eval): Replace dummy argument with NULL.
8753 (eval_maybe_dot): Check for a NULL result section pointer.
8754 (Symbol_expression::value): Likewise.
8755 (Dot_expression::value): Likewise.
8756 (BINARY_EXPRESSION): Likewise.
8757 (Max_expression::value): Likewise.
8758 (Min_expression::value): Likewise.
8759 (Absolute_expression::value): Likewise.
8760 (Addr_expression::value_from_output_section): Likewise.
8761 (Loaddddr_expression::value_from_output_section): Likewise.
8762 (Segment_start_expression::value): Likewise.
8763 * script-sections.cc
8764 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8765 argument with NULL.
8766 (Sections_elememt_dot_assignment::set_section_addresses):
8767 Likewise.
8768 (Output_data_expression::do_write_to_buffer): Likewise.
8769 (Output_section_definition::finalize_symbols): Likewise.
8770 (Output_section_definition::set_section_addresses): Likewise.
8771
f81bc8b5
DK
87722010-09-30 Doug Kwan <dougkwan@google.com>
8773
8774 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8775
c95e9f27
ST
87762010-09-28 Sriraman Tallam <tmsriram@google.com>
8777
8778 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8779 function.
c95e9f27
ST
8780 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8781 virtual function.
8782 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8783 virtual function.
8784 * icf.cc (get_section_contents): Inline merge sections only when
8785 target allows it.
8786
3cac54d2
RW
87872010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8788
8789 * configure: Regenerate.
8790
2904037a
ILT
87912010-09-17 Ian Lance Taylor <iant@google.com>
8792
8793 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8794 * testsuite/Makefile.am (memory_test.o): New target.
8795 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8796 memory_test.t.
8797 * testsuite/Makefile.in: Rebuild.
2904037a 8798
bca7fb63
DK
87992010-09-17 Doug Kwan <dougkwan@google.com>
8800
8801 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8802 defintion if relocation uses GOT entries of the symbol.
8803 * testsuite/icf_safe_test.sh: Fix test.
8804 * testsuite/icf_safe_so_test.sh: Fix test.
8805
4ef28648
CC
88062010-09-16 Cary Coutant <ccoutant@google.com>
8807
8808 * script_sections.cc (class Memory_region): Remove "NULL" from
8809 vector initializations.
8810
793990de
CC
88112010-09-15 Cary Coutant <ccoutant@google.com>
8812
8813 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8814 Resolve forwarding symbols.
8815
81e015e2
DK
88162010-09-15 Doug Kwan <dougkwan@google.com>
8817
8818 * gold/testsuite/script_test_3.t: Add ARM special sections.
8819 * gold/testsuite/script_test_4.t: Same.
8820 * gold/testsuite/script_test_5.t: Same.
8821 * gold/testsuite/script_test_6.t: Same.
8822 * gold/testsuite/script_test_7.t: Same.
8823 * gold/testsuite/script_test_7.t: Same.
8824 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8825
36171d64
CC
88262010-09-14 Cary Coutant <ccoutant@google.com>
8827
8828 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8829 (Target_x86_64::Relocate::relocate_tls): Replace check for
8830 saw_tls_block_reloc_ with test for executable section.
8831
d89051bd
CC
88322010-09-12 Cary Coutant <ccoutant@google.com>
8833
8834 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8835 position-independent executables to shared libraries need dynamic
8836 relocations.
8837 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8838 position-independent executables.
8839 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8840 * testsuite/Makefile.in: Regenerate.
8841
fca41f0f
NC
88422010-09-10 Nick Clifton <nickc@redhat.com>
8843
8844 PR gold/11997
8845 * testsuite/memory_test.t: Discard any sections that are not
8846 needed.
8847
6695e4b3
L
88482010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8849
8850 PR gold/11996
8851 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8852 "This::" to work around a bug in gcc 4.2.
8853
8854 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8855
0f72bf6f
RÁE
88562010-09-09 Rafael Espindola <espindola@google.com>
8857
8858 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8859 sections with different PF_X flags in the same segment.
8860 (Layout::find_first_load_seg): Search all segments to find the first
8861 one.
8862 * options.h (rosegment): New.
8863
88642010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8865
05a79166 8866 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8867
aa98ff75
DK
88682010-09-08 Doug Kwan <dougkwan@google.com>
8869
8870 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8871 (Arm_relobj::do_relocate_sections): Add new parameter for output
8872 file to match the parent.
8873 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8874 of local symbols instead of input values. Update code to track
8875 changes in gold::relocate_section.
8876 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8877 (Sized_relobj::compute_final_local_value_internal): New methods.
8878 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8879 body into private version of Sized_relobj::compute_final_local_value.
8880 Call the inline method.
8881 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8882 merged symbol value if there is one.
8883 (Symbol_value::has_output_value): New method defintiion.
8884 (Sized_relobj::Compute_final_local_value_status): New enum type.
8885 (Sized_relobj::compute_final_local_value): New methods.
8886 (Sized_relobj::compute_final_local_value_internal): New methods.
8887 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8888 and arm_cortex_a8.sh.
8889 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8890 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8891 New tests.
8892 * Makefile.in: Regenerate.
8893 * testsuite/arm_bl_out_of_range.s: Update test.
8894 * testsuite/thumb_bl_out_of_range.s: Ditto.
8895 * testsuite/thumb_blx_out_of_range.s: Ditto.
8896 * testsuite/arm_branch_out_of_range.sh: New file.
8897 * testsuite/arm_cortex_a8.sh: Ditto.
8898 * testsuite/arm_cortex_a8_b.s: Ditto.
8899 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8900 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8901 * testsuite/arm_cortex_a8_bl.s: Ditto.
8902 * testsuite/arm_cortex_a8_blx.s: Ditto.
8903 * testsuite/arm_cortex_a8_local.s: Ditto.
8904 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8905 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8906
05a79166
L
89072010-09-08 Rafael Espindola <espindola@google.com>
8908
8909 * Makefile.am (memory_test.stdout): Run readelf with -W.
8910 * Makefile.in: Regenerate.
8911 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8912 64 bit output.
8913
33dbc701
RÁE
89142010-09-08 Rafael Espindola <espindola@google.com>
8915
8916 * script-sections.cc (Script_sections::add_memory_region): Convert
8917 field precision to int.
8918 * script.cc (script_set_section_region, script_set_section_region):
8919 Convert field precision to int.
8920
731ca54a
RÁE
89212010-09-08 Rafael Espindola <espindola@google.com>
8922
8923 * arm.cc (do_finalize_sections): Create the __exidx_start and
8924 __exdix_end symbols even when the section is missing.
8925
7f8cd844
NC
89262010-09-08 Nick Clifton <nickc@redhat.com>
8927
8928 * README: Remove claim that MEMORY is not supported.
8929 * expression.cc (script_exp_function_origin)
8930 (script_exp_function_length): Move from here to ...
8931 * script.cc: ... here.
8932 (script_set_section_region, script_add_memory)
8933 (script_parse_memory_attr, script_include_directive): New
8934 functions.
8935 * script-sections.cc
8936 (class Memory_region): New class.
8937 (class Output_section_definition): Add set_memory_region,
8938 set_section_vma, set_section_lma and get_section_name methods.
8939 (class Script_Sections): Add add_memory_region,
8940 find_memory_region, find_memory_region_origin,
8941 find_memory_region_length and set_memory_region methods.
8942 Have set_section_addresses method walk the list of set memory
8943 regions.
8944 Extend the print methos to display memory regions.
8945 * script-sections.h: Add prototypes for new methods.
8946 Add enum for MEMORY region attributes.
8947 * yyscript.y: Add support for parsing MEMORY regions.
8948 * script-c.h: Add prototypes for new functions.
8949 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8950 * testsuite/Makefile.in: Regenerate.
8951 * testsuite/memory_test.sh: New script.
8952 * testsuite/memory_test.s: New assembler source file.
8953 * testsuite/memory_test.t: New linker script.
8954
a4649286
DK
89552010-08-27 Doug Kwan <dougkwan@google.com>
8956
8957 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8958 reference override an existing dynamic weak reference.
8959 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8960 * testsuite/Makefile.in: Regenerate.
8961 * testsuite/dyn_weak_ref.sh: New file.
8962 * testsuite/dyn_weak_ref_1.c: Ditto.
8963 * testsuite/dyn_weak_ref_2.c: Ditto.
8964
b56648ad
ILT
89652010-08-27 Ian Lance Taylor <iant@google.com>
8966
8967 * incremental.h (class Incremental_input_entry): Add virtual
8968 destructor.
8969
809313cb
ILT
89702010-08-27 Ian Lance Taylor <iant@google.com>
8971
8972 * testsuite/start_lib_test_3.c: Mark t3 as used.
8973
11e32464
NC
89742010-08-27 Nick Clifton <nickc@redhat.com>
8975
8976 * options.cc (version_script): Fix small typo in previous
8977 whitespace tidyup.
8978
ca09d69a
NC
89792010-08-25 Nick Clifton <nickc@redhat.com>
8980
8981 * archive.cc: Formatting fixes: Remove whitespace between
8982 typename and following asterisk. Remove whitespace between
8983 function name and opening parenthesis.
8984 * archive.h: Likewise.
8985 * arm.cc: Likewise.
8986 * attributes.cc: Likewise.
8987 * attributes.h: Likewise.
8988 * common.cc: Likewise.
8989 * copy-relocs.cc: Likewise.
8990 * dirsearch.h: Likewise.
8991 * dynobj.cc: Likewise.
8992 * ehframe.cc: Likewise.
8993 * ehframe.h: Likewise.
8994 * expression.cc: Likewise.
8995 * fileread.cc: Likewise.
8996 * fileread.h: Likewise.
8997 * gc.h: Likewise.
8998 * gold-threads.cc: Likewise.
8999 * gold.cc: Likewise.
9000 * i386.cc: Likewise.
9001 * icf.h: Likewise.
9002 * incremental-dump.cc: Likewise.
9003 * incremental.cc: Likewise.
9004 * layout.cc: Likewise.
9005 * layout.h: Likewise.
9006 * main.cc: Likewise.
9007 * merge.cc: Likewise.
9008 * merge.h: Likewise.
9009 * object.cc: Likewise.
9010 * object.h: Likewise.
9011 * options.cc: Likewise.
9012 * options.h: Likewise.
9013 * output.cc: Likewise.
9014 * output.h: Likewise.
9015 * plugin.cc: Likewise.
9016 * plugin.h: Likewise.
9017 * powerpc.cc: Likewise.
9018 * reloc.cc: Likewise.
9019 * script-c.h: Likewise.
9020 * script-sections.cc: Likewise.
9021 * script.cc: Likewise.
9022 * stringpool.cc: Likewise.
9023 * symtab.cc: Likewise.
9024 * symtab.h: Likewise.
9025 * target.cc: Likewise.
9026 * timer.cc: Likewise.
9027 * timer.h: Likewise.
9028 * version.cc: Likewise.
9029 * x86_64.cc: Likewise.
9030
b8fa8750
NC
90312010-08-24 Nick Clifton <nickc@redhat.com>
9032
9033 PR 11899
9034 * layout.cc (segment_precedes): Sort segments by their physical
9035 addresses, if they have been set.
9036
9919d93b
CC
90372010-08-23 Cary Coutant <ccoutant@google.com>
9038
9039 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9040 symbols data.
9041 (Lib_group::include_member): Unlock object after deleting its
9042 symbols data.
9043 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9044 the bug fixed here.
9045
97b4be1c
CC
90462010-08-19 Neil Vachharajani <nvachhar@google.com>
9047 Cary Coutant <ccoutant@google.com>
9048
9049 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9050 constructor, and set_blocker.
9051 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9052 readsyms_blocker_.
9053 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9054 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9055 * testsuite/Makefile.am (start_lib_test): New test case.
9056 * testsuite/Makefile.in: Regenerate.
9057 * testsuite/start_lib_test_main.c: New file.
9058 * testsuite/start_lib_test_1.c: New file.
9059 * testsuite/start_lib_test_2.c: New file.
9060 * testsuite/start_lib_test_3.c: New file.
9061
dd0b1884
ILT
90622010-08-19 Ian Lance Taylor <iant@google.com>
9063
9064 * Makefile.in: Rebuild with automake 1.11.1.
9065 * aclocal.m4: Likewise.
9066 * testsuite/Makefile.in: Likewise.
9067
7223e9ca
ILT
90682010-08-19 Ian Lance Taylor <iant@google.com>
9069
9070 PR 10893
9071 * i386.cc (class Output_data_plt_i386): Update declarations.
9072 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9073 local_ifuncs_ fields.
9074 (Target_i386::do_plt_section_for_global): New function.
9075 (Target_i386::do_plt_section_for_local): New function.
9076 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9077 parameter; change all callers. Initialize global_ifuncs_ and
9078 local_ifuncs_. If doing a static link define __rel_iplt_start and
9079 __rel_iplt_end.
9080 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9081 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9082 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9083 symbols.
9084 (Target_i386::make_plt_section): New function, broken out of
9085 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9086 (Target_i386::make_plt_entry): Call make_plt_section.
9087 (Target_i386::make_local_ifunc_plt_entry): New function.
9088 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9089 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9090 R_386_IRELATIVE to switch.
9091 (Target_i386::Scan::global): Likewise.
9092 (Target_i386::Relocate::relocate): Likewise.
9093 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9094 switch.
9095 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9096 (Target_x86_64::do_plt_section_for_global): New function.
9097 (Target_x86_64::do_plt_section_for_local): New function.
9098 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9099 parameter; change all callers. If doing a static link define
9100 __rela_iplt_start and __rela_iplt_end.
9101 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9102 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9103 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9104 to point to .plt.
9105 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9106 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9107 switch.
9108 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9109 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9110 R_X86_64_IRELATIVE to switch.
9111 (Target_x86_64::Scan::global): Likewise.
9112 (Target_x86_64::Relocate::relocate): Likewise.
9113 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9114 switch.
9115 * target.h (class Target): Add plt_section_for_global and
9116 plt_section_for_local functions. Add do_plt_section_for_global
9117 and do_plt_section_for_local virtual functions.
9118 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9119 clarifying comments.
9120 (Symbol::use_plt_offset): Handle IFUNC symbol.
9121 * object.cc (Sized_relobj::Sized_relobj): Initialize
9122 local_plt_offsets_.
9123 (Sized_relobj::local_has_plt_offset): New function.
9124 (Sized_relobj::local_plt_offset): New function.
9125 (Sized_relobj::set_local_plt_offset): New function.
9126 (Sized_relobj::do_count): Handle IFUNC symbol.
9127 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9128 a bit away from input_shndx_ field. Add set_is_func_symbol and
9129 is_ifunc_symbol functions.
9130 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9131 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9132 local_plt_offsets_ field.
9133 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9134 * output.h (class Output_section_data): Add non-const
9135 output_section function.
9136 (class Output_data_got): Update declarations.
9137 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9138 Add use_plt_offset parameter to global and local constructors.
9139 Change all callers. Change local_sym_index_ field to 31 bits.
9140 Change GSYM_CODE and CONSTANT_CODE accordingly.
9141 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9142 doing a static link don't set sh_link field.
9143 (Output_data_got::Got_entry::write): Use PLT offset if
9144 appropriate.
9145 (Output_data_got::add_global_plt): New function.
9146 (Output_data_got::add_local_plt): New function.
9147 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9148 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9149 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9150 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9151 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9152 IFUNC conditional.
9153 * testsuite/ifunc-sel.h: New file.
9154 * testsuite/ifuncmain1.c: New file.
9155 * testsuite/ifuncmain1vis.c: New file.
9156 * testsuite/ifuncmod1.c: New file.
9157 * testsuite/ifuncdep2.c: New file.
9158 * testsuite/ifuncmain2.c: New file.
9159 * testsuite/ifuncmain3.c: New file.
9160 * testsuite/ifuncmod3.c: New file.
9161 * testsuite/ifuncmain4.c: New file.
9162 * testsuite/ifuncmain5.c: New file.
9163 * testsuite/ifuncmod5.c: New file.
9164 * testsuite/ifuncmain6pie.c: New file.
9165 * testsuite/ifuncmod6.c: New file.
9166 * testsuite/ifuncmain7.c: New file.
9167 * configure, testsuite/Makefile.in: Rebuild.
9168
56f75c03
ILT
91692010-08-18 Ian Lance Taylor <iant@google.com>
9170
9171 * incremental.cc
9172 (Output_section_incremental_inputs::write_input_files): Add cast
9173 to avoid signed/unsigned comparison warning.
9174 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9175
55455f89
CC
91762010-08-12 Cary Coutant <ccoutant@google.com>
9177
9178 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9179
e2054bcb
ILT
91802010-08-13 Ian Lance Taylor <iant@google.com>
9181
9182 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9183
74f67560
DK
91842010-08-12 Cary Coutant <ccoutant@google.com>
9185 Doug Kwan <dougkwan@google.com>
9186
9187 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9188 defintion overrides non-weak undef, remember that the original undef
9189 is not weak.
9190 * symtab.cc (Symbol_table::sized_write_global): For undef without
9191 an original weak binding, set binding to global in output.
9192 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9193 * testsuite/Makefile.in: Regenerate.
9194 * testsuite/strong_ref_weak_def.sh: New file.
9195 * testsuite/strong_ref_weak_def_1.c: Ditto.
9196 * testsuite/strong_ref_weak_def_2.c: Ditto.
9197
d1238d12
CC
91982010-08-12 Cary Coutant <ccoutant@google.com>
9199
9200 * testsuite/incremental_test.sh: Rewrite.
9201 * testsuite/incremental_test_1.c: Rewrite.
9202 * testsuite/incremental_test_2.c: Rewrite.
9203
0e70b911
CC
92042010-08-12 Cary Coutant <ccoutant@google.com>
9205
9206 * arm.cc (Target_arm::got_size): Add const.
9207 (Target_arm::got_entry_count): New function.
9208 (Target_arm::plt_entry_count): New function.
9209 (Target_arm::first_plt_entry_offset): New function.
9210 (Target_arm::plt_entry_size): New function.
9211 (Output_data_plt_arm::entry_count): New function.
9212 (Output_data_plt_arm::first_plt_entry_offset): New function.
9213 (Output_data_plt_arm::get_plt_entry_size): New function.
9214 * i386.cc (Target_i386::got_size): Add const.
9215 (Target_i386::got_entry_count): New function.
9216 (Target_i386::plt_entry_count): New function.
9217 (Target_i386::first_plt_entry_offset): New function.
9218 (Target_i386::plt_entry_size): New function.
9219 (Output_data_plt_i386::entry_count): New function.
9220 (Output_data_plt_i386::first_plt_entry_offset): New function.
9221 (Output_data_plt_i386::get_plt_entry_size): New function.
9222 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9223 find_incremental_inputs_sections. Dump incremental_got_plt section.
9224 * incremental.cc: Include target.h.
9225 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9226 parameter. Adjust all callers. Find incremental_got_plt section.
9227 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9228 section.
9229 (Output_section_incremental_inputs::set_final_data_size): Calculate
9230 size of incremental_got_plt section.
9231 (Output_section_incremental_inputs::do_write): Write the
9232 incremental_got_plt section.
9233 (Got_plt_view_info): New struct.
9234 (Local_got_offset_visitor): New class.
9235 (Global_got_offset_visitor): New class.
9236 (Global_symbol_visitor_got_plt): New class.
9237 (Output_section_incremental_inputs::write_got_plt): New function.
9238 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9239 Add parameter. Adjust all callers.
9240 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9241 (Incremental_inputs::got_plt_section): New function.
9242 (Incremental_inputs::got_plt_section_): New data member.
9243 (Incremental_got_plt_reader): New class.
9244 * layout.cc (Layout::create_incremental_info_sections): Add the
9245 incremental_got_plt section.
9246 * object.h (Got_offset_list::get_list): New function.
9247 (Got offset_list::for_all_got_offsets): New function.
9248 (Sized_relobj::local_got_offset_list): New function.
9249 * powerpc.cc (Target_powerpc::got_size): Add const.
9250 (Target_powerpc::got_entry_count): New function.
9251 (Target_powerpc::plt_entry_count): New function.
9252 (Target_powerpc::first_plt_entry_offset): New function.
9253 (Target_powerpc::plt_entry_size): New function.
9254 (Output_data_plt_powerpc::entry_count): New function.
9255 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9256 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9257 * sparc.cc (Target_sparc::got_size): Add const.
9258 (Target_sparc::got_entry_count): New function.
9259 (Target_sparc::plt_entry_count): New function.
9260 (Target_sparc::first_plt_entry_offset): New function.
9261 (Target_sparc::plt_entry_size): New function.
9262 (Output_data_plt_sparc::entry_count): New function.
9263 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9264 (Output_data_plt_sparc::get_plt_entry_size): New function.
9265 * symtab.h (Symbol::got_offset_list): New function.
9266 (Symbol_table::for_all_symbols): New function.
9267 * target.h (Sized_target::got_entry_count): New function.
9268 (Sized_target::plt_entry_count): New function.
9269 (Sized_target::plt_entry_size): New function.
9270 * x86_64.cc (Target_x86_64::got_size): Add const.
9271 (Target_x86_64::got_entry_count): New function.
9272 (Target_x86_64::plt_entry_count): New function.
9273 (Target_x86_64::first_plt_entry_offset): New function.
9274 (Target_x86_64::plt_entry_size): New function.
9275 (Output_data_plt_x86_64::entry_count): New function.
9276 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9277 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9278
09ec0418
CC
92792010-08-12 Cary Coutant <ccoutant@google.com>
9280
9281 * archive.cc: Include incremental.h.
9282 (Archive::Archive): Initialize incremental_info_.
9283 (Archive::include_member): Record archive members in incremental info.
9284 (Add_archive_symbols::run): Record begin and end of an archive in
9285 incremental info.
9286 (Lib_group::include_member): Record objects in incremental info.
9287 * archive.h (Incremental_archive_entry): Forward declaration.
9288 (Archive::set_incremental_info): New member function.
9289 (Archive::incremental_info): New member function.
9290 (Archive::Unused_symbol_iterator): New class.
9291 (Archive::unused_symbols_begin): New member function.
9292 (Archive::unused_symbols_end): New member function.
9293 (Archive::incremental_info_): New data member.
9294 * incremental-dump.cc (find_input_containing_global): New function.
9295 (dump_incremental_inputs): Dump new incremental info sections.
9296 * incremental.cc: Include symtab.h.
9297 (Output_section_incremental_inputs): New class.
9298 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9299 new incremental info sections.
9300 (Sized_incremental_binary::do_check_inputs): Likewise.
9301 (Incremental_inputs::report_archive): Remove.
9302 (Incremental_inputs::report_archive_begin): New function.
9303 (Incremental_inputs::report_archive_end): New function.
9304 (Incremental_inputs::report_object): New function.
9305 (Incremental_inputs::finalize_inputs): Remove.
9306 (Incremental_inputs::report_input_section): New function.
9307 (Incremental_inputs::report_script): Rewrite.
9308 (Incremental_inputs::finalize): Do nothing but finalize string table.
9309 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9310 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9311 (Incremental_inputs::create_data_sections): New function.
9312 (Incremental_inputs::relocs_entsize): New function.
9313 (Output_section_incremental_inputs::set_final_data_size): New function.
9314 (Output_section_incremental_inputs::do_write): New function.
9315 (Output_section_incremental_inputs::write_header): New function.
9316 (Output_section_incremental_inputs::write_input_files): New function.
9317 (Output_section_incremental_inputs::write_info_blocks): New function.
9318 (Output_section_incremental_inputs::write_symtab): New function.
9319 * incremental.h (Incremental_script_entry): Forward declaration.
9320 (Incremental_object_entry): Forward declaration.
9321 (Incremental_archive_entry): Forward declaration.
9322 (Incremental_inputs): Forward declaration.
9323 (Incremental_inputs_header_data): Remove.
9324 (Incremental_inputs_header): Remove.
9325 (Incremental_inputs_header_write): Remove.
9326 (Incremental_inputs_entry_data): Remove.
9327 (Incremental_inputs_entry): Remove.
9328 (Incremental_inputs_entry_write): Remove.
9329 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9330 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9331 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9332 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9333 Likewise.
9334 (Incremental_input_entry): New class.
9335 (Incremental_script_entry): New class.
9336 (Incremental_object_entry): New class.
9337 (Incremental_archive_entry): New class.
9338 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9339 (Incremental_inputs::report_inputs): Remove.
9340 (Incremental_inputs::report_archive): Remove.
9341 (Incremental_inputs::report_archive_begin): New function.
9342 (Incremental_inputs::report_archive_end): New function.
9343 (Incremental_inputs::report_object): Change prototype.
9344 (Incremental_inputs::report_input_section): New function.
9345 (Incremental_inputs::report_script): Change prototype.
9346 (Incremental_inputs::get_reloc_count): New function.
9347 (Incremental_inputs::set_reloc_count): New function.
9348 (Incremental_inputs::create_data_sections): New function.
9349 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9350 (Incremental_inputs::inputs_section): New function.
9351 (Incremental_inputs::symtab_section): New function.
9352 (Incremental_inputs::relocs_section): New function.
9353 (Incremental_inputs::get_stringpool): Add const.
9354 (Incremental_inputs::command_line): Add const.
9355 (Incremental_inputs::inputs): Remove.
9356 (Incremental_inputs::command_line_key): New function.
9357 (Incremental_inputs::input_file_count): New function.
9358 (Incremental_inputs::input_files): New function.
9359 (Incremental_inputs::relocs_entsize): New function.
9360 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9361 (Incremental_inputs::finalize_inputs): Remove.
9362 (Incremental_inputs::Input_info): Remove.
9363 (Incremental_inputs::lock_): Remove.
9364 (Incremental_inputs::inputs_): Change type.
9365 (Incremental_inputs::inputs_map_): Remove.
9366 (Incremental_inputs::current_object_entry_): New data member.
9367 (Incremental_inputs::inputs_section_): New data member.
9368 (Incremental_inputs::symtab_section_): New data member.
9369 (Incremental_inputs::relocs_section_): New data member.
9370 (Incremental_inputs::reloc_count_): New data member.
9371 (Incremental_inputs_reader): New class.
9372 (Incremental_symtab_reader): New class.
9373 (Incremental_relocs_reader): New class.
9374 * layout.cc (Layout::finalize): Move finalization of incremental info
9375 and creation of incremental info sections to follow finalization of
9376 symbol table. Set offsets for postprocessing sections.
9377 (Layout::create_incremental_info_sections): Call
9378 Incremental_inputs::create_data_sections. Add incremental symtab
9379 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9380 sections to layout after input sections.
9381 * layout.h (struct Timespec): Forward declaration.
9382 (Layout::incremental_inputs): Add const.
9383 (Layout::create_incremental_info_sections): Add parameter.
9384 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9385 * object.cc: Include incremental.h.
9386 (Relobj::finalize_incremental_relocs): New function.
9387 (Sized_relobj::do_layout): Record input sections in incremental info.
9388 * object.h (Object::output_section): New function.
9389 (Object::output_section_offset): Moved from Relobj.
9390 (Object::get_incremental_reloc_base): New function.
9391 (Object::get_incremental_reloc_count): New function.
9392 (Object::do_output_section): New function.
9393 (Object::do_output_section_offset): Moved from Relobj.
9394 (Object::do_get_incremental_reloc_base): New function.
9395 (Object::do_get_incremental_reloc_count): New function.
9396 (Object::Object): Initialize new data members.
9397 (Relobj::output_section): Renamed do_output_section and moved to
9398 protected.
9399 (Relobj::output_section_offset): Moved to Object.
9400 (Relobj::do_get_incremental_reloc_base): New function.
9401 (Relobj::do_get_incremental_reloc_count): New function.
9402 (Relobj::allocate_incremental_reloc_counts): New function.
9403 (Relobj::count_incremental_reloc): New function.
9404 (Relobj::finalize_incremental_relocs): New function.
9405 (Relobj::next_incremental_reloc_index): New function.
9406 (Relobj::reloc_counts_): New data member.
9407 (Relobj::reloc_bases_): New data member.
9408 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9409 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9410 (Sized_relobj::incremental_relocs_scan): New function.
9411 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9412 (Sized_relobj::incremental_relocs_write): New function.
9413 (Sized_relobj::incremental_relocs_write_reltype): New function.
9414 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9415 incremental link.
9416 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9417 archives and object files elsewhere.
9418 (Add_symbols::run): Report object files here.
9419 (Finish_group::run): Report end of archive at end of group.
9420 * reloc.cc: Include layout.h, incremental.h.
9421 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9422 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9423 (Sized_relobj::incremental_relocs_scan): New function.
9424 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9425 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9426 (Sized_relobj::incremental_relocs_write): New function.
9427 (Sized_relobj::incremental_relocs_write_reltype): New function.
9428 * script.cc (read_input_script): Rewrite test for incremental link.
9429 Change call to Incremental_inputs::report_script.
9430 * symtab.h (Symbol_table::first_global_index): New function.
9431 (Symbol_table::output_count): New function.
9432
ce0d1972
DK
94332010-08-12 Doug Kwan <dougkwan@google.com>
9434
9435 * arm.cc (Target_arm::merge_object_attributes): Check command line
9436 options --no-wchar-size-warning and --no-enum-size-warning.
9437 * options.h (General_options): Add ld-compatible options
9438 --no-enum-size-warning and --no-wchar-size-warning.
9439
6e5710ce
ILT
94402010-08-04 Ian Lance Taylor <iant@google.com>
9441
9442 * x86_64.cc (Target_x86_64::Scan::local): Use
9443 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9444 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9445 (Target_x86_64::Scan::global): Likewise.
9446 (Target_x86_64::Relocate::relocate): Likewise.
9447 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9448 Likewise.
9449
fef830db
CC
94502010-08-03 Cary Coutant <ccoutant@google.com>
9451
9452 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9453 to reserve space in merged_strings vector. Keep total input size
9454 for stats.
9455 (Output_merge_string::do_print_merge_stats): Print total input size.
9456 * merge.h (Output_merge_string): Add input_size_ field.
9457 * stringpool.cc (Stringpool_template::string_length): Move
9458 implementations out of Stringpool_template class and place in
9459 stringpool.h.
9460 * stringpool.h (string_length): Move out of Stringpool_template.
9461
1e3811b0
ILT
94622010-08-03 Ian Lance Taylor <iant@google.com>
9463
9464 PR 11712
9465 * layout.cc (relaxation_loop_body): If address of load segment is
9466 set, adjust address to include headers if possible.
9467
7af0c620
ILT
94682010-08-03 Ian Lance Taylor <iant@google.com>
9469
9470 * version.cc (version_string): Bump to 1.10.
9471
22f0da72
ILT
94722010-08-03 Ian Lance Taylor <iant@google.com>
9473
9474 PR 11805
9475 * layout.h (enum Output_section_order): Define.
9476 (class Layout): Update declarations.
9477 * layout.cc (Layout::get_output_section): Add order parameter.
9478 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9479 is_first_non_relro parameters. Change all callers.
9480 (Layout::choose_output_section): Likewise.
9481 (Layout::add_output_section_data): Likewise.
9482 (Layout::make_output_section): Likewise. Set order.
9483 (Layout::default_section_order): New function.
9484 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9485 * output.cc (Output_section::Output_section): Initialize order_.
9486 Don't initialize deleted fields.
9487 (Output_segment::Output_segment): Don't initialize deleted
9488 fields.
9489 (Output_segment::add_output_section_to_load): New function
9490 replacing add_output_section. Change all callers to call this or
9491 add_output_section_to_nonload.
9492 (Output_segment::add_output_section_to_nonload): New function.
9493 (Output_segment::remove_output_section): Rewrite.
9494 (Output_segment::add_initial_output_data): Likewise.
9495 (Output_segment::has_any_data_sections): Likewise.
9496 (Output_segment::is_first_section_relro): Likewise.
9497 (Output_segment::maximum_alignment): Likewise.
9498 (Output_segment::has_dynamic_reloc): New function replacing
9499 dynamic_reloc_count. Change all callers.
9500 (Output_segment::has_dynamic_reloc_list): New function replacing
9501 dynamic_reloc_count_list. Change all callers.
9502 (Output_segment::set_section_addresses): Rewrite.
9503 (Output_segment::set_offset): Rewrite.
9504 (Output_segment::find_first_and_last_list): Remove.
9505 (Output_segment::set_tls_offsets): Rewrite.
9506 (Output_segment::first_section_load_address): Likewise.
9507 (Output_segment::output_section_count): Likewise.
9508 (Output_segment::section_with_lowest_load_address): Likewise.
9509 (Output_segment::write_section_headers): Likewise.
9510 (Output_segment::print_sections_to_map): Likewise.
9511 * output.h (class Output_data): Remove dynamic_reloc_count_
9512 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9513 (Output_data::add_dynamic_reloc): Rewrite.
9514 (Output_data::has_dynamic_reloc): New function.
9515 (Output_data::dynamic_reloc_count): Remove.
9516 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9517 is_last_relro_, is_first_non_relro_, is_interp_,
9518 is_dynamic_linker_section_ fields. Add order and set_order
9519 functions. Remove is_relro_local, set_is_relro_local,
9520 is_last_relro, set_is_last_relro, is_first_non_relro,
9521 set_is_first_non_relro functions, is_interp, set_is_interp,
9522 is_dynamic_linker_section, and set_is_dynamic_linker_section
9523 functions.
9524 (class Output_segment): Change Output_data_list from std::list to
9525 std:;vector. Add output_lists_ field. Remove output_data_ and
9526 output_bss_ fields. Update declarations.
9527
3ff2ccb0
ILT
95282010-08-02 Ian Lance Taylor <iant@google.com>
9529
9530 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9531 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9532 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9533
88a4108b
ILT
95342010-08-02 Ian Lance Taylor <iant@google.com>
9535
9536 PR 11855
9537 * script.cc (Script_options::Script_options): Initialize
9538 symbol_definitions_ and symbol_references_.
9539 (Script_options::add_symbol_assignment): Update
9540 symbol_definitions_ and symbol_references_.
9541 (Script_options::add_symbol_reference): New function.
9542 (script_symbol): New function.
9543 * script.h (class Script_options): Add symbol_definitions_ and
9544 symbol_references_ fields.
9545 (Script_options::referenced_const_iterator): New type.
9546 (Script_options::referenced_begin): New function.
9547 (Script_options::referenced_end): New function.
9548 (Script_options::is_referenced): New function.
9549 (Script_options::any_unreferenced): New function.
9550 * script-c.h (script_symbol): Declare.
9551 * yyscript.y (exp): Call script_symbol.
9552 * symtab.cc: Include "script.h".
9553 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9554 Change all callers. Check symbols referenced by scripts.
9555 (Symbol_table::add_undefined_symbols_from_command_line): Add
9556 layout parameter. Change all callers.
9557 (Symbol_table::do_add_undefined_symbols_from_command_line):
9558 Likewise. Break out loop body. Check symbols referenced by
9559 scripts.
9560 (Symbol_table::add_undefined_symbol_from_command_line): New
9561 function broken out of
9562 do_add_undefined_symbols_from_command_line.
9563 * symtab.h (class Symbol_table): Update declarations.
9564 * archive.cc: Include "layout.h".
9565 (Archive::should_include_member): Add layout parameter. Change
9566 all callers. Check for symbol mentioned in expression.
9567 * archive.h (class Archive): Update declaration.
9568 * object.cc (Sized_relobj::do_should_include_member): Add layout
9569 parameter.
9570 * object.h (Object::should_include_member): Add layout parameter.
9571 Change all callers.
9572 (Object::do_should_include_member): Add layout parameter.
9573 (class Sized_relobj): Update declaration.
9574 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9575 parameter.
9576 * dynobj.h (class Sized_dynobj): Update declaration.
9577 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9578 layout parameter.
9579 * plugin.h (class Sized_pluginobj): Update declaration.
9580
5f1ab67a
ILT
95812010-08-02 Ian Lance Taylor <iant@google.com>
9582
9583 PR 11866
9584 * output.cc (Output_segment::set_offset): Search for the first and
9585 last sections rather than assuming that the list is in order.
9586 (Output_segment::find_first_and_last_list): New function.
9587 * output.h (class Output_segment): Update declarations.
9588 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9589 (relro_strip_test_SOURCES): New variable.
9590 (relro_strip_test_DEPENDENCIES): New variable.
9591 (relro_strip_test_LDFLAGS): New variable.
9592 (relro_strip_test_LDADD): New variable.
9593 (relro_strip_test.so): New target.
9594
a8df5856
ILT
95952010-08-02 Ian Lance Taylor <iant@google.com>
9596
9597 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9598 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9599 (Target_i386::got_tlsdesc_section): New function.
9600 (Target_i386::got_section): Create space for GOT entries for
9601 TLSDESC relocations.
9602 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9603 R_386_TLS_GOTDESC.
9604 (Target_i386::Scan::global): Likewise.
9605 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9606 using TLSDESC GOT.
9607 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9608 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9609 (Target_x86_64::got_tlsdesc_section): New function.
9610 (Target_x86_64::got_section): Create space for GOT entries for
9611 TLSDESC relocations.
9612 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9613 R_386_TLS_GOTDESC.
9614 (Target_x86_64::Scan::global): Likewise.
9615 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9616 using TLSDESC GOT.
9617
0c10a0a6
ILT
96182010-08-02 Ian Lance Taylor <iant@google.com>
9619
9620 * testsuite/final_layout.sh: Use dc to convert from hex to
9621 decimal.
9622
41cbeecc
ST
96232010-07-29 Sriraman Tallam <tmsriram@google.com>
9624
9625 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9626 paramter to the call to gold::gc_process_relocs.
9627 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9628 paramter to the call to gold::gc_process_relocs.
9629 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9630 parameter to the call to gold::gc_process_relocs.
9631 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9632 template parameter to the call to gold::gc_process_relocs.
9633 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9634 paramter to the call to gold::gc_process_relocs.
9635 * gc.h (get_embedded_addend_size): New function.
9636 (gc_process_relocs): Save the size of the reloc for use by ICF.
9637 * icf.cc (get_section_contents): Get the addend from the text section
9638 for SHT_REL relocation sections.
9639 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9640 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9641 * int_encoding.h (read_from_pointer): New overloaded function.
9642 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9643 * testsuite/icf_sht_rel_addend_test.sh: New file.
9644 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9645 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9646
6ea55b82
RW
96472010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9648
9649 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9650 * Makefile.in: Regenerate.
9651 * testsuite/Makefile.in: Regenerate.
9652
9691462b
ILT
96532010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9654
9655 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9656 * gold/testsuite/debug_msg.cc: Likewise.
9657 * gold/testsuite/odr_violation1.cc
9658 * gold/testsuite/odr_violation2.cc
9659
76897331
CC
96602010-07-21 Cary Coutant <ccoutant@google.com>
9661
9662 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9663 string, and length fields.
9664 (Output_merge_string::Merged_strings_list): New type.
9665 (Output_merge_string::Merged_strings_lists): New typedef.
9666 (Output_merge_string): Replace merged_strings_ with
9667 merged_strings_lists_.
9668 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9669 Merged_strings_list per input object and section. Don't store pointer
9670 to the string. Don't store length with each merged string entry.
9671 (Output_merge_string::finalize_merged_data): Loop over list of merged
9672 strings lists. Recompute length of each merged string.
9673
78384e8f
CC
96742010-07-15 Cary Coutant <ccoutant@google.com>
9675
9676 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9677 here.
9678
783659f9
ILT
96792010-07-14 Ian Lance Taylor <iant@google.com>
9680
9681 * descriptors.cc (Descriptors::open): Report correct name in error
9682 message.
9683
131687b4
DK
96842010-07-13 Doug Kwan <dougkwan@google.com>
9685
9686 * arm.cc (Arm_input_section::Arm_input_section): For a
9687 SHT_ARM_EXIDX section, always keeps the input sections.
9688 (Arm_input_section::set_exidx_section_link): New method.
9689 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9690 has_errors_ to false.
9691 (Arm_exidx_input_section::has_errors,
9692 Arm_exidx_input_section::set_has_errors): New methods.
9693 (Arm_exidx_input_section::has_errors_): New data member.
9694 (Arm_relobj::get_exidx_shndx_list): New method.
9695 (Arm_output_section::append_text_sections_to_list): Do not skip
9696 section without SHF_EXECINSTR.
9697 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9698 errors.
2e702c99 9699 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9700 section header. Make error messages more verbose. Check for
9701 a non-executable section linked to an EXIDX section.
9702 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9703 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9704 check that there is no deferred EXIDX section if we exit early.
9705 Instead of not making an EXIDX section in case of an error, make one
9706 and set the has_errors flag of it.
9707 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9708 in a relocatable link.
9709 (Target_arm::do_relax): Look for the EXIDX output section instead of
9710 assuming that it is called .ARM.exidx.
2e702c99 9711 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9712 section list. Do not check for SHF_EXECINSTR section flags but
9713 skip any input section with errors.
9714 * output.cc (Output_section::Output_section): Initialize
9715 always_keeps_input_sections_ to false.
9716 (Output_section::add_input_section): Check for
9717 always_keeps_input_sections_.
9718 * output.h (Output_section::always_keeps_input_sections,
9719 Output_section::set_always_keeps_input_sections): New methods.
9720 (Output_section::always_keeps_input_sections): New data member.
9721
69517287
RÁE
97222010-07-13 Rafael Espindola <espindola@google.com>
9723
9724 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9725 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9726
82742395
ILT
97272010-07-13 Philip Herron <herron.philip@googlemail.com>
9728 Ian Lance Taylor <iant@google.com>
9729
9730 * output.h (Output_section_lookup_maps::add_merge_section):
9731 Correct check of whether value was inserted.
9732 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9733 (Output_section_lookup_maps::add_relaxed_input_section):
9734 Likewise.
9735 * arm.cc (Target_arm::got_section): Remove used local os.
9736 * i386.cc (Target_i386::got_section): Likewise.
9737 * x86_64.cc (Target_x86_64::got_section): Likewise.
9738 * sparc.cc (Target_sparc::got_section): Likewise.
9739 (Target_sparc::relocate): Remove unused local have_got_offset.
9740 * powerpc.cc (Target_powerpc::relocate): Likewise.
9741
f2d707b5
ILT
97422010-07-13 Ian Lance Taylor <iant@google.com>
9743
241531d6
ILT
9744 * compressed_output.cc (zlib_decompress): Fix signature in
9745 !HAVE_ZLIB_H case.
9746
f2d707b5
ILT
9747 * archive.cc (Archive::include_member): Unlock an external member
9748 of a thin archive. Don't bother to delete an object we know is
9749 NULL.
9750
a2e47362
CC
97512010-07-12 Cary Coutant <ccoutant@google.com>
9752
9753 * compressed_output.cc (zlib_decompress): New function.
9754 (get_uncompressed_size): New function.
9755 (decompress_input_section): New function.
9756 * compressed_output.h (get_uncompressed_size): New function.
9757 (decompress_input_section): New function.
9758 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9759 Handle compressed debug sections.
9760 * layout.cc (is_compressed_debug_section): New function.
9761 (Layout::output_section_name): Map compressed section names to
9762 canonical names.
9763 * layout.h (is_compressed_debug_section): New function.
9764 (is_debug_info_section): Recognize compressed debug sections.
9765 * merge.cc: Include compressed_output.h.
9766 (Output_merge_data::do_add_input_section): Handle compressed
9767 debug sections.
9768 (Output_merge_string::do_add_input_section): Handle compressed
9769 debug sections.
9770 * object.cc: Include compressed_output.h.
9771 (Sized_relobj::Sized_relobj): Initialize new data members.
9772 (build_compressed_section_map): New function.
9773 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9774 * object.h (Object::section_is_compressed): New method.
9775 (Object::do_section_is_compressed): New method.
9776 (Sized_relobj::Compressed_section_map): New type.
9777 (Sized_relobj::do_section_is_compressed): New method.
9778 (Sized_relobj::compressed_sections_): New data member.
9779 * output.cc (Output_section::add_input_section): Handle compressed
9780 debug sections.
9781 * reloc.cc: Include compressed_output.h.
9782 (Sized_relobj::write_sections): Handle compressed debug sections.
9783
ce279a62
CC
97842010-07-08 Cary Coutant <ccoutant@google.com>
9785
9786 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9787 weak when resolving to a dynamic def.
9788 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9789 for weak undef/dynamic def cases. Adjust callers.
9790 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9791 undef_binding_weak_.
9792 (Symbol_table::sized_write_globals): Adjust symbol binding.
9793 (Symbol_table::sized_write_symbol): Add binding parameter.
9794 * symtab.h (Symbol::set_undef_binding): New method.
9795 (Symbol::is_undef_binding_weak): New method.
9796 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9797 (Symbol_table::should_override): Add new parameter.
9798 (Symbol_table::sized_write_symbol): Add new parameter.
9799
9800 * testsuite/weak_undef_file1.cc: Add new test case.
9801 * testsuite/weak_undef_file2.cc: Fix header comment.
9802 * testsuite/weak_undef_test.cc: Add new test case.
9803
b2286c10
DK
98042010-06-29 Doug Kwan <dougkwan@google.com>
9805
9806 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9807 Initialize USE_SYMBOL_.
9808 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9809 definition.
9810 (Arm_reloc_property::uses_symbol_): New data member declaration.
9811 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9812 uses symbol value and symbol is undefined but not weakly undefined.
9813
4802450a
RÁE
98142010-06-28 Rafael Espindola <espindola@google.com>
9815
9816 * plugin.cc (Plugin::load): Use dlerror.
9817
e5ca47ba
ILT
98182010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9819
9820 * symtab.cc (detect_odr_violations): When reporting an ODR
9821 violation, report an object where the symbol is defined.
9822
8a75a161
DK
98232010-06-25 Doug Kwan <dougkwan@google.com>
9824
9825 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9826 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9827 definition.
9828 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9829 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9830 target hook to detect function points.
9831 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9832 * icf.h (Icf::check_section_for_function_pointers): Change type of
9833 parameter SECTION_NAME to const reference to std::string. Use
9834 target hook to determine if section may have unsafe pointers.
9835 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9836 method definition.
9837
42218b9f
RÁE
98382010-06-21 Rafael Espindola <espindola@google.com>
9839
9840 * fileread.cc (Input_file::find_fie): New
9841 (Input_file::open): Use Input_file::find_fie.
9842 * fileread.h (Input_file::find_fie): New
9843 * plugin.cc (set_extra_library_path): New.
9844 (Plugin::load): Add set_extra_library_path to the transfer vector.
9845 (Plugin_manager::set_extra_library_path): New.
9846 (Plugin_manager::add_input_file): Use the extra search path if set.
9847 (set_extra_library_path(): New.
9848 * plugin.h (Plugin_manager): Add set_extra_library_path and
9849 extra_search_path_.
9850
a0506cca
CC
98512010-06-19 Cary Coutant <ccoutant@google.com>
9852
9853 * layout.cc (gdb_sections): Add .debug_types.
9854 (lines_only_debug_sections): Likewise.
9855
6508b958
RÁE
98562010-06-18 Rafael Espindola <espindola@google.com>
9857
9858 * plugin.cc (add_input_file,add_input_library)
9859 (Plugin_manager::add_input_file): Make filename arguments const.
9860 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9861 const.
9862
3e235302
DK
98632010-06-16 Doug Kwan <dougkwan@google.com>
9864
9865 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9866 .ARM.attributes section if we have not merged any input
9867 attributes sections.
9868
106e8a6c
DK
98692010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9870
9871 * arm.cc: Allow combining objects with no EABI version
9872 information.
9873
91ff43fe
RÁE
98742010-06-15 Rafael Espindola <espindola@google.com>
9875
9876 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9877
68ed838c
ILT
98782010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9879
9880 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9881 (struct iovec): Correct !HAVE_READV definition.
9882
f3a2388f
CC
98832010-06-10 Cary Coutant <ccoutant@google.com>
9884
9885 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9886 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9887 reloc sections.
9888 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9889
9890 PR 11683
9891 * symtab.h (Symbol::is_placeholder): New member function.
9892 * target-reloc.h (relocate_section): Check for placeholder symbols.
9893
9894 * testsuite/Makefile.am (plugin_test_8): New test.
9895 (plugin_test_9): New test.
9896 * testsuite/Makefile.in: Regenerate.
9897
e1df38aa
NC
98982010-06-09 Nick Clifton <nickc@redhat.com>
9899
9900 * yyscript.y (input_list_element): Allow strings prefixed with
9901 the '-' character. Treat these as libraries.
9902 * script.cc (script_add_library): New function. Adds a library
9903 specified by "-l<name>" found in an input script.
9904 * script-c.h: Add prototype for script_add_library.
9905
25bbe950
DK
99062010-06-07 Doug Kwan <dougkwan@google.com>
9907
9908 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9909 Restrict stub-group size to be within long conditional branch
9910 range when working around cortex-A8 erratum.
9911
0f32ea4c
ILT
99122010-06-07 Damien Diederen <dd@crosstwine.com>
9913
9914 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9915 #ifdef typo.
9916
8fe2a369
ST
99172010-06-03 Sriraman Tallam <tmsriram@google.com>
9918
9919 PR gold/11658
9920 * output.cc
9921 (Output_section::Input_section_sort_entry::compare_section_ordering):
9922 Change to return non-zero correctly.
9923 (Output_section::Input_section_sort_section_order_index_compare
9924 ::operator()): Change to fix ambiguity in comparisons.
9925
6e9ba2ca
ST
99262010-06-01 Sriraman Tallam <tmsriram@google.com>
9927
9928 * gold.h (is_wildcard_string): New function.
9929 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9930 (Layout::layout_eh_frame): Ditto.
9931 (Layout::find_section_order_index): New method.
9932 (Layout::read_layout_from_file): New method.
9933 * layout.h (Layout::find_section_order_index): New method.
9934 (Layout::read_layout_from_file): New method.
9935 (Layout::input_section_position_): New private member.
9936 (Layout::input_section_glob_): New private member.
9937 * main.cc (main): Call read_layout_from_file here.
9938 * options.h (--section-ordering-file): New option.
9939 * output.cc (Output_section::input_section_order_specified_): New
9940 member.
9941 (Output_section::Output_section): Initialize new member.
9942 (Output_section::add_input_section): Add new parameter.
9943 Keep input sections when --section-ordering-file is used.
9944 (Output_section::set_final_data_size): Sort input sections when
9945 section ordering file is specified.
9946 (Output_section::Input_section_sort_entry): Add new parameter.
9947 Check sorting type.
9948 (Output_section::Input_section_sort_entry::compare_section_ordering):
9949 New method.
9950 (Output_section::Input_section_sort_compare::operator()): Change to
9951 consider section_order_index.
9952 (Output_section::Input_section_sort_init_fini_compare::operator()):
9953 Change to consider section_order_index.
9954 (Output_section::Input_section_sort_section_order_index_compare
9955 ::operator()): New method.
9956 (Output_section::sort_attached_input_sections): Change to sort
9957 according to section order when specified.
e1df38aa
NC
9958 (Output_section::add_input_section<32, true>): Add new parameter.
9959 (Output_section::add_input_section<64, true>): Add new parameter.
9960 (Output_section::add_input_section<32, false>): Add new parameter.
9961 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9962 * output.h (Output_section::add_input_section): Add new parameter.
9963 (Output_section::input_section_order_specified): New
9964 method.
9965 (Output_section::set_input_section_order_specified): New method.
9966 (Input_section::Input_section): Initialize section_order_index_.
9967 (Input_section::section_order_index): New method.
9968 (Input_section::set_section_order_index): New method.
9969 (Input_section::section_order_index_): New member.
9970 (Input_section::Input_section_sort_section_order_index_compare): New
9971 struct.
9972 (Output_section::input_section_order_specified_): New member.
9973 * script-sections.cc (is_wildcard_string): Delete and move modified
9974 method to gold.h.
9975 (Output_section_element_input::Output_section_element_input): Modify
9976 call to is_wildcard_string.
9977 (Output_section_element_input::Input_section_pattern
9978 ::Input_section_pattern): Ditto.
9979 (Output_section_element_input::Output_section_element_input): Ditto.
9980 * testsuite/Makefile.am (final_layout): New test case.
9981 * testsuite/Makefile.in: Regenerate.
9982 * testsuite/final_layout.cc: New file.
9983 * testsuite/final_layout.sh: New file.
9984
3537c84b
RÁE
99852010-06-01 Rafael Espindola <espindola@google.com>
9986
9987 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9988
105b6afd
RÁE
99892010-06-01 Rafael Espindola <espindola@google.com>
9990
9991 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9992 visibility of symbols.
9993
29e11421
DK
99942010-05-27 Doug Kwan <dougkwan@google.com>
9995
9996 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9997 from start of output section instead of address for a local symbol
9998 in a merged or relaxed section when doing a relocatable link.
9999
5e0f337e
RÁE
100002010-05-26 Rafael Espindola <espindola@google.com>
10001
703d02da 10002 PR 11604
5e0f337e
RÁE
10003 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10004 adding sections the garbage collector removed.
10005 * gold/testsuite/Makefile.am: Add test.
10006 * gold/testsuite/Makefile.in: Regenerate.
10007 * gold/testsuite/plugin_test_7.sh: New.
10008 * gold/testsuite/plugin_test_7_1.c: New.
10009 * gold/testsuite/plugin_test_7_2.c: New.
10010
f4187277
RÁE
100112010-05-26 Rafael Espindola <espindola@google.com>
10012
10013 * script-sections.cc (Output_section_definition::set_section_addresses):
10014 Check for --section-start.
10015
5c388529
DK
100162010-05-26 Doug Kwan <dougkwan@google.com>
10017
10018 * arm.cc (Arm_scan_relocatable_relocs): New class.
10019 (Target_arm::relocate_special_relocatable): New method.
10020 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10021 (Arm_relocate_functions::thumb_branch_common): Same.
10022 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10023 instead of Default_scan_relocatable_relocs.
10024 * target-reloc.h (relocate_for_relocatable): Let target handle
10025 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10026 * target.h (Sized_target::relocate_special_relocatable): New method.
10027
bca1c3ae
ILT
100282010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10029
10030 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10031
0439c796
DK
100322010-05-23 Doug Kwan <dougkwan@google.com>
10033
10034 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10035 instead of a cast.
10036 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10037 with a direct branch, not a conditional branch, to a stub.
10038 * merge.cc (Output_merge_base::record_input_section): New method
10039 defintion.
10040 (Output_merge_data::do_add_input_section): Record input section if
10041 keeps-input-sections flag is set.
10042 (Output_merge_string::do_add_input_section): Ditto.
10043 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10044 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10045 INPUT_SECTIONS_.
10046 (Output_merge_base::keeps_input_sections,
10047 Output_merge_base::set_keeps_input_sections,
10048 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10049 method definitions.
10050 (Output_merge_base::Input_sections): New type declaration.
10051 (Output_merge_base::input_sections_begin,
10052 Output_merge_base::input_sections_end,
10053 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10054 (Output_merge_base::bool keeps_input_sections_,
10055 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10056 Output_merge_base::input_sections_): New data members.
10057 (Output_merge_data::do_set_keeps_input_sections): New method
10058 defintion.
10059 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10060 * output.cc (Output_section::Input_section::relobj): Move method
10061 defintion from class declaration to here and handle merge sections.
10062 (Output_section::Input_section::shndx): Ditto.
10063 (Output_section::Output_section): Remove initializations of removed
10064 data members and initialize new data member LOOKUP_MAPS_.
10065 (Output_section::add_input_section): Set keeps-input-sections flag
10066 for a newly created merge output section as appropriate. Adjust code
10067 to use Output_section_lookup_maps class.
10068 (Output_section::add_relaxed_input_section): Adjst code for lookup
10069 maps code refactoring.
2e702c99 10070 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10071 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10072 class. If adding input section to a newly created merge output
10073 section fails, remove the new merge section.
10074 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10075 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10076 (Output_section::find_merge_section): Ditto.
0439c796 10077 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10078 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10079 Output_section_lookup_maps class.
10080 (Output_section::get_input_sections): Export merge sections. Adjust
10081 code to use Output_section_lookup_maps class.
10082 (Output_section:::add_script_input_section): Adjust code to use
10083 Output_section_lookup_maps class. Update lookup maps for merge
10084 sections also.
10085 (Output_section::discard_states): Use Output_section_lookup_maps.
10086 (Output_section::restore_states): Same.
10087 * output.h (Merge_section_properties): Move class defintion out of
10088 Output_section.
10089 (Output_section_lookup_maps): New class.
10090 (Output_section::Input_section::is_merge_section): New method
10091 defintion.
10092 (Output_section::Input_section::relobj): Move defintion out of class
10093 defintion. Declare method only.
10094 (Output_section::Input_section::shndx): Ditto.
10095 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10096 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10097 (Output_section::Merge_section_by_properties_map,
10098 Output_section::Output_section_data_by_input_section_map,
10099 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10100 Remove types.
2e702c99 10101 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10102 KEEPS_INPUT_SECTIONS.
10103 (Output_section::build_lookup_maps): New method declaration.
10104 (Output_section::merge_section_map_,
10105 Output_section::merge_section_by_properties_map_,
10106 Output_section::relaxed_input_section_map_,
10107 Output_section::is_relaxed_input_section_map_valid_): Remove data
10108 members.
10109 (Output_section::lookup_maps_): New data member.
10110
76295588
L
101112010-05-21 Doug Kwan <dougkwan@google.com>
10112
10113 PR gold/11619
10114 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10115 avoid a compilation error.
10116
d103a984
RÁE
101172010-05-19 Rafael Espindola <espindola@google.com>
10118
10119 * script-sections.cc (Output_section_definition::allocate_to_segment):
10120 Update the phdrs_list even when the output section is NULL.
10121 * testsuite/Makefile.am: Add test.
10122 * testsuite/Makefile.in: Regenerate.
10123 * testsuite/script_test_9.cc: New.
10124 * testsuite/script_test_9.sh: New.
10125 * testsuite/script_test_9.t: New.
10126
6625d24e
DK
101272010-05-19 Doug Kwan <dougkwan@google.com>
10128
10129 * arm.cc (Arm_input_section::original_size): New method.
10130 (Arm_input_section::do_addralign): Add a cast.
10131 (Arm_input_section::do_output_offset): Remove static cast.
10132 (Arm_input_section::original_addralign,
10133 Arm_input_section::original_size_): Change type to uint32_t.
10134 (Arm_input_section::init): Add safe casts for section alignment
10135 and size.
10136 (Arm_input_section::set_final_data_size): Do not set address and
10137 offset of stub table.
10138 (Arm_output_section::fix_exidx_coverage): Change use of of
10139 Output_section::Simple_input_section to that of
10140 Output_section::Input_section.
10141 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10142 except for the first pass.
10143 * output.cc (Output_section::get_input_sections): Change type of
10144 input_sections to std::list<Input_section>.
10145 (Output_section::add_script_input_section): Rename from
10146 Output_section::add_simple_input_section. Change type of SIS
10147 parameter from Simple_input_section to Input_section.
10148 * output.h (Output_section::Simple_input_section): Remove class.
10149 (Output_section::Input_section): Change class visibility to public.
10150 (Output_section::Input_section::addralign): Use stored alignments
10151 for special input sections if set.
10152 (Output_section::Input_section::set_addralign): New method.
10153 (Output_section::get_input_sections): Change parameter type from
10154 list of Simple_input_section to list of Input_section.
10155 (Output_section::add_script_input_section): Rename from
10156 Output_section::add_simple_input_section. Change first parameter's
10157 type from Simple_input_section to Input_section and remove the
10158 second and third parameters.
10159 * script-sections.cc (Input_section::Input_section_list): Change
10160 type to list of Output_section::Input_section/
10161 (Input_section_info::Input_section_info): Change parameter type of
10162 INPUT_SECTION to Output_section::Input_section.
10163 (Input_section_info::input_section): Change return type.
10164 (Input_section_info::input_section_): Change type to
10165 Output_section::Input_section.
10166 (Output_section_element_input::set_section_addresses): Adjust code
10167 to use Output_section::Input_section instead of
10168 Output_section::Simple_input_section. Adjust code for renaming
10169 of Output_section::add_simple_input_section.
10170 (Orphan_output_section::set_section_addresses): Ditto.
10171
e1e82ea4
RW
101722010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10173
10174 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10175 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10176
91e75c8a
RÁE
101772010-05-18 Rafael Espindola <espindola@google.com>
10178
10179 * options.cc (General_options::finalize): Handle -nostdlib.
10180 * options.h (nostdlib): New option.
10181 * script.cc (script_add_search_dir): Handle -nostdlib.
10182
da59ad79
DK
101832010-05-12 Doug Kwan <dougkwan@google.com>
10184
10185 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10186 attributes section only if there no attributes section after merging.
10187 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10188 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10189 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10190 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10191 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10192 and arm_attr_merge_7.stdout.
10193 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10194 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10195 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10196 arm_attr_merge_7b.o): New rules.
10197 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10198 arm_attr_merge_7
10199 * testsuite/Makefile.in: Regenerate.
10200 * testsuite/arm_attr_merge.sh: New file.
10201 * testsuite/arm_attr_merge_[67][ab].s: Same.
10202
3e01a7fd
NC
102032010-05-05 Nick Clifton <nickc@redhat.com>
10204
10205 * po/es.po: Updated Spanish translation.
10206
7ad2014a
L
102072010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10208
10209 * Makefile.am (install-exec-local): Properly install gold as
10210 default cross linker.
10211 * Makefile.in: Regenerated.
10212
4fda8867
NC
102132010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10214 Nick Clifton <nickc@redhat.com>
10215
10216 * configure.ac (install_as_default): Define and set to false
10217 unless --enable-gold or --enable-gold=both/gold has been
10218 specified.
10219 * configure: Regenerate.
10220
10221 * Makefile.am (install-exec-local): Install the executable as
10222 'ld.gold'. If install_as_default is true then also install it as
10223 'ld'.
10224 * Makefile.in: Regenerated.
10225
bd288ea2
ILT
102262010-04-24 Ian Lance Taylor <iant@google.com>
10227
10228 * layout.cc (Layout::layout_reloc): In relocatable link don't
10229 combine reloc sections for grouped sections.
10230
ef38fd8a
ST
102312010-04-23 Sriraman Tallam <tmsriram@google.com>
10232
10233 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10234 sections that are not ordinary to icf.
10235 * icf.cc (get_section_contents): Handle relocation pointing to section
10236 with no object or shndx information.
10237 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10238 * testsuite/Makefile.in: Regenerate.
10239 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10240 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10241
f6973bdc
ILT
102422010-04-22 Ian Lance Taylor <iant@google.com>
10243
10244 * expression.cc (Expression::Expression_eval_info): Add
10245 result_alignment_pointer field.
10246 (Expression::eval_with_dot): Add result_alignment_pointer
10247 parameter. Change all callers.
10248 (Expression::eval_maybe_dot): Likewise.
10249 (class Binary_expression): Add alignment_pointer parameter to
10250 left_value and right_value. Change all callers.
10251 (BINARY_EXPRESSION): Set result alignment.
10252 (class Trinary_expression): Add alignment_pointer parameter to
10253 arg2_value and arg3_value. Change all callers.
10254 (Trinary_cond::value): Set result alignment.
10255 (Max_expression::value, Min_expression::value): Likewise.
10256 (Align_expression::value): Likewise.
10257 * script-sections.cc (class Sections_element): Add dot_alignment
10258 parameter to set_section_addresses virtual function. Update
10259 instantiations.
10260 (class Output_section_element): Likewise.
10261 (Script_sections::create_segments): Add dot_alignment parameter.
10262 Change all callers.
10263 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10264 (Script_sections::set_phdrs_clause_addresses): Likewise.
10265 * script-sections.h: Update declarations.
10266 * script.h: Update declarations.
10267 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10268 min_p_align.
10269 * testsuite/script_test_3.t: Set large alignment.
10270 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10271 segment has expected alignment.
10272
9c9c98a5
NC
102732010-04-22 Nick Clifton <nickc@redhat.com>
10274
10275 * po/gold.pot: Updated by the Translation project.
10276 * po/vi.po: Updated Vietnamese translation.
10277
2253bfba
L
102782010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10279
10280 * testsuite/Makefile.am (check_PROGRAMS): Add
10281 icf_virtual_function_folding_test.
10282 * testsuite/Makefile.in: Regenerated.
10283
85fdf906
AH
102842010-04-15 Andrew Haley <aph@redhat.com>
10285
10286 * options.h (merge_exidx_entries): New option.
10287 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10288 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10289 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10290 (Target_arm::merge_exidx_entries): New function.
10291 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10292 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10293 to Arm_exidx_fixup constructor.
10294 Add new arg, merge_exidx_entries.
10295 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10296 Arm_output_section::fix_exidx_coverage.
10297
ce97fa81
ST
102982010-04-18 Sriraman Tallam <tmsriram@google.com>
10299
10300 * icf.cc (get_section_contents): Check for preemptible functions.
10301 Ignore addend when appropriate.
10302 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10303 section folded.
10304 (add_from_relobj): Check for section folded.
10305 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10306 * symtab.h (should_add_dynsym_entry): Add new parameter.
10307 * target-reloc.h (scan_relocs): Check for section folded.
10308 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10309 Check reloc types for function pointers in shared objects.
10310 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10311 case.
10312 (icf_preemptible_functions_test): New test case.
10313 (icf_string_merge_test): New test case.
10314 * testsuite.Makefile.in: Regenerate.
10315 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10316 bar_glob. Refactor code.
10317 * testsuite/icf_preemptible_functions_test.cc: New file.
10318 * testsuite/icf_preemptible_functions_test.sh: New file.
10319 * testsuite/icf_string_merge_test.cc: New file.
10320 * testsuite/icf_string_merge_test.sh: New file.
10321 * testsuite/icf_virtual_function_folding_test.cc: New file.
10322 * testsuite/icf_virtual_function_folding_test.sh: New file.
10323
04ceb17c
DK
103242010-04-14 Doug Kwan <dougkwan@google.com>
10325
10326 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10327 for local symbol recounting if we remove a section due to ICF.
10328 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10329 there are no regular objects in input.
10330
153e7da4
DK
103312010-04-13 Doug Kwan <dougkwan@google.com>
10332
10333 * arm.cc (Arm_input_section::set_final_data_size): Compute
10334 accurate final data size instead of using current data size.
10335
4dbd9faf
DK
103362010-04-09 Doug Kwan <dougkwan@google.com>
10337
10338 * layout.cc (Layout::choose_output_section): Handle script section
10339 types.
10340 (Layout::make_output_section_for_script): Add section type parameter.
10341 Handle script section types.
10342 * layout.h (Layout::make_output_section_for_script): Add section
10343 type parameter.
10344 * output.cc (Output_section::Output_section): Initialize data member
10345 is_noload_.
10346 (Output_section::do_reset_address_and_file_offset): Do not set address
10347 to 0 if section is a NOLOAD section.
10348 * output.h (Output_section::is_noload): New method.
10349 (Output_section::set_is_noload): Ditto.
10350 (Output_section::is_noload_): New data member.
10351 * script-c.h (Script_section_type): New enum type.
10352 (struct Parser_output_section_header): Add new file section_type.
10353 * script-sections.cc (Sections_element::output_section_name): Add
10354 parameter for returning script section type.
10355 (Output_section_definition::output_section_name): Ditto.
10356 (Output_section_definition::section_type)P; New method.
10357 (Output_section_definiton::script_section_type_name): Ditto.
10358 (Output_section_definition::script_section_type_): New data member.
10359 (Output_section_definition::Output_section_definition): Initialize
10360 data member Output_section_definition::script_section_type_.
10361 (Output_section_definition::create_sections): Pass script section type
10362 to Layout::make_output_section_for_script.
10363 (Output_section_definition::output_section_name): Return script
10364 section type to caller.
10365 (Output_section_definition::set_section_address): Do not advance
10366 dot value and load address if section type is NOLOAD. Set address
10367 of NOLOAD sections regardless of section flags.
10368 (Output_section_definition::print): Print section type if it is
10369 not SCRIPT_SECTION_TYPE_NONE.
10370 (Output_section_definition::section_type): New method.
10371 (Output_section_definition::script_section_type_name): Ditto.
10372 (Script_sections::output_section_name): Add new parameter
10373 PSECTION_TYPE for returning script section type. Pass it to
10374 section elements. Handle discard sections.
10375 (Sort_output_sections::operator()): Handle NOLOAD sections.
10376 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10377 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10378 returning script section type.
10379 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10380 INFO and NOLOAD.
10381 * yyscript.y (union): Add new field SECTION_TYPE.
10382 (COPY, DSECT, INFO, NOLOAD): New tokens.
10383 (opt_address_and_section_type): Change type to output_section_header.
10384 (section_type): New non-terminal
10385 (section_header): Handle section type.
2253bfba 10386 (opt_address_and_section_type): Return section type value.
4dbd9faf 10387
721ea635
L
103882010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10389
10390 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10391 * testsuite/plugin_common_test_2.c (foo): Likewise.
10392
6bf924b0
DK
103932010-04-08 Doug Kwan <dougkwan@google.com>
10394
10395 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10396 Output_merge_data.
10397 * output.cc (Output_section::add_merge_input_section): Simplify
10398 code and return status of Output_merge_base::add_input_section.
e1df38aa 10399 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10400 returns true.
10401
24af6f92
DK
104022010-04-07 Doug Kwan <dougkwan@google.com>
10403
10404 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10405 if section is marked as containing instructions but has no mapping
10406 symbols.
10407 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10408 correct section index.
10409 (Arm_relobj::find_linked_text_section): Ditto.
10410
00698fc5
CC
104112010-04-07 Cary Coutant <ccoutant@google.com>
10412
10413 * archive.cc (include_member): Destroy Read_symbols_data object before
10414 releasing file.
10415 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10416 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10417 (Read_symbols_data::~Read_symbols_data) New destructor.
10418 (Section_relocs::Section_relocs) New constructor.
10419 (Section_relocs::~Section_relocs) New destructor.
10420 (Read_relocs_data::Read_relocs_data) New constructor.
10421 (Read_relocs_data::~Read_relocs_data) New destructor.
10422 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10423 pointers to NULL after deleting.
10424
7296d933
DK
104252010-04-07 Doug Kwan <dougkwan@google.com>
10426
10427 * arm.cc: Replace "endianity" with "endianness" in comments.
10428 (Arm_exidx_cantunwind): Ditto.
10429 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10430 (Arm_relobj::merge_flags_and_attributes): New method.
10431 (Arm_relobj::merge_flags_and_attributes_): New data member.
10432 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10433 (Arm_relobj::scan_sections_for_stubs): Ditto.
10434 (Arm_relobj::do_read_symbols): Check to see if we really want to
10435 merge processor-specific flags and attributes. Exit early if
10436 an object is empty except for section names and the undefined symbol.
10437 (Target_arm::do_finalize_sections): Move check for ELF format to
10438 Arm_relobj::do_read_symbols. Merge processor specific flags and
10439 attributes from a regular object only when we have determined that
10440 it is aapropriate. Do not create an .ARM.attributes section in
10441 output if there is no regular input object.
10442 (Target_arm::merge_processor_specific_flags): Check
10443 --warn-mismatch before printing any error.
10444 (Target_arm::merge_object_attributes): Ditto.
10445 * gold.cc (queue_middle_tasks): Handle the case in which there is
10446 no regular object in input.
10447 * options.cc (General_options::parse_EB): New method.
10448 (General_options::parse_EL): Same.
10449 (General_options::General_options): Initialize endianness_.
10450 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10451 New options.
10452 (General_options::Endianness): New enum.
10453 (General_options::endianness): New method.
10454 (General_options::endianness_): New data member.
10455 * parameters.cc (Parameters::set_options): Check target endianness.
10456 (Parameters::set_target_once): Ditto.
10457 (Parameters::check_target_endianness): New method.
10458 (parameters_force_valid_target): If either -EL or -EB is specified,
10459 use it to define endianness of default target.
10460 * parameters.h (Parameters::check_target_endianness): New method
10461 declaration.
10462 * target.h (class Target): Change "endianity" to "endianness"
10463 in comments.
10464
efc8d4f2
RW
104652010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10466
10467 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10468 * configure: Regenerate.
10469 * Makefile.in: Regenerate.
10470 * testsuite/Makefile.in: Regenerate.
10471
be234d88
CC
104722010-04-06 Cary Coutant <ccoutant@google.com>
10473
10474 gcc PR lto/42757
10475 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10476 prevailing definitions of common symbols.
10477 * testsuite/plugin_test_6.sh: New test case.
10478 * testsuite/plugin_common_test_1.c: New test case.
10479 * testsuite/plugin_common_test_2.c: New test case.
10480 * testsuite/Makefile.am (plugin_test_6): New test case.
10481 * testsuite/Makefile.in: Regenerate.
10482
bd32c6bd
NC
104832010-04-06 Nick Clifton <nickc@redhat.com>
10484
10485 * po/vi.po: New Vietnamese translation.
10486
323c532f
DK
104872010-03-30 Doug Kwan <dougkwan@google.com>
10488
10489 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10490
4fcd97eb
DK
104912010-03-25 Doug Kwan <dougkwan@google.com>
10492
10493 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10494 to avoid a conversion warning on a 32-bit host.
10495
4ebf39db
ILT
104962010-03-24 Ian Lance Taylor <iant@google.com>
10497
10498 * testsuite/script_test_3.t: Add a TLS segment.
10499 * testsuite/Makefile.am (check_PROGRAMS): Add
10500 tls_phdrs_script_test.
10501 (tls_phdrs_script_test_SOURCES): Define.
10502 (tls_phdrs_script_test_DEPENDENCIES): Define.
10503 (tls_phdrs_script_test_LDFLAGS): Define.
10504 (tls_phdrs_script_test_LDADD): Define.
10505 * testsuite/Makefile.in: Rebuild.
10506
4a599bdd
CC
105072010-03-23 Cary Coutant <ccoutant@google.com>
10508
10509 * fileread.cc (find_or_make_view): Fix comment.
10510
6c93b22c
ILT
105112010-03-23 Ian Lance Taylor <iant@google.com>
10512
10513 * script-sections.cc (class Orphan_section_placement): Define
10514 PLACE_TLS and PLACE_TLS_BSS.
10515 (Orphan_section_placement::Orphan_section_placement): Initialize
10516 new places.
10517 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10518 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10519 (tls_script_test_SOURCES): Define.
10520 (tls_script_test_DEPENDENCIES): Define.
10521 (tls_script_test_LDFLAGS): Define.
10522 (tls_script_test_LDADD): Define.
10523 * testsuite/Makefile.in: Rebuild.
10524
a2c7281b
DK
105252010-03-22 Doug Kwan <dougkwan@google.com>
10526
10527 * arm.cc (Arm_relocate_functions::abs8,
10528 Arm_relocate_functions::abs16): Use correct check for overflow
10529 specified in the ARM ELF specs.
10530 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10531 target of a BLX instruction specially.
10532 (Reloc_stub::stub_type_for_reloc): Ditto.
10533 (Relocate::relocate): Use symbolic names instead of numeric relocation
10534 codes to report error.
10535 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10536 workaround.
10537 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10538 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10539 thumb2_blx_out_of_range.stdout
10540 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10541 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10542 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10543 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10544 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10545 thumb2_blx_in_range, thumb2_blx_in_range.o,
10546 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10547 thumb2_blx_out_of_range.o): New rules.
2e702c99 10548 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10549 thumb2_blx_in_range and thumb2_blx_out_of_range.
10550 * testsuite/Makefile.in: Regenerate.
10551 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10552 * testsuite/thumb_blx_in_range.s: New file.
10553 * testsuite/thumb_blx_out_of_range.s: New file.
10554
b0193076
RÁE
105552010-03-22 Rafael Espindola <espindola@google.com>
10556
10557 * archive.cc (Should_include): Move to archive.h.
10558 (should_include_member): Make it a member of Archive.
10559 (Lib_group): New.
10560 (Add_lib_group_symbols): New.
10561 * archive.h: Include options.h.
10562 (Archive_member): Moved from Archive.
10563 (Should_include): Moved from archive.cc.
10564 (Lib_group): New.
10565 (Add_lib_group_symbols): New.
10566 * dynobj.cc (do_should_include_member): New.
10567 * dynobj.h (do_should_include_member): New.
10568 * gold.cc (queue_initial_tasks): Update call to queue.
10569 * main.cc (main): Print lib group stats.
10570 * object.cc (do_should_include_member): New.
10571 * object.h: Include archive.h.
10572 (Object::should_include_member): New.
10573 (Object::do_should_include_member): New.
10574 (Sized_relobj::do_should_include_member): New.
10575 * options.cc (General_options::parse_start_lib): New.
10576 (General_options::parse_end_lib): New.
10577 (Input_arguments::add_file): Handle lib groups.
10578 (Input_arguments::start_group): Check we are not in a lib.
10579 (Input_arguments::start_lib): New.
10580 (Input_arguments::end_lib): New.
10581 * options.h (General_options): Add start_lib and end_lib.
10582 (Input_argument::lib_): New.
10583 (Input_argument::lib): New.
10584 (Input_argument::is_lib): New.
10585 (Input_file_lib): New.
10586 (Input_arguments::in_lib_): New.
10587 (Input_arguments::in_lib): New.
10588 (Input_arguments::start_lib): New.
10589 (Input_arguments::end_lib_): New.
10590 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10591 in unused members as preempted.
10592 (Sized_pluginobj::do_should_include_member): New.
10593 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10594 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10595 return the blocker.
10596 (Read_symbols::do_whole_lib_group): New.
10597 (Read_symbols::do_lib_group): New.
10598 (Read_symbols::do_read_symbols): Handle lib groups.
10599 (Read_symbols::get_name): Handle lib groups.
10600 * readsyms.h (Read_symbols): Add an archive member pointer.
10601 (Read_symbols::do_whole_lib_group): New.
10602 (Read_symbols::do_lib_group): New.
10603 (Read_symbols::member_): New.
10604 * script.cc (read_input_script): Update call to queue_soon.
10605
d099120c
DK
106062010-03-19 Doug Kwan <dougkwan@google.com>
10607
10608 * arm.cc (Stub_table::Stub_table): Initialize new data members
10609 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10610 (Stub_table::add_reloc_stub): Assign stub offset and update
10611 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10612 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10613 New data members.
2e702c99 10614 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10615 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10616 instead of going over all reloc stubs.
2e702c99 10617 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10618 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10619 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10620 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10621 Stringpool_template::offset_.
10622 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10623 Stringpool_template::offset_ to zero.
10624
1aa37384
DK
106252010-03-15 Doug Kwan <dougkwan@google.com>
10626
10627 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10628 offset_.
10629 (Stringpool_template::new_key_offset): New method.
10630 (Stringpool_template::add_string): Assign offsets when adding new
10631 strings.
10632 (Stringpool_template::set_string_offsets): Do not set string offsets
10633 when not optimizing.
10634 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10635 member size_.
2e702c99
RM
10636 (Chunked_vector::clear): Clear size_.
10637 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10638 (Chunked_vector::size): Return size_.
10639 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10640 (Chunked_vector::size_): New data member.
1aa37384
DK
10641 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10642 (Stringpool_template::new_key_offset): New method declaration.
10643 (Stringpool_template::offset_): New data member.
10644
b672b057
RÁE
106452010-03-15 Rafael Espindola <espindola@google.com>
10646
10647 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10648 Add_symbols' constructor.
10649 * readsyms.h (Add_symbols): Remove the input_group member.
10650
b6848d3c
ILT
106512010-03-10 Ian Lance Taylor <iant@google.com>
10652
10653 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10654 target to ask whether a reference to a symbol requires a stack
10655 split.
10656 * target.h (Target::is_call_to_non_split): New function.
10657 (Target::do_is_call_to_non_split): Declare virtual function.
10658 * target.cc: Include "symtab.h".
10659 (Target::do_is_call_to_non_split): New function.
10660 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10661
a2a5469e
CC
106622010-03-10 Cary Coutant <ccoutant@google.com>
10663
10664 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10665 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10666 (File_read::open[2]): Add whole_file_view_ to list of views.
10667 (File_read::make_view): Remove test of whole_file_view_.
10668 (File_read::find_or_make_view): Create whole_file_view_ if
10669 necessary.
10670 (File_read::clear_views): Replace bool parameter with enum;
10671 adjust all callers. Don't delete views with permanent data;
10672 do delete cached views and views from archives if
10673 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10674 if clearing the corresponding view.
10675 * fileread.h (File_read::Clear_views_mode): New enum.
10676 (File_read::View::is_permanent_view): New method.
10677 (File_read::clear_views): Replace bool parameter
10678 with enum; adjust all callers.
10679 * options.h (General_options): Change keep_files_mapped option;
10680 add map_whole_files.
10681 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10682 releasing the file.
10683 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10684 the file.
10685
8861f32b
DM
106862010-03-10 David S. Miller <davem@davemloft.net>
10687
10688 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10689
d62d0f5f
ST
106902010-03-09 Sriraman Tallam <tmsriram@google.com>
10691
10692 * icf.cc (get_section_contents): Add '@' marker after processing the
10693 merge reloc.
10694
9177756d
DK
106952010-03-08 Doug Kwan <dougkwan@google.com>
10696
10697 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10698 due to a conversion warning.
10699 (Arm_relobj::update_output_local_symbol_count): Check for local
10700 symbol with unset output index.
10701
9e9e071b
ILT
107022010-03-05 Ian Lance Taylor <iant@google.com>
10703
10704 * options.h (class General_options): Add --spare-dynamic-tags.
10705 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10706 --spare-dynamic-tags.
10707
a81ee015
ILT
107082010-03-05 Ian Lance Taylor <iant@google.com>
10709
10710 * incremental.cc: Include "libiberty.h".
10711
44ec90b9
RO
107122010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10713
10714 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10715 function, is_info_ member.
10716 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10717 (Versions::Versions): Update caller.
10718 (Versions::define_base_version): Likewise.
10719 (Versions::add_def): Likewise.
10720
0897ed3b
ST
107212010-03-03 Sriraman Tallam <tmsriram@google.com>
10722
10723 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10724 (Scan::possible_function_pointer_reloc): New function.
10725 (Scan::local_reloc_may_be_function_pointer): Change to call
10726 possible_function_pointer_reloc.
10727 (Scan::global_reloc_may_be_function_pointer): Ditto.
10728 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10729 relocations in ".data.rel.ro._ZTV" section.
10730 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10731 * testsuite/icf_safe_so_test.cc: Ditto.
10732 * testsuite/icf_safe_test.cc: Ditto.
10733 * testsuite/icf_safe_test.sh: Ditto.
10734
d3bbad62
ILT
107352010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10736 Ian Lance Taylor <iant@google.com>
10737
10738 * target-reloc.h (relocate_section): Check the symbol table index
10739 for -1U before setting the local symbol index.
10740 (scan_relocatable_relocs): If copying the relocation, record that
10741 the local symbol is required.
10742 * object.h (Symbol_value::is_output_symtab_index_set): New
10743 function.
10744 (Symbol_value::may_be_discarded_from_output_symtab): New
10745 function.
10746 (Symbol_value::has_output_symtab_entry): New function.
10747 (Symbol_value::needs_output_symtab_entry): Remove.
10748 (Symbol_value::output_symtab_index): Make sure the symbol index is
10749 set.
10750 (Symbol_value::set_output_symtab_index): Make sure the symbol
10751 index is not set. Make sure the new index is valid.
10752 (Symbol_value::set_must_have_output_symtab_entry): New function.
10753 (Symbol_value::has_output_dynsym_entry): New function.
10754 (Symbol_value::set_output_dynsym_index): Make sure the new index
10755 is valid.
10756 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10757 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10758 local symbol if permitted.
10759 (Sized_relobj::do_finalize_local_symbols): Call
10760 is_output_symtab_index_set rather than needs_output_symtab_entry.
10761 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10762 rather than needs_output_symtab_entry. Call
10763 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10764 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10765 is_output_symtab_index_set rather than needs_output_symtab_entry.
10766 * testsuite/discard_locals_relocatable_test.c: New file.
10767 * testsuite/discard_locals_test.sh: Test -r.
10768 * testsuite/Makefile.am (check_DATA): Add
10769 discard_locals_relocatable_test1.syms,
10770 discard_local_relocatable_test2.syms.
10771 (MOSTLYCLEANFILES): Likewise. Also add
10772 discard_locals_relocatable_test1.lout and
10773 discard_locals_relocatable_test2.out.
10774 (discard_locals_relocatable_test1.syms): New target.
10775 (discard_locals_relocatable_test.o): New target.
10776 (discard_locals_relocatable_test1.out): New target.
10777 (discard_locals_relocatable_test2.syms): New target.
10778 (discard_locals_relocatable_test2.out): New target.
10779 (various): Add missing ../ld-new dependencies.
10780 * testsuite/Makefile.in: Rebuild.
10781
7e8ccf26
NC
107822010-03-03 Nick Clifton <nickc@redhat.com>
10783
10784 * po/fi.po: New Finnish translation.
10785
2a0ff005
DK
107862010-03-01 Doug Kwan <dougkwan@google.com>
10787
10788 * layout.cc (Layout::Layout): Force section types of .init_array*,
10789 .preinit_array* and .fini_array* sections.
10790 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10791 Fix check of return value of std::string::find.().
10792 (Output_section::Input_section_sort_compare::operator()): Remove
10793 comment about .init_array.
10794 (Output_section::Input_section_sort_init_fini_compare::operator()):
10795 New method.
10796 (Output_section::sort_attached_input_sections): Handle .init_array
10797 and .fini_array specially.
10798 * output.h (Output_section::Inut_section_sort_compare): Update
10799 comment.
10800 (Output_section::Input_section_sort_init_fini_compare): New struct.
10801
c3e4ae29
DK
108022010-02-26 Doug Kwan <dougkwan@google.com>
10803
10804 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10805 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10806 * testsuite/debug_msg.sh: Avoid matching source line number for
10807 use of global variable undef_int.
10808
2fd9ae7a
DK
108092010-02-26 Doug Kwan <dougkwan@google.com>
10810
10811 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10812 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10813 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10814 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10815 * options.cc (General_options::General_options): Initialize member
10816 fix_v4bx_.
10817 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10818 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10819 and rm_no_fix_v4bx.stdout
10820 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10821 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10822 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10823 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10824 and arm_no_fix_v4bx.
10825 * Makefile.in: Regenerate.
10826 * testsuite/arm_fix_v4bx.s: New file.
10827 * testsuite/arm_fix_v4bx.sh: Ditto.
10828
67ec7d0b
DK
108292010-02-24 Doug Kwan <dougkwan@google.com>
10830
10831 * arm.cc (Target_arm::got_section): Make the .got section the first
10832 non RELRO section in the data segment.
10833 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10834 suffixes of section names.
10835
10165461
DK
108362010-02-24 Doug Kwan <dougkwan@google.com>
10837
10838 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10839 flags and attributes merging if an input file is a binary file.
10840 * fileread.cc (Input_file::open): Record format of original file.
10841 * fileread.h (Input_file::Format): New enum type.
2e702c99 10842 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10843 (Input_file::format): New method definition.
10844 (Input_file::format_):: New data member.
10845
4a54abbb
DK
108462010-02-24 Doug Kwan <dougkwan@google.com>
10847
10848 * arm.cc (Arm_output_data_got): New class.
10849 (ARM_TCB_SIZE): New constant
10850 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10851 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10852 If user uses a script with a SECTIONS clause, issue only a warning
10853 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10854 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10855 garbage collection.
10856 (Target_arm::got_mode_index_entry): Handle static linking.
10857 (Target_arm::Scan::local): Ditto.
10858 (Target_arm::Scan::global): Ditto.
10859 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10860 all incorrectly implemented relocations.
e1df38aa 10861 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10862 Arm_output_section::fix_exidx_coverage.
10863 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10864 from ".ARM.exidx." and ".ARM.extab.".
10865
ca419a6f
ILT
108662010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10867
10868 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10869 section if it does not already exist.
10870 * attributes.cc (Attributes_section_data::Attributes_section_data):
10871 Don't crash if size is zero.
10872
135b9c78
ILT
108732010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10874 Ian Lance Taylor <iant@google.com>
10875
10876 * gold.cc (queue_middle_tasks): If no input files were opened,
10877 exit.
10878 * workqueue.h (Task_function::Task_function): Assert that there is
10879 a blocker.
10880
bb0bfe4f
DK
108812010-02-22 Doug Kwan <dougkwan@google.com>
10882
10883 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10884 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10885 types to avoid warnings due to different uint64_t implementations
10886 on different hosts.
10887
2a2b6d42
DK
108882010-02-21 Doug Kwan <dougkwan@google.com>
10889
10890 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10891 handling of the maximum backward branch offset.
2e702c99 10892 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10893 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10894 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10895 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10896 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10897 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10898 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10899 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10900 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10901 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10902 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10903 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10904 thumb2_bl_out_of_range.o): New rules.
10905 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10906 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10907 thumb2_bl_out_of_range
10908 * testsuite/Makefile.in: Regenerate.
10909 * testsuite/arm_bl_in_range.s: New file.
10910 * testsuite/arm_bl_out_of_range.s: Ditto.
10911 * testsuite/arm_branch_in_range.sh: Ditto.
10912 * testsuite/arm_branch_range.t: Ditto.
10913 * testsuite/thumb2_branch_range.t: Ditto.
10914 * testsuite/thumb_bl_in_range.s: Ditto.
10915 * testsuite/thumb_bl_out_of_range.s: Ditto.
10916 * testsuite/thumb_branch_range.t: Ditto.
10917
b487ad64
ST
109182010-02-20 Sriraman Tallam <tmsriram@google.com>
10919
10920 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10921 Add reloc offset information.
10922 * icf.cc (get_section_contents): Change iterators to point to the new
10923 vectors. Add reloc offset information to the contents.
10924 * icf.h (Icf::Sections_reachable_info): New typedef.
10925 (Icf::Sections_reachable_list): New typedef.
10926 (Icf::Offset_info): New typedef.
10927 (Icf::Reloc_info): New struct typedef.
10928 (Icf::Reloc_info_list): New typedef.
10929 (Icf::symbol_reloc_list): Delete method.
10930 (Icf::addend_reloc_list): Delete method.
10931 (Icf::section_reloc_list): Delete method.
10932 (Icf::reloc_info_list): New method.
10933 (Icf::reloc_info_list_): New member.
10934
f96accdf
DK
109352010-02-19 Doug Kwan <dougkwan@google.com>
10936
10937 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10938 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10939 * arm.cc (Arm_relocation_functions): New forward declaration.
10940 (Target_arm::Target_arm): Initialize new data members
10941 got_mod_index_offset_ and tls_base_symbol_defined_.
10942 (Target_arm::Relocate::relocate_tls): New method.
10943 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10944 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10945 New methods.
2e702c99 10946 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10947 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10948 (Target_arm::got_mod_index_offset_,
10949 Target_arm::tls_base_symbol_defined_): New data members.
10950 (Target_arm::Scan::local, Target::Scan::global,
10951 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10952 relocations.
10953
c8761b9a
DK
109542010-02-18 Doug Kwan <dougkwan@google.com>
10955
10956 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10957 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10958 text section as a parameter becuase some broken tools may not set
10959 the link in section header.
10960 (Target_arm::has_got_section): New method.
10961 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10962 without any mapping symbol as data only. Remove warning.
10963 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10964 link in its section header, try to discover the link by inspecting the
10965 REL31 relocation at the beginning of the section.
10966 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10967 in error message.
10968 (Target_arm::Scan::global): Treat any reference to the symbol
10969 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10970
21bb3914
ST
109712010-02-12 Sriraman Tallam <tmsriram@google.com>
10972
10973 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10974 (Scan::global_reloc_may_be_function_pointer): New function.
10975 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10976 (Scan::global_reloc_may_be_function_pointer): New function.
10977 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10978 (Scan::global_reloc_may_be_function_pointer): New function.
10979 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10980 (Scan::global_reloc_may_be_function_pointer): New function.
10981 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10982 (Scan::global_reloc_may_be_function_pointer): New function.
10983 (Scan::possible_function_pointer_reloc): New function.
10984 (Target_x86_64::can_check_for_function_pointers): New function.
10985 * gc.h (gc_process_relocs): Scan relocation types to determine if
10986 function pointers were taken for targets that support it.
10987 * icf.cc (Icf::find_identical_sections): Include functions for
10988 folding in safe ICF whose pointer is not taken.
10989 * icf.h (Secn_fptr_taken_set): New typedef.
10990 (fptr_section_id_): New member.
10991 (section_has_function_pointers): New function.
10992 (set_section_has_function_pointers): New function.
10993 (check_section_for_function_pointers): New function.
10994 * options.h: Fix comment for safe ICF option.
10995 * target.h (can_check_for_function_pointers): New function.
10996 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10997 Modify icf_safe_test for X86-64.
10998 * testsuite/Makefile.in: Regenerate.
10999 * testsuite/icf_safe_so_test.cc: New file.
11000 * testsuite/icf_safe_so_test.sh: New file.
11001 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11002 (main): Change to take pointer to function kept_func_3.
11003 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11004 folding is done correctly for X86-64.
11005
0da6fa6c
DM
110062010-02-12 David S. Miller <davem@davemloft.net>
11007
11008 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11009 is_symbolless parameter.
11010 (Output_reloc<SHT_REL>::is_symbolless): New.
11011 (Output_reloc<SHT_REL>::is_symbolless_): New.
11012 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11013 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11014 (Output_reloc<SHT_RELA>::is_symbolless): New.
11015 (Output_data_reloc::add_global): Handle is_symbolless.
11016 (Output_data_reloc::add_global_relative): Likewise.
11017 (Output_data_reloc::add_local): Likewise.
11018 (Output_data_reloc::add_local_relative): Likewise.
11019 (Output_data_reloc::add_symbolless_global_addend): New.
11020 (Output_data_reloc::add_symbolless_local_addend): New.
11021 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11022 is_symbolless.
11023 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11024 instead of ->is_relative_
11025 (Output_reloc::write): Likewise.
11026 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11027 (Output_reloc::write_rel): Simplify.
11028
11029 * sparc.cc (Target_sparc::Scan::local): Use
11030 ->add_symbolless_local_addend as needed.
11031 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11032 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11033 based upon relocation offset.
11034
e4782e83
DK
110352010-02-11 Doug Kwan <dougkwan@google.com>
11036
11037 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11038 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11039 beginning of function.
11040 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11041 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11042 parameter is_32bit in calls to should_apply_static_reloc.
11043 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11044 (check_DATA): Add arm_abs_global.stdout.
11045 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11046 arm_abs_global.stdout): New rules.
11047 (MOSTLLYCLEANFILES): Add arm_abs_global
11048 * Makefile.in: Regenerate.
11049 * testsuite/arm_abs_global.s: New file.
11050 * testsuite/arm_abs_global.sh: Ditto.
11051 * testsuite/arm_abs_lib.s: Ditto.
11052
93ceb764
ILT
110532010-02-11 Ian Lance Taylor <iant@google.com>
11054
11055 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11056 Read_relocs task.
11057 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11058 Allocate_commons_task first.
11059 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11060 task, rather than symtab_lock_.
11061 (Gc_process_relocs::~Gc_process_relocs): New function.
11062 (Gc_process_relocs::is_runnable): Check this_blocker_.
11063 (Gc_process_relocs::locks): Use next_blocker_ rather than
11064 blocker_.
11065 (Scan_relocs::~Scan_relocs): New function.
11066 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11067 symtab_lock_.
11068 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11069 next_blocker_.
11070 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11071 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11072 constructor accordingly.
11073 (class Gc_process_relocs): Likewise.
11074 (class Scan_relocs): Likewise.
11075 * common.h (class Allocate_commons_task): Remove symtab_lock_
11076 field, and corresponding constructor parameter.
11077 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11078 symtab_lock_.
11079 (Allocate_commons_task::locks): Likewise.
11080
114dfbe1
ILT
110812010-02-11 Ian Lance Taylor <iant@google.com>
11082
11083 * gold-threads.h (class Once): Define.
11084 (class Initialize_lock): Rewrite as child of Once.
11085 * gold-threads.cc (class Once_initialize): Define.
11086 (once_pointer_control): New static variable.
11087 (once_pointer, once_arg): New static variables.
11088 (c_run_once): New static function.
11089 (Once::Once, Once::run_once, Once::internal_run): New functions.
11090 (class Initialize_lock_once): Remove.
11091 (initialize_lock_control): Remove.
11092 (initialize_lock_pointer): Remove.
11093 (initialize_lock_once): Remove.
11094 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11095 (Initialize_lock::initialize): Rewrite.
11096 (Initialize_lock::do_run_once): New function.
11097 * archive.cc (Archive::interpret_header): Only clear name if it is
11098 not already empty.
11099 * fileread.cc: Include "gold-threads.h"
11100 (file_counts_lock): New static variable.
11101 (file_counts_initialize_lock): Likewise.
11102 (File_read::release): Only increment counts when using --stats.
11103 Use a lock around the increment.
11104 * parameters.cc (class Set_parameters_target_once): Define.
11105 (set_parameters_target_once): New static variable.
11106 (Parameters::Parameters): Move here from parameters.h.
11107 (Parameters::set_target): Rewrite.
11108 (Parameters::set_target_once): New function.
11109 (Parameters::clear_target): Move here and rewrite.
11110 * parameters.h (class Parameters): Update declarations. Add
11111 set_parameters_target_once_ field.
11112 (Parameters::Parameters): Move to parameters.cc.
11113 (Parameters::clear_target): Likewise.
11114 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11115 task.
11116 (Start_group::~Start_group): New function.
11117 (Start_group::is_runnable): New function.
11118 (Start_group::locks, Start_group::run): New functions.
11119 (Finish_group::run): Change saw_undefined to size_t.
11120 * readsyms.h (class Start_group): Define.
11121 (class Finish_group): Change saw_undefined_ field to size_t.
11122 (Finish_group::Finish_group): Remove saw_undefined and
11123 this_blocker parameters. Change all callers.
11124 (Finish_group::set_saw_undefined): New function.
11125 (Finish_group::set_blocker): New function.
11126 * symtab.h (class Symbol_table): Change saw_undefined to return
11127 size_t. Change saw_undefined_ field to size_t.
11128 * target-select.cc (Set_target_once::do_run_once): New function.
11129 (Target_selector::Target_selector): Initialize set_target_once_
11130 field. Don't initialize lock_ and initialize_lock_ fields.
11131 (Target_selector::instantiate_target): Rewrite.
11132 (Target_selector::set_target): New function.
11133 * target-select.h (class Set_target_once): Define.
11134 (class Target_selector): Update declarations. Make
11135 Set_target_once a friend. Remove lock_ and initialize_lock_
11136 fields. Add set_target_once_ field.
11137
fa17a3f4
ILT
111382010-02-10 Ian Lance Taylor <iant@google.com>
11139
11140 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11141 queueing any tasks.
11142 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11143 (queue_middle_tasks): Add all blockers before queueing any tasks.
11144 (queue_final_tasks): Likewise.
11145 * token.h (Task_token::add_blockers): New function.
11146 * object.h (Input_objects::number_of_relobjs): New function.
11147
c7177d31
ILT
111482010-02-10 Ian Lance Taylor <iant@google.com>
11149
5de0e392
ILT
11150 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11151 shared, not if not position independent.
11152 * x86_64.cc (Relocate::relocate_tls): Likewise.
11153 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11154 (tls_pie_pic_test): New target.
11155 * testsuite/Makefile.in: Rebuild.
11156
c7177d31
ILT
11157 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11158 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11159 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11160 * testsuite/Makefile.in: Rebuild.
11161
684b268a
DM
111622010-02-09 David S. Miller <davem@davemloft.net>
11163
11164 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11165 R_SPARC_RELATIVE using ->add_local_relative().
11166 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11167
612a8d3d
DM
11168 * output.h (Output_data_dynamic::add_section_size): New method
11169 that takes two Output_data objects.
11170 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11171 entry param. Handle it in initializers.
11172 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11173 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11174 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11175 arg.
11176 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11177 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11178 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11179 for dynrel_includes_plt.
11180 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11181 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11182 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11183 before .rela.plt
11184 (Target_sparc::do_finalize_sections): Update to pass true for
11185 dynrel_includes_plt.
11186 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11187 output before .rela.plt
11188 (Target_powerpc::do_finalize_sections): Update to pass true for
11189 dynrel_includes_plt when 32-bit.
11190
cb1be87e
DK
111912010-02-08 Doug Kwan <dougkwan@google.com>
11192
11193 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11194 method.
11195 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11196 Arm_relobj::scan_section_for_cortex_a8_stubs,
11197 Arm_relobj::do_relocation_section): Instead of calling
11198 Output_section::output_address, use faster
11199 Arm_relobj::simple_input_section_output_address.
11200
705b5121
DM
112012010-02-08 David S. Miller <davem@davemloft.net>
11202
11203 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11204 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11205 relocation helper function.
11206
024c4466
DM
11207 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11208 just like R_SPARC_GOT{10,13,22}.
11209 (Target_sparc::Scan::local): Likewise.
11210 (Target_sparc::Relocate:relocate): Likewise.
11211
9109c078
ILT
112122010-02-06 Ian Lance Taylor <iant@google.com>
11213
11214 * configure.ac: Rewrite targetobjs duplicate removal code to use
11215 only shell constructs.
11216 * configure: Rebuild.
11217
cf846138
DK
112182010-02-05 Doug Kwan <dougkwan@google.com>
11219
11220 PR 11247
11221 * arm.cc (Arm_relobj::section_is_scannable): New method.
11222 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11223 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11224
6cfaf60b
DK
112252010-02-04 Doug Kwan <dougkwan@google.com>
11226
11227 PR 11247
11228 * arm-reloc-property.cc (cstdio): Include.
11229 * configure.ac (targetobjs): Remove duplicates.
11230 * configure: Regenerate.
11231 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11232 big and little endian version for a given address size.
11233
5c57f1be
DK
112342010-02-03 Doug Kwan <dougkwan@google.com>
11235
11236 * arm-reloc-property.cc
11237 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11238 definition.
11239 * arm-reloc-property.h
11240 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11241 New method definition.
11242 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11243 declaration.
11244 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11245 overflow to N.
11246 (GOT_PREL): Change implemented to Y.
11247 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11248 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11249 (Arm_relocate_functions::movw_abs_nc): Remove method.
11250 (Arm_relocate_functions::movt_abs): Ditto.
11251 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11252 (Arm_relocate_functions::thm_movt_abs): Ditto.
11253 (Arm_relocate_functions::movw_rel_nc): Ditto.
11254 (Arm_relocate_functions::movw_rel): Ditto.
11255 (Arm_relocate_functions::movt_rel): Ditto.
11256 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11257 (Arm_relocate_functions:thm_movw_rel): Ditto.
11258 (Arm_relocate_functions:thm_movt_rel): Ditto.
11259 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11260 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11261 New method definitions.
11262 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11263 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11264 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11265 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11266 (Target_arm::Relocate::relocate): Check for non-static or
11267 unimplemented relocation code and exit early. Change calls to
11268 Target_arm::reloc_uses_thumb_bit and
11269 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11270 instead. Refactor code to handle similar relocations to increase
11271 code sharing. Remove check for unsupported relocation code in switch
11272 statement.
11273 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11274 relocation property table to find out size. Change error message to
11275 print out the name of a relocation code instead of the numeric value.
11276 (Target_arm::scan_reloc_for_stub): Use relocation property table
11277 instead of calling Target_arm::reloc_uses_thumb_bit().
11278
218c5831
DK
112792010-02-02 Doug Kwan <dougkwan@google.com>
11280
11281 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11282 types of relaxed input section.
11283
0d31c79d
DK
112842010-02-02 Doug Kwan <dougkwan@google.com>
11285
11286 * Makefile.am (HFILES): Add arm-reloc-property.h.
11287 (DEFFILES): New.
2e702c99
RM
11288 (TARGETSOURCES): Add arm-reloc-property.cc
11289 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11290 (libgold_a_SOURCES): $(DEFFILES)
11291 * Makefile.in: Regenerate.
11292 * arm-reloc-property.cc: New file.
11293 * arm-reloc-property.h: New file.
11294 * arm-reloc.def: New file.
11295 * arm.cc: Update comments.
11296 (arm-reloc-property.h): New included header.
11297 (arm_reloc_property_table): New global variable.
11298 (Target_arm::do_select_as_default_target): New method definition.
11299 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11300 arm-reloc-property to targ_extra_obj.
11301 * parameters.cc (set_parameters_target): Call
11302 Target::select_as_default_target().
11303 * target.h (Target::select_as_default_target): New method definition.
11304 (Target::do_select_as_default_target): Same.
11305
546c7457
DK
113062010-02-01 Doug Kwan <dougkwan@google.com>
11307
11308 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11309 first_output_text_section_.
11310 (Arm_exidx_fixup::first_output_text_section): New method definition.
11311 (Arm_exidx_fixup::first_output_text_section_): New data member.
11312 (Arm_exidx_fixup::process_exidx_section): Record the first text
11313 output section seen.
11314 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11315 and entsize in output section header.
11316
11b861d5
DK
113172010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11318
11319 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11320 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11321 (Arm_relocate_functions::thm_alu11): New Method.
11322 (Arm_relocate_functions::thm_pc8): New Method.
11323 (Arm_relocate_functions::thm_pc12): New Method.
11324 (Target_arm::Scan::local): Handle the relocations.
11325 (Target_arm::Scan::global): Likewise.
11326 (Target_arm::Relocate::relocate): Likewise.
11327 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11328
c9a2c125
DK
113292010-01-29 Doug Kwan <dougkwan@google.com>
11330
11331 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11332 of relocation types as ld.
11333
1521477a
DK
113342010-01-29 Doug Kwan <dougkwan@google.com>
11335
11336 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11337 to public.
11338 (Arm_relocate_functions::thumb_branch_common): Ditto.
11339 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11340 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11341 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11342 Arm_relocate_functions::jump24): Remove.
11343 (Target_arm::Relocate::relocate): Adjust code to call
11344 Arm_relocation_functions::arm_branch_common and
11345 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11346 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11347
e7eca48c
DK
113482010-01-29 Doug Kwan <dougkwan@google.com>
11349
11350 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11351 output_local_symbol_count_needs_update_.
11352 (Arm_relobj::output_local_symbol_count_needs_update,
11353 Arm_relobj::set_output_local_symbol_count_needs_update,
11354 Arm_relobj::update_output_local_symbol_count): New methods.
11355 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11356 member.
11357 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11358 of pointed function as in a R_ARM_PREL31 relocation.
11359 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11360 for output local symbol count updating.
11361 (Target_arm::do_relax): Update output local symbol counts in objects
11362 if necessary.
11363 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11364
02961d7e
ILT
113652010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11366
11367 * arm.cc: Added support for the ARM relocations:
11368 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11369 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11370 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11371 movw_prel_nc).
11372 (Arm_relocate_functions::movw_rel): New method.
11373 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11374 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11375 thm_movw_prel_nc).
11376 (Arm_relocate_functions::thm_movw_rel): New method.
11377 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11378 thm_movt_prel).
11379 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11380 relocations.
11381 (Target_arm::Scan::global): Likewise.
11382 (Target_arm::Relocate::relocate): Likewise.
11383 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11384 Likewise.
11385
b10d2873
ILT
113862010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11387
11388 * arm.cc: Added support for ARM group relocations.
11389 (Target_arm::reloc_needs_sym_origin): New method.
11390 (Arm_relocate_functions::calc_grp_kn): New method.
11391 (Arm_relocate_functions::calc_grp_residual): New method.
11392 (Arm_relocate_functions::calc_grp_gn): New method.
11393 (Arm_relocate_functions::arm_grp_alu): New Method.
11394 (Arm_relocate_functions::arm_grp_ldr): New Method.
11395 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11396 (Arm_relocate_functions::arm_grp_ldc): New Method.
11397 (Target_arm::Scan::local): Handle the ARM group relocations.
11398 (Target_arm::Scan::global): Likewise.
11399 (Target_arm::Relocate::relocate): Likewise.
11400 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11401 Likewise.
11402
2b328d4e
DK
114032010-01-26 Doug Kwan <dougkwan@google.com>
11404
11405 * arm.cc (set): Include.
11406 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11407 pointer type.
2e702c99 11408 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11409 (Arm_output_section::append_text_sections_to_list): New method.
11410 (Arm_output_section::fix_exidx_coverage): Ditto.
11411 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11412 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11413 Relobj::set_section_offset() instead of
11414 Sized_relobj::invalidate_section_offset().
2e702c99 11415 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11416 parameter for section headers. Ignore relocation sections for
11417 unallocated sections and EXIDX sections.
11418 (Target_arm::fix_exidx_coverage): New method.
11419 (Target_arm::output_section_address_less_than): New type.
11420 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11421 linked text section instead of the EXIDX section.
11422 (Arm_output_section::create_stub_group): Add an assertion to check
11423 that this is not an EXIDX output section.
11424 (Arm_output_section::append_text_sections_to_list): New method.
11425 (Arm_output_section::fix_exidx_coverage): Ditto.
11426 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11427 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11428 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11429 first pass.
11430 (Target_arm::fix_exidx_coverage): New method.
11431 * object.h (Relobj::set_output_section): New method.
11432 (Sized_relobj::invalidate_section_offset): Remove method.
11433 (Sized_relobj::do_invalidate_section_offset): Remove method.
11434 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11435
c7f3c371
DK
114362010-01-25 Doug Kwan <dougkwan@google.com>
11437
11438 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11439 Fix warning due to signed and unsigned comparison on a 32-bit host.
11440
8923b24c
DK
114412010-01-22 Doug Kwan <dougkwan@google.com>
11442
11443 * arm.cc (Target_arm::do_relax): Record an output section for section
11444 offset adjustment it contains any stub table that has changed.
11445 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11446 offsets in an output section if necessary.
11447 * output.cc (Output_section::Output_section): Initialize
11448 section_offsets_need_adjustments_.
11449 (Output_section::add_input_section_for_script): Renamed to
11450 Output_section::add_simple_input_section.
11451 (Output_section::save_states): Add a comment.
11452 (Output_section::discard_states): New method defintion.
11453 (Output_section::adjust_section_offsets): Same.
11454 * output.h (Output_section::add_input_section_for_script): Renamed to
11455 Output_section::add_simple_input_section.
11456 (Output_section::discard_states): New method declaration.
11457 (Output_section::adjust_section_offsets): Same.
11458 (Output_section::section_offsets_need_adjustment,
11459 Output_section::set_section_offsets_need_adjustment): New method
11460 definitions.
11461 (Output_section::section_offsets_need_adjustment_): New data member.
11462 * script-sections.cc
11463 (Output_section_element_input::set_section_address): Adjust code for
11464 renaming of Output_section::add_input_section_for_script.
11465 (Orphan_output_section::set_section_address): Same.
11466
9b2fd367
DK
114672010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11468
11469 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11470 Fix_v4bx enum values .
11471 * gold/options.h (General_options): New option definitions.
11472 (General_options::fix_v4bx): New method.
11473 (General_options::Fix_v4bx): New enum.
11474 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11475 (General_options::parse_fix_v4bx_interworking): New method.
11476
80d0d023
DK
114772010-01-22 Doug Kwan <dougkwan@google.com>
11478
11479 * arm.cc (Arm_exidx_fixup): New class.
11480
af2cdeae
DK
114812010-01-21 Doug Kwan <dougkwan@google.com>
11482
11483 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11484 classes.
11485 (Arm_exidx_section_offset_map): New type.
11486
993d07c1
DK
114872010-01-21 Doug Kwan <dougkwan@google.com>
11488
11489 * arm.cc (Arm_exidx_input_section): New class.
11490 (Arm_relobj::exidx_input_section_by_link,
11491 Arm_relobj::exidx_input_section_by_shndx,
11492 Arm_relobj::make_exidx_input_section): New methods.
11493 (read_arm_attributes_section): Remove.
11494 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11495 information about them.
11496 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11497 to here.
11498
5ac169d4
DK
114992010-01-20 Doug Kwan <dougkwan@google.com>
11500
11501 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11502 Input_section_specifier to Section_id.
11503 (Target_arm::new_arm_input_section: Adjust code for change of key
11504 type.
11505 (Target_arm::find_arm_input_section): Ditto.
11506 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11507 (Section_id): Remove.
11508 (Garbage_collection::Section_id_hash): Remove.
11509 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11510 (Section_id): Remove.
11511 (Icf::Section_id_hash): Remove.
11512 * object.h (Section_id, Const_section_id, Section_id_hash,
11513 Const_section_id_hash): New type definitions.
11514 * output.cc (Output_section::add_relaxed_input_section): Change to
11515 use Const_section_id instead of Input_section_specifier as key type.
11516 (Output_section::add_merge_input_section): Ditto.
11517 (Output_section::build_relaxation_map): Change to use Section_id
11518 instead of Input_section_specifier as key type.
2e702c99 11519 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11520 Ditto.
11521 (Output_section::convert_input_sections_to_relaxed_sections): Change
11522 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11523 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11524 (Output_section::find_relaxed_input_section): Ditto.
11525 * output.h (Input_section_specifier): Remove class.
11526 (Output_section::Output_section_data_by_input_section_map): Change
11527 key type to Const_section_id.
11528 (Output_section::Output_relaxed_input_section_by_input_section_map):
11529 Ditto.
11530 (Output_section::Relaxation_map): Change key type to Section_id.
11531
a2162063
ILT
115322010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11533
11534 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11535 (class Arm_v4bx_stub): New class.
11536 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11537 (Stub_factory::make_arm_v4bx_stub): New method.
11538 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11539 (Stub_table::empty): Handle v4bx stubs.
11540 (Stub_table::add_arm_v4bx_stub): New method.
11541 (Stub_table::find_arm_v4bx_stub): New method.
11542 (Arm_relocate_functions::v4bx): New method.
11543 (Target_arm::fix_v4bx): New method.
11544 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11545 (Stub_table::relocate_stubs): Likewise.
11546 (Stub_table::do_write): Likewise.
11547 (Stub_table::update_data_size_and_addralign): Likewise.
11548 (Stub_table::finalize_stubs): Likewise.
11549 (Target_arm::Scan::local): Likewise.
11550 (Target_arm::Scan::global): Likewise.
11551 (Target_arm::do_finalize_sections): Likewise.
11552 (Target_arm::Relocate::relocate): Likewise.
11553 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11554 Likewise.
11555 (Target_arm::scan_reloc_for_stub): Likewise.
11556 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11557
5696ab0b
ILT
115582010-01-19 Ian Lance Taylor <iant@google.com>
11559
11560 * output.cc (Output_section_headers::do_sized_write): Write large
11561 segment count to sh_info field.
11562 (Output_file_header::do_sized_write): For large segment count,
11563 write PN_XNUM to e_phnum field.
11564
800d0f56
ILT
115652010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11566
11567 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11568 (Arm_relocate_functions::thm_jump8): New function.
11569 (Arm_relocate_functions::thm_jump11): New function.
11570 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11571 R_ARM_THM_JUMP11.
11572 (Target_arm::Scan::global): Likewise.
11573 (Target_arm::Relocate::relocate): Likewise.
11574 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11575 Likewise.
11576
41263c05
DK
115772010-01-14 Doug Kwan <dougkwan@google.com>
11578
11579 * arm.cc (map, utility): Include headers.
11580 (Target_arm::apply_cortex_a8_workaround): New method.
11581 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11582 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11583 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11584 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11585 the --[no-]fix-cortex-a8 command line options.
11586 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11587 (Target_arm::relocate_stub): Use addend in instruction template.
11588 * options.h (DEFINE_bool): Set the user-set flag.
11589 (General_options): Add --[no-]-fix-cortex options.
11590 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11591 : Update fast look-up map after conversion.
41263c05 11592
459e9b03
ST
115932010-01-14 Sriraman Tallam <tmsriram@google.com>
11594
11595 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11596 in the first pass of do_layout.
11597
b521dfe4
DK
115982010-01-13 Doug Kwan <dougkwan@google.com>
11599
11600 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11601 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11602 apparent compiler problem of not folding static constant integral
11603 data members of elfcpp::Elf_sizes<32>.
11604
44272192
DK
116052010-01-13 Doug Kwan <dougkwan@google.com>
11606
11607 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11608 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11609 Arm_relobj::scan_section_for_cortex_a8_erratum,
11610 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11611 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11612 sections to scan for relocation stubs into a new method
11613 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11614 relocation and Cortex-A8 stub scanning.
11615 (Target_arm::do_relax): Force stubs to be after stubbed sections
11616 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11617 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11618 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11619
44b71ece
ILT
116202010-01-12 Ian Lance Taylor <iant@google.com>
11621
11622 * target-reloc.h (visibility_error): New inline function.
11623 (relocate_section): Call visibility_error.
11624 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11625 (MOSTLYCLEANFILES): Likewise.
11626 (protected_4_pic.o, protected_3.err): New targets.
11627 * testsuite/protected_4.cc: New file.
11628
a120bc7f
DK
116292010-01-12 Doug Kwan <dougkwan@google.com>
11630
11631 * arm.cc (Cortex_a8_reloc): New class.
11632 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11633 and cortex_a8_relocs_info_.
11634 (Target_arm::fix_cortex_a8): New method definition.
11635 (Target_arm::Cortex_a8_relocs_info): New type.
11636 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11637 New data member declarations.
11638 (Target_arm::scan_reloc_for_stub): Record information about
11639 relocations for THUMB branches that might be exempted from the
11640 Cortex-A8 workaround.
11641 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11642 at the beginning of a relaxation pass.
11643
20138696
DK
116442010-01-12 Doug Kwan <dougkwan@google.com>
11645
11646 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11647 (Arm_relobj::Mapping_symbol_position,
11648 Arm_reloj::Mapping_symbol_position_less,
11649 Arm_relobj::Mapping_symbols_info): New types.
11650 (Target_arm::is_mapping_symbol_name): New method definition.
11651 (Arm_relobj::do_count_local_symbols): Save information about mapping
11652 symbols.
11653
089d69dc
DK
116542010-01-11 Doug Kwan <dougkwan@google.com>
11655
11656 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11657 Arm_relocate_functions::thumb32_branch_upper,
11658 Arm_relocate_functions::thumb32_branch_lower,
11659 Arm_relocate_functions::thumb32_cond_branch_offset,
11660 Arm_relocate_functions::thumb32_cond_branch_upper,
11661 Arm_relocate_functions::thumb32_cond_branch_lower,
11662 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11663 branch offset encoding.
11664 (Arm_relocate_functions::thumb_branch_common): Use new branch
11665 offset encoding methods to avoid code duplication.
11666 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11667 (Stub_addend_reader::operator()): Use new branch encoding method
11668 to avoid code duplication.
11669
99e5bff2
DK
116702010-01-11 Doug Kwan <dougkwan@google.com>
11671
11672 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11673 (Target_arm::do_finalize_sections): Define special EXIDX section
11674 symbols only if referenced.
11675 * gc.h (Garbage_collection::add_reference): New method.
11676 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11677 code duplication.
11678
98e090bd
ILT
116792010-01-11 Ian Lance Taylor <iant@google.com>
11680
d0a91bd8
ILT
11681 * script.cc (Version_script_info::build_expression_list_lookup):
11682 Change complaing about duplicate wildcard match from error to
11683 warning.
11684
98e090bd
ILT
11685 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11686 of 2009-12-30.
11687 (Version_script_info::Version_script_info): Initialize globs_,
11688 default_version_, default_is_global_, and exact_. Don't
11689 initialize globals_ or locals_.
11690 (Version_script_info::build_lookup_tables): Build local symbols
11691 first.
11692 (Version_script_info::unquote): New function.
11693 (Version_script_info::add_exact_match): New function.
11694 (Version_script_info::build_expression_list_lookup): Remove lookup
11695 parameter. Add is_global parameter. Change all callers. Handle
11696 wildcard pattern specially. Unquote pattern. Call
11697 add_exact_match.
11698 (Version_script_info::get_name_to_match): New function.
11699 (Version_script_info::get_symbol_version): New function.
11700 (Version_script_info::get_symbol_version_helper): Remove.
11701 (Version_script_info::check_unmatched_names): Call unquote.
11702 * script.h (class Version_script_info): Change get_symbol_version
11703 to be non-inline and add is_global parameter; change all callers.
11704 Rewrite symbol_is_local. Update declarations. Define struct
11705 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11706 Remove globals_ and locals_ members. Add exact_, globs_,
11707 default_version_, is_global_.
11708 (Version_script_info::Glob): Remove pattern, add expression and
11709 is_global. Update constructor. Change all callers.
11710 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11711 default version.
11712 (Versions::symbol_section_contents): If a symbol is undefined, or
11713 defined in a dynamic object, set the version index to
11714 VER_NDX_LOCAL.
11715 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11716 symbol_is_local.
11717 (Symbol_table::add_from_pluginobj): Likewise.
11718 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11719
d56962d3
DK
117202010-01-11 Doug Kwan <dougkwan@google.com>
11721
11722 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11723 (incremental_dump_LDADD): Add linking option for libintl.
11724 * Makefile.in: Regenerate.
11725
94e6ee91
L
117262010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11727
11728 PR gold/11144
11729 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11730 instead of -Ds.
11731 * testsuite/Makefile.in: Regenerated.
11732
e96c574b
DK
117332010-01-10 Doug Kwan <dougkwan@google.com>
11734
11735 * options.h (DEFINE_var): Use parentheses around argument varname__
11736 in macro body to avoid any unintended subsequent substitutions.
11737
7198066b
ILT
117382010-01-10 Ian Lance Taylor <iant@google.com>
11739
ba4d53bf
ILT
11740 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11741 candidates before doing symbol resolution.
11742
7198066b
ILT
11743 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11744 ODR candidates if only one is weak.
11745
a2beed37
ILT
117462010-01-08 Ian Lance Taylor <iant@google.com>
11747
11748 * script.cc (Version_script_info::build_expression_list_lookup):
11749 Don't warn about ambiguous version, just record the ambiguity.
11750 (Version_script_info::get_symbol_version_helper): Give error if
11751 version is ambiguous.
11752
2fb7225c
DK
117532010-01-08 Doug Kwan <dougkwan@google.com>
11754
11755 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11756 prev_data_size_ and prev_addralign_. Remove initializer for
11757 deleted data member has_been_changed_.
11758 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11759 to determine if the table is empty.
11760 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11761 Remove.
11762 (Stub_table::add_reloc_stub): Define method in class definition
11763 instead of just declaring it there.
11764 (Stub_table::add_cortex_a8_stub): New method definition.
11765 (Stub_table::update_data_size_and_addralign): Ditto.
11766 (Stub_table::finalize_stubs): Ditto.
11767 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11768 (Stub_table::do_addralign_): Return address alignment in the
11769 (Stub_table::do_reset_address_and_file_offset): Define method in
11770 class definition instead of declaring it there. Set current data
11771 size to be the data size of the previous pass.
11772 (Stub_table::set_final_data_size): Use current data size as the
11773 final data size.
11774 (Stub_table::relocate_stub): Change parameter type of stub from
11775 Reloc_stub pointer to Stub pointer.
11776 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11777 (Stub_table::Cortex_a8_stub_list): New typedef.
11778 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11779 Stub_table::prev_addralign_): New data member.
11780 (Arm_relobj::Arm_relobj): Initialize data member
11781 section_has_cortex_a8_workaround_.
11782 (Arm_relobj::section_has_cortex_a8_workaround,
11783 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11784 definitions.
11785 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11786 declarations.
11787 (Target_arm::relocate_stub): Change parameter type of stub from
11788 Reloc_stub pointer to Stub pointer.
11789 (Insn_template::size, Insn_template::alignment): Handle
11790 THUMB16_SPECIAL_TYPE.
11791 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11792 Stub_table::update_data_size_and_addralign,
11793 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11794 definitions.
11795 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11796 (Stub_table::do_write): Ditto.
11797 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11798
880cd20d
ILT
117992010-01-08 Ian Lance Taylor <iant@google.com>
11800
11801 PR 11108
11802 * symtab.h (class Symbol): Remove fields is_target_special_ and
11803 has_plt_offset_. Add field is_defined_in_discarded_section_.
11804 (Symbol::is_defined_in_discarded_section): New function.
11805 (Symbol::set_is_defined_in_discarded_section): New function.
11806 (Symbol::has_plt_offset): Rewrite.
11807 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11808 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11809 Don't initialize is_target_special_ or has_plt_offset_.
11810 Initialize is_defined_in_discarded_section_.
11811 (Symbol_table::add_from_relobj): If appropriate, set
11812 is_defined_in_discarded_section.
11813 * resolve.cc (Symbol::override_base_with_special): Don't test
11814 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11815 * target-reloc.h (relocate_section): Do special handling for
11816 symbols defined in discarded sections for global symbols as well
11817 as local symbols.
11818
2703e3eb
ILT
118192010-01-08 Ian Lance Taylor <iant@google.com>
11820
11821 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11822 the SHT_SYMTAB case.
11823
339d40a3
ILT
118242010-01-08 Ian Lance Taylor <iant@google.com>
11825
11826 * object.cc (Sized_relobj::do_layout): Don't get confused if
11827 layout_eh_frame returns NULL.
11828
abecea76
ILT
118292010-01-08 Ian Lance Taylor <iant@google.com>
11830
11831 PR 11084
11832 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11833 dynamic symbol table, use the normal symbol table.
11834 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11835 symbol table.
11836
6b7dd3f3
ILT
118372010-01-08 Ian Lance Taylor <iant@google.com>
11838
11839 PR 11072
11840 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11841 sections.
11842
36c50e63
L
118432010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11844
11845 * version.cc (print_version): Change to "Copyright 2010".
11846
e291e7b9
ILT
118472010-01-08 Ian Lance Taylor <iant@google.com>
11848
11849 PR 10287
11850 PR 11063
11851 * i386.cc (class Target_i386): Change return type of plt_section
11852 to be non-const.
11853 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11854 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11855 tls_desc_rel_ field.
11856 (Output_data_plt_i386::rel_tls_desc): New function.
11857 (Target_i386::rel_tls_desc_section): New function.
11858 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11859 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11860 R_386_TLS_DESC reloc in rel_tls_desc_section.
11861 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11862 Define struct Tlsdesc_info.
11863 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11864 (Target_x86_64::do_reloc_symbol_index): New function.
11865 (Target_x86_64::add_tlsdesc_info): New function.
11866 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11867 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11868 tlsdesc_rel_ field.
11869 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11870 all callers.
11871 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11872 (Target_x86_64::rela_tlsdesc_section): New function.
11873 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11874 handling.
11875 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11876 (Target_x86_64::do_reloc_addend): New function.
11877 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11878 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11879 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11880 (Output_reloc::type): New function.
11881 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11882 (Output_reloc::is_target_specific): New function.
11883 (Output_reloc::target_arg): New function.
11884 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11885 absolute relocs and target specific relocs.
11886 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11887 add_target_specific.
11888 (class Output_data_reloc) [SHT_RELA]: Likewise.
11889 * output.cc (Output_reloc::Output_reloc): Add four new versions
11890 for absolute relocs and target specific relocs.
11891 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11892 (Output_reloc::get_symbol_index): Likewise.
11893 (Output_reloc::local_section_offset): Check that local_sym_index_
11894 is not TARGET_CODE or 0.
11895 (Output_reloc::symbol_value): Likewise.
11896 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11897 reloc.
11898 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11899 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11900 functions.
11901 * layout.cc (add_target_dynamic_tags): Use output section for
11902 DT_PLTRELSZ and DT_JMPREL.
11903
3a44184e
ILT
119042010-01-07 Ian Lance Taylor <iant@google.com>
11905
11906 PR 11061
11907 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11908 function.
11909 (class Output_data_reloc_generic): Define.
11910 (class Output_data_reloc_base): Change base class to
11911 Output_data_reloc_generic. Change add() method to call
11912 bump_relative_reloc_count for a relative reloc. Remove
11913 sort_relocs_ field.
11914 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11915 to sort_relocs().
11916 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11917 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11918 appropriate.
11919 * layout.h (class Layout): Update declaration.
11920
ea715a34
ILT
119212010-01-07 Ian Lance Taylor <iant@google.com>
11922
11923 * output.h (class Output_data): Add const version of
11924 output_section and do_output_section.
11925 (class Output_section_data): Add const version of
11926 do_output_section.
11927 (class Output_section): Likewise.
11928 * layout.cc (Layout::add_target_dynamic_tags): New function.
11929 * layout.h (class Layout): Update declarations.
11930 * arm.cc (Target_arm::do_finalize_sections): Use
11931 add_target_dynamic_tags.
11932 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11933 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11934 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11935 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11936
659948a4
ILT
119372010-01-07 Ian Lance Taylor <iant@google.com>
11938
11939 PR 11042
11940 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11941 object as needed.
11942
9d3b86f6
ILT
119432010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11944 Ian Lance Taylor <iant@google.com>
11945
11946 PR 11019
11947 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11948 Xindex::read_symtab_xindex.
11949
bb0d3eb0
DK
119502010-01-07 Doug Kwan <dougkwan@google.com>
11951
11952 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11953 (Insn_template::thumb16_bcond_insn): New method declaration.
11954 (Insn_template): Fix spelling.
11955 (Stub::thumb16_special): New method declaration.
11956 (Stub::do_write): Define virtual method which was previously pure
11957 virtual.
11958 (Stub::do_thumb16_special): New method declaration.
11959 (Stub::do_fixed_endian_write): New template member.
11960 (Reloc_stub::do_write): Remove.
11961 (Reloc_stub::do_fixed_endian_write): Remove.
11962 (Cortex_a8_stub): New class definition.
11963 (Stub_factory::make_cortex_a8_stub): New method definition.
11964 (Stub_factory::Stub_factory): Add missing static storage class
11965 qualifier for elf32_arm_stub_a8_veneer_blx.
11966
ffeef7df
ILT
119672010-01-07 Ian Lance Taylor <iant@google.com>
11968
dc3f80fe
ILT
11969 PR 10980
11970 * options.h (class General_options): Add --warn-unresolved-symbols
11971 and --error-unresolved-symbols.
11972 * errors.cc (Errors::undefined_symbol): Implement
11973 --warn-unresolved-symbols.
11974
ffeef7df
ILT
11975 * options.h (class General_options): Add -z text and -z textoff.
11976 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11977
f1ec9ded
ST
119782010-01-06 Sriraman Tallam <tmsriram@google.com>
11979
11980 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11981 (Garbage_collection::cident_sections): New function.
11982 (Garbage_collection::add_cident_section): New function.
11983 (Garbage_collection::cident_sections_): New member.
11984 (gc_process_relocs): Add references to sections whose names are C
11985 identifiers.
11986 * gold.h (cident_section_start_prefix): New constant.
11987 (cident_section_stop_prefix): New constant.
11988 (is_cident): New function.
11989 * layout.cc (Layout::define_section_symbols): Replace string constants
11990 with the newly defined constants.
11991 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11992 C identifiers.
11993 * testsuite/Makefile.am: Add gc_orphan_section_test.
11994 * testsuite/Makefile.in: Regenerate.
11995 * testsuite/gc_orphan_section_test.cc: New file.
11996 * testsuite/gc_orphan_section_test.sh: New file.
11997
6eda8c29
ILT
119982010-01-06 Ian Lance Taylor <iant@google.com>
11999
b9674e17
ILT
12000 PR 10980
12001 * options.h (class General_options): Add --warn-shared-textrel.
12002 * layout.cc (Layout::finish_dynamic_section): Implement
12003 --warn-shared-textrel.
12004
6eda8c29
ILT
12005 PR 10980
12006 * options.h (class General_options): Add --warn-multiple-gp.
12007
32dcd44e
ILT
120082010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12009
12010 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12011 $(THREADSLIB) and $(LIBDL).
12012 * Makefile.in: Rebuild.
12013
a192ba05
ILT
120142010-01-06 Ian Lance Taylor <iant@google.com>
12015
12016 PR 10980
12017 * options.cc (General_options::parse_section_start): New function.
12018 (General_options::section_start): New function.
12019 (General_options::General_options): Initialize all members.
12020 * options.h: Include <map>
12021 (class General_options): Add --section-start. Add section_starts_
12022 member.
12023 * layout.cc (Layout::attach_allocated_section_to_segment): If
12024 --section-start was used, set the address of the segment. Remove
12025 local sort_sections.
12026 (Layout::relaxation_loop_body): If the address of the load segment
12027 has been set by --section-start, don't use it.
12028 * output.h (Output_segment::update_flags_for_output_section): New
12029 function.
12030 * output.cc (Output_segment::add_output_section): Call
12031 update_flags_for_output_section.
12032
dde3f402
ILT
120332010-01-05 Ian Lance Taylor <iant@google.com>
12034
62dfdd4d
ILT
12035 PR 10980
12036 * options.h (class General_options): Add --undefined-version.
12037 * script.cc (struct Version_expression): Add was_matched_by_symbol
12038 field.
12039 (Version_script_info::matched_symbol): New function.
12040 (Version_script_info::get_symbol_version_helper): Call
12041 matched_symbol.
12042 (Version_script_info::check_unmatched_names): New function.
12043 * script.h (class Version_script_info): Update declarations.
12044 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12045
9c4ae156
ILT
12046 * options.h (class General_options): Use DEFINE_bool_alias for
12047 allow_multiple_definition.
12048 * resolve.cc (Symbol_table::should_override): Don't test
12049 allow_multiple_definition.
12050
dde3f402
ILT
12051 PR 10980
12052 * options.h (class General_options): Add --cref.
12053 * main.cc (main): Print cref table if --cref. Don't close mapfile
12054 until after printing cref table.
12055 * cref.cc: Include "symtab.h".
12056 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12057 (Cref_table_compare::operator()): New function.
12058 (Cref_inputs::gather_cref): New function.
12059 (filecol): New static const.
12060 (Cref_inputs::print_cref): New function.
12061 (Cref::print_cref): New function.
12062 * cref.h: Include <cstdio>.
12063 (class Cref): Update declarations.
12064 * mapfile.h (Mapfile::file): New function.
12065 * object.h (class Object): Define Symbols. Declare virtual
12066 do_get_global_symbols.
12067 (Object::get_global_symbols): New function.
12068 * object.cc (Input_objects::add_object): Pass object to cref_ if
12069 --cref.
12070 (Input_objects::archive_start): Likewise.
12071 (Input_objects::archive_stop): Likewise.
12072 (Input_objects::print_cref): New function.
12073 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12074 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12075 --cref.
12076 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12077 function.
12078 * plugin.h (class Sized_pluginobj): Update declarations.
12079
8781f709
ILT
120802010-01-05 Ian Lance Taylor <iant@google.com>
12081
12082 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12083 to is_default_version. Rename insdef to insdefault.
12084 (Symbol_table::add_from_relobj): Rename def to is_default_version
12085 and local to is_forced_local.
12086 (Symbol_table::add_from_pluginobj): Likewise.
12087 (Symbol_table::add_from_dynobj): Likewise.
12088 (Symbol_table::define_special_symbol): Rename insdef to
12089 insdefault.
12090
fe35d28d
ILT
120912010-01-04 Ian Lance Taylor <iant@google.com>
12092
30bc8c46
ILT
12093 PR 10980
12094 * options.h (class General_options): Add
12095 --allow-multiple-definition and -z muldefs.
12096 * resolve.cc (Symbol_table::should_override): Don't warn about a
12097 multiple symbol definition if --allow-multiple-definition or -z
12098 muldefs.
12099
7eaea549
ILT
12100 PR 10980
12101 * options.h (class General_options): Add --add-needed and
12102 --copy-dt-needed-entries. Tweak --as-needed help entry.
12103 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12104 error if --copy-dt-needed-entries aka --add-needed is used and
12105 would cause a change in behaviour.
12106
fe35d28d
ILT
12107 PR 10980
12108 * options.h (class General_options): Add -G as a short version of
12109 --shared. Add no-op options -assert, -g, and -i.
12110
55a2bb35
ST
121112010-01-04 Sriraman Tallam <tmsriram@google.com>
12112
12113 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12114 check for .text or .gnu.linkonce.t sections.
12115 * icf.cc (Icf::find_identical_sections): Ditto.
12116 Change the detection for mangled function name within the section
12117 name.
12118 * icf.h (is_section_foldable_candidate): New function.
12119
719328e1
ILT
121202009-12-30 Ian Lance Taylor <iant@google.com>
12121
12122 PR 10980
12123 * options.h (class General_options): Permit two dashes with
12124 --retain-symbols-file.
12125
d7bb5745
ILT
121262009-12-30 Ian Lance Taylor <iant@google.com>
12127
403a15dd
ILT
12128 PR 10979
12129 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12130 don't put the file header and segment headers in the text
12131 segment.
12132
eda294df
ILT
12133 PR 10979
12134 * common.cc (Sort_commons::operator()): Stabilize sort when both
12135 entries are NULL.
12136 (Symbol_table::do_allocate_commons_list): When allocating common
12137 symbols, skip a symbol which is no longer common.
12138 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12139 an object before checking its type.
12140 * testsuite/common_test_2.c: New file.
12141 * testsuite/common_test_3.c: New file.
12142 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12143 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12144 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12145 (common_test_2_pic.o, common_test_2.so): New targets.
12146 (common_test_3_pic.o, common_test_3.so): New targets.
12147 * testsuite/Makefile.in: Rebuild.
12148
d7bb5745
ILT
12149 PR 10979
12150 * script.cc (read_input_script): If we see a new SECTIONS clause,
12151 and we have added an input section, give an error.
12152 * layout.h (class Layout): Add have_added_input_section function.
12153 Add have_added_input_section_ field.
12154 * layout.cc (Layout::Layout): Initialize
12155 have_added_input_section_.
12156 (Layout::layout): Set have_added_input_section_.
12157 (Layout::layout_eh_frame): Likewise.
12158
fc59c572
ILT
121592009-12-30 Ian Lance Taylor <iant@google.com>
12160
12161 PR 10931
12162 * options.h (class General_options): Add --sort-common option.
12163 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12164 * common.cc (Sort_common): Add sort_order parameter to
12165 constructor. Add sort_order_ field.
12166 (Sort_commons::operator): Check sort_order_.
12167 (Symbol_table::allocate_commons): Determine the sort order.
12168 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12169 Change all callers.
12170 (Symbol_table::do_allocate_commons_list): Likewise.
12171
1c74fab0
ILT
121722009-12-30 Ian Lance Taylor <iant@google.com>
12173
12174 PR 10916
12175 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12176 symbols from this object, don't change the visibility of an
12177 undefined symbol.
12178 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12179
6affe781
ILT
121802009-12-30 Ian Lance Taylor <iant@google.com>
12181
12182 PR 10861
12183 * script.h (class Version_script_info): Define Language enum.
12184 Update declarations. Define Glob, Exact, and Lookup types. Add
12185 new fields globals_, locals_, and is_finalized_.
12186 * script.cc: Various formatting fixes.
12187 (class Parser_closure): Change language_stack_ from a vector of
12188 std::string to one of Version_script_info::Language. Adjust all
12189 uses accordingly.
12190 (class Lazy_demangler): Remove.
12191 (struct Version_expression): Change language from std::string to
12192 Version_script_info::Language.
12193 (Version_script_info::Version_script_info): New function.
12194 (Version_script_info::~Version_script_info): Don't call clear.
12195 (Version_script_info::finalize): New function.
12196 (Version_script_info::build_lookup_tables): New function.
12197 (Version_script_info::build_expression_list_lookup): New
12198 function.
12199 (Version_script_info::get_symbol_version_helper): Rewrite to use
12200 lookup tables.
12201 (Version_script_info::print_expression_list): Adjust to use
12202 Version_script_info::Language.
12203 (script_push_lex_into_version_mode): Check that the version script
12204 has not been finalized.
12205 (version_script_push_lang): Change language string to
12206 Version_script_info::Language.
12207 * options.cc (Command_line::version_script): New function.
12208 * options.h (class General_options): Add finalize_dynamic_list
12209 function. Change version_script from declaration to definition.
12210 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12211 * testsuite/version_script.map: Remove duplicate def of foo.
12212 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12213 version_script.map.
12214 * testsuite/Makefile.in: Rebuild.
12215
818bf354
ILT
122162009-12-30 Ian Lance Taylor <iant@google.com>
12217
12218 PR 10843
12219 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12220 if the input symbol index is 0, make the output symbol index 0.
12221
ebcc8304
ILT
122222009-12-30 Ian Lance Taylor <iant@google.com>
12223
12224 PR 10670
12225 * options.h (class General_options): Add -x/--discard-all.
12226 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12227 --discard-all. If the local symbol needs a dynamic entry, check
12228 that before handling --discard-locals.
12229
176fe33f
ILT
122302009-12-30 Ian Lance Taylor <iant@google.com>
12231
bb321bb1
ILT
12232 PR 10450
12233 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12234 flags to PF_R.
12235 (Output_segment::add_output_section): Don't change the flags if
12236 the type is PT_TLS.
12237
176fe33f
ILT
12238 PR 10450
12239 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12240 GNU hash table if they need a dynamic value. Otherwise, don't add
12241 them if they are defined in a dynamic object or are forced local.
12242
e8cd95c7
ILT
122432009-12-29 Ian Lance Taylor <iant@google.com>
12244
1b81fb71
ILT
12245 PR 10450
12246 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12247 .gnu.hash table for a 32-bit target.
12248
8d6d383d
ILT
12249 PR 10450
12250 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12251 regular and a dynamic object only needs a dynamic symbol table
12252 entry if it is externally visible.
12253
e785ec03
ILT
12254 PR 10450
12255 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12256 constructor. Add global_offset_table_ field.
12257 (Target_i386::got_section): Set global_offset_table_.
12258 (Target_i386::do_finalize_sections): Set global_offset_table_
12259 size.
12260 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12261 in constructor. Add global_offset_table_ field.
12262 (Target_x86_64::got_section): Set global_offset_table_.
12263 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12264 size.
12265
1a2dff53
ILT
12266 * layout.cc (Layout::Layout): Initialize increase_relro_.
12267 (Layout::get_output_section): Add is_relro, is_last_relro, and
12268 is_first_non_relro parameters. Change all callers.
12269 (Layout::choose_output_section): Likewise.
12270 (Layout::add_output_section_data): Likewise.
12271 (Layout::make_output_section): Likewise.
12272 (Layout::set_segment_offsets): Clear increase_relro when using a
12273 linker script.
12274 * layout.h (class Layout): Add increase_relro method. Add
12275 increase_relro_ field. Update declarations.
12276 * output.cc (Output_section::Output_section): Initialize
12277 is_last_relro_ and is_first_non_relro_.
12278 (Output_segment::add_output_section): Group relro sections is
12279 do_sort is true. Handle is_last_relro and is_first_non_relro.
12280 (Output_segment::maximum_alignment): Remove relro handling.
12281 (Output_segment::set_section_addresses): Add increase_relro
12282 parameter. Change all callers. Add initial alignment to align
12283 relro sections on separate page. Remove old relro handling.
12284 (Output_segment::set_section_list_addresses): Remove in_relro
12285 parameter. Change all callers.
12286 (Output_segment::set_offset): Add increase parameter. Change all
12287 callers. Remove old relro handling.
12288 * output.h (class Output_section): Add new methods: is_last_relro,
12289 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12290 Add is_last_relro_ and is_first_non_relro_ fields.
12291 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12292 Create separate .got.plt section. Call increase_relro.
12293 * x86_64.cc (Target_x86_64::got_section): Likewise.
12294 * testsuite/relro_script_test.t: Add .got.plt.
12295
f0ba79e2
ILT
12296 PR 10450
12297 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12298 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12299 (Layout::finalize): Call set_dynamic_symbol_size.
12300 (Layout::set_dynamic_symbol_size): New function.
12301 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12302 set_dynamic_symbol_size.
12303
e8cd95c7
ILT
12304 PR 10450
12305 * output.h (class Output_section): Add is_entsize_zero_ field.
12306 * output.cc (Output_section::Output_section): Initialize
12307 is_entsize_zero_.
12308 (Output_section::set_entsize): If two different entsizes are
12309 requested, force it to zero.
12310 (Output_section::add_input_section): Set flags for .debug_str
12311 before updating section flags. Set entsize.
12312 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12313 and SHF_STRING if all input sections have those flags.
12314
3e1b9a8a
RÁE
123152009-12-29 Rafael Espindola <espindola@google.com>
12316
12317 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12318 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12319 reporting.
3e1b9a8a 12320
3dcad376
ST
123212009-12-29 Sriraman Tallam <tmsriram@google.com>
12322
12323 * options.cc (General_options::parse_version): Allow -v to exit
12324 without an error if there is nothing to link.
12325
084e2665
ILT
123262009-12-29 Ian Lance Taylor <iant@google.com>
12327
12328 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12329 using a version of gcc before 4.1.
12330 * configure: Rebuild.
12331
250acde3
CD
123322009-12-28 Chris Demetriou <cgd@google.com>
12333
12334 * attributes.cc (Output_attributes_section_data::do_write): Use
12335 std::vector::front rather than std::vector::data.
12336
99fff23b
ILT
123372009-12-28 Ian Lance Taylor <iant@google.com>
12338
12339 * symtab.h (class Symbol_table): Add enum Defined.
12340 * resolve.cc (Symbol_table::should_override): Add defined
12341 parameter. Change all callers. Test whether object is NULL
12342 before calling a method on it.
12343 (Symbol_table::report_resolve_problem): Add defined parameter.
12344 Change all callers.
12345 (Symbol_table::should_override_with_special): Likewise.
12346 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12347 parameter. Change all callers.
12348 (Symbol_table::do_define_in_output_data): Likewise.
12349 (Symbol_table::define_in_output_segment): Likewise.
12350 (Symbol_table::do_define_in_output_segment): Likewise.
12351 (Symbol_table::define_as_constant): Likewise.
12352 (Symbol_table::do_define_as_constant): Likewise.
12353 * script.h (class Symbol_assignment): Add is_defsym parameter to
12354 constructor; change all callers.
12355 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12356 parameter. Change all callers. Add is_defsym_ field.
12357 (class Parser_closure): Add parsing_defsym parameter to
12358 constructor; change all callers. Add parsing_defsym accessor
12359 function. Add parsing_defsym_ field.
12360
556bd683
ILT
123612009-12-28 Ian Lance Taylor <iant@google.com>
12362
12363 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12364 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12365
1782c879
ILT
123662009-12-23 Ian Lance Taylor <iant@google.com>
12367
12368 * i386.cc (Target_i386::do_calls_non_split): Recognize
12369 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12370 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12371 -fsplit-stack prologue when using %r11.
1782c879 12372
329ca2b1
ST
123732009-12-21 Sriraman Tallam <tmsriram@google.com>
12374
12375 * options.cc (General_options::parse_version): Make -v continue and do
12376 the link like GNU ld does.
12377
d675ff46
RÁE
123782009-12-17 Rafael Avila de Espindola <espindola@google.com>
12379
12380 * Makefile.am (CCFILES): Add timer.cc.
12381 (HFILES): Add timer.h.
12382 * configure.ac: Check for sysconf and times.
12383 * main.cc: include timer.h.
12384 (main): Use Timer instead of get_run_time.
12385 * timer.cc: New.
12386 * timer.h: New.
12387 * workqueue.cc: include timer.h.
12388 (Workqueue::find_and_run_task):
12389 Report user, sys and wall time.
12390 * Makefile.in: Regenerate.
12391 * config.in: Regenerate.
12392 * configure: Regenerate.
12393
d6344fb5
DK
123942009-12-16 Doug Kwan <dougkwan@google.com>
12395
12396 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12397 sections.
12398 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12399 relaxed input sections.
12400 * output.cc (Output_section::find_relaxed_input_section): Change
12401 return type to Output_relaxed_input_section pointer. Adjust code
12402 for new type of relaxed_input_section_map_.
12403 * output.h (Output_section::find_relaxed_input_section): Change
12404 return type to Output_relaxed_input_section pointer.
12405 (Output_section::Output_relaxed_input_section_by_input_section_map):
12406 New type.
12407 (Output_section::relaxed_input_section_map_): Change type to
12408 Output_section::Output_relaxed_input_section_by_input_section_map.
12409 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12410 input section.
12411
0e0d5469
ILT
124122009-12-15 Ian Lance Taylor <iant@google.com>
12413
12414 * layout.cc (Layout::create_shstrtab): Only write out after input
12415 sections if we are compressing debug sections.
12416
0649a889
ILT
124172009-12-15 Ian Lance Taylor <iant@google.com>
12418
12419 * archive.cc (Archive::add_symbols): Only look up a symbol without
12420 a version if there is, in fact, a version.
12421
2ea97941
ILT
124222009-12-14 Ian Lance Taylor <iant@google.com>
12423
12424 Revert -Wshadow changes, all changes from:
12425 2009-12-11 Doug Kwan <dougkwan@google.com>
12426 2009-12-11 Nick Clifton <nickc@redhat.com>
12427 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12428
b0eec2cc
DK
124292009-12-11 Doug Kwan <dougkwan@google.com>
12430
12431 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12432 due to -Wshadow.
12433 * attributes.cc (Object_attribute::size): Ditto.
12434 (Attributes_section_data::size): Ditto.
12435 (Attributes_section_data::Attributes_section_data): Ditto.
12436 (Output_attributes_section_data::do_write): Ditto.
12437 * attributes.h (Object_attribute::set_type): Ditto.
12438 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12439
91d6fa6a
NC
124402009-12-11 Nick Clifton <nickc@redhat.com>
12441
12442 * archive.cc: Fix shadowed variable warnings.
12443 * arm.cc: Likewise.
12444 * compressed_output.cc: Likewise.
12445 * compressed_output.h: Likewise.
12446 * configure: Likewise.
12447 * dwarf_reader.cc: Likewise.
12448 * dynobj.cc: Likewise.
12449 * dynobj.h: Likewise.
12450 * ehframe.cc: Likewise.
12451 * ehframe.h: Likewise.
12452 * errors.cc: Likewise.
12453 * expression.cc: Likewise.
12454 * fileread.cc: Likewise.
12455 * fileread.h: Likewise.
12456 * freebsd.h: Likewise.
12457 * i386.cc: Likewise.
12458 * icf.cc: Likewise.
12459 * incremental.h: Likewise.
12460 * layout.cc: Likewise.
12461 * layout.h: Likewise.
12462 * mapfile.cc: Likewise.
12463 * merge.cc: Likewise.
12464 * merge.h: Likewise.
12465 * object.cc: Likewise.
12466 * object.h: Likewise.
12467 * options.h: Likewise.
12468 * output.cc: Likewise.
12469 * output.h: Likewise.
12470 * parameters.cc: Likewise.
12471 * plugin.cc: Likewise.
12472 * powerpc.cc: Likewise.
12473 * reduced_debug_output.cc: Likewise.
12474 * reduced_debug_output.h: Likewise.
12475 * reloc.cc: Likewise.
12476 * reloc.h: Likewise.
12477 * resolve.cc: Likewise.
12478 * script-sections.cc: Likewise.
12479 * script.cc: Likewise.
12480 * script.h: Likewise.
12481 * sparc.cc: Likewise.
12482 * symtab.cc: Likewise.
12483 * symtab.h: Likewise.
12484 * target-select.cc: Likewise.
12485 * target-select.h: Likewise.
12486 * token.h: Likewise.
12487 * workqueue.cc: Likewise.
12488 * workqueue.h: Likewise.
12489 * x86_64.cc: Likewise.
12490
a0351a69
DK
124912009-12-10 Doug Kwan <dougkwan@google.com>
12492
12493 * arm.cc (attributes.h): New include.
12494 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12495 (Arm_relobj::~Arm_relobj): Delete object pointed by
12496 attributes_section_data_.
12497 (Arm_relobj::attributes_section_data): New method definition.
12498 (Arm_relobj::attributes_section_data_): New data member declaration.
12499 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12500 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12501 attributes_section_data_.
12502 (Arm_dynobj::attributes_section_data): New method definition.
12503 (Arm_dynobj::attributes_section_data_): New data member declaration.
12504 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12505 initialization value of may_use_blx_ to false.
2e702c99 12506 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12507 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12508 object attributes to compute results instead of hard-coding.
12509 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12510 Target_arm::get_secondary_compatible_arch,
12511 Target_arm::set_secondary_compatible_arch
12512 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12513 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12514 New method declarations.
12515 (Target_arm::get_aeabi_object_attribute): New method definition.
12516 (Target_arm::attributes_section_data_): New data member declaration.
12517 (read_arm_attributes_section): New template definition.
12518 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12519 (Arm_dynobj::do_read_symbols): Ditto.
12520 (Target_arm::do_finalize_sections): Merge attributes sections from
12521 input. Check for BLX use after attributes section merging.
12522 Fix __exidx_start and __exidx_end visibility. Create an
12523 .ARM.attributes section if necessary.
12524 (Target_arm::get_secondary_compatible_arch,
12525 Target_arm::set_secondary_compatible_arch,
12526 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12527 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12528 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12529 New method definitions.
12530
b59befec
ILT
125312009-12-09 Ian Lance Taylor <iant@google.com>
12532
12533 * plugin.cc (Plugin::load): Don't cast from void* to a function
12534 pointer.
12535
1276bc89
ILT
125362009-12-09 Ian Lance Taylor <iant@google.com>
12537
12538 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12539 information fields.
12540
2f2de248
L
125412009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12542
12543 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12544 Replace two_file_shared_1.so with two_file_shared_2.so.
12545 * testsuite/Makefile.in: Regenerated.
12546
4f787271
DK
125472009-12-08 Doug Kwan <dougkwan@google.com>
12548
12549 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12550 (HFILES): Add attributes.h and int_encoding.h.
12551 * Makefile.in: Regenerate.
12552 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12553 function definitions to int_encoding.cc
12554 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12555 prototypes to int_encoding.h
12556 * reduced_debug_output.cc (int_encoding.h): New include.
12557 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12558 function definitions to int_encoding.cc
12559 (insert_into_vector, read_from_pointer): Move template definitions to
12560 int_encoding.h
12561 * attributes.cc: New file.
12562 * attributes.h: New file.
12563 * int_encoding.cc: New file.
12564 * int_encoding.h: New file.
12565
20b52f1a
RÁE
125662009-12-07 Rafael Avila de Espindola <espindola@google.com>
12567
12568 PR gold/11055
12569 * incremental-dump.cc (dump_incremental_inputs): New.
12570 (main): Use dump_incremental_inputs.
12571
53d7974c
L
125722009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12573
12574 PR gold/10893
12575 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12576 checking elfcpp::STT_FUNC.
12577 (Target_i386::Relocate::relocate): Likewise.
12578 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12579
12580 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12581 symbols from shared libraries into normal FUNC symbols.
12582
12583 * symtab.h (Symbol): Add is_func and use it.
12584
05a352e6
DK
125852009-12-05 Doug Kwan <dougkwan@google.com>
12586
12587 * arm.cc (Target_arm::arm_info): Initialize new fields
12588 attributes_section and attributes_vendor.
12589 * i386.cc (Target_i386::i386_info): Same.
12590 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12591 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12592 fields attributes_section and attributes_vendor.
53d7974c 12593 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12594 * target.h (Target::attributes_section, Target::attributes_vendor,
12595 Target::is_attributes_section, Target::attribute_arg_type,
12596 Target::attributes_order): New method definitions.
12597 (Target::Target_info::attributes_section,
12598 Target::Target_info::attributes_vendor): New fields.
12599 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12600 virtual method definitions.
12601 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12602 attributes_section and attributes_vendor.
12603 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12604
f4e5969c
DK
126052009-12-05 Doug Kwan <dougkwan@google.com>
12606
12607 * arm.cc: Update comments about interworking and stub generation.
12608 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12609 considered as non-PIC.
12610 (Arm_relocate_functions::base_abs): Fix formatting.
12611 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12612 of function to use GOT entry address instead of offset.
12613 (Target_arm::Scan::global): Issue an error if a symbol would need a
12614 PLT does not get one because it is untyped. Remove code to create
12615 dynamic symbols for relative branches.
12616 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12617 takes unsigned integer instead of boolean.
12618
1abce4a6
L
126192009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12620
12621 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12622 (two_file_test_LDADD): Likewise.
12623 (common_test_1_LDADD): Likewise.
12624 (exception_test_LDADD) Likewise.
12625 (weak_test_LDADD): Likewise.
12626 (many_sections_test_LDADD): Likewise.
12627 (initpri1_LDADD): Likewise.
12628 (script_test_1_LDADD): Likewise.
12629 (script_test_2_LDADD): Likewise.
12630 (justsyms_LDADD): Likewise.
12631 (binary_test_LDADD): Likewise.
12632 (large_LDADD): Likewise.
12633 * testsuite/Makefile.in: Regenerated.
12634
adcf2816 126352009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12636
adcf2816
L
12637 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12638 (Symbol_table::override_with_special): Likewise.
12639 (Symbol_table::add_from_object): Likewise.
12640
28e67f5d
RÁE
126412009-12-04 Rafael Avila de Espindola <espindola@google.com>
12642
12643 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12644 Don't set the data_offset twice.
12645
ae10a101
RÁE
126462009-12-04 Rafael Avila de Espindola <espindola@google.com>
12647
12648 * testsuite/Makefile.in: Regenerate.
12649
f59f41f3
DK
126502009-12-03 Doug Kwan <dougkwan@google.com>
12651
12652 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12653 (Target_arm::do_finalize_sections): Add parameter for symbol table
12654 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12655 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12656 parameter for symbol table pointer.
12657 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12658 an additional parameter for a pointer to symbol table.
12659 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12660 parameter for a symbol table pointer.
12661 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12662 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12663 Ditto.
12664 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12665 parameter for a symbol table pointer.
12666
ca55d848
RÁE
126672009-12-03 Rafael Avila de Espindola <espindola@google.com>
12668
12669 * incremental.cc (Incremental_inputs_header)
12670 (Incremental_inputs_header_write, Incremental_inputs_entry)
12671 (Incremental_inputs_entry_write): Move ...
12672 * incremental.h (Incremental_inputs_header)
12673 (Incremental_inputs_header_write, Incremental_inputs_entry)
12674 (Incremental_inputs_entry_write): here.
12675
3aec4f9c
RÁE
126762009-12-02 Rafael Avila de Espindola <espindola@google.com>
12677
12678 * incremental.cc (make_sized_incremental_binary): Set the target.
12679 Error if it is incompatible.
12680 * output.h (Output_file): Add filename method.
12681
9c0ae74d
RÁE
126822009-12-02 Rafael Avila de Espindola <espindola@google.com>
12683
12684 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12685 from the get_* methods.
12686
a45500ae
RÁE
126872009-12-02 Rafael Avila de Espindola <espindola@google.com>
12688
12689 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12690 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12691 Write 0 for the data_offset of scripts.
12692
325e6408
RÁE
126932009-12-02 Rafael Avila de Espindola <espindola@google.com>
12694
12695 * testsuite/Makefile.am: Add the incremental_test.sh test.
12696 * testsuite/incremental_test.sh: New.
12697 * testsuite/incremental_test_1.c: New.
12698 * testsuite/incremental_test_2.c: New.
12699
954c3e2e
RÁE
127002009-12-01 Rafael Avila de Espindola <espindola@google.com>
12701
703d02da 12702 * incremental-dump.cc (main): Fix typos.
954c3e2e 12703
f8086623
RÁE
127042009-11-27 Rafael Avila de Espindola <espindola@google.com>
12705
12706 PR gold/11025
12707 * incremental-dump.cc (main): Use llu to print 64 bit values.
12708
3b0dd6ac
L
127092009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12710 H.J. Lu <hongjiu.lu@intel.com>
12711
12712 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12713 $(LIBDL).
12714 (incremental_dump_LDADD): Likewise.
12715 * Makefile.in: Regenerated.
12716
a6d1ef57 127172009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12718
a6d1ef57
DK
12719 Revert:
12720
12721 2009-11-25 Doug Kwan <dougkwan@google.com>
12722
12723 * arm.cc (Target_arm::Target_arm): Move method definition
12724 outside of class definition. Add code to handle
12725 --target1-rel, --target1-abs and --target2= options.
12726 (Target_arm::get_reloc_reloc_type): Change method to be
12727 non-static and const.
12728 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12729 New data member declaration.
12730 (Target_arm::Scan::local, Target_arm::Scan::global,
12731 Target_arm::Relocate::relocate,
12732 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12733 Adjust call to Target_arm::get_real_reloc_type.
12734 (Target_arm::get_real_reloc_type): Use command line options
12735 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12736 * options.h (--target1-rel, --target1-abs, --target2): New
12737 ARM-only options.
12738
50aeb7d4
DK
127392009-11-25 Doug Kwan <dougkwan@google.com>
12740
12741 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12742 class definition. Add code to handle --target1-rel, --target1-abs
12743 and --target2= options.
12744 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12745 and const.
12746 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12747 member declaration.
12748 (Target_arm::Scan::local, Target_arm::Scan::global,
12749 Target_arm::Relocate::relocate,
12750 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12751 call to Target_arm::get_real_reloc_type.
12752 (Target_arm::get_real_reloc_type): Use command line options to
12753 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12754 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12755 options.
12756
51938283
DK
127572009-11-25 Doug Kwan <dougkwan@google.com>
12758
12759 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12760 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12761 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12762 formatting.
12763 (Arm_relocate_functions::thm_call): Replace body with a call to
12764 Arm_relocate_functions::thumb_branch_common.
12765 (Arm_relocate_functions::thm_jump24,
12766 Arm_relocate_functions::thm_xpc22): New method definitions.
12767 (Arm_relocate_functions::thumb_branch_common): New method definition.
12768 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12769 operator.
12770 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12771 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12772
e2b8f3c4
RÁE
127732009-11-24 Rafael Avila de Espindola <espindola@google.com>
12774
12775 * Makefile.am: Build incremental-dump
12776 * Makefile.in: Regenerate.
12777 * incremental-dump.cc: New.
12778 * incremental.cc (Incremental_inputs_header_data,
12779 Incremental_inputs_entry_data): Move to incremental.h
12780 * incremental.h: (Incremental_inputs_header_data,
12781 Incremental_inputs_entry_data): Move from incremental.cc
12782
bcba9aec
RÁE
127832009-11-24 Rafael Avila de Espindola <espindola@google.com>
12784
12785 * incremental.cc (Incremental_inputs_header,
12786 Incremental_inputs_header_write, Incremental_inputs_entry,
12787 Incremental_inputs_entry_write): Add a typedef with the data type.
12788
7c3afe08
RÁE
127892009-11-24 Rafael Avila de Espindola <espindola@google.com>
12790
12791 * incremental.cc (Incremental_inputs_header,
12792 Incremental_inputs_header_write, Incremental_inputs_entry,
12793 Incremental_inputs_entry_write): Update comment about which
12794 type has the filed descriptions.
12795
d204b6e9
DK
127962009-11-15 Doug Kwan <dougkwan@google.com>
12797
12798 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12799 (Arm_relocate_functions::arm_branch_common): Change method defintion
12800 in class definition to a method declaration and update list of formal
12801 parameters.
12802 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12803 Arm_relocation_functions::jump24): Adjust call to
12804 Arm_relocate_functions::arm_branch_common. Update list of formal
12805 parameters.
12806 (Arm_relocate_functions::xpc25): New method definition.
12807 (Arm_relocate_functions::arm_branch_common): Move method defintion
12808 out from class definition. Use stubs for mode-switching and extending
12809 branch ranges.
12810 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12811 specially. Change code to enable use of stubs in ARM branches.
12812
43d12afe
DK
128132009-11-10 Doug Kwan <dougkwan@google.com>
12814
12815 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12816 in method declaration.
12817 (Target_arm::relocate_stub): New method declaration.
12818 (Target_arm::default_target): Change to return a pointer instead of
12819 a const reference.
12820 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12821 Target_arm::default_target.
12822 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12823 method definition.
12824 (Target_arm::relocate_section): Adjust view.
12825 (Target_arm::relocate_stub): New method definition.
12826
ac33a407
DK
128272009-11-10 Doug Kwan <dougkwan@google.com>
12828
12829 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12830 a format warning.
12831 * incremental.cc (open_incremental_binary): Initialized local
12832 variables to avoid warnings.
12833 * object.cc (make_elf_object): Ditto.
12834 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12835 a format warning.
e1df38aa 12836
88ee28e9
L
12837009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12838
12839 PR gold/10930
12840 * testsuite/plugin_test.c: Include "config.h".
12841
2daedcd6
DK
128422009-11-09 Doug Kwan <dougkwan@google.com>
12843
12844 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12845 (arm_symbol_value): Remove.
12846 (Arm_relocate_functions::arm_branch_common,
12847 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12848 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12849 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12850 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12851 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12852 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12853 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12854 Arm_relocate_functions::thm_mobw_abs_nc,
12855 Arm_relocate_functions::thm_mov_abs,
12856 Arm_relocate_functions::movw_prel_nc,
12857 Arm_relocate_functions::thm_movt_abs,
12858 Arm_relocate_functions::movt_prel,
12859 Arm_relocate_functions::thm_movw_prel_nc,
12860 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12861 (Target_arm::Relocate::relocate): Only decompose address into two
12862 parts if relocation type uses the thumb-bit and pass the actual
12863 bit instead of a flag indicating that the thumb-bit is used. Adjust
12864 calls to methods in Arm_relocate_functions for this change.
12865
1276bc89 128662009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12867
12868 PR 10925
12869 * reloc.cc: Instantiate
12870 Sized_relobj::initialize_input_to_output_maps and
12871 Sized_relobj:free_input_to_output_maps.
12872
e53ad1b5
ILT
128732009-11-06 Ian Lance Taylor <iant@google.com>
12874
12875 PR 10876
12876 * defstd.cc (in_segment): Set only_if_ref true for "end".
12877
eb44217c
DK
128782009-11-06 Doug Kwan <dougkwan@google.com>
12879
12880 * arm.cc (class Reloc_stub): Correct a comment.
12881 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12882 (Target_arm::scan_section_for_stubs): New method declaration.
12883 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12884 Change methods from private to protected.
12885 (Target_arm::do_may_relax): New method definition.
12886 (Target_arm::do_relax, Target_arm::group_sections,
12887 Target_arm::scan_reloc_for_stub,
12888 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12889 (Target_arm::arm_input_section_map_): New data member declaration.
12890 (Target_arm::scan_reloc_for_stub,
12891 Target_arm::scan_reloc_section_for_stubs,
12892 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12893 Target_arm::do_relax): New method definitions.
12894
5d329b7d
ILT
128952009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12896
12897 * configure.ac: Check for (struct stat)::st_mtim
12898 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12899 * config.in: Regenerate.
12900 * configure: Regenerate.
12901
96a0d71b
ILT
129022009-11-05 Ian Lance Taylor <iant@google.com>
12903
12904 PR 10910
12905 * output.cc (Output_segment::add_output_section): Add missing
12906 return statement.
12907
594c8e5e
ILT
129082009-11-04 Ian Lance Taylor <iant@google.com>
12909
12910 PR 10880
12911 * object.h (class Object): Add is_needed and set_is_needed
12912 methods. Add is_needed_ field. Make bool fields into bitfields.
12913 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12914 defined in a dynamic object and referenced by a regular object,
12915 set is_needed for the dynamic object.
12916 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12917 if the file is marked with as_needed and it is not needed.
12918
22b127cc
ILT
129192009-11-04 Ian Lance Taylor <iant@google.com>
12920
12921 PR 10887
12922 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12923 tags if data is discarded by linker script.
12924 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12925 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12926 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12927 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12928
f5c870d2
ILT
129292009-11-04 Ian Lance Taylor <iant@google.com>
12930
12931 * layout.cc (Layout::get_output_section): Add is_interp and
12932 is_dynamic_linker_section parameters. Change all callers.
12933 (Layout::choose_output_section): Likewise.
12934 (Layout::make_output_section): Likewise.
12935 (Layout::add_output_section_data): Add is_dynamic_linker_section
12936 parameter. Change all callers.
12937 * layout.h (class Layout): Update declarations.
12938 * output.h (class Output_section): Add is_interp, set_is_interp,
12939 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12940 Add is_interp_, is_dynamic_linker_section_ fields. Change
12941 generate_code_fills_at_write_ to a bitfield.
12942 * output.cc (Output_section::Output_sections): Initialize new
12943 fields.
12944 (Output_segment::add_output_section): Add do_sort parameter.
12945 Change all callers.
12946
1ae4d23b
ILT
129472009-11-03 Ian Lance Taylor <iant@google.com>
12948
12949 PR 10860
12950 * options.h (class General_options): Add --warn-common.
12951 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12952 merging two common symbols.
12953 (Symbol_table::should_override): Handle --warn-common when merging
12954 a common symbol with a defined symbol. Use report_resolve_problem
12955 for multiple definitions.
12956 (Symbol_table::report_resolve_problem): New function.
12957 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12958
55da9579
DK
129592009-11-03 Doug Kwan <dougkwan@google.com>
12960
12961 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12962 stub_factory_.
12963 (Target_arm::stub_factory): New method definition.
12964 (Target_arm::new_arm_input_section,
12965 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12966 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12967 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12968 New type definitions.
12969 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12970 member declarations.
12971 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12972 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12973 New method definitions.
12974
37a9ac43
ILT
129752009-11-03 Ian Lance Taylor <iant@google.com>
12976
12977 * options.h (class General_options): Add --warn_constructors.
12978
b3d6a3d4
ILT
129792009-11-03 Ian Lance Taylor <iant@google.com>
12980
12981 PR 10893
12982 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12983 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12984
934b01dd
ILT
129852009-11-03 Ian Lance Taylor <iant@google.com>
12986
12987 PR 10895
12988 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12989 --msgid-bugs-address.
12990 (install-pdf): New target.
12991 (install-data_yes): Look up one directory to find mkinstalldirs.
12992
03c1939b
L
129932009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12994
12995 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12996 tree.
12997
ebd95253
DK
129982009-10-30 Doug Kwan <dougkwan@google.com>
12999
13000 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13001
e9bbb538
DK
130022009-10-30 Doug Kwan <dougkwan@google.com>
13003
13004 * arm.cc (Stub_addend_reader): New struct template definition
13005 and partial specializations.
13006 (Stub_addend_reader::operator()): New method definition for a
13007 partially specialized template.
13008
d5b40221
DK
130092009-10-30 Doug Kwan <dougkwan@google.com>
13010
13011 * arm.cc (Arm_relobj::processor_specific_flags): New method
13012 definition.
13013 (Arm_relobj::do_read_symbols): New method declaration.
13014 (Arm_relobj::processor_specific_flags_): New data member declaration.
13015 (Arm_dynobj): New class definition.
13016 (Target_arm::do_finalize_sections): Add input_objects parameter.
13017 (Target_arm::do_adjust_elf_header): New method declaration.
13018 (Target_arm::are_eabi_versions_compatible,
13019 (Target_arm::merge_processor_specific_flags): New method declaration.
13020 (Target_arm::do_make_elf_object): New overloaded method definitions
13021 and declaration.
13022 (Arm_relobj::do_read_symbols): New method definition.
13023 (Arm_dynobj::do_read_symbols): Ditto.
13024 (Target_arm::do_finalize_sections): Add input_objects parameters.
13025 Merge processor-specific flags from all input objects.
13026 (Target_arm::are_eabi_versions_compatible,
13027 Target_arm::merge_processor_specific_flags,
13028 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13029 New method definitions.
13030 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13031 Input_objects pointer type parameter.
13032 * layout.cc (Layout::finalize): Pass input objects to target's.
13033 finalize_sections function.
13034 * output.cc (Output_file_header::do_sized_write): Set ELF file
13035 header's processor-specific flags.
13036 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13037 Input_objects pointer type parameter.
13038 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13039 * target.h (Input_objects): New forward class declaration.
13040 (Target::processor_specific_flags,
13041 Target::are_processor_specific_flags_sect): New method definitions.
13042 (Target::finalize_sections): Add input_objects parameter.
13043 (Target::Target): Initialize processor_specific_flags_ and
13044 are_processor_specific_flags_set_.
13045 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13046 parameter.
13047 (Target::set_processor_specific_flags): New method definition.
13048 (Target::processor_specific_flags_,
13049 Target::are_processor_specific_flags_set_): New data member
13050 declarations.
13051 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13052 Input_objects pointer type parameter.
13053
ebabffbd
DK
130542009-10-30 Doug Kwan <dougkwan@google.com>
13055
13056 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13057
ad0f2072
ILT
130582009-10-28 Ian Lance Taylor <iant@google.com>
13059
13060 * object.h (class Relobj): Drop options parameter from
13061 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13062 do_scan_relocs, do_relocate. Change all callers.
13063 (class Sized_relobj): Drop options parameters from
13064 do_gc_process_relocs, do_scan_relocs, do_relocate,
13065 do_relocate_sections, relocate_sections, emit_relocs_scan,
13066 emit_relocs_scan_reltype. Change all callers.
13067 (struct Relocate_info): Remove options field and all references to
13068 it.
13069 * reloc.h (class Read_relocs): Remove options constructor
13070 parameter and options_ field. Change all callers.
13071 (class Gc_process_relocs, class Scan_relocs): Likewise.
13072 (class Relocate_task): Likewise.
13073 * target-reloc.h (scan_relocs): Remove options parameter. Change
13074 all callers.
13075 (scan_relocatable_relocs): Likewise.
13076 * target.h (class Sized_target): Remove options parameter from
13077 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13078 all callers.
13079 * gc.h (gc_process_relocs): Remove options parameter. Change all
13080 callers.
13081 * arm.cc: Update functions to remove options parameters.
13082 * i386.cc: Likewise.
13083 * powerpc.cc: Likewise.
13084 * sparc.cc: Likewise.
13085 * x86_64.cc: Likewise.
13086 * testsuite/testfile.cc: Likewise.
13087
8ffa3667
DK
130882009-10-28 Doug Kwan <dougkwan@google.com>
13089
13090 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13091 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13092 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13093 New method definitions.
13094
40f36857
CC
130952009-10-28 Cary Coutant <ccoutant@google.com>
13096
13097 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13098 (Plugin::cleanup_done_): New member.
13099 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13100 (Plugin_manager::cleanup_done_): Remove.
13101 (Plugin_manager::add_input_file): Edit error message.
13102 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13103 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13104
2c849493
ILT
131052009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13106
13107 * fileread.cc: (File_read::View::~View): Use the new
13108 data_ownership_ filed.
13109 (File_read::~File_read): Dispose the new whole_file_view_.
13110 (File_read::open): Mmap the whole file if needed.
13111 (File_read::open): Use whole_file_view_ instead of contents_.
13112 (File_read::find_view): Use whole_file_view_ if applicable.
13113 (File_read::do_read): Use whole_file_view_ instead of contents_.
13114 (File_read::make_view): Use whole_file_view_ instead of contents_,
13115 update File_read::View::View call.
13116 (File_read::find_or_make_view): Update File_read::View::View
13117 call.
13118 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13119 remove contents_
13120 (File_read::View::Data_ownership): New enum.
13121 (File_read::View::View): Replace bool mapped_ with Data_ownership
13122 argument.
13123 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13124 (File_read::View::data_ownership_): New field.
13125 (File_read::contents_): Remove (replaced by whole_file_view_).
13126 (File_read::whole_file_view_): New field.
13127 * options.h (class General_options): Add --keep-files-mapped.
13128
24998053
CC
131292009-10-27 Cary Coutant <ccoutant@google.com>
13130
13131 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13132 * testsuite/Makefile.am (plugin_test_5): New test case.
13133 * testsuite/Makefile.in: Regenerate.
13134
72adc4fa
DK
131352009-10-25 Doug Kwan <dougkwan@google.com>
13136
13137 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13138 from private to protected to allow access by child class.
13139 (Sized_relobj::do_relocate_sections): New method declaration.
13140 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13141 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13142 Sized_relobj::relocate_sections. Instantiate template explicitly
13143 for different target sizes and endianity.
13144
07f508a2
DK
131452009-10-24 Doug Kwan <dougkwan@google.com>
13146
13147 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13148 (Arm_input_section::as_arm_input_section): New method.
13149 (Arm_output_section): New class definition.
13150 (Arm_output_section::create_stub_group,
13151 Arm_output_section::group_sections): New method definitions.
13152
10ad9fe5
DK
131532009-10-22 Doug Kwan <dougkwan@google.com>
13154
13155 * arm.cc (Arm_input_section): New class definition.
13156 (Arm_input_section::init, Arm_input_section:do_write,
13157 Arm_input_section::set_final_data_size,
13158 Arm_input_section::do_reset_address_and_file_offset): New method
13159 definitions.
13160
56ee5e00
DK
131612009-10-21 Doug Kwan <dougkwan@google.com>
13162
13163 * arm.cc (Stub_table, Arm_input_section): New forward class
13164 declarations.
13165 (Stub_table): New class defintion.
13166 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13167 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13168 New method definition.
13169
b569affa
DK
131702009-10-21 Doug Kwan <dougkwan@google.com>
13171
13172 * arm.cc: Update copyright comments.
13173 (Target_arm): New forward class template declaration.
13174 (Arm_address): New type.
13175 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13176 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13177 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13178 constants.
13179 (Insn_template): Same.
13180 (DEF_STUBS): New macro.
13181 (Stub_type): New enum type.
13182 (Stub_template): New class definition.
13183 (Stub): Same.
13184 (Reloc_stub): Same.
13185 (Stub_factory): Same.
13186 (Target_arm::Target_arm): Initialize may_use_blx_ and
13187 should_force_pic_veneer_.
13188 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13189 Target_arm::should_force_pic_veneer,
13190 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13191 Target_arm::using_thumb_only, Target_arm:;default_target): New
13192 method defintions.
13193 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13194 New data member declarations.
13195 (Insn_template::size, Insn_template::alignment): New method defintions.
13196 (Stub_template::Stub_template): New method definition.
13197 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13198 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13199 (Stub_factory::Stub_factory): New method definition.
13200 * gold.h (string_hash): New template.
13201 * output.h (Input_section_specifier::hash_value): Use
13202 gold::string_hash.
13203 (Input_section_specifier::string_hash): Remove.
13204 * stringpool.cc (Stringpool_template::string_hash): Use
13205 gold::string_hash.
13206
6c172549
DK
132072009-10-20 Doug Kwan <dougkwan@google.com>
13208
13209 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13210 symbols of relaxed input sections.
13211 * output.h (Output_section::find_relaxed_input_section): Make
13212 method public.
13213
c5617f2f
DK
132142009-10-16 Doug Kwan <dougkwan@google.com>
13215
13216 * dynobj.cc (Versions::Versions): Initialize version_script_.
13217 Only insert base version symbol definition for a shared object
13218 if version script defines any version versions.
13219 (Versions::define_base_version): New method definition.
13220 (Versions::add_def): Check that base version is not needed.
13221 (Versions::add_need): Define base version lazily.
13222 * dynobj.h (Versions::define_base_version): New method declaration.
13223 (Versions::needs_base_version_): New data member declaration.
13224 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13225 (check_DATA): Add no_version_test.stdout.
13226 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13227 New make rules.
13228 * testsuite/Makefile.in: Regenerate.
13229 * testsuite/no_version_test.c: New file.
13230 * testsuite/no_version_test.sh: Ditto.
13231
3c12dcdb
DK
132322009-10-16 Doug Kwan <dougkwan@google.com>
13233
13234 * expression.cc (class Segment_start_expression): New class definition.
13235 (Segment_start_expression::value): New method definition.
13236 (script_exp_function_segment_start): Return a new
13237 Segment_start_expression.
13238 * gold/script-c.h (script_saw_segment_start_expression): New function
13239 prototype.
13240 * script-sections.cc (Script_sections::Script_sections): Initialize
13241 SAW_SEGMENT_START_EXPRESSION_ to false.
13242 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13243 and -Tbbs options to specify section addresses if given in
13244 command line and no SEGMENT_START expression is seen in a script.
13245 * script-sections.h (Script_sections::saw_segment_start_expression,
13246 Script_sections::set_saw_segment_start_expression): New method
13247 definition.
13248 (Script_sections::saw_segment_start_expression_): New data member
13249 declaration.
13250 * script.cc (script_saw_segment_start_expression): New function.
13251 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13252 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13253 script_test_7.sh and script_test_8.sh.
13254 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13255 script_test_8.stdout.
13256 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13257 (script_test_6, script_test_6.stdout, script_test_7,
13258 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13259 * Makefile.in: Regenerate.
13260 * testsuite/script_test_6.sh: New file.
13261 * testsuite/script_test_6.t: Same.
13262 * testsuite/script_test_7.sh: Same.
13263 * testsuite/script_test_7.t: Same.
13264 * testsuite/script_test_8.sh: Same.
13265
64b1ae37
DK
132662009-10-16 Doug Kwan <dougkwan@google.com>
13267
13268 * output.cc (Output_segment::set_section_list_address): Cast
13269 expressions to unsigned long long type to avoid format warnings.
13270
661be1e2
ILT
132712009-10-15 Ian Lance Taylor <iant@google.com>
13272
12edd763 13273 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13274 dot assignment to script_sections_.
12edd763
ILT
13275 * script-sections.cc (Script_sections::add_dot_assignment):
13276 Initialize if necessary.
13277
68b6574b
ILT
13278 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13279 program headers with no load segment if there is a linker script.
13280
661be1e2
ILT
13281 * layout.cc (Layout::set_segment_offsets): Align the file offset
13282 to the segment aligment for -N or -n with no load segment.
13283 * output.cc (Output_segment::add_output_section): Don't crash if
13284 the first section is a TLS section.
13285 (Output_segment::set_section_list_addresses): Print an error
13286 message if the address moves backward in a linker script.
13287 * script-sections.cc
13288 (Output_section_element_input::set_section_addresses): Don't
13289 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13290 (Orphan_output_section::set_section_addresses): Likewise.
13291
f15f61a7
DK
132922009-10-15 Doug Kwan <dougkwan@google.com>
13293
13294 * layout.cc (Layout::finish_dynamic_section): Generate tags
13295 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13296 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13297 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13298
82bb573a
ILT
132992009-10-14 Ian Lance Taylor <iant@google.com>
13300
13301 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13302 fields.
13303 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13304 data_shdr fields of relinfo.
13305 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13306 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13307 R_386_TLS_LDO_32, adjust based on section flags.
13308 (Target_i386::Relocate::fix_up_ldo): Remove.
13309
374ad285
ILT
133102009-10-13 Ian Lance Taylor <iant@google.com>
13311
13312 Add support for -pie.
13313 * options.h (class General_options): Add -pie and
13314 --pic-executable.
13315 (General_options::output_is_position_independent): Test -pie.
13316 (General_options::output_is_executable): Return true if not shared
13317 and not relocatable.
13318 (General_options::output_is_pie): Remove.
13319 * options.cc (General_options::finalize): Reject incompatible uses
13320 of -pie.
13321 * gold.cc (queue_middle_tasks): A -pie link is not static.
13322 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13323 * symtab.cc (Symbol::final_value_is_known): Return false if
13324 output_is_position_independent.
13325 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13326 output_is_position_independent.
13327 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13328 output_is_position_independent.
13329 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13330 output_is_position_independent.
13331 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13332 two_file_pie_test.
13333 (basic_pie_test.o, basic_pie_test): New targets.
13334 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13335 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13336 (two_file_pie_test): New target.
13337 * testsuite/Makefile.in: Rebuild.
13338 * README: Remove note saying that -pie is not supported.
13339
c6585162
ILT
133402009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13341
13342 * options.h (class General_options): Add -init and -fini.
13343 * layout.cc (Layout::finish_dynamic_section): Emit
13344 given init and fini functions.
13345
032ce4e9
ST
133462009-10-13 Sriraman Tallam <tmsriram@google.com>
13347
13348 * gc.h (gc_process_relocs): Check if icf is enabled using new
13349 function.
13350 * gold.cc (queue_initial_tasks): Likewise.
13351 (queue_middle_tasks): Likewise.
13352 * object.cc (do_layout): Likewise.
13353 * symtab.cc (is_section_folded): Likewise.
13354 * main.cc (main): Likewise.
13355 * reloc.cc (Read_relocs::run): Likewise.
13356 (Sized_relobj::do_scan_relocs): Likewise.
13357 * icf.cc (is_function_ctor_or_dtor): New function.
13358 (Icf::find_identical_sections): Check if function is ctor or dtor when
13359 safe icf is chosen.
13360 * options.h (General_options::icf): Change option to be an enum.
13361 (Icf_status): New enum.
13362 (icf_enabled): New method.
13363 (icf_safe_folding): New method.
13364 (set_icf_status): New method.
13365 (icf_status_): New variable.
13366 * (options.cc) (General_options::finalize): Set icf_status_.
13367 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13368 icf_test and icf_keep_unique_test to use the --icf enum flag.
13369 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13370 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13371
f345227a
ST
133722009-10-12 Sriraman Tallam <tmsriram@google.com>
13373
13374 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13375 includes to gc.h and icf.h.
13376 * arm.cc: Include gc.h.
13377 * gold.cc: Likewise.
13378 * i386.cc: Likewise.
13379 * powerpc.cc: Likewise.
13380 * sparc.cc: Likewise.
13381 * x86_64.cc: Likewise.
13382 * gc.h: Include icf.h.
13383
1c7814ed
ILT
133842009-10-11 Ian Lance Taylor <iant@google.com>
13385
13386 * plugin.cc: Include "gold.h" before other header files.
13387
ae3b5189
CD
133882009-10-10 Chris Demetriou <cgd@google.com>
13389
13390 * options.h (Input_file_argument::Input_file_type): New enum.
13391 (Input_file_argument::is_lib_): Replace with...
13392 (Input_file_argument::type_): New member.
13393 (Input_file_argument::Input_file_argument): Take Input_file_type
13394 'type' rather than boolean 'is_lib' as second argument.
13395 (Input_file_argument::is_lib): Use type_.
13396 (Input_file_argument::is_searched_file): New function.
13397 (Input_file_argument::may_need_search): Handle is_searched_file.
13398 * options.cc (General_options::parse_library): Support -l:filename.
13399 (General_options::parse_just_symbols): Update for Input_file_argument
13400 changes.
13401 (Command_line::process): Likewise.
13402 * archive.cc (Archive::get_file_and_offset): Likewise.
13403 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13404 * script.cc (read_script_file, script_add_file): Likewise.
13405 * fileread.cc (Input_file::Input_file): Likewise.
13406 (Input_file::will_search_for): Handle is_searched_file.
13407 (Input_file::open): Likewise.
13408 * readsyms.cc (Read_symbols::get_name): Likewise.
13409 * testsuite/Makefile.am (searched_file_test): New test.
13410 * testsuite/Makefile.in: Regenerate.
13411 * testsuite/searched_file_test.cc: New file.
13412 * testsuite/searched_file_test_lib.cc: New file.
13413
f3048a1d
ILT
134142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13415 Ian Lance Taylor <iant@google.com>
13416
13417 * descriptor.cc: Include <cstdio> and "binary-io.h".
13418 (Descriptors::open): Open the files in binary mode always.
13419 * script.cc (Lex::get_token): Treat \r as whitespace.
13420
d4780e57
ILT
134212009-10-09 Ian Lance Taylor <iant@google.com>
13422
13423 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13424
d9a893b8
ILT
134252009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13426 Ian Lance Taylor <iant@google.com>
13427
13428 * configure.ac: Check for readv function also.
13429 * fileread.cc (readv): Define if not HAVE_READV.
13430 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13431 does not exist.
13432 * config.in: Regenerate.
13433 * configure: Regenerate.
13434
c0a62865
DK
134352009-10-09 Doug Kwan <dougkwan@google.com>
13436
13437 * layout.cc (Layout::make_output_section): Call target hook to make
13438 ordinary output section.
13439 (Layout::finalize): Adjust parameter list of call the
13440 Target::may_relax().
13441 * layout.h (class Layout::section_list): New method.
13442 * merge.h (Output_merge_base::entsize): Change visibility to public.
13443 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13444 New methods.
13445 (Output_merge_string::do_is_string): New method.
13446 * object.cc (Sized_relobj::do_setup): renamed from
13447 Sized_relobj::set_up.
13448 * object.h (Sized_relobj::adjust_shndx,
13449 Sized_relobj::initializ_input_to_output_maps,
13450 Sized_relobj::free_input_to_output_maps): Change visibilities to
13451 protected.
13452 (Sized_relobj::setup): Virtualize.
13453 (Sized_relobj::do_setup): New method declaration.
13454 (Sized_relobj::invalidate_section_offset,
13455 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13456 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13457 * options.cc (parse_int): New function.
13458 * options.h (parse_int): New declaration.
13459 (DEFINE_int): New macro.
13460 (stub_group_size): New option.
13461 * output.cc (Output_section::Output_section): Initialize memebers
13462 merge_section_map_, merge_section_by_properties_map_,
13463 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13464 (Output_section::add_input_section): Handled deferred code-fill
13465 generation and remove an old comment.
13466 (Output_section::add_relaxed_input_section): New method definition.
13467 (Output_section::add_merge_input_section): Use merge section by
13468 properties map to speed to search. Update merge section maps
13469 as appropriate.
13470 (Output_section::build_relaxation_map): New method definition.
13471 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13472 Same.
13473 (Output_section::relax_input_section): Renamed to
13474 Output_section::convert_input_sections_to_relaxed_sections and change
13475 interface to take a vector of pointers to relaxed sections.
13476 (Output_section::find_merge_section,
13477 Output_section::find_relaxed_input_section): New method definitions.
13478 (Output_section::is_input_address_mapped,
13479 Output_section::output_offset, Output_section::output_address):
13480 Use output section data maps to speed up searching.
13481 (Output_section::find_starting_output_address): Add comments.
13482 (Output_section::do_write,
13483 Output_section::write_to_postprocessing_buffer): Do code-fill
13484 generation as appropriate.
13485 (Output_section::get_input_sections): Invalidate relaxed input section
13486 map.
13487 (Output_section::restore_states): Adjust type of checkpoint .
13488 Invalidate relaxed input section map.
13489 * output.h (Output_merge_base): New class declaration.
13490 (Input_section_specifier): New class defintion.
13491 (class Output_relaxed_input_section) Change base class to
13492 Output_section_data_build.
13493 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13494 base class initializer.
13495 (Output_section::add_relaxed_input_section): New method declaration.
13496 (Output_section::Input_section): Change visibility to protected.
2e702c99 13497 (Output_section::Input_section::relobj,
c0a62865
DK
13498 Output_section::Input_section::shndx): Handle relaxed input sections.
13499 Output_section::input_sections) Change visibility to protected. Also
13500 define overload to return a non-const pointer.
13501 (Output_section::Merge_section_properties): New class defintion.
13502 (Output_section::Merge_section_by_properties_map,
13503 Output_section::Output_section_data_by_input_section_map,
13504 Output_section::Relaxation_map): New types.
13505 (Output_section::relax_input_section): Rename method to
13506 Output_section::convert_input_sections_to_relaxed_sections and change
13507 interface to take a vector of relaxed section pointers.
13508 (Output_section::find_merge_section,
13509 Output_section::find_relaxed_input_section,
13510 Output_section::build_relaxation_map,
13511 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13512 New method declarations.
13513 (Output_section::merge_section_map_
13514 Output_section::merge_section_by_properties_map_,
13515 Output_section::relaxed_input_section_map_,
13516 Output_section::is_relaxed_input_section_map_valid_,
13517 Output_section::generate_code_fills_at_write_): New data members.
13518 * script-sections.cc
13519 (Output_section_element_input::set_section_addresses): Call
13520 current_data_size and addralign methods of relaxed input sections.
13521 (Orphan_output_section::set_section_addresses): Call current_data_size
13522 and addralign methods of relaxed input sections.
13523 * symtab.cc (Symbol_table::compute_final_value): Extract template
13524 from the body of Symbol_table::sized_finalize_symbol.
13525 (Symbol_table::sized_finalized_symbol): Call
13526 Symbol_table::compute_final_value.
13527 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13528 (Symbol_table::compute_final_value): New templated method declaration.
13529 * target.cc (Target::do_make_output_section): New method defintion.
13530 * target.h (Target::make_output_section): New method declaration.
13531 (Target::relax): Add more parameters for input objects, symbol table
13532 and layout. Adjust call to do_relax.
13533 (Target::do_make_output_section): New method declaration.
13534 (Target::do_relax): Add parameters for input objects, symbol table
13535 and layout.
13536
d446d6c4
ILT
135372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13538
13539 * pread.c: Include stdio.h.
13540
bc06c745
ILT
135412009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13542
13543 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13544 defined.
13545
75aea3d0
ILT
135462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13547
13548 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13549 Change read_shndx type to unsigned int.
13550 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13551 int.
13552 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13553 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13554 Change read_shndx type to unsigned int.
13555 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13556 int.
13557 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13558 * layout.cc (Layout::create_symtab_sections): Cast the result of
13559 local_symcount * symsize to off_t in the gold_assert.
13560
be8fcb75
ILT
135612009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13562
13563 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13564 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13565 R_ARM_BASE_ABS.
13566 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13567 (Arm_relocate_functions::thm_abs5): New function.
13568 (Arm_relocate_functions::abs12): New function.
13569 (Arm_relocate_functions::abs16): New function.
13570 (Arm_relocate_functions::base_abs): New function.
13571 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13572 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13573 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13574 R_ARM_BASE_ABS.
13575 (Scan::global): Likewise.
13576 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13577 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13578 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13579 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13580 R_ARM_BASE_ABS.
13581
c2a122b6
ILT
135822009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13583
13584 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13585 (Arm_relocate_functions::movt_prel): New function.
13586 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13587 (Arm_relocate_functions::thm_movt_prel): New function.
13588 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13589 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13590 (Scan::global, Relocate::relocate): Likewise.
13591 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13592
c4aa1e2d
ILT
135932009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13594
13595 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13596 Incremental_checker.
13597 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13598 unsigned int.
13599 (class Incremental_inputs_header): New class.
13600 (Incremental_inputs_header_writer): Edit comment.
13601 (Incremental_inputs_entry): New class.
13602 (Incremental_inputs_entry_writer): Edit comment.
13603 (Sized_incremental_binary::do_find_incremental_inputs_section):
13604 Add *strtab_shndx parameter, fill it.
13605 (Sized_incremental_binary::do_check_inputs): New method.
13606 (Incremental_checker::can_incrementally_link_output_file): Use
13607 Sized_incremental_binary::check_inputs.
13608 (Incremental_inputs::report_command_line): Save command line in
13609 command_line_.
13610 * incremental.h:
13611 (Incremental_binary::find_incremental_inputs_section): New
13612 method.
13613 (Incremental_binary::do_find_incremental_inputs_section): Add
13614 strtab_shndx parameter.
13615 (Incremental_binary::do_check_inputs): New pure virtual method.
13616 (Sized_incremental_binary::do_check_inputs): Declare.
13617 (Incremental_checker::Incremental_checker): Add incremental_inputs
13618 parameter, use it to initialize incremental_inputs_.
13619 (Incremental_checker::incremental_inputs_): New field.
13620 (Incremental_checker::command_line): New method.
13621 (Incremental_checker::inputs): New method.
13622 (Incremental_checker::command_line_): New field.
13623
c549a694
ILT
136242009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13625
13626 * incremental.cc: Include <cstdarg> and "target-select.h".
13627 (vexplain_no_incremental): New function.
13628 (explain_no_incremental): New function.
13629 (Incremental_binary::error): New method.
13630 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13631 method.
13632 (make_sized_incremental_binary): New function.
13633 (open_incremental_binary): New function.
13634 (can_incrementally_link_file): Add checks if output is ELF and has
13635 inputs section.
13636 * incremental.h: Include "elfcpp_file.h" and "output.h".
13637 (Incremental_binary): New class.
13638 (Sized_incremental_binary): New class.
13639 (open_incremental_binary): Declare.
13640 * object.cc (is_elf_object): Use
13641 elfcpp::Elf_recognizer::is_elf_file.
13642 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13643 * output.h (Output_file::filesize): New method.
13644
fd3c5f0b
ILT
136452009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13646
13647 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13648 New function.
13649 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13650 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13651 function.
13652 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13653 function.
13654 (Arm_relocate_functions::movw_abs_nc): New function.
13655 (Arm_relocate_functions::movt_abs): New function.
13656 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13657 (Arm_relocate_functions::thm_movt_abs): New function.
13658 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13659 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13660 (Scan::global): Likewise.
13661 (Relocate::relocate): Likewise.
13662 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13663
7f5309a5
ILT
136642009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13665
13666 * arm.cc (Arm_relocate_functions::got_prel) New function.
13667 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13668 (Relocate::relocate): Likewise.
13669 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13670
364c7fa5
ILT
136712009-10-06 Ian Lance Taylor <iant@google.com>
13672
13673 * options.h (class General_options): Define
13674 split_stack_adjust_size parameter.
13675 * object.h (class Object): Add uses_split_stack_ and
13676 has_no_split_stack_ fields. Add uses_split_stack and
13677 has_no_split_stack accessor functions. Declare
13678 handle_split_stack_section.
13679 (class Reloc_symbol_changes): Define.
13680 (class Sized_relobj): Define Function_offsets. Declare
13681 split_stack_adjust, split_stack_adjust_reltype, and
13682 find_functions.
13683 * object.cc (Object::handle_split_stack_section): New function.
13684 (Sized_relobj::do_layout): Call handle_split_stack_section.
13685 * dynobj.cc (Sized_dynobj::do_layout): Call
13686 handle_split_stack_section.
13687 * reloc.cc (Sized_relobj::relocate_sections): Call
13688 split_stack_adjust for executable sections in split_stack
13689 objects. Pass reloc_map to relocate_section.
13690 (Sized_relobj::split_stack_adjust): New function.
13691 (Sized_relobj::split_stack_adjust_reltype): New function.
13692 (Sized_relobj::find_functions): New function.
13693 * target-reloc.h: Include "object.h".
13694 (relocate_section): Add reloc_symbol_changes parameter. Change
13695 all callers.
13696 * target.h (class Target): Add calls_non_split method. Declare
13697 do_calls_non_split virtual method. Declare match_view and
13698 set_view_to_nop.
13699 * target.cc: Include "elfcpp.h".
13700 (Target::do_calls_non_split): New function.
13701 (Target::match_view): New function.
13702 (Target::set_view_to_nop): New function.
13703 * gold.cc (queue_middle_tasks): Give an error if mixing
13704 split-stack and non-split-stack objects with -r.
13705 * i386.cc (Target_i386::relocate_section): Add
13706 reloc_symbol_changes parameter.
13707 (Target_i386::do_calls_non_split): New function.
13708 * x86_64.cc (Target_x86_64::relocate_section): Add
13709 reloc_symbol_changes parameter.
13710 (Target_x86_64::do_calls_non_split): New function.
13711 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13712 parameter.
13713 * powerpc.cc (Target_powerpc::relocate_section): Add
13714 reloc_symbol_changes parameter.
13715 * sparc.cc (Target_sparc::relocate_section): Add
13716 reloc_symbol_changes parameter.
13717 * configure.ac: Call AM_CONDITIONAL for the default target.
13718 * configure: Rebuild.
13719 * testsuite/Makefile.am (TEST_AS): New variable.
13720 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13721 (check_DATA): Add split_i386 and split_x86_64 files.
13722 (SPLIT_DEFSYMS): Define.
13723 (split_i386_[1234n].o): New targets.
13724 (split_i386_[124]): New targets.
13725 (split_i386_[1234r].stdout): New targets.
13726 (split_x86_64_[1234n].o): New targets.
13727 (split_x86_64_[124]): New targets.
13728 (split_x86_64_[1234r].stdout): New targets.
13729 (MOSTLYCLEANFILES): Add new executables.
13730 * testsuite/split_i386.sh: New file.
13731 * testsuite/split_x86_64.sh: New file.
13732 * testsuite/split_i386_1.s: New file.
13733 * testsuite/split_i386_2.s: New file.
13734 * testsuite/split_i386_3.s: New file.
13735 * testsuite/split_i386_4.s: New file.
13736 * testsuite/split_i386_n.s: New file.
13737 * testsuite/split_x86_64_1.s: New file.
13738 * testsuite/split_x86_64_2.s: New file.
13739 * testsuite/split_x86_64_3.s: New file.
13740 * testsuite/split_x86_64_4.s: New file.
13741 * testsuite/split_x86_64_n.s: New file.
13742 * testsuite/testfile.cc (Target_test): Update relocation_section
13743 function.
13744 * testsuite/Makefile.in: Rebuild.
13745
e8a9fcda
ILT
137462009-10-06 Ian Lance Taylor <iant@google.com>
13747
13748 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13749 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13750 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13751 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13752 the address on ldo_addrs_.
13753 (Target_i386::Relocate::fix_up_ldo): New function.
13754
e99daf92
ILT
137552009-10-06 Rafael Espindola <espindola@google.com>
13756
13757 * plugin.cc (add_input_library): New.
13758 (Plugin::load): Add add_input_library to tv.
13759 (Plugin_manager::add_input_file): Add the is_lib argument.
13760 (add_input_file): Update call to Plugin_manager::add_input_file.
13761 (add_input_library): New.
13762 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13763
966d4097
DK
137642009-09-30 Doug Kwan <dougkwan@google.com>
13765
13766 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13767 symbol and call Symbol::may_need_copy_reloc to determine if
13768 a copy reloc is needed.
13769 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13770 nocopyreloc is given in command line.
13771 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13772 given in command line.
13773 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13774 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13775 of the removed Target_i386::may_need_copy_reloc.
13776 * options.h (copyreloc): New option with default value false.
13777 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13778 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13779 instead of the removed Target_powerpc::may_need_copy_reloc.
13780 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13781 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13782 instead of the removed Target_sparc::may_need_copy_reloc.
13783 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13784 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13785 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13786 instead of the removed Target_x86_64::may_need_copy_reloc.
13787
029ba973
ILT
137882009-09-30 Ian Lance Taylor <iant@google.com>
13789
13790 * object.h (class Object): Remove target_ field, and target,
13791 sized_target, and set_target methods.
13792 (Object::sized_target): Remove.
13793 (class Sized_relobj): Update declarations. Remove sized_target.
13794 * object.cc (Sized_relobj::setup): Remove target parameter.
13795 Change all callers.
13796 (Input_objects::add_object): Don't do anything with the target.
13797 (make_elf_sized_object): Add punconfigured parameter. Change all
13798 callers. Set or test parameter target.
13799 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13800 Change all callers.
13801 * parameters.cc (Parameters::set_target): Change parameter type to
13802 be non-const.
13803 (Parameters::default_target): Remove.
13804 (set_parameters_target): Change parameter type to be non-const.
13805 (parameters_force_valid_target): New function.
13806 (parameters_clear_target): New function.
13807 * parameters.h (class Parameters): Update declarations. Remove
13808 default_target method. Add sized_target and clear_target
13809 methods. Change target_ to be non-const.
13810 (set_parameters_target): Update declaration.
13811 (parameters_force_valid_target): Declare.
13812 (parameters_clear_target): Declare.
13813 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13814 as NULL if we aren't searching.
13815 (Add_symbols::run): Don't check for compatible target.
13816 * fileread.cc (Input_file::open_binary): Call
13817 parameters_force_valid_target.
13818 * gold.cc (queue_middle_tasks): Likewise.
13819 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13820 set_target on object.
13821 * dynobj.h (class Sized_dynobj): Update declarations.
13822 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13823 make_elf_object returns NULL.
13824 (Archive::include_member): Don't check whether object target is
13825 compatible.
13826 * output.cc (Output_section::add_input_section): Get target from
13827 parameters.
13828 (Output_section::relax_input_section): Likewise.
13829 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13830 parameters.
13831 (Sized_relobj::do_scan_relocs): Likewise.
13832 (Sized_relobj::relocate_sections): Likewise.
13833 * resolve.cc (Symbol_table::resolve): Likewise.
13834 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13835 parameter. Change all callers.
13836 (Symbol_table::add_from_object): Get target from parameters.
13837 (Symbol_table::add_from_relobj): Don't check object target.
13838 (Symbol_table::add_from_dynobj): Likewise.
13839 (Symbol_table::define_special_symbol): Get target from
13840 parameters.
13841 * symtab.h (class Symbol_table): Update declaration.
13842 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13843 parameter. Change all callers. Clear parameter target.
13844 (Binary_test): Test target here.
13845 * testsuite/object_unittest.cc (gold_testsuite): Remove
13846 target_test_pointer parameter. Change all callers.
13847 (Object_test): Test target here.
13848
a6a22b83
ILT
138492009-09-26 Ian Lance Taylor <iant@google.com>
13850
13851 * testsuite/initpri1.c: Don't try to use constructor priorities if
13852 compiling with gcc before 4.3.
13853
6a8f49fe
ILT
138542009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13855
13856 * testsuite/retain_symbols_file_test.sh (check_present): Change
13857 output file name to retain_symbols_file_test.stdout.
13858 (check_absent): Likewise.
13859
8c604651
CS
138602009-09-18 Craig Silverstein <csilvers@google.com>
13861
13862 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13863 * options.cc: Include <cerrno> and <fstream>.
13864 (General_options::finalize): Parse -retain-symbols-file tag.
13865 * options.h: New flag.
13866 (General_options): New method should_retain_symbol, new
13867 variable symbols_to_retain.
13868 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13869 should_retain_symbol map.
13870 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13871 * testsuite/Makefile.in: Regenerate.
13872 * testsuite/retain_symbols_file_test.sh: New file.
13873
ca58b19f
NC
138742009-09-18 Nick Clifton <nickc@redhat.com>
13875
13876 * po/es.po: Updated Spanish translation.
13877
20e6d0d6
DK
138782009-09-17 Doug Kwan <dougkwan@google.com>
13879
13880 * debug.h (DEBUG_RELAXATION): New constant.
13881 (DEBUG_ALL): Add DEBUG_RELAXATION.
13882 (debug_string_to_enum): Add relaxation debug option.
13883 * layout.cc
13884 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13885 Layout::Relaxation_debug_check::read_sections,
13886 Layout::Relaxation_debug_check::read_sections): New method definitions.
13887 (Layout::Layout): Initialize data members
13888 record_output_section_data_from_scrips_,
13889 script_output_section_data_list_ and relaxation_debug_check_.
13890 (Layout::save_segments, Layout::restore_segments,
13891 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13892 Layout::relaxation_loop_body): New method definitions.
13893 (Layout::finalize): Support relaxation. Move section layout code to
13894 Layout::relaxation_loop_body.
13895 (Layout::set_asection_address_from_script): Move code for orphan
13896 section placement out.
13897 (Layout::place_orphan_sections_in_script): New method definition.
13898 * layout.h (Output_segment_headers, Output_file_header):
13899 New forward class declarations.
13900 (Layout::~Layout): Define.
13901 (Layout::new_output_section_data_from_script): New method definition.
13902 (Layout::place_orphan_sections_in_script): New method declaration.
13903 (Layout::Segment_states): New type declaration.
13904 (Layout::save_segments, Layout::restore_segments,
13905 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13906 Layout::relaxation_loop_body): New method declarations.
13907 (Layout::Output_section_data_list): New type declaration.
13908 (Layout::Relaxation_debug_check): New class definition.
13909 (Layout::record_output_section_data_from_script_,
13910 Layout::script_output_section_data_list_, Layout::segment_states_,
13911 Layout::relaxation_debug_check_): New data members.
13912 * output.cc: (Output_section_headers::do_size): New method definition.
13913 (Output_section_headers::Output_section_headers): Move size
13914 computation to Output_section_headers::do_size.
13915 (Output_segment_headers::do_size): New method definition.
e1df38aa 13916 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13917 Output_file_header::do_size and call it.
13918 (Output_file_header::do_size): New method definition.
13919 (Output_data_group::Output_data_group): Adjust call to
13920 Output_section_data.
13921 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13922 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13923 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13924 RELAXED_INPUT_SECTION_CODE.
13925 (Output_section::Output_section): Initialize data member checkpoint_.
13926 (Output_section::~Output_section): Delete checkpoint object pointed
13927 by checkpoint_.
13928 (Output_section::add_input_section): Always add an Input_section if
13929 relaxing.
13930 (Output_section::add_merge_input_section): Add assert.
13931 (Output_section::relax_input_section): New method definition.
13932 (Output_section::set_final_data_size): Set load address to zero for
13933 an unallocated section.
13934 (Output_section::do_address_and_file_offset_have_reset_values):
13935 New method definition.
13936 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13937 Handle relaxed input section.
13938 (Output_section::sort_attached_input_sections): Checkpoint input
13939 section list lazily.
13940 (Output_section::get_input_sections): Change type of input_sections to
13941 list of Simple_input_section pointers. Checkpoint input section list
13942 lazily. Also handle relaxed input sections.
13943 (Output_section::add_input_section_for_script): Take a reference to
13944 a Simple_input_section object instead of Relobj pointer and section
13945 index as parameter. Handle relaxed input sections.
13946 (Output_section::save_states, Output_section::restore_states): New
13947 method definitions.
13948 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13949 (Output_data::is_data_size_fixed): New method definition.
13950 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13951 if it is fixed.
13952 (Output_data::address_and_file_offset_have_reset_values): New method
13953 definition.
13954 (Output_data::do_address_and_file_offset_have_reset_values): New method
13955 definition.
13956 (Output_data::set_data_size): Check that data size is not fixed.
13957 (Output_data::fix_data_size): New method definition.
13958 (Output_data::is_data_size_fixed_): New data member.
13959 (Output_section_headers::set_final_data_size): New method definition.
13960 (Output_section_headers::do_size): New method declaration.
13961 (Output_segment_headers::set_final_data_size): New method definition.
13962 (Output_segment_headers::do_size): New method declaration.
13963 (Output_file_header::set_final_data_size)::New method definition.
13964 (Output_file_header::do_size)::New method declaration.
13965 (Output_section_data::Output_section_data): Add new parameter
13966 is_data_size_fixed and use it to fix data size.
13967 (Output_data_const::Output_data_const): Adjust call to base class
13968 constructor and fix data size.
13969 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13970 base class constructor and fix data size.
13971 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13972 base class constructor and fix data size.
13973 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13974 class constructor and fix data size.
13975 (Output_data_group::set_final_data_size): New method definition.
13976 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13977 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13978 class constructor and fix data size.
13979 (Output_relaxed_input_section): New class definition.
13980 (Output_section::Simple_input_section): New class definition.
13981 (Output_section::get_input_sections): Adjust parameter list.
13982 (Output_section::add_input_section_for_script): Same.
13983 (Output_section::save_states, Output_section::restore_states,
13984 Output_section::do_address_and_file_offset_have_reset_values,
13985 (Output_section::Input_section::Input_section): Handle
13986 RELAXED_INPUT_SECTION_CODE. Add new overload for
13987 Output_relaxed_input_section.
13988 (Output_section::Input_section::is_input_section,
13989 Output_section::Input_section::set_output_section): Handle relaxed
13990 input section.
13991 (Output_section::Input_section::is_relaxed_input_section,
13992 Output_section::Input_section::output_section_data,
13993 Output_section::Input_section::relaxed_input_section): New method
13994 definitions.
13995 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13996 value.
13997 (Output_section::Input_section::u1_): Update comments.
13998 (Output_section::Input_section::u2_): Add new union member poris.
13999 (Output_section::Checkpoint_output_section): New classs definition.
14000 (Output_section::relax_input_section): New method declaration.
14001 (Output_section::checkpoint_): New data member.
14002 (Output_segment): Update comments.
14003 (Output_segment::Output_segment): Un-privatize copy constructor.
14004 (Output_segment::operator=): Un-privatize.
14005 * script-sections.cc (Output_section_element::Input_section_list):
14006 Change element type to Output_section::Simple_input_section.
14007 (Output_section_element_dot_assignment::set_section_addresses):
14008 Register output section data for relaxation clean up.
14009 (Output_data_exression::Output_data_expression): Adjust call to base
14010 constructor to fix data size.
14011 (Output_section_element_data::set_section_addresses): Register
14012 Output_data_expression object for relaxation clean up.
14013 (struct Input_section_info): Replace Relobj pointer and section index
14014 pair with Output_section::Simple_input_section and Convert struct to a
14015 class.
14016 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14017 Input_section_info data member to use accessors.
20e6d0d6
DK
14018 (Output_section_element_input::set_section_addresses): Use layout
14019 parameter. Adjust code to use Output_section::Simple_input_section
14020 and Input_secction_info classes. Register filler for relaxation
14021 clean up.
14022 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14023 and section index pair with Output_section::Simple_input_section
14024 class. Adjust code accordingly.
14025 (Phdrs_element::release_segment): New method definition.
14026 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14027 segment list.
14028 (Script_sections::release_segments): New method definition.
14029 * gold/script-sections.h (Script_sections::release_segments): New
14030 method declaration.
14031 * gold/target.h (Target::may_relax, Target::relax,
14032 Target::do_may_relax, Target::do_relax): New method definitions.
14033
5e445df6
ILT
140342009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14035
14036 * arm.cc (has_signed_unsigned_overflow): New function.
14037 (Arm_relocate_functions::abs8): New function.
14038 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14039 (Target_arm::Scan::global): Likewise.
14040 (Target_arm::relocate::relocate): Likewise.
14041 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14042 Likewise.
14043
8c604651 140442009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14045
14046 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14047 * testsuite/Makefile.in: Regenerate.
14048
1e9cc1c2
NC
140492009-09-11 Nick Clifton <nickc@redhat.com>
14050
14051 * po/gold.pot: Updated by the Translation project.
14052
6a89f575
CC
140532009-09-08 Cary Coutant <ccoutant@google.com>
14054
14055 * output.cc (Output_file::open): Add execute permission to empty file.
14056 * testsuite/Makefile.am (permission_test): New test.
14057 * testsuite/Makefile.in: Regenerate.
14058
fdcac5af
ILT
140592009-09-02 Ian Lance Taylor <iant@google.com>
14060
14061 * output.cc (Output_file::resize): Call map_no_anonymous rather
14062 than map.
14063
44453f85
ILT
140642009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14065
14066 * gold.cc: Include "incremental.h".
14067 (queue_initial_tasks): Call Incremental_checker methods.
14068 * incremental.cc: Include "output.h".
14069 (Incremental_checker::can_incrementally_link_output_file): New
14070 method.
14071 * incremental.h (Incremental_checker): New class.
14072
14073 * output.cc (Output_file::open_for_modification): New method.
14074 (Output_file::map_anonymous): Changed return type to bool. Record
14075 map in base_ field.
14076 (Output_file::map_no_anonymous): New method, broken out of map.
14077 (Output_file::map): Use map_no_anonymous and map_anonymous.
14078 * output.h (class Output_file): Update declarations.
14079
293c1386
CC
140802009-08-24 Cary Coutant <ccoutant@google.com>
14081
14082 * options.h (Command_line::Pre_options): New class.
14083 (Command_line::pre_options): New member.
14084 * options.cc (gold::options::ready_to_register): New variable.
14085 (One_option::register_option): Do nothing if not registering options.
14086 Assert if same short option registered twice.
14087 (General_options::General_options): Turn off option registration when
14088 done constructing.
14089 (Command_line::Pre_options::Pre_options): New constructor.
14090
f773f3d2
CC
140912009-08-24 Cary Coutant <ccoutant@google.com>
14092
06a73cfe
CC
14093 * options.h (General_options::no_keep_memory): Remove incorrect
14094 short option.
f773f3d2 14095
a15af8e2
RW
140962009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14097
14098 * Makefile.am (am__skiplex, am__skipyacc): New.
14099 * Makefile.in: Regenerate.
14100
c462b41b
RW
141012009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14102
14ec8efd
RW
14103 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14104 (INCLUDES): ... this.
14105 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14106 (AM_CPPFLAGS): Renamed from ...
14107 (INCLUDE): ... this.
14108 * Makefile.in, testsuite/Makefile.in: Regenerate.
14109
81ecdfbb
RW
14110 * Makefile.in: Regenerate.
14111 * aclocal.m4: Likewise.
14112 * config.in: Likewise.
14113 * configure: Likewise.
14114 * testsuite/Makefile.in: Likewise.
14115
c462b41b
RW
14116 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14117 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14118 * Makefile.in: Regenerate.
14119 * testsuite/Makefile.in: Regenerate.
14120
2da73f13
CC
141212009-08-19 Cary Coutant <ccoutant@google.com>
14122
14123 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14124 symbols in shared libraries overridden by hidden or internal symbols
14125 in the main program.
14126
2db70501
CD
141272009-08-19 Chris Demetriou <cgd@google.com>
14128
14129 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14130 checking source file names in error messages.
14131
f733487b
DK
141322009-08-18 Doug Kwan <dougkwan@google.com>
14133
14134 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14135 an elcpp::Ehdr as parameter. Adjust call to set_target.
14136 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14137 an elfcpp::Ehdr as parameter.
14138 * object.cc (Object::set_target): Remove the version that looks up
14139 a target and sets it.
14140 (Sized_relobj::setup): Take a Target object instead of
14141 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14142 (make_elf_sized_object): Find target and ask target to
14143 make an ELF object.
14144 * object.h: (Object::set_target): Remove the version that looks up
14145 a target and sets it.
14146 (Sized_relobj::setup): Take a Target object instead of
14147 an elfcpp:Ehdr as parameter.
14148 * target.cc: Include dynobj.h.
14149 (Target::do_make_elf_object_implementation): New.
2e702c99 14150 (Target::do_make_elf_object): New.
f733487b
DK
14151 * target.h (Target::make_elf_object): New template declaration.
14152 (Target::do_make_elf_object): New method declarations.
14153 (Target::do_make_elf_object_implementation): New template declaration.
14154
cc70f101
ILT
141552009-08-14 Ian Lance Taylor <iant@google.com>
14156
14157 * gold.h (FUNCTION_NAME): Define.
14158 (gold_unreachable): Use FUNCTION_NAME.
14159
ef5e0cb1
ST
141602009-08-12 Sriraman Tallam <tmsriram@google.com>
14161
14162 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14163 symbol in the --keep-unique list is not found.
14164
48c187ce
ST
141652009-08-12 Sriraman Tallam <tmsriram@google.com>
14166
14167 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14168 been maked as --keep-unique.
14169 (Icf::unfold_section): New function.
14170 * icf.h (Icf::unfold_section): New function.
14171 * options.h (General_options::keep_unique): New option.
14172 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14173 * testsuite/Makefile.in: Regenerate.
14174 * testsuite/icf_keep_unique_test.sh: New file.
14175 * testsuite/icf_keep_unique_test.cc: New file.
14176
645afe0c
CC
141772009-08-12 Cary Coutant <ccoutant@google.com>
14178
14179 PR 10471
14180 * resolve.cc (Symbol_table::resolve): Check for references from
14181 dynamic objects to hidden and internal symbols.
14182 * testsuite/Makefile.am (hidden_test.sh): New test.
14183 * testsuite/Makefile.in: Regenerate.
14184 * testsuite/hidden_test.sh: New script.
14185 * testsuite/hidden_test_1.c: New test source.
14186 * testsuite/hidden_test_main.c: New test source.
14187
11af873f
DK
141882009-08-11 Doug Kwan <dougkwan@google.com>
14189
14190 * arm.cc: Update comments.
14191 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14192 segment to locate the .ARM.exidx section if present.
14193
b9f7d72d
DK
141942009-08-09 Doug Kwan <dougkwan@google.com>
14195
14196 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14197 patch.
14198
ddd3c53c
ST
141992009-08-07 Sriraman Tallam <tmsriram@google.com>
14200 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14201 compiler warnings.
14202
27721062
ST
142032009-08-06 Sriraman Tallam <tmsriram@google.com>
14204
14205 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14206 valid tls_segment only for non-debug-section relocations.
14207 * testsuite/Makefile.am: Add gc_tls_test.
14208 * testsuite/Makefile.in: Regenerate.
14209 * testsuite/gc_tls_test.cc: New file.
14210 * testsuite/gc_tls_test.sh: New file.
14211
ef15dade 142122009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14213
ef15dade
ST
14214 * icf.cc: New file.
14215 * icf.h: New file.
14216 * Makefile.am (CCFILES): Add icf.cc.
14217 (HFILES): Add icf.h
14218 * Makefile.in: Regenerate.
14219 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14220 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14221 section, symbol and addend information for the relocs.
14222 * gold.cc (queue_middle_tasks): Call identical code folding.
14223 * gold.h: Add defines for multimap.
14224 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14225 to the call of finalize_local_symbols.
14226 * main.cc (main): Create object of class Icf.
14227 * object.cc (Sized_relobj::do_layout): Allow this function to be
14228 called twice during icf.
14229 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14230 to sections marked as identical by icf.
14231 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14232 when available.
14233 (Sized_relobj::do_section_entsize): New function.
14234 * object.h (Object::section_entsize): New function.
14235 (Object::do_section_entsize): New pure virtual function.
14236 (Relobj::finalize_local_symbols): Add new parameter.
14237 (Relobj::do_section_entsize): New function.
14238 * options.h (General_options::icf): New option.
14239 (General_options::icf_iterations): New option.
14240 (General_options::print_icf_sections): New option.
14241 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14242 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14243 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14244 icf.
14245 * symtab.cc (Symbol_table::is_section_folded): New function.
14246 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14247 to sections marked as identical by icf.
14248 * symtab.h (Symbol_table::set_icf): New function.
14249 (Symbol_table::icf): New function.
14250 (Symbol_table::is_section_folded): New function.
14251 (Symbol_table::icf_): New data member.
14252 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14253 * testsuite/Makefile.am: Add commands to build icf_test.
14254 * testsuite/Makefile.in: Regenerate.
14255 * testsuite/icf_test.sh: New file.
14256 * testsuite/icf_test.cc: New file.
14257
c3b65ac4
CD
142582009-07-24 Chris Demetriou <cgd@google.com>
14259
14260 * layout.cc (is_compressible_debug_section): Fix incorrect
14261 comment about compressed section names.
14262
1caf2c51
ILT
142632009-07-20 Ian Lance Taylor <ian@airs.com>
14264
14265 PR 10419
14266 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14267
1ef4d87f
ILT
142682009-07-16 Ian Lance Taylor <iant@google.com>
14269
14270 PR 10400
14271 * layout.h: #include <map>.
14272 (class Kept_section): Change from struct to class. Add accessors
14273 and setters. Add section size to Comdat_group mapping. Change
14274 Comdat_group to std::map. Add is_comdat_ field. Add
14275 linkonce_size field in union.
14276 (class Layout): Update declaration of find_or_add_kept_section.
14277 Don't declare find_kept_object.
14278 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14279 parameter. Add object, shndx, is_comdat, and is_group_name
14280 parameters. Change all callers. Adjust for new Kept_section.
14281 (Layout::find_kept_object): Remove.
14282 * object.cc (Sized_relobj::include_section_group): Update use of
14283 Kept_section. Rename secnum to shndx. Only record
14284 Kept_comdat_section if sections are the same size.
14285 (Sized_relobj::include_linkonce_section): Update use of
14286 Kept_section. Only record Kept_comdat_section if sections are the
14287 same size. Set size of linkonce section.
14288 (Sized_relobj::map_to_kept_section): Update call to
14289 get_kept_comdat_section.
14290 * object.h (class Sized_relobj): Rename fields in
14291 Kept_comdat_section to drop trailing underscores; change object
14292 field to Relobj*. Change Kept_comdat_section_table to store
14293 struct rather than pointer.
14294 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14295 Add kept_object and kept_shndx parameters. Change all callers.
14296 (Sized_relobj::get_kept_comdat_section): Change return type to
14297 bool. Add kept_object and kept_shndx parameters. Change all
14298 callers.
14299 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14300 Layout::find_or_add_kept_section.
14301
37c3b7b0
ILT
143022009-07-09 Ian Lance Taylor <iant@google.com>
14303
14304 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14305 Reserve space in the hash table.
14306
98fa85cb
ILT
143072009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14308
14309 * fileread.cc (File_read::get_mtime): New method.
14310 * fileread.h (Timespec): New structure.
14311 (File_read::get_mtime): New method.
14312 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14313 Renamed from timestamp_nsec.
14314 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14315 Elf_Xword.
e1df38aa 14316 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14317 timestamp_nsec.
e1df38aa 14318 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14319 (Incremental_inputs::report_obejct): Save mtime; style fix.
14320 (Incremental_inputs::report_script): Save mtime; style fix.
14321 (Incremental_inputs::finalize_inputs): Style fix.
14322 (Incremental_inputs::finalize): Style fix.
14323 (Incremental_inputs::create_input_section_data): Store inputs
14324 mtime.
14325 * incremental.h (Incremental_inputs::report_script): Add mtime
14326 argument.
14327 (Incremental_inputs::Input_info::Input_info): Intialize only one
14328 union member.
14329 (Incremental_inputs::Input_info::archive): Move to nameless
14330 union.
14331 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14332 (Incremental_inputs::Input_info::script): Move to nameless union.
14333 (Incremental_inputs::mtime): New field.
14334 * script.cc (read_input_script): Pass file mtime to
14335 Incremental_input.
14336 * script.h (Script_info::inputs): Style fix.
14337
c9d70757
ILT
143382009-07-01 Ian Lance Taylor <ian@airs.com>
14339
14340 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14341 instead of 32.
14342
9c547ec3
ILT
143432009-06-24 Ian Lance Taylor <iant@google.com>
14344
14345 PR 10156
14346 * layout.cc (Layout::choose_output_section): If we find an
14347 existing section, update the flags.
14348 (Layout::create_notes): New function, broken out of
14349 Layout::finalize.
14350 (Layout::finalize): Don't create note sections.
14351 (Layout::create_note): Don't crash if linker script discards
14352 section.
14353 (Layout::create_gold_note): Likewise.
14354 (Layout::create_build_id): Likewise. Don't set
14355 after_input_sections on the section.
14356 (Layout::create_executable_stack_info): Remove target parameter.
14357 Change caller.
14358 * layout.h (class Layout): Declare create_notes. Update
14359 declaration of create_executable_stack_info.
14360 * gold.cc (queue_middle_tasks): Call create_notes.
14361 * output.cc (Output_section::update_flags_for_input_section): Move
14362 here from output.h. If SHF_ALLOC flag is newly set, mark address
14363 invalid.
14364 * output.h (Output_data::mark_address_invalid): New function.
14365 (class Output_section): Only declare, not define,
14366 update_flags_for_input_section. Remove set_flags.
14367
55458500
ILT
143682009-06-24 Ian Lance Taylor <iant@google.com>
14369
14370 * script-sections.cc (Output_section_definition::
14371 set_section_addresses): Rename shadowing local load_address to
14372 laddr.
14373
1307d6cd
ILT
143742009-06-24 Ian Lance Taylor <iant@google.com>
14375
14376 PR 10244
14377 * reloc.cc (relocate_sections): Skip empty relocation sections.
14378
ec3f783e
ILT
143792009-06-23 Ian Lance Taylor <iant@google.com>
14380
14381 PR 10156
14382 * layout.cc (Layout::create_note): Use choose_output_section
14383 rather than make_output_section.
14384
459c9f1c
ILT
143852009-06-23 Ian Lance Taylor <iant@google.com>
14386
14387 PR 10237
14388 * options.cc (General_options::parse_V): Set printed_version_.
14389 (General_options::General_options): Initialize printed_version_.
14390 * options.h (class General_options): Add printed_version_ field.
14391 * gold.cc (queue_initial_tasks): If there are no input files,
14392 don't give a fatal error if we printed the version information.
14393 (queue_middle_tasks): If using -r with a shared object, give a
14394 fatal error rather than an ordinary error.
14395
1518dc8f
ILT
143962009-06-23 Ian Lance Taylor <iant@google.com>
14397
14398 PR 10219
14399 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14400 (Layout::make_output_section): Set have_stabstr_section_ if we see
14401 a .stab*str section.
14402 (Layout::finalize): Call link_stabs_sections.
14403 (Layout::link_stabs_sections): New file.
14404 * layout.h (class Layout): Add have_stabstr_section_ field.
14405 Declare link_stabs_sections.
14406
3d857b98
DK
144072009-06-23 Doug Kwan <dougkwan@google.com>
14408
14409 * Makefile.am (libgold_a_LIBADD): New.
14410 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14411 * Makefile.in: Regenerate.
3d857b98
DK
14412 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14413 * configure: Regenerate.
14414 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14415 * fileread.cc: Include sys/state.h
14416 * gold.h: Declare memmem and strndup if found missing.
14417 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14418
0639a6f6
ILT
144192009-06-23 Ian Lance Taylor <iant@google.com>
14420
14421 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14422 * configure: Rebuild.
14423
8d63875c
ILT
144242009-06-23 Ian Lance Taylor <iant@google.com>
14425
14426 PR 10147
14427 * object.cc (Object::section_contents): Don't try to get a view if
14428 the section has length zero.
14429 (Object::handle_gnu_warning_section): If the section is empty, use
14430 the name of the section as the warning.
14431
f7c8a183
ILT
144322009-06-23 Ian Lance Taylor <iant@google.com>
14433
14434 PR 10133
14435 * stringpool.h (class Stringpool_template): Add optimize_ field.
14436 (Stringpool_template::set_optimize): New function.
14437 * stringpool.cc (Stringpool_template::Stringpool_template):
14438 Initialize optimize_ field.
14439 (Stringpool_template::set_string_offsets): Test local optimize
14440 fild rather than parameter.
14441 * layout.cc (Layout::Layout): Call set_optimize on the section
14442 name stringpool.
14443
e6a307ba
ILT
144442009-06-22 Ian Lance Taylor <iant@google.com>
14445
14446 PR 10030
14447 * yyscript.y: Parse TARGET.
14448 * script.cc (script_set_target): New function.
14449 * script-c.h (script_set_target): Declare.
14450 * options.cc (General_options::string_to_object_format): Rename
14451 from string_to_object_format in anonymous namespace. Change
14452 callers.
14453 * options.h (class General_options): Declare
14454 string_to_object_format.
14455
3ee173de
ILT
144562009-06-22 Ian Lance Taylor <iant@google.com>
14457
14458 * script-sections.cc (Script_sections::create_segments): Don't put
14459 program headers in a PT_LOAD segment if -n or -N.
14460
144612009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14462
14463 PR 10141
14464 * options.h (class General_options): Add -z lazy and -z now. Sort
14465 -z options into alphabetical order.
14466 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14467
cd6739a1 144682009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14469
14470 * layout.cc (Layout::make_output_section): Call
14471 Target::new_output_section.
14472 (Layout::attach_allocated_section_to_segment): Put large section
14473 sections in a separate load segment with the large segment flag
14474 set.
14475 (Layout::segment_precedes): Sort large data segments after other
14476 load segments.
14477 (align_file_offset): New static function.
14478 (Layout::set_segment_offsets): Use align_file_offset.
14479 * output.h (class Output_section): Add is_small_section_ and
14480 is_large_section_ fields.
14481 (Output_section::is_small_section): New function.
14482 (Output_section::set_is_small_section): New function.
14483 (Output_section::is_large_section): New function.
14484 (Output_section::set_is_large_section): New function.
14485 (Output_section::is_large_data_section): New function.
14486 (class Output_segment): Add is_large_data_segment_ field.
14487 (Output_segment::is_large_data_segment): New function.
14488 (Output_segment::set_is_large_data_segment): New function.
14489 * output.cc (Output_section::Output_section): Initialize new
14490 fields.
14491 (Output_segment::Output_segment): Likewise.
14492 (Output_segment::add_output_section): Add assertion that large
14493 data sections always go in large data segments. Force small data
14494 sections to the end of the list of data sections. Force small BSS
14495 sections to the start of the list of BSS sections. For large BSS
14496 sections to the end of the list of BSS sections.
14497 * symtab.h (class Symbol): Declare is_common_shndx.
14498 (Symbol::is_defined): Check Symbol::is_common_shndx.
14499 (Symbol::is_common): Likewise.
14500 (class Symbol_table): Define enum Commons_section_type. Update
14501 declarations. Add small_commons_ and large_commons_ fields.
14502 * symtab.cc (Symbol::is_common_shndx): New function.
14503 (Symbol_table::Symbol_table): Initialize new fields.
14504 (Symbol_table::add_from_object): Put small and large common
14505 symbols in the right list.
14506 (Symbol_table::sized_finalized_symbol): Check
14507 Symbol::is_common_shndx.
14508 (Symbol_table::sized_write_globals): Likewise.
14509 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14510 common symbol lists. Don't call do_allocate_commons_list if the
14511 list is empty.
14512 (Symbol_table::do_allocate_commons_list): Remove is_tls
14513 parameter. Add comons_section_type parameter. Change all
14514 callers. Handle small and large common symbols.
14515 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14516 Symbol::is_common_shndx.
14517 * resolve.cc (symbol_to_bits): Likewise.
14518 * target.h (Target::small_common_shndx): New function.
14519 (Target::small_common_section_flags): New function.
14520 (Target::large_common_shndx): New function.
14521 (Target::large_common_section_flags): New function.
14522 (Target::new_output_section): New function.
14523 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14524 small_common_section_flags, and large_common_section_flags
14525 fields.
14526 (Target::do_new_output_section): New virtual function.
14527 * arm.cc (Target_arm::arm_info): Initialize new fields.
14528 * i386.cc (Target_i386::i386_info): Likewise.
14529 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14530 Likewise.
14531 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14532 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14533 (Target_x86_64::do_new_output_section): New function.
14534 * configure.ac: Define conditional MCMODEL_MEDIUM.
14535 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14536 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14537 (large_LDFLAGS): Define.
14538 * testsuite/large.c: New file.
14539 * testsuite/testfile.cc (Target_test::test_target_info):
14540 Initialize new fields.
14541 * configure, testsuite/Makefile.in: Rebuild.
14542
bb04269c
DK
145432009-06-05 Doug Kwan <dougkwan@google.com>
14544
14545 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14546 * Makefile.in: Regenerate.
bb04269c
DK
14547 * i386.cc (class Target_i386): Define new virtual method to
14548 override do_is_local_label_name in parent.
14549 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14550 local symbols if --discard-locals or -X is given.
14551 * options.h (class General_options): Declare new options
14552 '--discard-locals' and '-X' for discarding locals.
14553 * target.h (class Target): Define new methods is_local_label_name.
14554 Declare new virtual method do_is_local_label_name.
14555 * target.cc: New file.
14556 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14557 (check_SCRIPTS): Add discard_locals_test.sh.
14558 (check_DATA): Add discard_local_tests.syms.
14559 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14560 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14561 * testsuite/Makefile.in: Regenerate.
14562 * testsuite/discard_locals_test.c: New file.
14563 * testsuite/discard_locals_test.sh: Same.
14564
805bb01c
DK
145652009-06-05 Doug Kwan <dougkwan@google.com>
14566
14567 * object.cc (Sized_relobj::Sized_relobj): Initialize
14568 discarded_eh_frame_shndx_ to -1U.
14569 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14570 section.
14571 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14572 a discarded .eh_frame section.
14573 (Sized_relobj::do_finalize_local_symbols): Ditto.
14574 * object.h (class Sized_relobj): Declare new member
14575 discarded_eh_frame_shndx_.
14576 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14577 (local_labels_test.o, local_labels_test): New rules.
14578 * testsuite/Makefile.in: Regenerate.
14579
1dcd334d
DK
145802009-06-04 Doug Kwan <dougkwan@google.com>
14581
14582 * layout.cc (Layout::section_name_mapping): Add mapping for
14583 special ARM sections.
14584
96d49306
DK
145852009-06-03 Doug Kwan <dougkwan@google.com>
14586
14587 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14588 (utils::has_overflow): Same.
14589
dff16297
ILT
145902009-06-03 Ian Lance Taylor <iant@google.com>
14591
14592 * layout.cc (Layout::section_name_mapping): New array, replacing
14593 Layout::linkonce_mapping.
14594 (Layout::section_name_mapping_count): New variable, replacing
14595 Layout::linkonce_mapping_count.
14596 (Layout::linkonce_output_name): Remove.
14597 (Layout::output_section_name): Rewrite.
14598 * layout.h (class Layout): Rename Linkonce_mapping to
14599 Section_name_mapping, linkonce_mapping to section_name_mapping,
14600 linkonce_mapping_count to section_name_mapping_count. Don't
14601 declare linkonce_output_name.
14602
c121c671
DK
146032009-06-03 Doug Kwan <dougkwan@google.com>
14604
14605 * gold/arm.cc (namespace utils): New.
14606 (Target_arm::reloc_is_non_pic): Define new method.
14607 (class Arm_relocate_functions): New.
14608 (Target_arm::Relocate::relocate): Handle relocation types used by
14609 Android.
14610
07800fab
ILT
146112009-06-03 Ian Lance Taylor <iant@google.com>
14612
14613 * arm.cc (Target_arm::scan::global): Use || instead of |.
14614
c121c671
DK
146152009-06-02 Doug Kwan <dougkwan@google.com>
14616
14617 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14618 issued_non_pic_error_.
14619 (class Target_arm::Scan): Declare new method check_non_pic.
14620 Define new method symbol_needs_plt_entry.
14621 Declare new data member issued_non_pic_error_.
14622 (class Target_arm::Relocate): Declare new method
14623 should_apply_static_reloc.
14624 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14625 (Target_arm::Scan::check_non_pic): Define new method.
14626 (Target_arm::Scan::local): Handle a small subset of reloc types used
14627 by Android.
14628 (Target_arm::Scan::local): Same.
14629 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14630
b19b0c6d
ILT
146312009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14632
14633 * incremental.cc (Incremental_inputs::report_command_line): Filter
14634 out --incremental-* options.
14635
94cdfcff
DK
146362009-05-29 Doug Kwan <dougkwan@google.com>
14637
14638 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14639 template class.
14640 (class Target_arm): Update comment.
14641 (Target_arm::Target_arm): Initialize new data members GOT_,
14642 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14643 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14644 and Target_arm::rel_dyn_section.
14645 Declare new_enum Target_arm::Got_type.
14646 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14647 and DYNBSS_.
14648 Update commments for member do_dynsym_value.
14649 (Target_arm::got_size, Target_arm::plt_section,
14650 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14651 new methods inside class defintion.
14652 (Target_arm::got_section): Define new method.
14653 (Target_arm::rel_dyn_section): Same.
14654 (Output_data_plt_arm): New template class.
14655 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14656 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14657 (Output_data_plt_arm::add_entry): Same.
14658 (Output_data_plt_arm::first_plt_entry): Define new
14659 static data member for PLT instruction template.
14660 (Output_data_plt_arm::plt_entry): Same.
14661 (Output_data_plt_arm::do_write): Define new method.
14662 (Target_arm::make_plt_entry): Same.
14663 (Target_arm::do_finalize_sections): Same.
14664 (Target_arm::do_dynsym_value): Same.
14665
4a657b0d
DK
146662009-05-28 Doug Kwan <dougkwan@google.com>
14667
14668 * Makefile.am (TARGETSOURCES): Add arm.cc.
14669 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14670 * Makefile.in: Regenerate.
14671 * arm.cc: New file.
14672 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14673
e7ae8c36
DK
146742009-05-26 Doug Kwan <dougkwan@google.com>
14675
14676 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14677 (General_options::check_excluded_libs): Strip off directories in
14678 archive name before matching like GNU ld does.
14679 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14680 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14681 (exclude_libs_test_LDFLAGS): Add linker option
14682 -Wl,--exclude-libs,libexclude_libs_test_3
14683 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14684 an explicit archive without using -l.
14685 (alt/libexclude_libs_test_3.a): New make rule.
14686 * testsuite/Makefile.in: Regenerate.
14687 * testsuite/exclude_libs_test.c : Declare lib3_default().
14688 (main): Call it.
14689 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14690 * exclude_libs_test_3.c: New file.
14691
f12e7348
NC
146922009-05-26 Nick Clifton <nickc@redhat.com>
14693
14694 * po/id.po: New Indonesian translation.
14695 * po/gold.pot: Updated template file.
14696
4daadc0d
ST
146972009-05-22 Sriraman Tallam <tmsriram@google.com>
14698
e1df38aa 14699 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14700 gc_comdat_test files. Add -Wl,--gc-sections to build
14701 gc_comdat_test.
14702 * testsuite/Makefile.in: Regenerate.
14703 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14704
531813ad
ST
147052009-05-21 Sriraman Tallam <tmsriram@google.com>
14706
14707 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14708 kept comdat section was garbage collected.
14709 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14710 * testsuite/Makefile.in: Regenerate.
14711 * testsuite/gc_comdat_test.sh: New file.
14712 * testsuite/gc_comdat_test_1.cc: New file.
14713 * testsuite/gc_comdat_test_2.cc: New file.
14714
65514900
CC
147152009-05-19 Doug Kwan <dougkwan@google.com>
14716
14717 * archive.cc (Archive::Archive): Move constructor from archive.h
14718 to here. Initialize no_export_.
14719 (Archive::get_elf_object_for_member): Set no_export flag of object.
14720 * archive.h (Archive::Archive): Move constructor body to
14721 archive.cc.
14722 (Archive::no_export): New method.
14723 (Archive::no_export_): New field.
14724 * object.h (Object::Object): Initialize no_export_ to false.
14725 (Object::no_export, Object::set_no_export): New methods.
14726 (Object::no_export_): New field.
14727 * options.cc (General_options::parse_exclude_libs): New method.
14728 (General_options::check_excluded_libs) Same.
14729 * options.h (exclude_libs): New option.
14730 (General_options::check_excluded_libs): New method declaration.
14731 (General_options::excluded_libs_): New field.
14732 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14733 default or protected visibility if an object has no-export flag set.
14734 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14735 (check_SCRIPTS): Add exclude_libs_test.sh.
14736 (check_DATA): Add exclude_libs_test.syms.
14737 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14738 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14739 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14740 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14741 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14742 libexclude_libs_test_2.a): New rules.
14743 * testsuite/Makefile.in: Regenerate.
14744 * testsuite/exclude_libs_test.c: New file.
14745 * testsuite/exclude_libs_test.sh: Ditto.
14746 * testsuite/exclude_libs_test_1.c: Ditto.
14747 * testsuite/exclude_libs_test_2.c: Ditto.
14748
1b77ea50
ILT
147492009-05-15 Ian Lance Taylor <iant@google.com>
14750
14751 * configure.ac: Check for declarations for cases where libiberty.h
14752 checks HAVE_DECL_xxx.
14753 * configure, config.in: Rebuild.
14754
072fe7ce
ILT
147552009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14756
14757 * gold.h (Incremental_argument_list): Remove (invalid) forward
14758 declaration.
14759 * incremental.cc (Incremental_inputs::report_achive): New method.
14760 (Incremental_inputs::report_object): New method.
14761 (Incremental_inputs::report_script): New method.
14762 (Incremental_inputs::finalize_inputs): New method.
14763 (Incremental_inputs::finalize): Call finalize_inputs().
14764 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14765 Create inputs entries.
14766 * incremental.h (Incremental_input_type): New enum.
14767 (Incremental_inputs::Incremental_input): Initialize new fields.
14768 (Incremental_inputs::report_inputs): New method.
14769 (Incremental_inputs::report_achive): New method.
14770 (Incremental_inputs::report_object): New method.
14771 (Incremental_inputs::report_script): New method.
14772 (Incremental_inputs::finalize_inputs): New method.
14773 (Incremental_inputs::Input_info): New struct.
14774 (Incremental_inputs::Input_info_map): New typedef.
14775 (Incremental_inputs::lock_): New field.
14776 (Incremental_inputs::Inputs_): New field.
14777 (Incremental_inputs::Inputs_map): New field.
14778 * main.cc (main): Call Incremental_input::report_inputs.
14779 * options.h (Input_argument_list): Typedef moved from
14780 Input_arguments.
14781 (Input_file_group::Files): Remove, use ::Input_argument_list.
14782 (Input_file_group::Input_argument_list): Remove, use
14783 ::Input_argument_list.
14784 * plugin.cc (Plugin_manager::add_input_file): Add error in
14785 incremental build.
14786 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14787 functions.
14788 * script.cc (read_input_script): Call
14789 Incremental_input::report_script.
14790 * script.h (Script_info): New class.
14791
b0481b0b
ILT
147922009-04-27 Ian Lance Taylor <iant@google.com>
14793
14794 * x86_64.cc (do_adjust_output_section): Set entsize to
14795 plt_entry_size.
14796
b22a5a41 147972009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14798
14799 * output.cc (Output_file::close): After short writes, continue
14800 writing from the correct offset in the buffer being written.
14801
40fde488
CD
148022009-04-23 Chris Demetriou <cgd@google.com>
14803
14804 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14805 * configure: Regenerate.
14806 * config.in: Regenerate.
14807 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14808 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14809
3ce2c28e
ILT
148102009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14811
14812 * incremental.cc (Incremental_inputs_header_data): Renamed from
14813 Incremental_input_header_data.
14814 (Incremental_inputs_header_data::data_size): New field.
14815 (Incremental_inputs_header_data::put_input_file_count): Renamed
14816 from input_file_count.
14817 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14818 from command_line_offset.
14819 (Incremental_inputs_header_data::put_reserved): Renamed from
14820 put_reserved.
14821 (Incremental_inputs_entry_data): Renamed from
14822 Incremental_input_entry_data.
14823 (Incremental_inputs_entry_data::data_size): New field.
14824 (Incremental_inputs::report_command_line): New method.
14825 (Incremental_inputs::finalize): New method.
14826 (Incremental_inputs::create_incremental_inputs_data): New method.
14827 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14828 * incremental.h: New file.
14829 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14830 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14831 incremental builds.
703d02da 14832 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14833 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14834 (Layout::create_incremental_info_sections): New method.
14835 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14836 * main.cc (main): Notify Incremental_input of the command line.
14837
e55bde5e
ILT
148382009-04-01 Ian Lance Taylor <iant@google.com>
14839 Mikolaj Zalewski <mikolajz@google.com>
14840
14841 * gold.h (reserve_unordered_map): Define, three versions, one for
14842 each version of Unordered_map.
14843 * layout.cc (Layout::Layout): Remove options parameter. Add
14844 number_of_input_files parameter. Don't initialize options_.
14845 Initialize number_of_input_files_ and resized_signatures_. Move
14846 sections_are_attached_.
14847 (Layout::layout_group): Reserve space for group_signatures_.
14848 (Layout::find_or_add_kept_section): Change name parameter to be a
14849 reference. Resize signatures_ map when it gets large enough.
14850 (Layout::layout_eh_frame): Use parameters->options() instead of
14851 this->options_.
14852 (Layout::make_output_section): Likewise.
14853 (Layout::attach_allocated_section_to_segment): Likewise.
14854 (Layout::finalize, Layout::create_executable_stack): Likewise.
14855 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14856 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14857 * layout.h (class Layout): Update declarations. Remove options_
14858 field. Add number_of_input_files_ and resized_signatures_
14859 fields. Move sections_are_attached_ field.
14860 * main.cc (main): Pass number of input files to Layout
14861 constructor. Don't pass options.
14862
154b857c
ILT
148632009-03-30 Ian Lance Taylor <iant@google.com>
14864
14865 * ffsll.c (ffsll): Correct implementation.
14866
2f35ab9b
ILT
148672009-03-27 Ian Lance Taylor <iant@google.com>
14868
fd03461a
ILT
14869 * ffsll.c: New file.
14870 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14871 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14872 * ftruncate.c (ftruncate): Declare before definition.
14873 * mremap.c (mremap): Likewise.
14874 * pread.c (pread): Likewise.
14875 * configure, Makefile.in, config.in: Rebuild.
14876
2f35ab9b
ILT
14877 * mremap.c: New file.
14878 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14879 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14880 (mremap): Declare if HAVE_MREMAP is not defined.
14881 * configure, Makefile.in, config.in: Rebuild.
14882
33aea2fd
CC
148832009-03-27 Cary Coutant <ccoutant@google.com>
14884
14885 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14886 position independent.
14887 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14888 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14889
6d479619
CC
148902009-03-24 Cary Coutant <ccoutant@google.com>
14891
14892 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14893 an executable.
14894 (needs_dynamic_reloc): Likewise.
14895
afc06bb8
ILT
148962009-03-24 Ian Lance Taylor <iant@google.com>
14897
14898 * yyscript.y (file_cmd): Recognize EXTERN.
14899 (extern_name_list, extern_name_list_body): New nonterminals.
14900 * script.cc (script_add_extern): Define.
14901 * script-c.h (script_add_extern): Declare.
14902
f6060a4d
ILT
149032009-03-24 Rafael Avila de Espindola <espindola@google.com>
14904
14905 * object.cc (is_elf_object): Define.
14906 * object.h (is_elf_object): Declare.
14907 * archive.cc (Archive::get_elf_object_for_member): Call
14908 is_elf_object.
33aea2fd 14909 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14910
26736d8e
ILT
149112009-03-24 Elliott Hughes <enh@google.com>
14912
14913 * output.cc (Output_file::map_anonymous): Define.
14914 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14915 try an anonymous one. Report the size if the mmap fails.
14916 * output.h (class Output_file): Declare map_anonymous.
14917
22fd9730
ILT
149182009-03-24 Ian Lance Taylor <iant@google.com>
14919
14920 * target-select.cc (instantiate_target): Don't acquire the lock if
14921 the instantiated_target_ field has already been set.
14922
cb010894
ILT
149232009-03-23 Ian Lance Taylor <iant@google.com>
14924
7f055c20
ILT
14925 * gold-threads.h (class Initialize_lock): Define.
14926 * gold-threads.cc (class Initialize_lock_once): Define.
14927 (initialize_lock_control): New static variable.
14928 (initialize_lock_pointer): New static variable.
14929 (initialize_lock_once): New static function.
14930 (Initialize_lock::Initialize_lock): Define.
14931 (Initialize_lock::initialize): Define.
14932 * target-select.h: Include "gold-threads.h".
14933 (class Target_selector): Add lock_ and initialize_lock_ fields.
14934 Don't define instantiate_target, just declare it.
14935 * target-select.cc (Target_selector::Target_selector): Initialize
14936 new fields.
14937 (Target_selector::instantiate_target): Define.
14938 * descriptors.h: Include "gold-threads.h".
14939 (class Descriptors): Add initialize_lock_ field.
14940 * descriptors.cc (Descriptors::Descriptors): Initialize new
14941 field.
14942 (Descriptors::open): Use initialize_lock_ field
14943 * errors.h (class Errors): Add initialize_lock_ field.
14944 * errors.cc (Errors::Errors): Initialize new field.
14945 (Errors::initialize_lock): Use initialize_lock_ field.
14946 * powerpc.cc (class Target_selector_powerpc): Remove
14947 instantiated_target_ field. In do_recognize call
14948 instantiate_target rather than do_instantiate_target. In
14949 do_instantiate_target just allocate a new target.
14950 * sparc.cc (class Target_selector_sparc): Likewise.
14951
36959681
ILT
14952 * freebsd.h: New file.
14953 * i386.cc: Include "freebsd.h".
14954 (Target_i386): Derive from Target_freebsd rather than
14955 Sized_target.
14956 (Target_selector_i386): Derive from Target_selector_freebsd rather
14957 than Target_selector.
14958 * x86_64.cc: Include "freebsd.h".
14959 (Target_x86_64): Derive from Target_freebsd rather than
14960 Sized_target.
14961 (Target_selector_x86_64): Derive from Target_selector_freebsd
14962 rather than Target_selector.
14963 * target.h (class Target): Add adjust_elf_header and
14964 do_adjust_elf_header.
14965 * output.cc (Output_file_header:: do_sized_write): Call target
14966 adjust_elf_header routine.
14967 * configure.tgt: Set targ_osabi.
14968 * configure.ac: Define GOLD_DEFAULT_OSABI.
14969 * parameters.cc (Parameters::default_target): Pass
14970 GOLD_DEFAULT_OSABI to select_target.
14971 * target-select.h (class Target_selector): Make instantiate_target
14972 protected rather than private.
14973 * Makefile.am (HFILES): Add freebsd.h.
14974 * configure, Makefile.in, config.in: Rebuild.
14975
cb010894
ILT
14976 * merge.cc (do_add_input_section): Correct pend value. Change
14977 message about last entry not being null terminated from error to
14978 warning.
14979
0e879927
ILT
149802009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14981
14982 * incremental.cc: New file.
14983 * Makefile.am (CCFILES): Add incremental.cc.
14984 * Makefile.in: Rebuild.
14985
41105937
PP
149862009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14987
14988 * layout.cc (Layout::output_section_name): Preserve names
14989 of '.note.' sections.
e1df38aa 14990
60439920
ILT
149912009-03-19 Ian Lance Taylor <iant@google.com>
14992
14993 * descriptors.cc (Descriptors::open): Check that the options are
14994 valid before using them.
14995
0d371ad3
ILT
149962009-03-18 Ian Lance Taylor <iant@google.com>
14997
14998 * script-sections.h: Include <list>.
14999 (class Script_sections): Change Sections_elements from std::vector
15000 to std::list. Typedef public Elements_iterator. Add
15001 orphan_section_placement_, data_segment_align_start_, and
15002 saw_data_segment_align_ fields. Remove data_segment_align_index_
15003 field.
15004 * script-sections.cc (class Orphan_section_placement): New class.
15005 (class Sections_element): Add virtual functions is_relro and
15006 orphan_section_init. Remove virtual function place_orphan_here.
15007 (class Output_section_definition): Add is_relro and
15008 orphan_section_init. Remove place_orphan_here.
15009 (class Orphan_output_section): Likewise.
15010 (Script_sections::Script_sections): Update for field changes.
15011 (Script_sections::data_segment_align): Set saw_data_segment_align_
15012 and data_segment_align_start_, not data_segment_align_index.
15013 (Script_sections::data_segment_relro_end): Check
15014 saw_data_segment_align_. Use data_segment_align_start_ rather
15015 than data_segment_align_index_.
15016 (Script_sections::place_orphan): Rewrite to use
15017 Orphan_section_placement.
15018
9201d894
ILT
150192009-03-17 Ian Lance Taylor <iant@google.com>
15020
9c5b8369
ILT
15021 * archive.cc (Archive::add_symbols): Check for a version attached
15022 to the symbol name in the archive map.
15023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15024 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15025 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15026 (ver_test_11.a): New target.
15027 * testsuite/Makefile.in: Rebuild.
15028
9201d894
ILT
15029 * configure.ac: Check for chsize and posix_fallocate. Replace
15030 ftruncate.
15031 * ftruncate.c: New file, from gnulib.
15032 * output.cc (posix_fallocate): Define dummy version if not
15033 HAVE_POSIX_FALLOCATE.
15034 (Output_file::map): Call posix_fallocate rather than lseek and
15035 write.
15036 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15037 * configure, Makefile.in, config.in: Rebuild.
15038
ef4ab7a8 150392009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15040
ef4ab7a8
PP
15041 * layout.h (Layout::create_note): Add section_name parameter.
15042 * layout.cc (Layout::create_note): Likewise.
15043 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15044
8c500701
ILT
150452009-03-17 Ian Lance Taylor <iant@google.com>
15046
e85b18e1
ILT
15047 * descriptors.cc: Include "options.h".
15048 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15049 (Descriptors::open): Always use O_CLOEXEC when opening a new
15050 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15051 then set FD_CLOEXEC.
15052
9efe6174
ILT
15053 * sparc.cc (class Target_sparc): Add has_got_section.
15054 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15055 make sure we have a GOT section.
15056
15057 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15058 (Target_sparc::Scan::local): Likewise.
15059 (Target_sparc::Scan::global): Likewise.
15060 (Target_sparc::Relocate::relocate): Likewise.
15061 (Target_sparc::Relocate::relocate_tls): Likewise.
15062
8c500701
ILT
15063 * symtab.cc (Symbol_table::define_default_version): New function,
15064 broken out of add_from_object.
15065 (Symbol_table::add_from_object): Call define_default_version.
15066 (Symbol_table::define_special_symbol): Add resolve_oldsym
15067 parameter. Change all callers. If the version for a symbol comes
15068 from a version script, resolve it with the symbol with the same
15069 name with no version. Also add the symbol without a version if
15070 appropriate.
15071 (do_define_in_output_data): If resolving with oldsym, don't delete
15072 sym.
15073 (do_define_in_output_segment): Likewise.
15074 (do_define_as_constant): Likewise.
15075 * symtab.h (class Symbol_table): Update declarations.
15076
f1ed28fb
ILT
150772009-03-13 Ian Lance Taylor <iant@google.com>
15078
15f8229b
ILT
15079 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15080 (Read_symbols::requeue): New function.
15081 (Read_symbols::do_read_symbols): If make_elf_object fails because
15082 the target type is not configured, and the file was searched for,
15083 issue a warning and retry with the next directory.
15084 (Add_symbols::run): If the file has an incompatible format, and
15085 it was searched for, requeue the Read_symbols task. On error,
15086 release the object.
15087 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15088 dirindex parameter to constructor. Change all callers. Declare
15089 incompatible_warning and requeue.
15090 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15091 input_argument_ and input_group_ fields. Add them to
15092 constructor. Change all callers.
15093 (class Read_script): Add dirindex_ field. Add it to constructor.
15094 Change all callers.
15095 * archive.cc (Archive::setup): Remove input_objects parameter.
15096 Change all callers.
15097 (Archive::get_file_and_offset): Likewise.
15098 (Archive::read_all_symbols): Likewise.
15099 (Archive::read_symbols): Likewise.
15100 (Archive::get_elf_object_for_member): Remove input_objects
15101 parameter. Add punconfigured parameter. Change all callers.
15102 (Archive::add_symbols): Change return type to bool. Check return
15103 value of include_member.
15104 (Archive::include_all_members): Likewise.
15105 (Archive::include_member): Change return type to bool. Return
15106 false if first included object has incompatible target. Set
15107 included_member_ field.
15108 (Add_archive_symbols::run): If add_symbols returns false, requeue
15109 Read_symbols task.
15110 * archive.h (class Archive): Add included_member_ field.
15111 Initialize it in constructor. Add input_file and searched_for
15112 methods. Update declarations.
15113 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15114 input_argument_ fields. Add them to constructor. Change all
15115 callers.
15116 * script.cc: Include "target-select.h".
15117 (class Parser_closure): Add skip_on_incompatible_target_ and
15118 found_incompatible_target_ fields. Add
15119 skip_on_incompatible_target parameter to constructor. Change all
15120 callers. Add methods skip_on_incompatible_target,
15121 clear_skip_on_incompatible_target, found_incompatible_target, and
15122 set_found_incompatible_target.
15123 (read_input_script): Add dirindex parameter. Change all callers.
15124 If parser finds an incompatible target, requeue Read_symbols
15125 task.
15126 (script_set_symbol): Clear skip_on_incompatible_target in
15127 closure.
15128 (script_add_assertion, script_parse_option): Likewise.
15129 (script_start_sections, script_add_phdr): Likewise.
15130 (script_check_output_format): New function.
15131 * script.h (read_input_script): Update declaration.
15132 * script-c.h (script_check_output_format): Declare.
15133 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15134 (ignore_cmd): Remove OUTPUT_FORMAT.
15135 * fileread.cc (Input_file::Input_file): Add explicit this.
15136 (Input_file::will_search_for): New function.
15137 (Input_file::open): Add pindex parameter. Change all callers.
15138 * fileread.h (class Input_file): Add input_file_argument method.
15139 Declare will_search_for. Update declarations.
15140 * object.cc (make_elf_object): Add punconfigured parameter.
15141 Change all callers.
15142 * object.h (class Object): Make input_file public. Add
15143 searched_for method.
15144 (make_elf_object): Update declaration.
15145 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15146 restart search.
15147 * dirsearch.h (class Dirsearch): Update declaration.
15148 * options.h (class General_options): Add --warn-search-mismatch.
15149 * parameters.cc (Parameters::is_compatible_target): New function.
15150 * parameters.h (class Parameters): Declare is_compatible_target.
15151 * workqueue.cc (Workqueue::add_blocker): New function.
15152 * workqueue.h (class Workqueue): Declare add_blocker.
15153
f1ed28fb
ILT
15154 * fileread.cc (Input_file::open): Remove options parameter.
15155 Change all callers.
15156 (Input_file::open_binary): Likewise.
15157 * script.cc (read_input_script): Likewise.
15158 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15159 options parameter from constructor. Change all callers.
15160 (class Read_script): Likewise.
15161 * fileread.h (class Input_file): Update declarations.
15162 * script.h (read_input_script): Update declaration.
15163
34dd024a
NC
151642009-03-10 Nick Clifton <nickc@redhat.com>
15165
15166 * po/es.po: New Spanish translation.
15167
6d71b17c
CC
151682009-03-06 Cary Coutant <ccoutant@google.com>
15169
15170 * options.cc (parse_short_option): Keep dash_z from registering itself.
15171
031cdbed
ILT
151722009-03-03 Ian Lance Taylor <iant@google.com>
15173
15174 PR 9918
15175 * target-reloc.h (relocate_section): Pass output_section to
15176 relocate.
15177 * i386.cc (Target_i386::should_apply_static_reloc): Add
15178 output_section parameter. Change all callers.
15179 (Target_i386::Relocate::relocate): Add output_section parameter.
15180 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15181 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15182 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15183 * testsuite/two_file_shared.sh: New script.
15184 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15185 (check_DATA): Add two_file_shared.dbg.
15186 (two_file_shared.dbg): New target.
15187 * testsuite/Makefile.in: Rebuild.
15188
15d5fa16
ILT
151892009-03-01 Ian Lance Taylor <iant@google.com>
15190
15191 * configure.ac: Check for byteswap.h.
15192 * configure: Rebuild.
15193 * config.in: Rebuild.
15194
8a4c0b0d
ILT
151952009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15196
15197 * layout.cc (Layout::find_or_add_kept_section): New function.
15198 (Layout::add_comdat): Removed.
15199 * layout.h (struct Kept_section): Move out of class Layout.
15200 Remove trailing underscores from field names. Add group_sections
15201 field. Rename group_ field to is_group. Change all uses.
15202 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15203 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15204 comdat_groups_ field.
15205 (Sized_relobj::include_section_group): Use
15206 find_or_add_kept_section and Kept_section::group_sections.
15207 (Sized_relobj::include_linkonce_section): Likewise.
15208 * object.cc (class Sized_relobj): Don't define Comdat_group or
15209 Comdat_group_table. Remove find_comdat_group and
15210 add_comdat_group. Remove comdat_groups_ field.
15211 * plugin.cc (include_comdat_group): Use
15212 Layout::find_or_add_kept_section.
15213
b4ecf66b
ILT
152142009-02-28 Ian Lance Taylor <iant@google.com>
15215
14359ca0
ILT
15216 * README: --gc-sections and map files are now supported. Document
15217 some build requirements.
15218
b4ecf66b
ILT
15219 PR 6992
15220 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15221 relocatable link set the value of the section symbol to zero.
15222 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15223 relocatable link don't include the section address in the local
15224 symbol value.
15225
0602e05a
ILT
152262009-02-27 Ian Lance Taylor <iant@google.com>
15227
fd9d194f
ILT
15228 PR 6811
15229 * options.h (class Search_directory): Add is_system_directory.
15230 (class General_options): Declare is_in_system_directory.
15231 * options.cc (get_relative_sysroot): Make static.
15232 (get_default_sysroot): Make static.
15233 (General_optoins::is_in_system_directory): New function.
15234 * fileread.cc (Input_file::is_in_system_directory): New function.
15235 * fileread.h (class Input_file): Declare is_in_system_directory.
15236 * object.h (class Object): Add is_in_system_directory.
15237 (class Input_objects): Remove system_library_directory_ field.
15238 * object.cc (Input_objects::add_object): Don't set
15239 system_library_directory_.
15240 (input_objects::found_in_system_library_directory): Remove.
15241 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15242 parameter. Change all callers.
15243 (Symbol_table::sized_write_globals): Likewise.
15244 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15245 Call Object::is_in_system_directory.
15246 * symtab.h (class Symbol_table): Update declarations.
15247
61edd21f
ILT
15248 PR 5990
15249 * descriptors.h (Open_descriptor): Add is_on_stack field.
15250 * descriptors.cc (Descriptors::open): If the descriptor is on the
15251 top of the stack, remove it. Initialize is_on_stack field.
15252 (Descriptors::release): Only add pod to stack if it is not on the
15253 stack already.
15254 (Descriptors::close_some_descriptor): Clear stack_next and
15255 is_on_stack fields.
15256
e29e076a
ILT
15257 PR 7091
15258 * output.cc (Output_section::find_starting_output_address): Rename
15259 from starting_output_address; add PADDR parameter; change return
15260 type.
15261 * output.h (class Output_section): Declare
15262 find_starting_output_address instead of starting_output_address.
15263 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15264 section symbol for which we can't find a merge section.
15265
0602e05a
ILT
15266 PR 9836
15267 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15268 hidden or internal, force the symbol to be local.
15269 * resolve.cc (Symbol::override_visibility): Define.
15270 (Symbol::override_base): Use override_visibility.
15271 (Symbol_table::resolve): Likewise.
15272 (Symbol::override_base_with_special): Likewise.
15273 (Symbol_table::override_with_special): If the visibility is hidden
15274 or internal, force the symbol to be local.
15275 * symtab.h (class Symbol): Add set_visibility and
15276 override_visibility.
15277 * testsuite/ver_test_1.sh: New file.
15278 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15279 (check_DATA): Add ver_test_1.syms.
15280 (ver_test_1.syms): New target.
15281 * testsuite/Makefile.in: Rebuild.
15282
401a9a73
CC
152832009-02-25 Cary Coutant <ccoutant@google.com>
15284
15285 * layout.cc (Layout::choose_output_section): Don't rename sections
15286 when using a linker script that has a SECTIONS clause.
15287 * Makefile.in: Regenerate.
15288
15289 * testsuite/Makefile.am (script_test_5.sh): New test case.
15290 * testsuite/Makefile.in: Regenerate.
15291 * testsuite/script_test_5.cc: New file.
15292 * testsuite/script_test_5.sh: New file.
15293 * testsuite/script_test_5.t: New file.
15294
f488e4b0
CC
152952009-02-13 Rafael Avila de Espindola <espindola@google.com>
15296
15297 * archive.cc (Archive::include_member): Update calls to add_symbols.
15298 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15299 the Layout argument.
15300 * dynobj.h (do_add_symbols): Add the Layout argument.
15301 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15302 Layout argument.
15303 * object.h (Object::add_symbols): Add the Layout argument.
15304 (Object::do_add_symbols): Add the Layout argument.
15305 (Sized_relobj::do_add_symbols): Add the Layout argument.
15306 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15307 Unify the two versions.
15308 (Add_plugin_symbols): Remove.
15309 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15310 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15311 (Add_plugin_symbols): Remove.
15312 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15313 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15314 (Add_symbols::run): Make it work with Pulginobj.
15315
89dd1680
ILT
153162009-02-06 Ian Lance Taylor <iant@google.com>
15317
15318 * object.cc (Sized_relobj::do_layout): Make info message start
15319 with lower case letter.
15320
266d0a74
ILT
153212009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15322
602b464e
ILT
15323 * binary.cc: Fix file comment.
15324
266d0a74
ILT
15325 * options.h (enum Incremental_disposition): Define.
15326 (class General_options): Add new options: --incremental,
15327 --incremental_changed, --incremental_unchanged,
15328 --incremental_unknown. Add incremental_disposition_ and
15329 implicit_incremental_ fields.
15330 (General_options::incremental_disposition): New function.
15331 (class Position_dependent_options): Add incremental_disposition
15332 option.
15333 (Position_dependent_options::copy_from_options): Set incremental
15334 dispositions.
15335 * options.cc (General_options::parse_incremental_changed): New
15336 function.
2e702c99
RM
15337 (General_options::parse_incremental_unchanged): New function.
15338 (General_options::parse_incremental_unknown): New function.
15339 (General_options::General_options): Initialize new fields
266d0a74 15340 incremental_disposition_ and implicit_incremental_.
2e702c99 15341 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15342 without --incremental.
15343
f073bbf7
CD
153442009-02-06 Chris Demetriou <cgd@google.com>
15345
15346 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15347 pointer and to report location as the file name associated with
15348 the symbol.
15349 (gold_undefined_symbol_at_location): New function to replace the
15350 old gold_undefined_symbol functionality.
15351 * target-reloc.h (relocate_section): Update to use
15352 gold_undefined_symbol_at_location.
15353 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15354 Call gold_undefined_symbol function rather than gold_error.
15355 * errors.h (Errors::undefined_symbol): Take location as a
15356 string, rather than calculating it from a relocation.
15357 * errors.cc (Errors::fatal): Print "fatal error:" before the
15358 formatted message.
15359 (Errors::error, Errors::error_at_location): Print "error: "
15360 before the formatted message.
15361 (Errors::undefined_symbol): Take location as a string, rather
15362 than calculating it from a relocation.
15363 (gold_undefined_symbol_at_location): New function akin to
15364 old gold_undefined_symbol, calculates location from relocation.
15365 (gold_undefined_symbol): Change to take only a Symbol pointer
15366 and to report location as the file name associated with the symbol.
15367 * testsuite/debug_msg.sh: Update for changed error messages.
15368 * testsuite/undef_symbol.sh: Likewise.
15369
8e94a90c
ILT
153702009-02-04 Duncan Sands <baldrick@free.fr>
15371
15372 PR 9812
15373 * reduced_debug_output.h
15374 (Output_reduced_debug_abbrev_section::failed): Use format for
15375 gold_warning.
15376 (Output_reduced_debug_info_section::faild): Likewise.
15377
88a0e15b
ILT
153782009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15379
15380 * script.cc (Lazy_demangler): New class.
2e702c99 15381 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15382 symbol only once.
15383
5efc7cd2
CC
153842009-01-29 Cary Coutant <ccoutant@google.com>
15385
15386 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15387 to __tls_get_addr.
15388 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15389
e0ebcf42
ILT
153902009-01-28 Ian Lance Taylor <iant@google.com>
15391
5efc7cd2 15392 * version.cc (version_string): Bump to 1.9.
75fe7426 15393
e0ebcf42
ILT
15394 * gold.h: Include <cstring> and <stdint.h>.
15395 * version.cc: Include <cstdio>.
15396 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15397 warning.
15398 * reduced_debug_output.cc (insert_into_vector): Rename from
15399 Insert_into_vector; change all callers. Use Swap_unaligned to
15400 avoid aliasing issue; remove union since it is unnecessary.
15401
8e2813be 154022009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15403
15404 * Makefile.am (CCFILES): Add gc.cc.
15405 (HFILES): Add gc.h.
15406 * Makefile.in: Regenerate.
15407 * gold.cc (Gc_runner): New class.
15408 (queue_initial_tasks): Call garbage collection related tasks
15409 when corresponding options are invoked.
15410 (queue_middle_gc_tasks): New function.
15411 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15412 processed early before laying out sections during garbage collection.
15413 * gold.h (queue_middle_gc_tasks): New function.
15414 (is_prefix_of): Move from "layout.cc".
15415 * i386.cc (Target_i386::gc_process_relocs): New function.
15416 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15417 * main.cc (main): Create object of class "Garbage_collection".
15418 * object.cc (Relobj::copy_symbols_data): New function.
15419 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15420 (Sized_relobj::do_layout): Allow this function to be called twice
15421 during garbage collection and defer layout of section during the
6d03d481
ST
15422 first call.
15423 * object.h (Relobj::get_symbols_data): New function.
15424 (Relobj::is_section_name_included): New function.
15425 (Relobj::copy_symbols_data): New function.
15426 (Relobj::set_symbols_data): New function.
15427 (Relobj::get_relocs_data): New function.
15428 (Relobj::set_relocs_data): New function.
15429 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15430 (Relobj::gc_process_relocs): New function.
15431 (Relobj::do_gc_process_relocs): New pure virtual function.
15432 (Relobj::sd_): New data member.
15433 (Sized_relobj::is_output_section_offset_invalid): New function.
15434 (Sized_relobj::do_gc_process_relocs): New function.
15435 * options.h (General_options::gc_sections): Modify to not be a no-op.
15436 (General_options::print_gc_sections): New option.
15437 * plugin.cc (Plugin_finish::run): Remove function call to
15438 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15439 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15440 * reloc.cc (Read_relocs::run): Add task to process relocs and
15441 determine unreferenced sections when doing garbage collection.
15442 (Gc_process_relocs): New class.
15443 (Sized_relobj::do_gc_process_relocs): New function.
15444 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15445 sections that are garbage collected.
15446 * reloc.h (Gc_process_relocs): New class.
15447 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15448 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15449 symbols whose corresponding sections are garbage collected.
15450 (Symbol_table::Symbol_table): Add new parameter for the garbage
15451 collection object.
15452 (Symbol_table::gc_mark_undef_symbols): New function.
15453 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15454 (Symbol_table::gc_mark_dyn_syms): New function.
15455 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15456 as garbage.
15457 (Symbol_table::add_from_object): Likewise.
15458 (Symbol_table::add_from_relobj): When building shared objects, do not
15459 treat externally visible symbols as garbage.
15460 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15461 table information for static and relocatable links.
15462 * symtab.h (Symbol_table::set_gc): New function.
15463 (Symbol_table::gc): New function.
15464 (Symbol_table::gc_mark_undef_symbols): New function.
15465 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15466 (Symbol_table::gc_mark_dyn_syms): New function.
15467 (Symbol_table::gc_): New data member.
e1df38aa 15468 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15469 function.
15470 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15471 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15472
3b293544
CF
154732009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15474
15475 * options.h (General_options::gc_sections): Define as a no-op for now.
15476 (General_options::no_keep_memory): Ditto.
15477 (General_options::Bshareable): Define.
15478 * options.cc (General_options::finalize): Honor -Bshareable.
15479
83d22aa8
AS
154802009-01-20 Andreas Schwab <schwab@suse.de>
15481
15482 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15483 read the value in the contents, since we don't use it. Use the
15484 template endianness when writing.
15485 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15486
cd536b21
AS
154872009-01-19 Andreas Schwab <schwab@suse.de>
15488
15489 * configure.tgt (powerpc64-*): Fix targ_obj.
15490
99e9a495
ILT
154912009-01-15 Ian Lance Taylor <iant@google.com>
15492
15493 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15494 local symbols when stripping all symbols.
15495
bbbfea06
CC
154962009-01-14 Cary Coutant <ccoutant@google.com>
15497
99e9a495 15498 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15499
0f7c0701
CC
155002009-01-14 Cary Coutant <ccoutant@google.com>
15501
15502 * archive.cc (Archive::get_elf_object_for_member): Remove call
15503 to File_read::claim_for_plugin.
15504 * descriptors.cc (Descriptors::open): Remove reference to
15505 is_claimed.
15506 (Descriptors::claim_for_plugin): Remove.
15507 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15508 (Descriptors::is_claimed): Remove.
15509 (claim_descriptor_for_plugin): Remove.
15510 * fileread.cc (File_read::claim_for_plugin): Remove.
15511 * fileread.h (File_read::claim_for_plugin): Remove.
15512 (File_read::descriptor): Reopen descriptor if necessary.
15513 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15514 (Plugin_manager::all_symbols_read): Add task parameter. Change
15515 all callers.
15516 (Plugin_manager::get_input_file): New function.
15517 (Plugin_manager::release_input_file): New function.
15518 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15519 corresponding data member.
15520 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15521 and pass to base constructor. Change all callers.
15522 (get_input_file, release_input_file): New functions.
15523 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15524 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15525 (Plugin_manager::all_symbols_read): Add task parameter.
15526 (Plugin_manager::get_input_file): New function.
15527 (Plugin_manager::release_input_file): New function.
15528 (Plugin_manager::task_): New data member.
15529 (Pluginobj::Pluginobj): Add filesize parameter.
15530 (Pluginobj::filename): New function.
15531 (Pluginobj::descriptor): New function.
15532 (Pluginobj::filesize): New function.
15533 (Pluginobj::filesize_): New data member.
15534 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15535 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15536 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15537
15538 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15539 with archive libraries.
15540 * testsuite/Makefile.in: Regenerate.
15541 * testsuite/plugin_test.c (struct sym_info): New type.
15542 (get_input_file, release_input_file): New static variables.
15543 (onload): Capture new transfer vector entries.
15544 (claim_file_hook): Stop reading at end of file according to filesize.
15545 Factor out parsing of readelf output into separate function.
15546 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15547 APIs and get the source file name from the symbol table. Convert
15548 source file name to corresponding object file name. Print info
15549 message when adding new input files.
15550 (parse_readelf_line): New function.
15551 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15552 * testsuite/plugin_test_2.sh: Likewise.
15553 * testsuite/plugin_test_3.sh: Likewise.
15554 * testsuite/plugin_test_4.sh: New test case.
15555
62a6d109
ILT
155562009-01-07 Ian Lance Taylor <iant@google.com>
15557
15558 * version.cc (version_string): Bump to 1.8.
15559
483620e8
CC
155602008-12-23 Cary Coutant <ccoutant@google.com>
15561
15562 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15563 * plugin.cc (Plugin_manager::finish): Rename as
15564 layout_deferred_objects. Move cleanup to separate function.
15565 (Plugin_manager::cleanup): New function.
15566 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15567 separately.
15568 * plugin.h (Plugin_manager::finish): Rename as
15569 layout_deferred_objects.
15570 (Plugin_manager::cleanup): New function.
15571 (Plugin_manager::cleanup_done): New field.
15572
d66a9eb3
CC
155732008-12-23 Cary Coutant <ccoutant@google.com>
15574
15575 * plugin.cc (is_visible_from_outside): New function.
15576 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15577 so we don't return "IR only" status for exported symbols or -r links.
15578
15579 * testsuite/Makefile.am (plugin_test_3): New test case.
15580 * testsuite/Makefile.in: Regenerate.
15581 * testsuite/plugin_test_3.sh: New file.
15582
5995b570
CC
155832008-12-22 Cary Coutant <ccoutant@google.com>
15584
15585 * object.cc (Sized_relobj::layout_section): New function.
15586 (Sized_relobj::do_layout): Defer layout of input sections until after
15587 plugin has provided replacement files.
15588 (Sized_relobj::do_layout_deferred_sections): New function.
15589 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15590 (Relobj::layout_deferred_sections): New function.
15591 (Relobj::do_layout_deferred_sections): New function.
15592 (Sized_relobj::do_layout_deferred_sections): New function.
15593 (Sized_relobj::layout_section): New function.
15594 (Sized_relobj::Deferred_layout): New structure.
15595 (Sized_relobj::deferred_layout_): New field.
15596 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15597 Change all callers. Layout deferred sections.
15598 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15599 references.
15600 (Plugin_hook::run): Move code from do_plugin_hook inline.
15601 (Plugin_hook::do_plugin_hook): Remove.
15602 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15603 (Plugin_manager::finish): Renamed, was cleanup.
15604 (Plugin_manager::should_defer_layout): New function.
15605 (Plugin_manager::add_deferred_layout_object): New function.
15606 (Plugin_manager::Deferred_layout_list): New type.
15607 (Plugin_manager::deferred_layout_objects_): New field.
15608 (Plugin_hook::do_plugin_hook): Remove.
15609
ee769c88
ILT
156102008-12-17 Ian Lance Taylor <iant@google.com>
15611
15612 * options.h (class General_options): Add --no case for
15613 --export-dynamic.
15614
abc8dcba
CC
156152008-12-16 Cary Coutant <ccoutant@google.com>
15616
15617 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15618 vector.
15619 (Plugin_manager::claim_file): Create plugin object even if
15620 plugin did not call the add_symbols callback.
15621 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15622 asking for more symbols than were added.
15623 * testsuite/Makefile.am (plugin_test_1): Add test case with
15624 no global symbols.
15625 (empty.syms): New target.
15626 * testsuite/Makefile.in: Regenerate.
15627 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15628 message. Don't call add_symbols if no globals.
15629 (all_symbols_read_hook): Don't provide replacement for empty
15630 claimed file.
15631
b0074644
ILT
156322008-12-12 Ian Lance Taylor <iant@google.com>
15633
68943102
ILT
15634 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15635 r_type == 0 for a local symbol with r_sym == 0.
15636 (scan_relocatable_relocs): Pass r_sym to
15637 local_non_section_strategy.
15638 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15639 r_sym parameter.
15640
b0074644
ILT
15641 * configure.ac: Update test for TLS descriptors: they are
15642 supported as of glibc 2.9.
15643 * configure: Rebuild.
15644
c2508178
ILT
156452008-12-11 Ian Lance Taylor <iant@google.com>
15646
15647 PR 7091
15648 * target-reloc.h (Default_scan_relocatable_relocs): For each
15649 function, map r_type == 0 to RELOC_DISCARD.
15650
2756a258
CC
156512008-12-10 Cary Coutant <ccoutant@google.com>
15652
15653 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15654 object to override a kept COMDAT group from a plugin object.
15655
bb6f53d3
ILT
156562008-12-09 Ian Lance Taylor <iant@google.com>
15657
fbc558e1
ILT
15658 PR 7088
15659 * yyscript.y (file_cmd): Handle INPUT.
15660
bb6f53d3
ILT
15661 * testsuite/initpri1.c: Change all declarations to be full
15662 prototypes by adding void, to avoid compiler warnings.
15663
4674ecfc
CC
156642008-12-05 Rafael Avila de Espindola <espindola@google.com>
15665
15666 * options.cc (General_options::parse_plugin_opt): New.
15667 (General_options::add_plugin): The argument now is just the filename.
15668 (General_options::add_plugin_option): New.
15669 * options.h (plugin_opt): New.
15670 (add_plugin): Change argument name.
15671 (add_plugin_option): New.
15672 * plugin.cc (Plugin::load): Don't parse the plugin option.
15673 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15674 (Plugin::add_option): New.
15675 (Plugin::args_): Change type.
15676 (Plugin::filename_): New.
15677 (Plugin_manager::add_plugin_option): New.
15678 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15679 * testsuite/Makefile.in: Regenerate.
15680
fd06b4aa
CC
156812008-12-05 Cary Coutant <ccoutant@google.com>
15682
15683 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15684 Handle --strip-lto-sections option.
15685 * options.h (strip_lto_sections): New option.
15686
6c52134c
CC
156872008-12-01 Cary Coutant <ccoutant@google.com>
15688
15689 * plugin.cc (ld_plugin_message): Change format parameter to const.
15690 Fix mismatch between new[] and delete.
15691
a45248e0
CC
156922008-11-14 Cary Coutant <ccoutant@google.com>
15693
15694 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15695 instead of -1U.
15696
c82fbeee
CS
156972008-11-05 Craig Silverstein <csilvers@google.com>
15698
15699 * options.cc (General_options::parse_dynamic_list): New function.
15700 * options.h (General_options): New flags dynamic_list,
15701 dynamic_list_data, dynamic_list_cpp_new, and
15702 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15703 (General_options::in_dynamic_list): New function.
15704 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15705 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15706 (Lex::can_continue_name): Likewise.
15707 (yylex): Likewise.
15708 (read_script_file): New parameter script_options.
15709 (read_dynamic_list): New function.
15710 (Script_options::define_dynamic_list): New function.
15711 (dynamic_list_keyword_parsecodes): New variable.
15712 (dynamic_list_keywords): New variable.
15713 * script.h (Script_options::define_dynamic_list): New function
15714 prototype.
15715 (read_dynamic_list): New function prototype.
15716 * symtab.cc (strprefix): New macro.
15717 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15718 dynamic_list_data, dynamic_list_cpp_new, and
15719 dynamic_list_cpp_typeinfo.
15720 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15721 (dynamic_list_expr): New rule.
15722 (dynamic_list_nodes): Likewise.
15723 (dynamic_list_node): Likewise.
15724 * testsuite/Makefile.am (dynamic_list): New test.
15725 * testsuite/Makefile.in: Regenerated.
15726 * testsuite/dynamic_list.t: New file.
15727 * testsuite/dynamic_list.sh: New file.
15728
e0bb29a5
CS
157292008-11-05 Craig Silverstein <csilvers@google.com>
15730
15731 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15732 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15733 (t11_last): Likewise.
15734 * testsuite/ver_test_6.c (main): Likewise.
15735
4e1e25e0
CC
157362008-10-07 Cary Coutant <ccoutant@google.com>
15737
15738 * options.c (General_options::finalize): Add check for -static and
15739 -shared.
15740 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15741 is not empty.
15742
92f03fcb
CC
157432008-10-02 Cary Coutant <ccoutant@google.com>
15744
15745 * plugin.cc (make_sized_plugin_object): Fix conditional
15746 compilation to work when not all targets are enabled.
15747
fbd8a257
CC
157482008-09-29 Cary Coutant <ccoutant@google.com>
15749
15750 * archive.cc (Archive::get_file_and_offset): Use filename instead
15751 of name to get library path.
15752 (Archive::include_member): Unlock external member of a thin archive.
15753
15754 * testsuite/Makefile.am (TEST_AR): New variable.
15755 (thin_archive_test_1): New test.
15756 (thin_archive_test_2): New test.
81636b3f
CC
15757 * testsuite/Makefile.in: Regenerate.
15758 * testsuite/thin_archive_main.cc: New file.
15759 * testsuite/thin_archive_test_1.cc: New file.
15760 * testsuite/thin_archive_test_2.cc: New file.
15761 * testsuite/thin_archive_test_3.cc: New file.
15762 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15763
eff45813
CC
157642008-09-29 Cary Coutant <ccoutant@google.com>
15765
15766 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15767 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15768 instead of -1U.
15769 (Sized_relobj::do_finalize_local_symbols): Likewise.
15770 (Sized_relobj::map_to_kept_section): Likewise.
15771 * object.h (Sized_relobj::invalid_address): New constant.
15772 (Sized_relobj::do_output_section_offset): Check for invalid_address
15773 and return -1ULL.
15774 * output.cc (Output_reloc::local_section_offset): Use constant
15775 invalid_address instead of -1U.
15776 (Output_reloc::get_address): Likewise.
15777 (Output_section::output_address): Change -1U to -1ULL.
15778 * output.h (Output_reloc::invalid_address): New constant.
15779 * reloc.cc (Sized_relobj::write_sections): Use constant
15780 invalid_address instead of -1U.
15781 (Sized_relobj::relocate_sections): Likewise.
15782 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15783 values for merge sections.
15784 * target-reloc.h (relocate_for_relocatable): Use constant
15785 invalid_address instead of -1U.
15786
89fc3421
CC
157872008-09-19 Cary Coutant <ccoutant@google.com>
15788
15789 Add plugin functionality for link-time optimization (LTO).
15790 * configure.ac (plugins): Add --enable-plugins option.
15791 * configure: Regenerate.
15792 * config.in: Regenerate.
15793 * Makefile.am (LIBDL): New variable.
15794 (CCFILES): Add plugin.cc.
15795 (HFILES): Add plugin.h.
15796 (ldadd_var): Add LIBDL.
15797 * Makefile.in: Regenerate.
15798
15799 * archive.cc: Include "plugin.h".
15800 (Archive::setup): Don't preread archive symbols when using a plugin.
15801 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15802 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15803 files.
15804 (Archive::include_member): Add symbols from plugin objects.
15805 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15806 * descriptors.cc (Descriptors::open): Check for file descriptors
15807 abandoned by plugins.
15808 (Descriptors::claim_for_plugin): New function.
15809 * descriptors.h (Descriptors::claim_for_plugin): New function.
15810 (Open_descriptor::is_claimed): New field.
15811 (claim_descriptor_for_plugin): New function.
15812 * fileread.cc (File_read::claim_for_plugin): New function.
15813 * fileread.h (File_read::claim_for_plugin): New function.
15814 (File_read::descriptor): New function.
15815 * gold.cc: Include "plugin.h".
15816 (queue_initial_tasks): Add task to call plugin hooks for generating
15817 new object files.
15818 * main.cc: Include "plugin.h".
15819 (main): Load plugin libraries.
15820 * object.h (Pluginobj): Declare.
15821 (Object::pluginobj): New function.
15822 (Object::do_pluginobj): New function.
15823 (Object::set_target): New function.
15824 * options.cc: Include "plugin.h".
15825 (General_options::parse_plugin): New function.
15826 (General_options::General_options): Initialize plugins_ field.
15827 (General_options::add_plugin): New function.
15828 * options.h (Plugin_manager): Declare.
15829 (General_options): Add --plugin option.
15830 (General_options::has_plugins): New function.
15831 (General_options::plugins): New function.
15832 (General_options::add_plugin): New function.
15833 (General_options::plugins_): New field.
15834 * plugin.cc: New file.
15835 * plugin.h: New file.
15836 * readsyms.cc: Include "plugin.h".
15837 (Read_symbols::do_read_symbols): Check for archive before checking
15838 for ELF file. Call plugin hooks to claim files.
15839 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15840 from a real object file; force override when processing replacement
15841 files.
15842 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15843 (Symbol::init_base_object): Likewise.
15844 (Symbol::init_base_output_data): Likewise.
15845 (Symbol::init_base_output_segment): Likewise.
15846 (Symbol::init_base_constant): Likewise.
15847 (Symbol::init_base_undefined): Likewise.
15848 (Symbol::output_section): Assert that object is not a plugin.
15849 (Symbol_table::add_from_pluginobj): New function.
15850 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15851 undefined.
15852 (Symbol_table::sized_write_globals): Likewise.
15853 (Symbol_table::add_from_pluginobj): Instantiate template.
15854 * symtab.h (Sized_pluginobj): Declare.
15855 (Symbol::in_real_elf): New function.
15856 (Symbol::set_in_real_elf): New function.
15857 (Symbol::in_real_elf_): New field.
15858 (Symbol_table::add_from_pluginobj): New function.
15859
15860 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15861 (LIBDL): New variable.
15862 (LDADD): Add LIBDL.
15863 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15864 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15865 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15866 (MOSTLYCLEANFILES): Likewise.
15867 * testsuite/Makefile.in: Regenerate.
15868 * testsuite/plugin_test.c: New file.
15869 * testsuite/plugin_test_1.sh: New file.
15870 * testsuite/plugin_test_2.sh: New file.
15871
de31bda5
ILT
158722008-09-16 Ian Lance Taylor <iant@google.com>
15873
9c2d0ef9
ILT
15874 * target-reloc.h (relocate_section): Check whether a symbol is
15875 defined by the ABI before reporting an undefined symbol error.
15876 * target.h (Target::is_defined_by_abi): Make parameter const.
15877 (Target::do_is_defined_by_abi): Likewise.
15878 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15879 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15880 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15881 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15882 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15883 * testsuite/Makefile.in: Rebuild.
15884
de31bda5
ILT
15885 * fileread.cc (make_view): Add casts to avoid warning.
15886
9fa33bee
AO
158872008-09-16 Alexandre Oliva <aoliva@redhat.com>
15888
15889 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15890 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15891
183fd0e3
AO
158922008-09-16 Alexandre Oliva <aoliva@redhat.com>
15893
15894 * options.h (General_options::output_is_executable): New.
15895 (General_options::output_is_pie): New.
15896 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15897 for shared libraries.
15898 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15899
7be8330a
CD
159002008-09-11 Chris Demetriou <cgd@google.com>
15901
15902 * options.h (origin): New -z option.
15903 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15904 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15905 in DT_FLAGS_1.
15906
a9caad02
CC
159072008-09-05 Cary Coutant <ccoutant@google.com>
15908
15909 * fileread.cc (File_read::make_view): Add check for attempt to map
15910 beyond end of file.
15911
ae6dce4d
CC
159122008-09-05 Cary Coutant <ccoutant@google.com>
15913
15914 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15915 explicit instantiations.
15916
d7ab2a47
KVH
159172008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15918
15919 PR gold/6858
15920 * options.cc (General_options::finalize): Allow undefined symbols
15921 in shlibs if linking -shared.
15922
15923 PR gold/6859
15924 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15925 symbols as not needing a dynsym entry.
15926
1e52a9c1
CS
159272008-08-20 Craig Silverstein <csilvers@google.com>
15928
15929 * fileread.cc (File_read::open): Do not lock the file unless it
15930 was successfully opened.
15931
d85c80a3
CC
159322008-08-14 Cary Coutant <ccoutant@google.com>
15933
15934 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15935 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15936 * testsuite/tls_test.cc (struct int128): 128-bit struct
15937 for testing TLS relocs with non-zero addend.
15938 (v12): New TLS variable.
15939 (t12): New test.
15940 (t_last): Add check for v12.
15941 * testsuite/tls_test.h (t12): New function.
15942 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15943
2d924fd9
ILT
159442008-08-13 Ian Lance Taylor <iant@google.com>
15945
15946 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15947 set tls_segment_ or relro_segment_.
15948 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15949 when appropriate.
15950 * output.h (Output_section::clear_is_relro): New function.
15951 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15952 sections specially even when output_data_ is empty.
15953 (Output_segment::maximum_alignment): When first section is relro,
15954 only force alignment for PT_LOAD segments.
15955 * script.cc (script_data_segment_align): New function.
15956 (script_data_segment_relro_end): New function.
15957 * script-c.h (script_data_segment_align): Declare.
15958 (script_data_segment_relro_end): Declare.
15959 * script-sections.h (class Script_sections): Declare
15960 data_segment_align and data_segment_relro_end. Add fields
15961 segment_align_index_ and saw_relro_end_.
15962 * script-sections.cc (class Sections_element): Add set_is_relro
15963 virtual function. Add new bool* parameter to place_orphan_here.
15964 Add get_output_section virtual function.
15965 (class Output_section_definition): Add set_is_relro. Add new
15966 bool* parameter to place_orphan_here. Add get_output_section.
15967 Add is_relro_ field.
15968 (Output_section_definition::Output_section_definition): Initialize
15969 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15970 and is_relro_ fields.
15971 (Output_section_definition::place_orphan_here): Add is_relro
15972 parameter.
15973 (Output_section_definition::set_section_addresses): Set relro for
15974 output section.
15975 (Output_section_definition::alternate_constraint): Likewise.
15976 (class Orphan_output_section): Add new bool* parameter to
15977 place_orphan_here. Add get_output_section.
15978 (Orphan_output_section::place_orphan_here): Add is_relro
15979 parameter.
15980 (Script_sections::Script_sections): Initialize
15981 data_segment_align_index_ and saw_relro_end_.
15982 (Script_sections::data_segment_align): New function.
15983 (Script_sections::data_segment_relro_end): New function.
15984 (Script_sections::place_orphan): Set or clear is_relro.
15985 (Script_sections::set_section_addresses): Force alignment of first
15986 TLS section.
15987 * yyscript.y (exp): Call script_data_segment_align and
15988 script_data_segment_relro_end.
15989 * testsuite/relro_script_test.t: New file.
15990 * testsuite/relro_test.cc (using_script): Declare.
15991 (t1, t2): Test using_script.
15992 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15993 (relro_script_test_SOURCES): Define.
15994 (relro_script_test_DEPENDENCIES): Define.
15995 (relro_script_test_LDFLAGS): Define.
15996 (relro_script_test_LDADD): Define.
15997 (relro_script_test.so): New target.
15998 * testsuite/Makefile.in: Rebuild.
15999
f827c9a9
CC
160002008-08-06 Cary Coutant <ccoutant@google.com>
16001
16002 * archive.cc (Archive::total_archives, Archive::total_members)
16003 (Archive::total_members_loaded): New variables.
16004 (Archive::setup): Add parameter. Add option to preread
16005 archive symbols.
16006 (Archive::read_armap): Add counter.
16007 (Archive::get_file_and_offset): New function.
16008 (Archive::get_elf_object_for_member): New function.
16009 (Archive::read_all_symbols): New function.
16010 (Archive::read_symbols): New function.
16011 (Archive::add_symbols): Add counters.
16012 (Archive::include_all_members): Use armap to find members if it's
16013 already built.
16014 (Archive::include_member): Skip reading symbols if already read.
16015 Factored code into Archive::get_file_and_offset and
16016 Archive::get_elf_object_for_member. Changed call to
16017 Mapfile::report_include_archive_member.
16018 (Archive::print_stats): New function.
16019 * archive.h: Declare Object and Read_symbols_data classes.
16020 (Archive::Archive): Add initializers for new members.
16021 (Archive::setup): Add parameter.
16022 (Archive::print_stats): New function.
16023 (Archive::total_archives, Archive::total_members)
16024 (Archive::total_members_loaded): New variables.
16025 (Archive::get_file_and_offset): New function.
16026 (Archive::get_elf_object_for_member): New function.
16027 (Archive::read_all_symbols): New function.
16028 (Archive::read_symbols): New function.
16029 (Archive::Archive_member): New class.
16030 (Archive::members_): New member.
16031 (Archive::num_members_): New member.
16032 * main.cc: Include archive.h.
16033 (main): Call Archive::print_stats.
16034 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16035 archive parameter; member_name is now the fully-decorated name.
16036 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16037 * options.h: (General_options): Add --preread-archive-symbols option.
16038 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16039 Archive::setup.
16040
de4c45bd
ILT
160412008-08-04 Ian Lance Taylor <iant@google.com>
16042
16043 * symtab.h (Symbol::use_plt_offset): New function.
16044 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16045 * powerpc.cc (Relocate::relocate): Likewise.
16046 * sparc.cc (Relocate::relocate): Likewise.
16047 * x86_64.cc (Relocate::relocate): Likewise.
16048 * testsuite/weak_plt.sh: New test.
16049 * testsuite/weak_plt_main.cc: New test.
16050 * testsuite/weak_plt_shared.cc: New test.
16051 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16052 (check_PROGRAMS): Add weak_plt.
16053 (check_DATA): Add weak_plt_shared.so.
16054 (weak_plt_main_pic.o, weak_plt): New targets.
16055 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16056 * testsuite/Makefile.in: Rebuild.
16057
16058 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16059 gcctestdir/ld.
16060 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16061 * testsuite/Makefile.in: Rebuild.
16062
323ee3f4
AM
160632008-08-04 Alan Modra <amodra@bigpond.net.au>
16064
16065 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16066 * Makefile.in: Regenerate.
16067 * po/POTFILES.in: Regenerate.
16068
7c07ecec
ILT
160692008-07-29 Ian Lance Taylor <iant@google.com>
16070
16071 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16072 symbols before other symbols.
16073 * testsuite/script_test_2.cc (test_addr): Declare.
16074 (test_addr_alias): Declare.
16075 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16076 values.
7c07ecec
ILT
16077 * testsuite/script_test_2.t: Define test_addr_alias and
16078 test_addr.
16079
5778530e
ILT
160802008-07-24 Ian Lance Taylor <iant@google.com>
16081
2a00e4fb
ILT
16082 PR 5990
16083 * descriptors.cc: New file.
16084 * descriptors.h: New file.
16085 * gold-threads.h (class Hold_optional_lock): New class.
16086 * fileread.cc: Include "descriptors.h".
16087 (File_read::~File_read): Release descriptor rather than closing
16088 it.
16089 (File_read::open) [file]: Call open_descriptor rather than open.
16090 Set is_descriptor_opened_.
16091 (File_read::open) [memory]: Assert that descriptor is not open.
16092 (File_read::reopen_descriptor): New function.
16093 (File_read::release): Release descriptor.
16094 (File_read::do_read): Make non-const. Reopen descriptor.
16095 (File_read::read): Make non-const.
16096 (File_read::make_view): Reopen descriptor.
16097 (File_read::do_readv): Likewise.
16098 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16099 Update declarations.
16100 * layout.cc: Include "descriptors.h".
16101 (Layout::create_build_id): Use open_descriptor rather than open.
16102 * output.cc: Include "descriptors.h".
16103 (Output_file::open): Use open_descriptor rather than open.
16104 * archive.cc (Archive::const_iterator): Change Archive to be
16105 non-const.
16106 (Archive::begin, Archive::end): Make non-const.
16107 (Archive::count_members): Likewise.
16108 * archive.h (class Archive): Update declarations.
16109 * object.h (Object::read): Make non-const.
16110 * Makefile.am (CCFILES): Add descriptors.cc.
16111 (HFILES): Add descriptors.h.
16112 * Makefile.in: Rebuild.
16113
801647d1
ILT
16114 PR 6716
16115 * gold.h: Always include <clocale>. Add Solaris workarounds
16116 following code in binutils/sysdep.h.
16117
5edd166e
ILT
16118 PR 6048
16119 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16120 this->eh_frame_hdr_ is NULL before using it.
16121
c89ad728
ILT
16122 * dynobj.cc (Versions::Versions): Update comment.
16123
aa86f06b
ILT
16124 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16125 the base version name.
16126
5778530e
ILT
16127 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16128 array size plus one.
16129 (Stringpool_template::set_string_offsets): Subtract one from key
16130 before using it as an array index.
16131 (Stringpool_template::get_offset_with_length): Likewise.
16132 (Stringpool_template::write_to_buffer): Likewise.
16133 * stringpool.h (Stringpool_template::get_offset_from_key):
16134 Likewise.
16135
057ead22
ILT
161362008-07-23 Ian Lance Taylor <iant@google.com>
16137
7f649c59
ILT
16138 PR 6658
16139 * object.h (Merged_symbol_value::value): Do our best to handle a
16140 negative addend.
16141
057ead22
ILT
16142 PR 6647
16143 * script.cc (Version_script_info::get_versions): Don't add empty
16144 version tag to return value.
16145 (Version_script_info::get_symbol_version_helper): Change return
16146 type to bool. Add pversion parameter. Change all callers.
16147 (script_register_vers_node): Don't require a non-NULL tag.
16148 * script.h (class Version_script_info): Update declarations.
16149 (Version_script_info::get_symbol_version): Change return type to
16150 bool. Add version parameter. Change all callers.
16151 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16152 handling. Handle an empty version from a version script.
16153 (Symbol_table::define_special_symbol): Likewise.
16154 * testsuite/ver_test_10.script: New file.
16155 * testsuite/ver_test_10.sh: New file.
16156 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16157 (check_DATA): Add ver_test_10.syms.
16158 (ver_test_10.syms, ver_test_10.so): New target.
16159 * testsuite/Makefile.in: Rebuild.
16160
58e54ac2
CD
161612008-07-23 Simon Baldwin <simonb@google.com>
16162
16163 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16164 to zero for undefined symbols from dynamic libraries.
16165
95d14cd3
ILT
161662008-07-23 Ian Lance Taylor <iant@google.com>
16167
16168 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16169 Change all callers.
16170 * symtab.h (class Symbol_table): Update declaration.
16171 * testsuite/ver_test_9.cc: New file.
16172 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16173 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16174 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16175 (ver_test_9.so, ver_test_9.o): New targets.
16176 * testsuite/Makefile.in: Rebuild.
16177
92de84a6
ILT
161782008-07-22 Ian Lance Taylor <iant@google.com>
16179
34810851
ILT
16180 * options.h (class General_options): Define --check-sections.
16181 * layout.cc (Layout::set_segment_offsets): Handle
16182 --check-sections.
16183
af6156ef
ILT
16184 * options.h (class General_options): Define -n/--nmagic and
16185 -N/--omagic.
16186 * options.cc (General_options::finalize): For -n/--nmagic or
16187 -N/--omagic, set -static.
16188 * layout.cc (Layout::attach_allocated_section_to_segment): If
16189 -N/--omagic, don't put read-only and read-write sections in
16190 different segments.
16191 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16192 finding a read-only segment.
16193 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16194 don't set the minimum segment alignment to the common page size,
16195 and don't set the file offset to the address modulo the page size.
16196 * script-sections.cc (Script_sections::create_segments): If
16197 -n/--omagic, don't put read-only and read-write sections in
16198 different segments.
16199
92de84a6
ILT
16200 * cref.cc: New file.
16201 * cref.h: New file.
16202 * options.h (class General_options): Add --print-symbol-counts.
16203 * main.cc (main): Issue defined symbol report if requested.
16204 * archive.cc (Archive::interpret_header): Make into a const member
16205 function.
16206 (Archive::add_symbols): Call Input_objects::archive_start and
16207 archive_stop.
16208 (Archive::const_iterator): Define new class.
16209 (Archive::begin, Archive::end): New functions.
16210 (Archive::include_all_members): Rewrite to use iterator.
16211 (Archive::count_members): New function.
16212 * archive.h (class Archive): Update declarations.
16213 (Archive::filename): New function.
16214 * object.cc: Include "cref.h".
16215 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16216 (Sized_relobj::do_get_global_symbol_counts): New function.
16217 (Input_objects::add_object): Add object to cross-referencer.
16218 (Input_objects::archive_start): New function.
16219 (Input_objects::archive_stop): New function.
16220 (Input_objects::print_symbol_counts): New function.
16221 * object.h: Declare Cref and Archive.
16222 (Object::get_global_symbol_counts): New function.
16223 (Object::do_get_global_symbol_counts): New pure virtual function.
16224 (class Sized_relobj): Add defined_count_ field. Update
16225 declarations.
16226 (class Input_objects): Add cref_ field. Update constructor.
16227 Update declarations.
16228 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16229 defined_count_.
16230 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16231 symbol counts.
16232 (Sized_dynobj::do_get_global_symbol_counts): New function.
16233 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16234 defined_count_. Update declarations. Define Symbols typedef.
16235 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16236 parameter. Change all callers.
16237 (Symbol_table::add_from_dynobj): Add sympointers and defined
16238 parameters. Change all callers.
16239 * symtab.h (class Symbol_table): Update declarations.
16240 * Makefile.am (CCFILES): Add cref.cc.
16241 (HFILES): Add cref.h.
16242 * Makefile.in: Rebuild.
16243
3f7c5e1d
CD
162442008-07-22 Simon Baldwin <simonb@google.com>
16245
16246 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16247 to zero when writing undefined symbols.
16248
e0b64032
ILT
162492008-07-22 Ian Lance Taylor <iant@google.com>
16250
16251 * output.cc (Output_section::add_input_section): Don't try to
16252 merge empty merge sections.
16253
096b02cf
CS
162542008-07-21 Craig Silverstein <csilvers@google.com>
16255
16256 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16257 Include symbol version in error message.
cd536b21 16258
1d1f116d
CD
162592008-07-20 Chris Demetriou <cgd@google.com>
16260
cd536b21 16261 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16262 (RANDOM_SEED_CFLAGS): New substituted variable.
16263 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16264 * configure: Rebuild.
16265 * Makefile.in: Likewise.
16266 * testsuite/Makefile.in: Likewise.
16267
a18f591e
ILT
162682008-07-18 Ian Lance Taylor <iant@google.com>
16269
16270 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16271 where we see NAME/NULL and NAME/VERSION as separate symbols.
16272 * testsuite/ver_test_main.cc (main): Call t4.
16273 (t4, t4_2a): Define.
16274 * testsuite/ver_test_2.cc (t4_2): Define.
16275 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16276 * testsuite/ver_test_4.cc (t4_2a): Define.
16277 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16278 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16279
c6e3f6ed
ILT
162802008-07-17 Ian Lance Taylor <iant@google.com>
16281
16282 * dynobj.cc (Versions::add_def): If we give an error about a
16283 missing version, go ahead and create the version anyhow.
16284
ef9beddf
ILT
162852008-07-10 Ian Lance Taylor <iant@google.com>
16286
16287 Handle output sections with more than 0x7fffffff bytes.
16288 * object.h (class Relobj): Change map_to_output_ to
16289 output_sections_, and just keep a section pointer. Change all
16290 uses. Move comdat group support to Sized_relobj.
16291 (Relobj::is_section_specially_mapped): Remove.
16292 (Relobj::output_section): Remove poff parameter. Change all
16293 callers.
16294 (Relobj::output_section_offset): New function.
16295 (Relobj::set_section_offset): Rewrite.
16296 (Relobj::map_to_output): Remove.
16297 (Relobj::output_sections): New function.
16298 (Relobj::do_output_section_offset): New pure virtual function.
16299 (Relobj::do_set_section_offset): Likewise.
16300 (class Sized_relobj): Add section_offsets_ field. Add comdat
16301 group support from Relobj. Update declarations.
16302 (Sized_relobj::get_output_section_offset): New function.
16303 (Sized_relobj::do_output_section_offset): New function.
16304 (Sized_relobj::do_set_section_offset): New function.
16305 * object.cc (Relobj::output_section_address): Remove.
16306 (Sized_relobj::Sized_relobj): Initialize new fields.
16307 (Sized_relobj::include_section_group): Cast find_kept_object to
16308 Sized_relobj.
16309 (Sized_relobj::include_linkonce_section): Likewise.
16310 (Sized_relobj::do_layout): Use separate arrays for output section
16311 and output offset.
16312 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16313 output_sections.
16314 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16315 output_sections and section_offsets.
16316 (Sized_relobj::write_local_symbols): Likewise.
16317 (map_to_kept_section): Compute output address directly.
16318 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16319 output_sections and section_offsets.
16320 (Sized_relobj::write_sections): Likewise.
16321 (Sized_relobj::relocate_sections): Likewise.
16322 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16323 * output.h (class Output_reloc): Update declarations. Change
16324 u2_.relobj to Sized_relobj*.
16325 (class Output_data_reloc): Change add functions to use
16326 Sized_relobj*.
16327 * output.cc (Output_reloc::Output_reloc): Change relobj to
16328 Sized_relobj*.
16329 (Output_reloc::local_section_offset): Change return type to
16330 Elf_Addr. Use get_output_section_offset.
16331 (Output_reloc::get_address): Likewise.
16332 (Output_section::is_input_address_mapped): Don't call
16333 is_section_specially_mapped.
16334 (Output_section::output_offset): Likewise.
16335 (Output_section::output_address): Likewise.
16336 (Output_section::starting_output_address): Likewise.
16337 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16338 parameter to Sized_relobj*.
16339 (Copy_relocs::need_copy_reloc): Likewise.
16340 (Copy_relocs::save): Likewise.
16341 * copy-relocs.h (class Copy_relocs): Update declarations.
16342 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16343 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16344 * target-reloc.h (relocate_for_relocatable): Change
16345 offset_in_output_section type to Elf_Addr. Change code that uses
16346 it as well.
16347 * layout.cc (Layout::layout): Always set *off.
16348 * mapfile.cc (Mapfile::print_input_section): Use
16349 output_section_offset.
16350 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16351 Sized_relobj*.
16352 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16353 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16354 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16355
5cb66f97
ILT
163562008-07-03 Ian Lance Taylor <iant@google.com>
16357
16358 * layout.cc (Layout::include_section): Do not discard unrecognized
16359 SHT_STRTAB sections.
16360
afe47622
CS
163612008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16362
16363 * script.cc (Lex::can_continue_name): Make '?' allowable in
16364 version-script names.
16365 * testsuite/version_script.map: Change glob pattern to use '?'
16366
5adf9721
ILT
163672008-06-30 Manish Singh <yosh@gimp.org>
16368
16369 PR 6585
16370 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16371 Correct typo.
16372
e6fde208
ILT
163732008-06-30 Ian Lance Taylor <iant@google.com>
16374
16375 PR 6660
16376 PR 6682
16377 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16378 versions]: Don't try to read the value in the contents, since we
16379 don't use it. Use the template endianness when writing.
16380
3f2e6a2d
CC
163812008-06-25 Cary Coutant <ccoutant@google.com>
16382
16383 * fileread.cc (File_read::make_view): Assert on zero-length view.
16384 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16385 symbol table when there are no symbols to read.
16386
c43d3a48
CS
163872008-06-23 Craig Silverstein <csilvers@google.com>
16388
16389 * version.cc (version_string): Bump to 1.7
16390
5f494ea0
CS
163912008-06-18 Craig Silverstein <csilvers@google.com>
16392
16393 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16394 constant 0xFFFF to type Valtype.
16395 (Powerpc_relocate_functions::rel16_ha): Likewise.
16396
c42e122e
ILT
163972008-06-17 Ian Lance Taylor <iant@google.com>
16398
f34787f8
ILT
16399 * output.h (Output_section::Input_section): Initialize p2align_ to
16400 zero for Output_section_data constructors.
16401 (Output_section::Input_section::addralign): If not an input
16402 section, return the alignment of the Output_section_data.
16403 * testsuite/copy_test.cc: New file.
16404 * testsuite/copy_test_1.cc: New file.
16405 * testsuite/copy_test_2.cc: New file.
16406 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16407 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16408 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16409 (copy_test_1_pic.o, copy_test_1.so): New targets.
16410 (copy_test_2_pic.o, copy_test_2.so): New targets.
16411 * testsuite/Makefile.in: Rebuild.
16412
c42e122e
ILT
16413 * script-sections.cc (Script_sections::place_orphan): Initialize
16414 local variable exact.
16415
ce3ac18a
DE
164162008-06-13 David Edelsohn <edelsohn@gnu.org>
16417
16418 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16419
42cacb20
DE
164202008-06-12 David Edelsohn <edelsohn@gnu.org>
16421 David S. Miller <davem@davemloft.net>
16422
16423 * powerpc.cc: New file.
16424 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16425 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16426 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16427 * Makefile.in: Rebuild.
16428
7b308235
ILT
164292008-06-09 Ian Lance Taylor <iant@google.com>
16430
16431 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16432 <exception>.
16433 (throwing, orig_terminate): New static variables.
16434 (terminate_handler): New static function.
16435 (t2): Set terminate handler.
16436
f0b886e3
ILT
164372008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16438
16439 PR 6584
cd536b21 16440 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16441 alignment.
16442
3e90f135
CC
164432008-05-30 Cary Coutant <ccoutant@google.com>
16444
16445 * archive.cc (Archive::include_all_members) Correct to step
16446 over symbol table and extended name table in thin archives.
16447
e09ad04a
ILT
164482008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16449
16450 PR 6407
16451 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16452 calculation.
16453
62b01cb5
ILT
164542008-05-28 Caleb Howe <cshowe@google.com>
16455
16456 * reduced_debug_output.cc: New file.
16457 * reduced_debug_output.h: New file.
92de84a6 16458 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16459 * options.cc (General_options::finalize): Add strip_debug_non_line
16460 to the strip heirarchy.
16461 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16462 fields.
16463 * layout.cc: Include "reduced_debug_output.h".
16464 (Layout::Layout): Initialize new fields.
16465 (line_only_debug_sections): New static array.
16466 (is_lines_only_debug_sections): New static inline function.
16467 (Layout::include_section): Handle --strip-debug-non-line.
16468 (Layout::make_output_section): If --strip-debug-non-line, build
16469 new output sections for .debug_abbrev and .debug_info.
16470 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16471 gold. Warn about possible overflow.
16472 (read_signed_LEB_128): Likewise.
16473 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16474 (read_signed_LEB_128): Declare.
16475 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16476 (HFILES): Add reduced_debug_output.h.
16477 * Makefile.in: Rebuild.
16478
7d9e3d98
ILT
164792008-05-21 Ian Lance Taylor <iant@google.com>
16480
16481 * mapfile.cc: New file.
16482 * mapfile.h: New file.
16483 * options.h (class General_options): Add -M/--print-map and -Map.
16484 * options.cc (General_options::finalize): Make -M equivalent to
16485 -Map -.
16486 * main.cc: Include <cstdio> and "mapfile.h".
16487 (main): Open mapfile if requested.
16488 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16489 constructor. Change caller.
16490 (queue_initial_tasks): Add mapfile parameter. Change caller.
16491 (queue_middle_tasks): Likewise.
16492 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16493 declarations.
16494 * archive.cc: Include "mapfile.h".
16495 (Archive::add_symbols): Add mapfile parameter. Change all
16496 callers. Pass mapfile, symbol, and reason to include_member.
16497 (Archive::include_all_members): Add mapfile parameter. Change all
16498 callers.
16499 (Archive::include_member): Add mapfile, sym, and why parameters.
16500 Change all callers. Report inclusion to map file.
16501 * archive.h: Include "fileread.h".
16502 (class Archive): Update declarations.
16503 (Archive::file): New const method.
16504 (class Add_archive_symbols): Add mapfile_ field. Update
16505 constructor. Change all callers.
16506 * readsyms.h (class Read_symbols): Likewise.
16507 (class Finish_group): Likewise.
16508 (class Read_script): Likewise.
16509 * common.cc: Include "mapfile.h".
16510 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16511 all callers.
16512 (Symbol_table::do_allocate_commons): Likewise.
16513 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16514 symbol allocation to mapfile.
16515 * common.h (class Allocate_commons_task): Add mapfile_ field.
16516 Update constructor. Change all callers.
16517 * symtab.h (class Symbol_table): Update declarations.
16518 * layout.cc: Include "mapfile.h".
16519 (Layout_task_runner::run): Print information to mapfile.
16520 (Layout::create_gold_note): Change Output_data_fixed_space to
16521 Output_data_zero_fill.
16522 (Layout::create_build_id): Likewise.
16523 (Layout::print_to_mapfile): New function.
16524 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16525 constructor. Change caller.
16526 (class Layout): Declare print_to_mapfile.
16527 * output.cc (Output_section::Input_section::print_to_mapfile): New
16528 function.
16529 (Output_section::add_input_section): If producing a map, always
16530 add to input_sections_ list.
16531 (Output_section::do_print_to_mapfile): New function.
16532 (Output_segment::print_sections_to_mapfile): New function.
16533 (Output_segment::print_section_list_to_mapfile): New function.
16534 * output.h: Include "mapfile.h".
16535 (Output_data::print_to_mapfile): New function.
16536 (Output_data::do_print_to_mapfile): New virtual function.
16537 (Output_segment_headers::do_print_to_mapfile): New function.
16538 (Output_file_header::do_print_to_mapfile): New function.
16539 (Output_data_const::do_print_to_mapfile): New function.
16540 (class Output_data_const_buffer): Add map_name_ field. Update
16541 constructor. Change all callers. Add do_print_to_mapfile
16542 function.
16543 (class Output_data_fixed_space): Likewise.
16544 (class Output_data_space): Likewise.
16545 (class Output_data_zero_fill): New class.
16546 (Output_data_strtab::do_print_to_mapfile): New function.
16547 (Output_data_reloc_base::do_print_to_mapfile): New function.
16548 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16549 (Output_data_group::do_print_to_mapfile): New function.
16550 (Output_data_got::do_print_to_mapfile): New function.
16551 (Output_data_dynamic::do_print_to_mapfile): New function.
16552 (Output_symtab_xindex::do_print_to_mapfile): New function.
16553 (class Output_section): Declare do_print_to_mapflie. Declare
16554 print_to_mapfile in Input_section.
16555 (class Output_segment): Declare new functions.
16556 * object.h (Sized_relobj::symbol_count): New function.
16557 * script-sections.cc
16558 (Output_section_element_dot_assignment::set_section_addresses):
16559 Change Output_data_fixed_space to Output_data_zero_fill.
16560 (Output_data_expression::do_print_to_mapfile): New function.
16561 * script.cc (read_input_script): Add mapfile parameter. Change
16562 all callers.
16563 * script.h (read_input_script): Update declaration.
16564 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16565 (Eh_frame::do_print_to_mapfile): New function.
16566 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16567 (Output_merge_string::do_print_to_mapfile): New function.
16568 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16569 function.
16570 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16571 function.
16572 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16573 function.
16574 * Makefile.am (CCFILES): Add mapfile.cc.
16575 (HFILES): Add mapfile.h.
16576 * Makefile.in: Rebuild.
16577
9f1d377b
ILT
165782008-05-19 Ian Lance Taylor <iant@google.com>
16579
16580 * options.h (class General_options): Add -z relro.
16581 * layout.cc (Layout::Layout): Initialize relro_segment_.
16582 (Layout::add_output_section_data): Return the output section.
16583 (Layout::make_output_section): Rcognize relro sections and mark
16584 them appropriately.
16585 (Layout::attach_allocated_section_to_segment): Put relro sections
16586 in a PT_GNU_RELRO segment.
16587 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16588 section as relro.
16589 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16590 PT_TLS segments.
16591 (Layout::linkonce_mapping): Map d.rel.ro.local to
16592 .data.rel.ro.local.
16593 (Layout::output_section_name): Us .data.rel.ro.local for any
16594 section which begins with that.
16595 * layout.h (class Layout): Update add_output_section_data
16596 declaration. Add relro_segment_ field.
16597 * output.cc (Output_section::Output_section): Initialize is_relro_
16598 and is_relro_local_ fields.
16599 (Output_segment::add_output_section): Group relro sections.
16600 (Output_segment::is_first_section_relro): New function.
16601 (Output_segment::maximum_alignment): If there is a relro section,
16602 align the segment to the common page size.
16603 (Output_segment::set_section_addresses): Track whether we are
16604 looking at relro sections. If the last section is a relro
16605 section, align to the common page size.
16606 (Output_segment::set_section_list_addresses): Add in_relro
16607 parameter. Change all callers. Align to the page size when
16608 moving from relro to non-relro section.
16609 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16610 segment.
16611 * output.h (class Output_section): Add is_relro_ and
16612 is_relro_local_ fields.
16613 (Output_section::is_relro): New function.
16614 (Output_section::set_is_relro): New function.
16615 (Output_section::is_relro_local): New function.
16616 (Output_section::set_is_relro_local): New function.
16617 (class Output_segment): Update declarations.
16618 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16619 * sparc.cc (Target_sparc::got_section): Likewise.
16620 * x86_64.cc (Target_x86_64::got_section): Likewise.
16621 * testsuite/relro_test_main.cc: New file.
16622 * testsuite/relro_test.cc: New file.
16623 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16624 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16625 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16626 (relro_test.so, relro_test_pic.o): New targets.
16627 * testsuite/Makefile.in: Rebuild.
16628
a984ee1d
ILT
166292008-05-16 Ian Lance Taylor <iant@google.com>
16630
01676dcd
ILT
16631 * output.cc (Output_segment::add_output_section): Remove front
16632 parameter.
16633 * output.h (class Output_segment): Remove
16634 add_initial_output_section and overloaded add_output_section.
16635 Update declaration of remaining add_output_section.
16636 * layout.cc (Layout::create_interp): Call add_output_section
16637 rather than add_initial_output_section.
16638 (Layout::finish_dynamic_section): Likewise.
16639
497897f9
ILT
16640 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16641 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16642 know the dynamic type.
16643 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16644 field. Initialize it in constructor.
16645 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16646 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16647 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16648 reloc.
16649
a984ee1d
ILT
16650 * output.cc (Output_reloc::get_address): Change return type to
16651 Elf_Addr.
16652 * output.h (class Output_reloc): Update get_address declaration.
16653 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16654 for section addresses.
16655
55ba0940
ILT
166562008-05-09 Ian Lance Taylor <iant@google.com>
16657
16658 PR 6493
16659 * gold.cc (gold_nomem): Use return value of write.
16660
75517b77
ILT
166612008-05-08 Ian Lance Taylor <iant@google.com>
16662
16663 * symtab.c (Symbol::init_base_output_data): Add version
16664 parameter. Change all callers.
16665 (Symbol::init_base_output_segment): Likewise.
16666 (Symbol::init_base_constant): Likewise.
16667 (Symbol::init_base_undefined): Likewise.
16668 (Sized_symbol::init_output_data): Likewise.
16669 (Sized_symbol::init_output_segment): Likewise.
16670 (Sized_symbol::init_constant): Likewise.
16671 (Sized_symbol::init_undefined): Likewise.
16672 (Symbol_table::do_define_in_output_data): If the new symbol has a
16673 version, mark it as the default.
16674 (Symbol_table::do_define_in_output_segment): Likewise.
16675 (Symbol_table::do_define_as_constant): Likewise.
16676 * symtab.h (class Symbol): Update declarations.
16677 (class Sized_symbol): Likewise.
16678 * resolve.cc (Symbol::override_version): New function.
c42e122e 16679 (Symbol::override_base): Call override_version.
75517b77
ILT
16680 (Symbol::override_base_with_special): Likewise.
16681 * testsuite/ver_script_8.script: New file.
16682 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16683 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16684 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16685 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16686
f1f70eae
ILT
166872008-05-06 Ian Lance Taylor <iant@google.com>
16688
f3e9c5c5
ILT
16689 PR 6049
16690 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16691 functions.
16692 (class General_options): Remove existing --undefined, and add
16693 --no-undefined instead. Add new --undefined as synonym for -u.
16694 * archive.cc (Archive::add_symbols): Check whether symbol was
16695 named with -u.
16696 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16697 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16698 all uses. Add IS_UNDEFINED. Update declarations to split
16699 different versions of init_base. Declare init_base_undefined.
16700 (Symbol::is_defined): Handle IS_UNDEFINED.
16701 (Symbol::is_undefined): Likewise.
16702 (Symbol::is_weak_undefined): Call is_undefined.
16703 (Symbol::is_absolute): Handle IS_CONSTANT.
16704 (class Sized_symbol): Update declarations to split different
16705 versions of init. Declare init_undefined.
16706 (class Symbol_table): Declare new functions.
16707 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16708 Change all callers.
16709 (Symbol::init_base_output_data): Likewise.
16710 (Symbol::init_base_output_segment): Likewise.
16711 (Symbol::init_base_constant): Likewise.
16712 (Symbol::init_base_undefined): New function.
16713 (Sized_symbol::init_object): Rename from init. Change all
16714 callers.
16715 (Sized_symbol::init_output_data): Likewise.
16716 (Sized_symbol::init_output_segment): Likewise.
16717 (Sized_symbol::init_constant): Likewise.
16718 (Sized_symbol::init_undefined): New function.
16719 (Symbol_table::add_undefined_symbols_from_command_line): New
16720 function.
16721 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16722 function.
16723 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16724 (Symbol::output_section): Likewise.
16725 (Symbol::set_output_section): Likewise.
16726 (Symbol_table::sized_finalize_symbol): Likewise.
16727 (Symbol_table::sized_write_globals): Likewise.
16728 * resolve.cc (Symbol_table::should_override): Likewise.
16729 (Symbol::override_base_with_special): Likewise.
16730
8bdcdf2c
ILT
16731 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16732 symbol, change it to have default visibility.
16733 * testsuite/protected_1.cc: New file.
16734 * testsuite/protected_2.cc: New file.
16735 * testsuite/protected_3.cc: New file.
16736 * testsuite/protected_main_1.cc: New file.
16737 * testsuite/protected_main_2.cc: New file.
16738 * testsuite/protected_main_3.cc: New file.
16739 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16740 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16741 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16742 (protected_1.so): New target.
16743 (protected_1_pic.o, protected_2_pic.o): New targets.
16744 (protected_3_pic.o): New target.
16745 (check_PROGRAMS): Add protected_2.
16746 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16747 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16748 * testsuite/Makefile.in: Rebuild.
16749
2b706932
ILT
16750 * options.h (DEFINE_var): Add set_user_set_##varname__.
16751 (DEFINE_bool_alias): New macro.
16752 (class General_options): Define -Bstatic using DEFINE_bool_alias
16753 rather than DEFINE_special. Add --undefined as an alias for -z
16754 defs.
16755 * options.cc (General_options::parse_Bstatic): Remove.
16756
d82a5bcc
ILT
16757 * options.h (class General_options): Add --fatal-warnings.
16758 * main.cc (main): Implement --fatal-warnings.
16759 * errors.h (Errors::warning_count): New function.
16760
f1f70eae
ILT
16761 * options.h (class General_options): Add -Bsymbolic-functions.
16762 * symtab.h (Symbol::is_preemptible): Check for
16763 -Bsymbolic-functions.
16764
8825ac63
ILT
167652008-05-05 Ian Lance Taylor <iant@google.com>
16766
d98bc257
ILT
16767 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16768 as noVARNAME rather than no-VARNAME.
16769 (class General_options): Add option -z combreloc.
16770 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16771 get_address.
16772 (Output_reloc::sort_before) [SHT_REL]: New function.
16773 (Output_reloc::sort_before) [SHT_RELA]: New function.
16774 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16775 Sort_relocs_comparison.
16776 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16777 parameter. Change all callers.
16778 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16779 sort_relocs parameter. Change all callers.
16780 * output.cc (Output_reloc::get_address): New function, broken out
16781 of write_rel.
16782 (Output_reloc::write_rel): Call it.
16783 (Output_reloc::compare): New function.
16784 (Output_data_reloc_base::do_write): Optionally sort relocs.
16785
60b2b4e7
ILT
16786 * configure.ac: If targ_extra_obj is set, link it in.
16787 * configure.tgt: Initialize all variables.
16788 (x86_64*): Set targ_extra_obj and targ_extra_size.
16789 * configure: Rebuild.
16790
8825ac63
ILT
16791 * object.cc (Sized_relobj::include_section_group): Adjust section
16792 indexes read from group data. Build vector to pass to
16793 layout_group.
16794 * layout.cc (Layout::layout_group): Add flags and shndxes
16795 parameters. Remove contents parameter. Change caller. Update
16796 explicit instantiations.
16797 * layout.h (class Layout): Update layout_group declaration.
16798 * output.cc (Output_data_group::Output_data_group): Add flags and
16799 input_shndxes parameters. Remove contents parameter. Change
16800 caller.
16801 (Output_data_group::do_write): Change input_sections_ to
16802 input_shndxes_.
16803 * output.h (class Output_data_group): Update constructor
16804 declaration. Rename input_sections_ to input_shndxes_.
16805 * testsuite/many_sections_test.cc: Add template.
16806
e94cf127
CC
168072008-04-30 Cary Coutant <ccoutant@google.com>
16808
4418b2d5
CC
16809 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16810
e94cf127
CC
16811 * layout.cc (Layout::include_section): Refactored check for debug
16812 info section.
16813 (Layout::add_comdat): Add new parameters. Change type
16814 of signature parameter. Add object and shndx to signatures table.
16815 (Layout::find_kept_object): New function.
16816 * layout.h: Include <cstring>.
16817 (Layout::is_debug_info_section): New function.
16818 (Layout::add_comdat): Add new parameters.
16819 (Layout::find_kept_object): New function.
16820 (Layout::Kept_section): New struct.
16821 (Layout::Signatures): Change type of map range.
16822 * object.cc (Relobj::output_section_address): New function.
16823 (Sized_relobj::include_section_group): Add new parameters. Change
16824 calls to Layout::add_comdat. Change to build table of kept comdat
16825 groups and table mapping discarded sections to kept sections.
16826 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16827 (Sized_relobj::do_layout): Change calls to include_section_group and
16828 include_linkonce_section.
16829 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16830 value to zero when section is discarded.
16831 (Sized_relobj::map_to_kept_section): New function.
16832 * object.h (Relobj::output_section_address): New function.
16833 (Relobj::Comdat_group): New type.
16834 (Relobj::find_comdat_group): New function.
16835 (Relobj::Comdat_group_table): New type.
16836 (Relobj::Kept_comdat_section): New type.
16837 (Relobj::Kept_comdat_section_table): New type.
16838 (Relobj::add_comdat_group): New function.
16839 (Relobj::set_kept_comdat_section): New function.
16840 (Relobj::get_kept_comdat_section): New function.
16841 (Relobj::comdat_groups_): New field.
16842 (Relobj::kept_comdat_sections_): New field.
16843 (Symbol_value::input_value): Update comment.
16844 (Sized_relobj::map_to_kept_section) New function.
16845 (Sized_relobj::include_linkonce_section): Add new parameter.
16846 * target-reloc.h (Comdat_behavior): New type.
16847 (get_comdat_behavior): New function.
16848 (relocate_section): Add code to map a discarded section to the
16849 corresponding kept section when applying a relocation.
16850
e4e5049b
CS
168512008-04-30 Craig Silverstein <csilvers@google.com>
16852
16853 * dwarf_reader.cc (next_generation_count): New static var.
16854 (Addr2line_cache_entry): New struct.
16855 (addr2line_cache): New static var.
16856 (Dwarf_line_info::one_addr2line): Added caching.
16857 (Dwarf_line_info::clear_addr2line_cache): New function.
16858 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16859 cache-size parameter.
16860 (Dwarf_line_info::one_addr2line_cache): New function.
16861 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16862 new cache-size argument to one_addr2line(), and clear cache.
16863
d09e9154
CC
168642008-04-28 Cary Coutant <ccoutant@google.com>
16865
16866 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16867 R_386_PC8 relocations.
16868
7ef73768
ILT
168692008-04-23 Ian Lance Taylor <iant@google.com>
16870
55438702
ILT
16871 * object.cc (Sized_relobj::include_section_group): Check for
16872 invalid section group.
16873
c165fb93
ILT
16874 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16875 header size.
16876
7ef73768
ILT
16877 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16878 than read for file header.
16879 * archive.cc (Archive::include_member): Likewise.
16880
6194aaab
L
168812008-04-23 Paolo Bonzini <bonzini@gnu.org>
16882
16883 * aclocal.m4: Regenerate.
16884 * configure: Regenerate.
16885
d491d34e
ILT
168862008-04-19 Ian Lance Taylor <iant@google.com>
16887
5ea2bac6
ILT
16888 * version.cc (version_string): Bump to 1.6.
16889
7bc3e21a
ILT
16890 * testsuite/Makefile.am (many_sections_r_test): New target.
16891 (many_sections_r_test_SOURCES): Remove.
16892 (many_sections_r_test_DEPENDENCIES): Remove.
16893 (many_sections_r_test_LDFLAGS): Remove.
16894 (many_sections_r_test_LDADD): Remove.
16895
7fcd3aa9
ILT
16896 * object.cc (Sized_relobj::do_add_symbols): Always pass
16897 local_symbol_count_ to add_from_relobj.
16898
4c94d6ae
ILT
16899 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16900 every thousand variables.
16901 * testsuite/Makefile.in: Rebuild.
16902
d491d34e
ILT
16903 * object.cc (Xindex::initialize_symtab_xindex): New function.
16904 (Xindex::read_symtab_xindex): New function.
16905 (Xindex::sym_xindex_to_shndx): New function.
16906 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16907 available.
16908 (Sized_relobj::do_initialize_xindex): New function.
16909 (Sized_relobj::do_read_symbols): Adjust section links.
16910 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16911 parameter. Change all callers.
16912 (Sized_relobj::include_section_group): Adjust section links and
16913 symbol section indexes.
16914 (Sized_relobj::do_layout): Adjust section links.
16915 (Sized_relobj::do_count_local_symbols): Adjust section links and
16916 symbol section indexes.
16917 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16918 ordinary and special symbols.
16919 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16920 dynsym_xindex parameters. Change all callers. Adjust section
16921 links. Use SHN_XINDEX when needed.
16922 (Sized_relobj::get_symbol_location_info): Adjust section links.
16923 Don't get fooled by special symbols.
16924 * object.h (class Xindex): Define.
16925 (class Object): Add xindex_ parameter. Declare virtual functoin
16926 do_initialize_xindex.
16927 (Object::adjust_sym_shndx): New function.
16928 (Object::set_xindex): New protected function.
16929 (class Symbol_value): Add is_ordinary_shndx_ field.
16930 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16931 (Symbol_value::value): Assert ordinary section.
16932 (Symbol_value::initialize_input_to_output_map): Likewise.
16933 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16934 Change all callers.
16935 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16936 all callers.
16937 (class Sized_relobj): Update declarations.
16938 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16939 parameter. Change all callers.
16940 (Sized_relobj::adjust_shndx): New function.
16941 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16942 field.
16943 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16944 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16945 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16946 (Sized_dynobj::read_dynsym_section): Adjust section links.
16947 (Sized_dynobj::read_dynamic): Likewise.
16948 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16949 section links.
16950 (Sized_dynobj::do_initialize_xindex): New function.
16951 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16952 do_initialize_xindex.
16953 (Sized_dynobj::adjust_shndx): New function.
16954 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16955 dynsym_xindex_ fields.
16956 (Layout::finalize): Add a call to set_section_indexes before
16957 creating the symtab sections.
16958 (Layout::set_section_indexes): Don't do anything if the section
16959 already has a section index.
16960 (Layout::create_symtab_sections): Add shnum parameter. Change
16961 caller. Create .symtab_shndx section if needed.
16962 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16963 caller.
16964 (Layout::allocated_output_section_count): New function.
16965 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16966 needed.
16967 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16968 fields. Update declarations.
16969 (Layout::symtab_xindex): New function.
16970 (Layout::dynsym_xindex): New function.
16971 (class Write_symbols_task): Add layout_ field.
16972 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16973 Change caller.
16974 * output.cc (Output_section_headers::Output_section_headers): Add
16975 shstrtab_section parameter. Change all callers.
16976 (Output_section_headers::do_sized_write): Store overflow values
16977 for section count and section string table section index in
16978 section header zero.
16979 (Output_file_header::do_sized_write): Check for overflow of
16980 section count and section string table section index.
16981 (Output_symtab_xindex::do_write): New function.
16982 (Output_symtab_xindex::endian_do_write): New function.
16983 * output.h (class Output_section_headers): Add shstrtab_section_.
16984 Update declarations.
16985 (class Output_symtab_xindex): Define.
16986 (Output_section::has_out_shndx): New function.
16987 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16988 field.
16989 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16990 Change all callers.
16991 (Sized_symbol::init): Likewise.
16992 (Symbol::output_section): Check for ordinary symbol.
16993 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16994 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16995 callers.
16996 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16997 Change all callers. Simplify handling of symbols from sections
16998 not included in the link.
16999 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17000 distinction.
17001 (Weak_alias_sorter::operator()): Assert that symbols are
17002 ordinary.
17003 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17004 distinction.
17005 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17006 parameters. Change all callers.
17007 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17008 symbol distinction. Use SHN_XINDEX when needed.
17009 (Symbol_table::write_section_symbol): Add symtab_xindex
17010 parameter. Change all callers.
17011 (Symbol_table::sized_write_section_symbol): Likewise. Use
17012 SHN_XINDEX when needed.
17013 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17014 declarations.
17015 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17016 (Symbol::is_defined): Check is_ordinary.
17017 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17018 (Symbol::is_absolute, Symbol::is_common): Likewise.
17019 (class Sized_symbol): Update declarations.
17020 (class Symbol_table): Update declarations.
17021 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17022 parameters. Change all callers.
17023 (Sized_symbol::override): Likewise.
17024 (Symbol_table::override): Likewise.
17025 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17026 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17027 is_ordinary, and orig_st_shndx parameters. Change all callers.
17028 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17029 to be in an ordinary section.
17030 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17031 object and is_ordinary parameters. Change all callers.
17032 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17033 Change all callers. Don't add undefined or non-ordinary symbols
17034 to reloc_map_.
17035 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17036 Change all callers.
17037 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17038 declarations.
17039 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17040 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17041 (Sized_relobj::relocate_sections): Likewise.
17042 * target-reloc.h (scan_relocs): Adjust section symbol index.
17043 (scan_relocatable_relocs): Likewise.
17044 * i386.cc (Scan::local): Check for ordinary symbols.
17045 * sparc.cc (Scan::local): Likewise.
17046 * x86_64.cc (Scan::local): Likewise.
17047 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17048 to symbol_section_and_value.
17049 * testsuite/many_sections_test.cc: New file.
17050 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17051 (check_PROGRAMS): Add many_sections_test.
17052 (many_sections_test_SOURCES): Define.
17053 (many_sections_test_DEPENDENCIES): Define.
17054 (many_sections_test_LDFLAGS): Define.
17055 (BUILT_SOURCES): Add many_sections_define.h.
17056 (many_sections_define.h): New target.
17057 (BUILT_SOURCES): Add many_sections_check.h.
17058 (many_sections_check.h): New target.
17059 (check_PROGRAMS): Add many_sections_r_test.
17060 (many_sections_r_test_SOURCES): Define.
17061 (many_sections_r_test_DEPENDENCIES): Define.
17062 (many_sections_r_test_LDFLAGS): Define.
17063 (many_sections_r_test_LDADD): Define.
17064 (many_sections_r_test.o): New target.
17065 * testsuite/Makefile.in: Rebuild.
17066
c5818ff1
CC
170672008-04-17 Cary Coutant <ccoutant@google.com>
17068
17069 * errors.cc (Errors::info): New function.
17070 (gold_info): New function.
17071 * errors.h (Errors::info): New function.
17072 * gold.h (gold_info): New function.
17073 * object.cc (Input_objects::add_object): Print trace output.
17074 * options.cc (options::parse_set): New function.
17075 (General_options::parse_wrap): Deleted.
17076 (General_options::General_options): Deleted initializer.
17077 * options.h (options::String_set): New typedef.
17078 (options::parse_set): New function.
17079 (DEFINE_set): New macro.
17080 (General_options::wrap): Changed to use DEFINE_set. Changed
17081 callers of any_wrap_symbols and is_wrap_symbol.
17082 (General_options::trace, General_options::trace_symbol):
17083 New options.
17084 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17085 (General_options::wrap_symbols_): Deleted.
17086 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17087
b5be4a7c
DM
170882008-04-17 David S. Miller <davem@davemloft.net>
17089
17090 * options.cc (General_options::parse_V): New function.
17091 * options.h: Add entries for -V and -Qy.
17092
155a0dd7
ILT
170932008-04-17 Ian Lance Taylor <iant@google.com>
17094
17095 * common.cc (Symbol_table::allocate_commons): Remove options
17096 parameter. Change caller.
17097 (Symbol_table::do_allocate_commons): Remove options parameter.
17098 Change caller. Just call do_allocate_commons_list twice.
17099 (Symbol_table::do_allocate_commons_list): New function, broken out
17100 of do_allocate_commons.
17101 * common.h (class Allocate_commons_task): Remove options_ field.
17102 Update constructor.
17103 * symtab.cc (Symbol_table::Symbol_table): Initialize
17104 tls_commons_.
17105 (Symbol_table::add_from_object): Put TLS common symbols on
17106 tls_commons_ list.
17107 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17108 which are IN_OUTPUT_DATA.
17109 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17110 allocate_commons and do_allocate_commons declarations. Declare
17111 do_allocate_commons_list.
17112 * gold.cc (queue_middle_tasks): Update creation of
17113 Allocate_commons_task to not pass options.
17114 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17115 (TLS_TEST_C_FLAGS): New variable.
17116 (tls_test_c_pic.o): New target.
17117 (tls_test_shared.so): Link in tls_test_c_pic.o.
17118 (tls_test_c_pic_ie.o): New target.
17119 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17120 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17121 (tls_test_c.o): New target.
17122 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17123 (tls_pic_test_LDADD): Likewise.
17124 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17125 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17126 (tls_test_c_gnu2.o): New target.
17127 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17128 tls_test_c_gnu2.o.
17129 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17130 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17131 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17132 * testsuite/tls_test.cc: Include "config.h".
17133 (t_last): Call t11_last.
17134 * testsuite/tls_test.h (t11, t11_last): Declare.
17135 * testsuite/tls_test_c.c: New file.
17136 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17137 * configure.ac: Check for OpenMP support.
17138 * configure, config.in, Makefile.in: Rebuild.
17139 * testsuite/Makefile.in: Rebuild.
17140
edfbb029
CC
171412008-04-16 Cary Coutant <ccoutant@google.com>
17142
17143 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17144 (Target_i386::tls_base_symbol_defined_): New field.
17145 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17146 (Target_i386::Scan::global): Likewise.
17147 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17148 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17149 (Target_x86_64::tls_base_symbol_defined_): New field.
17150 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17151 (Target_x86_64::Scan::global): Likewise.
17152
f3c69fca
CC
171532008-04-16 Cary Coutant <ccoutant@google.com>
17154
17155 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17156 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17157 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17158 building shared libraries.
17159 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17160 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17161 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17162 * testsuite/Makefile.in: Rebuild.
17163 * testsuite/weak_undef.h: New file.
17164 * testsuite/weak_undef_file1.cc: Add extra test cases.
17165 * testsuite/weak_undef_file2.cc: Likewise.
17166 * testsuite/weak_undef_test.cc: Likewise.
17167
7c414435
DM
171682008-04-16 David S. Miller <davem@davemloft.net>
17169
32b769e1
DM
17170 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17171 Add issued_non_pic_error_ field. Declare check_non_pic.
17172 (Target_sparc::Scan::check_non_pic): New function.
17173 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17174 (Target_sparc::Scan::global): Likewise.
17175
11936fb1
DM
17176 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17177 * configure: Rebuild.
17178
7c414435
DM
17179 * options.h (DEFINE_enable): New macro.
17180 (new_dtags): New enable option.
17181 (initfirst, interpose, loadfltr, nodefaultlib,
17182 nodelete, nodlopen, nodump): New -z options.
17183 * layout.cc (Layout:finish_dynamic_section): If new
17184 dtags enabled, emit DT_RUNPATH. Also, emit a
17185 DT_FLAGS_1 containing any specified -z flags.
17186
85c7bf8b
ILT
171872008-04-16 Ian Lance Taylor <iant@google.com>
17188
12c0daef
ILT
17189 * copy-relocs.cc: New file.
17190 * copy-relocs.h: New file.
17191 * reloc.cc: Remove Copy_relocs code.
17192 * reloc.h: Likewise.
17193 * reloc-types.h (struct Reloc_types) [both versions]: Add
17194 get_reloc_addend_noerror.
17195 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17196 variants of add_global which take an addend which must be zero.
17197 * i386.cc: Include "copy-relocs.h".
17198 (class Target_i386): Change type of copy_relocs_ to variable,
17199 update initializer.
17200 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17201 Change all callers.
17202 (Target_i386::do_finalize_sections): Change handling of
17203 copy_relocs_.
17204 * sparc.cc: Include "copy-relocs.h".
17205 (class Target_sparc): Change type of copy_relocs_ to variable,
17206 update initializer.
17207 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17208 Change all callers.
17209 (Target_sparc::do_finalize_sections): Change handling of
17210 copy_relocs_.
17211 * x86_64.cc: Include "copy-relocs.h".
17212 (class Target_x86_64): Change type of copy_relocs_ to variable,
17213 update initializer.
17214 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17215 class. Change all callers.
17216 (Target_x86_64::do_finalize_sections): Change handling of
17217 copy_relocs_.
17218 * Makefile.am (CCFILES): Add copy-relocs.cc.
17219 (HFILES): Add copy-relocs.h.
17220
4f4995b6
ILT
17221 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17222
85c7bf8b
ILT
17223 * testsuite/script_test_4.sh: Permit leading zeroes.
17224
4f2a9edd
ILT
172252008-04-15 Ian Lance Taylor <iant@google.com>
17226
e6188289
ILT
17227 * script-sections.cc (Script_sections::create_segments): Use
17228 header_size_adjustment even when there is enough room for the
17229 headers.
17230 * testsuite/script_test_4.sh: New file.
17231 * testsuite/script_test_4.t: New file.
17232 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17233 (check_DATA): Add script_test_4.stdout.
17234 (MOSTLYCLEANFILES): Likewise.
17235 (script_test_4): New target.
17236 (script_test_4.stdout): New target.
17237 * testsuite/Makefile.in: Rebuild.
17238
4f2a9edd
ILT
17239 * sparc.cc: Add definitions for Output_data_plt_sparc class
17240 constants.
17241
f5314dd5
DM
172422008-04-14 David S. Miller <davem@davemloft.net>
17243
17244 * sparc.cc: New file.
17245 * Makefile.am (TARGETSOURCES): Add sparc.cc
17246 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17247 * configure.tgt: Document targ_extra_size and
17248 targ_extra_big_endian. Add entries for sparc-* and
17249 sparc64-*.
17250 * configure.ac: Handle targ_extra_size and
17251 targ_extra_big_endian.
17252 * Makefile.in: Rebuild.
17253 * configure: Likewise.
17254 * po/POTFILES.in: Likewise.
17255 * po/gold.pot: Likewise.
17256
154e0e9a
ILT
172572008-04-14 Ian Lance Taylor <iant@google.com>
17258
17259 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17260 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17261 in the name/type/flags to section mapping. Don't call
17262 allocate_output_section.
17263 (Layout::choose_output_section): Change parameter from adjust_name
17264 to is_input_section. Don't permit input sections after sections
17265 are attached to segments. Don't call allocate_output_section.
17266 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17267 not write_enable_output_section.
17268 (Layout::make_output_section): Don't push to
17269 unattached_section_list_ nor call attach_to_segment. Call
17270 attach_section_to_segment if sections are attached.
17271 (Layout::attach_sections_to_segments): New function.
17272 (Layout::attach_section_to_segment): New function.
17273 (Layout::attach_allocated_section_to_segment): Rename from
17274 attach_to_segment. Remove flags parameter.
17275 (Layout::allocate_output_section): Remove function.
17276 (Layout::write_enable_output_section): Remove function.
17277 * layout.h (class Layout): Update for above changes. Add new
17278 field sections_are_attached_.
17279 * output.h (Output_section::update_flags_for_input_section): New
17280 function.
17281 * output.cc (Output_section::add_input_section): Call
17282 update_flags_for_input_section.
17283 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17284
009a67a2
CC
172852008-04-11 Cary Coutant <ccoutant@google.com>
17286
17287 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17288 thought unnecessary.
17289 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17290
759b1a24
ILT
172912008-04-11 Ian Lance Taylor <iant@google.com>
17292
17293 * output.h (class Output_section_data): Remove inline definition
17294 of set_addralign.
17295 * output.cc (Output_section_data::set_addralign): New function.
17296
c2b45e22
CC
172972008-04-11 Cary Coutant <ccoutant@google.com>
17298
17299 Add support for TLS descriptors for i386 and x86_64.
17300 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17301 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17302 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17303 GOT_TYPE_TLS_DESC.
17304 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17305 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17306 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17307 relocations.
17308 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17309 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17310 Fix problem with initial-exec relocations.
17311 (Target_i386::Relocate::relocate_tls): Likewise.
17312 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17313 relaxation.
17314 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17315 support for section-plus-offset dynamic table entries.
17316 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17317 (Output_data_dynamic::Dynamic_entry): Add support for
17318 section-plus-offset dynamic table entries.
17319 (Output_data_dynamic::Classification): Likewise.
17320 (Output_data_dynamic::classification_): Renamed offset_.
17321 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17322 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17323 (Target_x86_64::make_plt_section): New function.
17324 (Target_x86_64::reserve_tlsdesc_entries): New function.
17325 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17326 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17327 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17328 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17329 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17330 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17331 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17332 add extra PLT entry for TLS descriptors.
17333 (Output_data_plt_x86_64::got_): New field.
17334 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17335 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17336 fields.
17337 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17338 descriptors.
17339 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17340 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17341 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17342 R_386_TLS_DESC_CALL relocations.
17343 (Target_x86_64::Scan::global): Likewise.
17344 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17345 for TLS descriptors.
17346 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17347 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17348 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17349 GD-to-IE relaxation.
17350 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17351 and TLS_DESCRIPTORS.
17352 * Makefile.in: Rebuild.
17353 * configure: Rebuild.
17354 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17355 (tls_test_shared2.so): New target.
17356 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17357 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17358 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17359 (tls_shared_gd_to_ie_test_LDADD): New variable.
17360 (tls_shared_gnu2_gd_to_ie_test): New target.
17361 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17362 New targets.
17363 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17364 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17365 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17366 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17367 (tls_shared_gnu2_test): New target.
17368 (tls_test_gnu2_shared.so): New target.
17369 (tls_shared_gnu2_test_SOURCES): New variable.
17370 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17371 (tls_shared_gnu2_test_LDFLAGS): New variable.
17372 (tls_shared_gnu2_test_LDADD): New variable.
17373 * testsuite/Makefile.in: Rebuild.
17374 * testsuite/Makefile.
17375
83bfb6b7
ILT
173762008-04-11 Ian Lance Taylor <iant@google.com>
17377
17378 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17379 justsyms.t.
17380 * testsuite/Makefile.in: Rebuild.
17381
17382 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17383 long.
17384 * testsuite/script_test_2.cc (main): Adjust test.
17385
706e1f5e
ILT
173862008-04-11 David S. Miller <davem@davemloft.net>
17387 Ian Lance Taylor <iant@google.com>
17388
17389 * options.h (General_options): Add entries for '-Y' and
17390 '-relax'.
17391 * options.cc (General_options:finalize): If -Y was used, add those
17392 entries to the library path instead of the default "/lib" and
17393 "/usr/lib".
17394
7c98e6bb
DM
173952008-04-11 David S. Miller <davem@davemloft.net>
17396
17397 * testsuite/justsyms.t: Start at 0x100.
17398 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17399 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17400 long.
17401 * testsuite/script_test_2.cc: Adjust string and section length
17402 checks.
7c98e6bb 17403
99a37bfd
ILT
174042008-04-09 Ian Lance Taylor <iant@google.com>
17405
2cefc357
ILT
17406 PR gold/5996
17407 * script-sections.cc (Sections_element::allocate_to_segment): Add
17408 orphan parameter.
17409 (Output_section_definition::allocate_to_segment): Likewise.
17410 (Orphan_output_section::allocate_to_segment): Likewise.
17411 (Script_sections::attach_sections_using_phdrs_clause): Don't
17412 propagate non-PT_LOAD segments to orphan sections.
17413 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17414 readelf rather than objdump.
17415 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17416 .interp section and PT_INTERP segment are the same size.
17417 * testsuite/Makefile.in: Rebuild.
17418
99a37bfd
ILT
17419 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17420 aliases for symbols defined in the same object.
17421 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17422 (weak_alias_test_SOURCES): New variable.
17423 (weak_alias_test_DEPENDENCIES): New variable.
17424 (weak_alias_test_LDFLAGS): New variable.
17425 (weak_alias_test_LDADD): New variable.
17426 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17427 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17428 (weak_alias_test_3.o): New target.
17429 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17430 * testsuite/weak_alias_test_main.cc: New file.
17431 * testsuite/weak_alias_test_1.cc: New file.
17432 * testsuite/weak_alias_test_2.cc: New file.
17433 * testsuite/weak_alias_test_3.cc: New file.
17434
780e49c5
ILT
174352008-04-08 Ian Lance Taylor <iant@google.com>
17436
cdb0b8f5
ILT
17437 * options.h (class General_options): Add --noinhibit-exec option.
17438 * main.cc (main): Check --noinhibit-exec.
17439
0864d551
ILT
17440 * options.h (class General_options): Define --wrap as a special
17441 option. Add wrap_symbols_ field.
17442 (General_options::any_wrap_symbols): New function.
17443 (General_options::is_wrap_symbol): New function.
17444 * options.cc (General_options::parse_wrap): New function.
17445 (General_options::General_options): Initialize wrap_symbols_.
17446 * symtab.cc (Symbol_table::wrap_symbol): New function.
17447 (Symbol_table::add_from_object): Handle --wrap.
17448 * symtab.h (class Symbol_table): Declare wrap_symbol.
17449 * target.h (Target::wrap_char): New function.
17450 (Target::Target_info): Add wrap_char field.
17451 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17452 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17453 * testsuite/testfile.cc (Target_test::test_target_info):
17454 Likewise.
17455
789aa6de
ILT
17456 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17457 there is one.
17458
2c38906f
ILT
17459 * layout.h (class Layout): Add added_eh_frame_data_ field.
17460 * layout.cc (Layout::Layout): Initialize new field.
17461 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17462 output section until we find a section we merged successfully.
17463 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17464 that the size be non-zero.
17465
780e49c5
ILT
17466 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17467 qualifier.
17468
7fcd0256
ILT
174692008-04-08 Craig Silverstein <csilvers@google.com>
17470
17471 * configure.ac: Export new conditional variable HAVE_ZLIB.
17472 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17473 on HAVE_ZLIB.
17474 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17475 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17476
6835af53
ILT
174772008-04-07 Ian Lance Taylor <iant@google.com>
17478
e24f324c
ILT
17479 * version.cc (version_string): Set to "1.5".
17480
a036edd8
ILT
17481 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17482 Add issued_non_pic_error_ field. Declare check_non_pic.
17483 (Target_x86_64::Scan::check_non_pic): New function.
17484 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17485 (Target_x86_64::Scan::global): Likewise.
17486
624f8810
ILT
17487 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17488 addend parameter. Change caller. Handle merge sections.
17489 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17490 Address to Addend. Don't add in the result of
17491 local_section_offset, pass down the addend and use the returned
17492 value.
17493 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17494 Update declarations of local_section_offset and symbol_value.
17495 * testsuite/two_file_test_1.cc (t18): New function.
17496 * testsuite/two_file_test_2.cc (f18): New function.
17497 * testsuite/two_file_test_main.cc (main): Call t18.
17498 * testsuite/two_file_test.h (t18, f18): Declare.
17499
6835af53
ILT
17500 * configure.ac: Don't test for objdump, c++filt, or readelf.
17501 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17502 conditionals.
17503 (TEST_READELF): New variable.
17504 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17505 (check_PROGRAMS): Add two_file_strip_test.
17506 (two_file_strip_test): New target.
17507 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17508 (two_file_same_shared_strip_test_SOURCES): New variable.
17509 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17510 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17511 (two_file_same_shared_strip_test_LDADD): New variable.
17512 (two_file_shared_strip.so): New target.
17513 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17514 (ver_test_5.syms, ver_test_7.syms): Likewise.
17515 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17516 (strip_test_3.stdout): Use TEST_OBJDUMP.
17517 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17518
86925eef
CC
175192008-04-04 Cary Coutant <ccoutant@google.com>
17520
17521 * symtab.h (Symbol::is_weak_undefined): New function.
17522 (Symbol::is_strong_undefined): New function.
17523 (Symbol::is_absolute): New function.
17524 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17525 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17526 absolute symbols.
17527 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17528 (weak_undef_test): New target.
17529 * testsuite/Makefile.in: Rebuild.
17530 * testsuite/weak_undef_file1.cc: New file.
17531 * testsuite/weak_undef_file2.cc: New file.
17532 * testsuite/weak_undef_test.cc: New file.
17533
126f3ece
ILT
175342008-04-03 Craig Silverstein <csilvers@google.com>
17535
17536 * compressed_output.h (class Output_compressed_section): Use
17537 unsigned buffer.
17538 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17539 add zlib header.
17540 (zlib_compressed_suffix): Removed.
17541 (Output_compressed_section::set_final_data_size): Use unsigned
17542 buffers.
17543 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17544 Fix linker invocation.
17545 (flagstest_o_specialfile_and_compress_debug_sections):
17546 Likewise.
17547 * testsuite/Makefile.in: Regenerated.
17548
deae2a14
DM
175492008-04-02 David S. Miller <davem@davemloft.net>
17550
17551 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17552 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17553
70752818
ILT
175542008-04-02 Craig Silverstein <csilvers@google.com>
17555
17556 * TODO: New file.
17557
39d0cb0e
ILT
175582008-04-02 Ian Lance Taylor <iant@google.com>
17559
17560 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17561 parameters. Update for new key type to views_. Change all
17562 callers.
17563 (File_read::read): Adjust for byteshift in returned view.
17564 (File_read::add_view): New function, broken out of
17565 find_and_make_view.
17566 (File_read::make_view): New function, broken out of
17567 find_and_make_view.
17568 (File_read::find_or_make_view): Add offset and aligned
17569 parameters. Rewrite accordingly. Change all callers.
17570 (File_read::get_view): Add offset and aligned parameters. Adjust
17571 for byteshift in return value.
17572 (File_read::get_lasting_view): Likewise.
17573 * fileread.h (class File_read): Update declarations.
17574 (class File_read::View): Add byteshift_ field. Add byteshift to
17575 constructor. Add byteshift method.
17576 * archive.h (Archive::clear_uncached_views): New function.
17577 (Archive::get_view): Add aligned parameter. Change all callers.
17578 * object.h (Object::get_view): Add aligned parameter. Change all
17579 callers.
17580 (Object::get_lasting_view): Likewise.
17581
17582 * fileread.cc (File_read::release): Don't call clear_views if
17583 there are multiple objects.
17584 * fileread.h (File_read::clear_uncached_views): New function.
17585 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17586 on the archive.
17587
a1207466
CC
175882008-03-31 Cary Coutant <ccoutant@google.com>
17589
17590 Add thin archive support.
17591 * archive.cc (Archive::armagt): New const.
17592 (Archive::setup): Remove task parameter and calls to unlock.
17593 (Archive::unlock_nested_archives): New function.
17594 (Archive::read_header): Add nested_off parameter. Change
17595 all callers.
17596 (Archive::interpret_header): Likewise.
17597 (Archive::include_all_members): Change to handle thin
17598 archives.
17599 (Archive::include_member): Likewise.
17600 * archive.h (Archive::Archive): Add new parameters and
17601 initializers.
17602 (Archive::armagt): New const.
17603 (Archive::setup): Remove task parameter.
17604 (Archive::unlock_nested_archives): New function.
17605 (Archive::read_header): Add nested_off parameter.
17606 (Archive::interpret_header): Likewise.
17607 (Archive::Nested_archive_table): New typedef.
17608 (Archive::is_thin_archive_): New field.
17609 (Archive::nested_archives_): New field.
17610 (Archive::options_): New field.
17611 (Archive::dirpath_): New field.
17612 (Archive::task_): New field.
17613 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17614 for thin archives. Pass additional parameters to
17615 Archive::Archive. Unlock the archive file after calling
17616 Archive::setup.
cd536b21 17617
479f6503
ILT
176182008-03-29 Ian Lance Taylor <iant@google.com>
17619
686c8caf
ILT
17620 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17621 version symbol to be local.
17622 * testsuite/ver_test_4.sh: New file.
17623 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17624 (check_DATA): Add ver_test_4.syms.
17625 (ver_test_4.syms): New target.
17626 * testsuite/Makefile.in: Rebuild.
17627
ab794b6b
ILT
17628 * output.cc
17629 (Output_section::Input_section_sort_entry::has_priority): New
17630 function.
17631 (Output_section::Input_section_sort_entry::match_file_name): New
17632 function.
17633 (Output_section::Input_section_sort_entry::match_section_name):
17634 Remove.
17635 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17636 Remove.
17637 (Output_section::Input_section_sort_entry::match_section_file):
17638 Remove.
17639 (Output_section::Input_section_sort_compare::operator()): Rewrite
17640 using new Input_section_sort_entry functions. Sort crtbegin and
17641 crtend first. Sort sections with no priority before sections with
17642 a priority.
17643 * testsuite/initpri1.c (d3): Check j != 4.
17644 (cd5): New constructor/destructor function.
17645 (main): Check j != 2.
17646
479f6503
ILT
17647 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17648 new symbol when resolving, don't call set_is_default.
17649 * testsuite/ver_test_7.cc: New file.
17650 * testsuite/ver_test_7.sh: New file.
17651 * testsuite/Makefile.am (ver_test_7.so): New target.
17652 (ver_test_7.o): New target.
17653 (check_SCRIPTS): Add ver_test_7.sh.
17654 (check_DATA): Add ver_test_7.syms.
17655 (ver_test_7.syms): New target.
17656
2fd32231
ILT
176572008-03-28 Ian Lance Taylor <iant@google.com>
17658
17659 * layout.cc (Layout::layout): If we see an input section with a
17660 name that needs sorting, set the must_sort flag for the output
17661 section.
17662 (Layout::make_output_section): If the name of the output section
17663 indicates that it might require sorting, set the may_sort flag.
17664 * output.h (Output_section::may_sort_attached_input_sections): New
17665 function.
17666 (Output_section::set_may_sort_attached_input_sections): New
17667 function.
17668 (Output_section::must_sort_attached_input_sections): New
17669 function.
17670 (Output_section::set_must_sort_attached_input_sections): New
17671 function.
17672 (class Output_section): Declare Input_section_sort_entry. Define
17673 Input_section_sort_compare. Declare
17674 sort_attached_input_sections. Add new fields:
17675 may_sort_attached_input_sections_,
17676 must_sort_attached_input_sections_,
17677 attached_input_sections_are_sorted_.
17678 * output.cc (Output_section::Output_section): Initialize new
17679 fields.
17680 (Output_section::add_input_section): Add an entry to
17681 input_sections_ if may_sort or must_sort are true.
17682 (Output_section::set_final_data_size): Call
17683 sort_attached_input_sections if necessary.
17684 (Output_section::Input_section_sort_entry): Define new class.
17685 (Output_section::Input_section_sort_compare::operator()): New
17686 function.
17687 (Output_section::sort_attached_input_sections): New function.
17688 * configure.ac: Check whether the compiler supports constructor
17689 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17690 * testsuite/initpri1.c: New file.
17691 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17692 CONSTRUCTOR_PRIORITY.
17693 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17694 (initpri1_LDFLAGS): New variable.
17695 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17696
18e6b24e
ILT
176972008-03-27 Ian Lance Taylor <iant@google.com>
17698
49bdd526
ILT
17699 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17700 * testsuite/common_test_1.c: New file.
17701 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17702 (common_test_1_SOURCES): New variable.
17703 (common_test_1_DEPENDENCIES): New variable.
17704 (common_test_1_LDFLAGS): New variable.
17705
18e6b24e
ILT
17706 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17707 and commons_ correctly when NAME/VERSION does not override
17708 NAME/NULL.
17709 * testsuite/ver_test_6.c: New file.
17710 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17711 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17712 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17713
04bf7072
ILT
177142008-03-26 Ian Lance Taylor <iant@google.com>
17715
5871526f
ILT
17716 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17717 of an undefined symbol from a version script.
17718 * testsuite/Makefile.am (ver_test_5.so): New target.
17719 (ver_test_5.o): New target.
17720 (check_SCRIPTS): Add ver_test_5.sh.
17721 (check_DATA): Add ver_test_5.syms.
17722 (ver_test_5.syms): New target.
17723 * testsuite/ver_test_5.cc: New file.
17724 * testsuite/ver_test_5.script: New file.
17725 * testsuite/ver_test_5.sh: New file.
17726 * Makefile.in, testsuite/Makefile.in: Rebuild.
17727
04bf7072
ILT
17728 PR gold/5986
17729 Fix problems building gold with gcc 4.3.0.
17730 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17731 (gold_error_at_location, gold_warning_at_location): Use it.
17732 * configure.ac: Check whether we can compile and use a template
17733 function with a printf attribute.
17734 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17735 when jumping over bytes.
17736 * object.cc: Instantiate Object::read_section_data.
17737 * debug.h: Include <cstring>
17738 * dwarf_reader.cc: Include <algorithm>
17739 * main.cc: Include <cstring>.
17740 * options.cc: Include <cstring>.
17741 * output.cc: Include <cstring>.
17742 * script.cc: Include <cstring>.
17743 * script.h: Include <string>.
17744 * symtab.cc: Include <cstring> and <algorithm>.
17745 * target-select.cc: Include <cstring>.
17746 * version.cc: Include <string>.
17747 * testsuite/testmain.cc: Include <cstdlib>.
17748 * configure, config.in: Rebuild.
17749
874c5b28
ILT
177502008-03-25 Ian Lance Taylor <iant@google.com>
17751
819d6c3a
ILT
17752 * options.cc: Include "../bfd/bfdver.h".
17753 (options::help): Print bug reporting address.
17754
f4b2c6f5
ILT
17755 * version.cc (print_version): Adjust output for current value of
17756 BFD_VERSION_STRING.
17757
17758 * NEWS: New file.
17759
e96caa79
ILT
17760 * options.cc (options::help): Print list of supported targets.
17761 * target-select.h: Include <vector>.
17762 (class Target_selector): Make machine_, size_, and is_big_endian_
17763 fields const. Add bfd_name_ and instantiated_target_ fields.
17764 (Target_selector::Target_selector): Add bfd_name parameter.
17765 (Target_selector::recognize): Make non-virtual, call
17766 do_recognize.
17767 (Target_selector::recognize_by_name): Make non-virtual, call
17768 do_recognize_by_name.
17769 (Target_selector::supported_names): New function.
17770 (Target_selector::bfd_name): New function.
17771 (Target_selector::do_instantiate_target): New pure virtual
17772 function.
17773 (Target_selector::do_recognize): New virtual function.
17774 (Target_selector::do_recognize_by_name): New virtual function.
17775 (Target_selector::instantiate_target): New private function.
17776 (supported_target_names): Declare.
17777 * target-select.cc (Target_selector::Target_selector): Update for
17778 new parameter and fields.
17779 (select_target_by_name): Check that the name matches before
17780 calling recognize_by_name.
17781 (supported_target_names): New function.
17782 * i386.cc (class Target_selector_i386): Update Target_selector
17783 constructor call. Remove recognize and recognize_by_name. Add
17784 do_instantiate_target.
17785 * x86_64.cc (class Target_selector_x86_64): Likewise.
17786 * testsuite/testfile.cc (class Target_selector_test): Update for
17787 changes to Target_selector.
17788
874c5b28
ILT
17789 * README: Rewrite, with some notes on unsupported features.
17790
0a65a3a7
CC
177912008-03-24 Cary Coutant <ccoutant@google.com>
17792
17793 * i386.cc (Target_i386::Got_type): New enum declaration.
17794 (Target_i386::Scan::local): Updated callers of Output_data_got
17795 member functions.
17796 (Target_i386::Scan::global): Likewise.
17797 (Target_i386::Relocate::relocate): Likewise.
17798 (Target_i386::Relocate::relocate_tls): Likewise.
17799 * object.h (Got_offset_list): New class.
17800 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17801 (Sized_relobj::local_got_offset): Likewise.
17802 (Sized_relobj::set_local_got_offset): Likewise.
17803 (Sized_relobj::local_has_tls_got_offset): Removed.
17804 (Sized_relobj::local_tls_got_offset): Removed.
17805 (Sized_relobj::set_local_tls_got_offset): Removed.
17806 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17807 * output.cc (Output_data_got::add_global): Added got_type parameter.
17808 (Output_data_got::add_global_with_rel): Likewise.
17809 (Output_data_got::add_global_with_rela): Likewise.
17810 (Output_data_got::add_global_pair_with_rel): New function.
17811 (Output_data_got::add_global_pair_with_rela): New function.
17812 (Output_data_got::add_local): Added got_type parameter.
17813 (Output_data_got::add_local_with_rel): Likewise.
17814 (Output_data_got::add_local_with_rela): Likewise.
17815 (Output_data_got::add_local_pair_with_rel): New function.
17816 (Output_data_got::add_local_pair_with_rela): New function.
17817 (Output_data_got::add_global_tls): Removed.
17818 (Output_data_got::add_global_tls_with_rel): Removed.
17819 (Output_data_got::add_global_tls_with_rela): Removed.
17820 (Output_data_got::add_local_tls): Removed.
17821 (Output_data_got::add_local_tls_with_rel): Removed.
17822 (Output_data_got::add_local_tls_with_rela): Removed.
17823 * output.h (Output_data_got::add_global): Added got_type parameter.
17824 (Output_data_got::add_global_with_rel): Likewise.
17825 (Output_data_got::add_global_with_rela): Likewise.
17826 (Output_data_got::add_global_pair_with_rel): New function.
17827 (Output_data_got::add_global_pair_with_rela): New function.
17828 (Output_data_got::add_local): Added got_type parameter.
17829 (Output_data_got::add_local_with_rel): Likewise.
17830 (Output_data_got::add_local_with_rela): Likewise.
17831 (Output_data_got::add_local_pair_with_rel): New function.
17832 (Output_data_got::add_local_pair_with_rela): New function.
17833 (Output_data_got::add_global_tls): Removed.
17834 (Output_data_got::add_global_tls_with_rel): Removed.
17835 (Output_data_got::add_global_tls_with_rela): Removed.
17836 (Output_data_got::add_local_tls): Removed.
17837 (Output_data_got::add_local_tls_with_rel): Removed.
17838 (Output_data_got::add_local_tls_with_rela): Removed.
17839 * resolve.cc (Symbol::override_base_with_special): Removed
17840 reference to has_got_offset_ field.
17841 * symtab.cc (Symbol::init_fields): Replaced initialization
17842 of got_offset_ with got_offsets_. Removed initialization
17843 of has_got_offset_
53fcba31 17844 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17845 (Symbol::got_offset): Likewise.
17846 (Symbol::set_got_offset): Likewise.
17847 (Symbol::has_tls_got_offset): Removed.
17848 (Symbol::tls_got_offset): Removed.
17849 (Symbol::set_tls_got_offset): Removed.
17850 (Symbol::got_offset_): Removed.
17851 (Symbol::tls_mod_got_offset_): Removed.
17852 (Symbol::tls_pair_got_offset_): Removed.
17853 (Symbol::got_offsets_): New field.
17854 (Symbol::has_got_offset): Removed.
17855 (Symbol::has_tls_mod_got_offset): Removed.
17856 (Symbol::has_tls_pair_got_offset): Removed.
17857 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17858 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17859 member functions.
17860 (Target_x86_64::Scan::global): Likewise.
17861 (Target_x86_64::Relocate::relocate): Likewise.
17862 (Target_x86_64::Relocate::relocate_tls): Likewise.
17863
bd52eafb
BE
178642008-03-25 Ben Elliston <bje@au.ibm.com>
17865
17866 * yyscript.y: Fix spelling error in comment.
17867
8b105e34
ILT
178682008-03-24 Ian Lance Taylor <iant@google.com>
17869
8ed814a9
ILT
17870 * options.h (class General_options): Define build_id option.
17871 * layout.h (class Layout): Declare write_build_id, create_note,
17872 create_build_id. Add build_id_note_ member.
17873 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17874 "libiberty.h", "md5.h", "sha1.h".
17875 (Layout::Layout): Initialize eh_frame_data_,
17876 eh_frame_hdr_section_, and build_id_note_.
17877 (Layout::finalize): Call create_build_id.
17878 (Layout::create_note): New function, broken out of
17879 Layout::create_gold_note.
17880 (Layout::create_gold_note): Call create_note.
17881 (Layout::create_build_id): New function.
17882 (Layout::write_build_id): New function.
17883 (Close_task_runner::run): Call write_build_id.
17884
8b105e34
ILT
17885 * x86_64.cc: Correct license to GPLv3.
17886
086a1841
ILT
178872008-03-23 Ian Lance Taylor <iant@google.com>
17888
17889 * options.cc: Include "demangle.h".
17890 (parse_optional_string): New function.
17891 (parse_long_option): Handle takes_optional_argument.
17892 (parse_short_option): Update dash_z initializer. Handle
17893 takes_optional_argument.
17894 (General_options::General_options): Initialize do_demangle_.
17895 (General_options::finalize): Set do_demangle_. Handle demangling
17896 style.
17897 * options.h (parse_optional_string): Declare.
17898 (struct One_option): Add optional_arg field. Update constructor.
17899 Update call constructor calls. Add takes_optional_argument
17900 function.
17901 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17902 (DEFINE_optional_string): Define.
17903 (General_options::demangle): Change from DEFINE_bool to
17904 DEFINE_optional_string.
17905 (General_options::no_demangle): New function.
17906 (General_options::do_demangle): New function.
17907 (General_options::set_do_demangle): New function.
17908 (General_options::execstack_status_): Move definition to end of
17909 class definition.
17910 (General_options::static_): Likewise.
17911 (General_options::do_demangle_): New field.
17912 * object.cc (big_endian>::get_symbol_location_info): Call
17913 Options::do_demangle, not Options::demangle.
17914 * symtab.cc (demangle): Likewise.
17915
cbb93e63
ILT
179162008-03-22 Ian Lance Taylor <iant@google.com>
17917
17918 * gold.h: Include <cstddef> and <sys/types.h>
17919 * options.h: Include <cstring>.
17920
ec531623
ILT
179212008-03-21 Ian Lance Taylor <iant@google.com>
17922
17923 * Added source code to GNU binutils.
752937aa 17924\f
b90efa5b 17925Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17926
17927Copying and distribution of this file, with or without modification,
17928are permitted in any medium without royalty provided the copyright
17929notice and this notice are preserved.
17930
17931Local Variables:
17932mode: change-log
17933left-margin: 8
17934fill-column: 74
17935version-control: never
17936End:
This page took 1.190066 seconds and 4 git commands to generate.