Add aarch64-specific --no-apply-dynamic-relocs option.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
0eccf19f
CC
12015-11-05 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/19163
4 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
5 certain relocations if --no-apply-dynamic-relocs is set.
6 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
7
c1e7d6a8
AM
82015-11-03 Alan Modra <amodra@gmail.com>
9
10 * po/POTFILES.in: Regenerate.
11
26f187cd
NC
122015-10-30 Nick Clifton <nickc@redhat.com>
13
14 * po/zh_CN.po: New (simplified) Chinese translation.
15
41e83f2b
L
162015-10-29 H.J. Lu <hongjiu.lu@intel.com>
17
18 PR gold/19184
19 * incremental.cc (Got_plt_view_info): Add got_entry_size.
20 (Local_got_offset_visitor::visit): Replace got_entry_size_
21 with info_.got_entry_size.
22 (Local_got_offset_visitor::got_entry_size_): Removed.
23 (Global_got_offset_visitor::visit): Replace got_entry_size_
24 with info_.got_entry_size.
25 (Global_got_offset_visitor::got_entry_size_): Removed.
26 (Output_section_incremental_inputs::write_got_plt): Initialize
27 view_info.got_entry_size.
28 * target.h (Sized_target::got_entry_size): New virtual function.
29 * x86_64.cc (Target_x86_64::got_entry_size): New function.
30
238830c6
MK
312015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
32
33 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
34 * testsuite/script_test_12a.c: Likewise.
35 * testsuite/script_test_1a.cc: Likewise.
36 * testsuite/script_test_2.cc: Likewise.
37
bd890911
MK
382015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
39
40 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
41
a817ff49
MK
422015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
43
44 PR gold/18959
45 * stringpool.cc (Stringpool_template::new_key_offset): Align all
46 strings, even zero-length.
47 (Stringpool_template::set_string_offsets): Likewise.
48
e79a4bad
MK
492015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
50
51 * s390.cc: New file.
52 * Makefile.am (TARGETSOURCES): Add s390.cc.
53 (ALL_TARGETOBJS): Add s390.o.
54 * Makefile.in: Regenerate.
55 * configure.ac: Add s390 support.
56 * configure: Regenerate.
57 * configure.tgt: Add s390-*-* and s390x-*-*.
58 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
59 support.
60
6f97897d
MK
612015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
62
63 * archive.cc (Archive::sym64name): New const.
64 (Archive::setup): Add support for SYM64 armap.
65 (Archive::read_armap): Likewise.
66 (Archive::interpret_header): Likewise.
67 (Archive::const_iterator::read_next_header): Likewise.
68 * archive.h (Archive::sym64name): New const.
69 (Archive::read_armap): Add mapsize template parameter.
70
8d9743bd
MK
712015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
72
73 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
74 target-specific entry size.
75 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
76 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
77 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
78 hash_entry_size.
79 * target.h (Target::hash_entry_size): New method.
80 (Target::Target_info::hash_entry_size): New data member.
81
82 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
83 * arm.cc (Target_arm::arm_info): Likewise.
84 (Target_arm_nacl::arm_nacl_info): Likewise.
85 * i386.cc (Target_i386::i386_info): Likewise.
86 (Target_i386_nacl::i386_nacl_info): Likewise.
87 (Target_iamcu::iamcu_info): Likewise.
88 * mips.cc (Target_mips::mips_info): Likewise.
89 (Target_mips_nacl::mips_nacl_info): Likewise.
90 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
91 * sparc.cc (Target_sparc::sparc_info): Likewise.
92 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
93 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
94 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
95 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
96
3043c1ab
L
972015-10-28 H.J. Lu <hongjiu.lu@intel.com>
98
99 PR gold/19177
100 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
101 and R_386_GOT32X relocations without base register.
102
4d2f5d58
HS
1032015-10.27 Han Shen <shenhan@google.com>
104
105 PR gold/19042 - unsupported reloc 311/312.
106
107 * aarch64.cc (Target_aarch64::Scan::local): Add support for
108 reloc 311/312.
109
2891b491
L
1102015-10-22 H.J. Lu <hongjiu.lu@intel.com>
111
112 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
113 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
114 as R_X86_64_GOTPCREL.
115 (Target_x86_64<size>::Scan::local): Likewise.
116 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
117 Likewise.
118 (Target_x86_64<size>::Scan::global): Likewise.
119 (Target_x86_64<size>::Relocate::relocate): Likewise.
120 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
121 Likewise.
122
493d4b48
L
1232015-10-22 H.J. Lu <hongjiu.lu@intel.com>
124
125 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
126 R_386_GOT32X the same as R_386_GOT32.
127 (Target_i386::Scan::local): Likewise.
128 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
129 (Target_i386::Scan::global): Likewise.
130 (Target_i386::Relocate::relocate): Likewise.
131 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
132 Likewise.
133
0fd15345
L
1342015-10-20 H.J. Lu <hongjiu.lu@intel.com>
135
136 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
137 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
138 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
139 x86_64_mov_to_lea1.o.
140 * testsuite/Makefile.in: Regenerated.
141
64571972
L
1422015-10-16 H.J. Lu <hongjiu.lu@intel.com>
143
144 PR gold/19119
145 * options.h (General_options): Remove "obsolete" from -m.
146 * parameters.cc (set_parameters_target): Check if input target
147 is compatible with output emulation set by "-m emulation".
148
01f573ad
L
1492015-10-13 H.J. Lu <hongjiu.lu@intel.com>
150
151 PR gold/19118
152 * i386.cc (Target_iamcu): New class.
153 (Target_selector_iamcu): Likewise.
154 (Target_iamcu::iamcu_info): New variable.
155 (target_selector_iamcu): Likewise.
156
3b0357da
AS
1572015-10-07 Andreas Schwab <schwab@suse.de>
158
159 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
160
9eacb935
CC
1612015-10-06 Cary Coutant <ccoutant@gmail.com>
162
163 PR gold/18855
164 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
165 parameter.
166 (Sparc_relocate_functions::gdop_lox10): Likewise.
167 (Target_sparc::Relocate::relocate): Use addend when computing
168 symbol value for R_SPARC_GOTDATA_OP*.
169
3d4fde69
CC
1702015-09-07 Cary Coutant <ccoutant@gmail.com>
171
172 PR gold/18930
173 PR gold/18886
174 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
175 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
176
358de988
L
1772015-09-02 H.J. Lu <hongjiu.lu@intel.com>
178
179 PR gold/18886
180 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
181 shared libraries into normal FUNC symbols.
182 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
183 symbols aren't from shared libraries.
184
d49044c7
AM
1852015-09-02 Alan Modra <amodra@gmail.com>
186
187 PR 18878
188 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
189 (Target_powerpc::Branch_info::make_stub): Determine whether long
190 branch stub is for save/restore function.
191 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
192 (Stub_table): Add need_save_res_.
193 (Stub_table:clear_stubs): Clear need_save_res_.
194 (Stub_table:set_address_and_size): Add save/restore section size.
195 (Stub_table::add_long_branch_entry): Add save_res param. Set
196 need_save_res_, but don't add space for save/restore stubs.
197 (Stub_table::find_long_branch_entry): Return offset to local copy
198 of save/restore func.
199 (Stub_table::do_write): Don't output save/restore stubs. Instead
200 copy the save/restore functions.
201 (Output_data_save_res:contents): New accessor.
202 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
203
7c61d651
CC
2042015-08-25 Cary Coutant <ccoutant@gmail.com>
205
206 PR gold/18847
207 * script-sections.cc (Memory_region::set_address): New method.
208 (Script_sections::find_memory_region): Add explicit_only parameter.
209 (Output_section_definition::set_section_addresses): Handle case where
210 script specifies both address and vma region.
211 * script-sections.h (Script_sections::find_memory_region): Add
212 explicit_only parameter.
213
4bfacfd3
CC
2142015-08-25 Cary Coutant <ccoutant@gmail.com>
215
216 PR gold/18859
217 * object.cc (Input_objects::add_object): Store objects in a map,
218 indexed by soname; update as-needed flag when necessary.
219 * object.h (Object::clear_as_needed): New method.
220 (Input_objects::so_names_): Change from set to map.
221
1757d35c
CC
2222015-08-25 Cary Coutant <ccoutant@gmail.com>
223
224 PR gold/14746
225 * expression.cc (Expression::Expression_eval_info): Add
226 is_valid_pointer field.
227 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
228 Adjust all callers.
229 (Addr_expression::value_from_output_section): Check whether address
230 is valid.
231 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
232 if evaluation failed due to address that is not yet valid.
233 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
234 parameter.
235
3ac0a36c
CC
2362015-08-25 Cary Coutant <ccoutant@gmail.com>
237
238 PR gold/18866
239 PR gold/18703
240 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
241
9215b98b
AM
2422015-08-20 Alan Modra <amodra@gmail.com>
243
244 PR gold/18846
245 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
246 Subtract os->address() from addend.
247 * powerpc.cc (relocate_relocs): Likewise.
248
40fc1451
SD
2492015-08-12 Simon Dardis <simon.dardis@imgtec.com>
250
251 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
252 lazy_stub_normal_1, lazy_stub_normal_1_n64,
253 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
254 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
255 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
256 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
257 of 'addu/daddu'.
258
37a42ee9
L
2592015-07-27 H.J. Lu <hongjiu.lu@intel.com>
260
261 * configure: Regenerated.
262
ab3b14b0
DK
2632015-07-26 Doug Kwan <dougkwan@google.com>
264
265 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
266 disassembler output format.
267
cdb06167
HS
2682015-07-23 Ian Coolidge <icoolidge@google.com>
269 Plumb --pic-veneer option for gold.
270
271 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
272 generation.
273 * options.h (General_options): Add --pic-veneer option.
274
5b2af7dd
L
2752015-07-22 H.J. Lu <hongjiu.lu@intel.com>
276
277 PR gold/18663
278 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
279 script_test_1a.cc script_test_1b.cc.
280 (script_test_11_r.o): Replace script_test_11.o with
281 script_test_11a.o script_test_11b.o.
282 (script_test_11.o): Removed.
283 (script_test_11a.o): New.
284 (script_test_11b.o): Likewise.
285 * testsuite/Makefile.in: Regenerated.
286 * testsuite/script_test_1.h: New file.
287 * testsuite/script_test_1b.cc: Likewise.
288 * testsuite/script_test_11.h: Likewise.
289 * testsuite/script_test_11b.c: Likewise.
290 * testsuite/script_test_1.cc: Renamed to ...
291 * testsuite/script_test_1a.cc: This.
292 Include "script_test_1.h".
293 (main): Call check_int and check_ptr.
294 * testsuite/script_test_11.c: Renamed to ...
295 * testsuite/script_test_11a.c: This.
296 Include "script_test_11.h".
297 (main): Call ptr_equal.
298
cd78ea77
L
2992015-07-22 H.J. Lu <hongjiu.lu@intel.com>
300
301 PR gold/18628
302 * testsuite/ifuncdep2.c (global): Change protected to hidden.
303 * testsuite/ifuncmod1.c (global): Likewise.
304 * testsuite/ifuncmod5.c (global): Likewise.
305
f945ba50
AM
3062015-07-22 Alan Modra <amodra@gmail.com>
307
308 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
309
5417c94d
CC
3102015-07-21 Cary Coutant <ccoutant@gmail.com>
311
312 PR gold/18548
313 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
314 forced local symbol even when oldsym != NULL.
315 (Symbol_table::do_define_in_output_segment): Likewise.
316 (Symbol_table::do_define_as_constant): Likewise.
317
cb5cf5e2
CC
3182015-07-21 Cary Coutant <ccoutant@gmail.com>
319
b8c6c5ef 320 PR gold/18698
cb5cf5e2
CC
321 * archive.cc (Library_base::should_include_member): Don't use entry
322 point for relocatable links, or if target is not yet valid.
323 * parameters.cc (Parameters::entry): Check target_valid().
324
0ef3814f
HS
3252015-07-20 Han Shen <shenhan@google.com>
326
327 Optimize erratum 843419 fix.
328
329 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
330 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
331 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
332 (E843419_stub): New sub-class of Erratum_stub.
333 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
334 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
335 (AArch64_relobj::create_erratum_stub): Add 1 argument.
336 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
337
2bca0377
HS
3382015-07-20 Han Shen <shenhan@google.com>
339
340 Fix arm elf header flags wrt hardfp bit.
341
342 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
343
f54f5e31
L
3442015-07-20 H.J. Lu <hongjiu.lu@intel.com>
345
346 PR gold/18689
347 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
348 from input group section for relocatable link.
349 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
350 (check_DATA): Add pr18689.stdout.
351 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
352 (pr18689.stdout): New rule.
353 (pr18689a.o): Likewise.
354 (pr18689b.o): Likewise.
355 (pr18689.o): Likewise.
356 * testsuite/pr18689.c: New file.
357 * testsuite/pr18689.sh: Likewise.
358 * testsuite/Makefile.in: Regenerated.
359
c20ceeb2
YW
3602015-07-20 Yiran Wang <yiran@google.com>
361 Cary Coutant <ccoutant@gmail.com>
362
363 PR gold/15574
364 * resolve.cc (Symbol_table): Remove warning about references
365 from shared objects to hidden symbols.
366 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
367 * testsuite/Makefile.in: Regenerate.
368 * testsuite/hidden_test.sh: Check dynamic symbol table; update
369 expected error messages.
370
19a7fe52
L
3712015-07-14 H.J. Lu <hongjiu.lu@intel.com>
372
373 * compressed_output.cc (Output_compressed_section::set_final_data_size):
374 Make --compress-debug-sections=zlib the same as
375 --compress-debug-sections=zlib-gabi.
376 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
377 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
378 ".zdebug_".
379 * testsuite/Makefile.in: Regenerated.
380
fb8b9dbc
L
3812015-07-12 H.J. Lu <hongjiu.lu@intel.com>
382
383 PR gold/18322
384 * compressed_output.cc (zlib_compress): Add argument for
385 compression header size. Set header size to compression header
386 size if it isn't 0. Don't write out the zlib header here.
387 (Output_compressed_section::set_final_data_size): Support
388 zlib-gnu and zlib-gabi compressions. Pass compression header
389 size to zlib_compress and write out compression header. Set
390 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
391 clear the SHF_COMPRESSED bit
392 * options.h (compress_debug_sections): Add zlib-gnu and
393 zlib-gabi.
394 * output.h (Output_section::set_flags): New.
395 * testsuite/Makefile.am (check_PROGRAMS): Add
396 flagstest_compress_debug_sections_none,
397 flagstest_compress_debug_sections_gnu and
398 flagstest_compress_debug_sections_gabi.
399 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
400 flagstest_compress_debug_sections.stdout,
401 flagstest_compress_debug_sections.cmp,
402 flagstest_compress_debug_sections.check,
403 flagstest_compress_debug_sections_gnu.stdout,
404 flagstest_compress_debug_sections_gnu.cmp,
405 flagstest_compress_debug_sections_gnu.check,
406 flagstest_compress_debug_sections_gabi.stdout,
407 flagstest_compress_debug_sections_gabi.cmp and
408 flagstest_compress_debug_sections_gabi.check.
409 (flagstest_compress_debug_sections_none): New.
410 (flagstest_compress_debug_sections_none.stdout): Likewise.
411 (flagstest_compress_debug_sections.stdout): Likewise.
412 (flagstest_compress_debug_sections.check): Likewise.
413 (flagstest_compress_debug_sections.cmp): Likewise.
414 (flagstest_compress_debug_sections_gnu): Likewise.
415 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
416 (flagstest_compress_debug_sections_gnu.check): Likewise.
417 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
418 (flagstest_compress_debug_sections_gabi): Likewise.
419 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
420 (flagstest_compress_debug_sections_gnu.check): Likewise.
421 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
422 * testsuite/Makefile.in: Regenerated.
423
48058663
L
4242015-07-12 H.J. Lu <hongjiu.lu@intel.com>
425
426 PR gold/18321
427 * compressed_output.h (decompress_input_section): Add arguments
428 for ELF class, big endian and sh_flags.
429 * compressed_output.cc (decompress_input_section): Likewise.
430 Support the SHF_COMPRESSED section.
431 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
432 functions.
433 * plugin.h (Pluginobj): Likewise.
434 * layout.cc (Layout::get_output_section_flags): Also clear the
435 SHF_COMPRESSED bit.
436 * object.h (Compressed_section_info): Add flag to store sh_flags.
437 (Object): Add pure virtual elfsize and is_big_endian member
438 functions.
439 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
440 prefix here.
441 (build_compressed_section_map): Check SHF_COMPRESSED for
442 uncompressed size. Store sh_flags in Compressed_section_info.
443 Pass size, big_endian and sh_flags to decompress_input_section.
444 Skip the ".debug"/".zdebug" prefix when passing section name to
445 need_decompressed_section.
446 (Sized_relobj_file<size, big_endian>::do_find_special_section):
447 Don't check ".zdebug_*" sections.
448 (Object::decompressed_section_contents): Pass ELF class, big
449 endian and sh_flags to decompress_input_section.
450 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
451 Likewise.
452 * testsuite/Makefile.am (check_DATA): Add
453 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
454 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
455 gdb_index_test_2_gabi.stdout.
456 (debug_msg_cdebug_gabi.o): New.
457 (odr_violation1_cdebug_gabi.o): Likewise.
458 (odr_violation2_cdebug_gabi.o): Likewise.
459 (debug_msg_cdebug_gabi.err): Likewise.
460 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
461 (gdb_index_test_cdebug_gabi.o): Likewise.
462 (gdb_index_test_2_gabi): Likewise.
463 (gdb_index_test_2_gabi.stdout): Likewise.
464 * testsuite/gdb_index_test_2_gabi.sh: New file.
465 * testsuite/Makefile.in: Regenerated.
466
73854cdd
HS
4672015-07-09 Han Shen <shenhan@google.com>
468
469 Use "gold_info" instead of "gold_warning" for erratum fix.
470
471 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
472 'gold_info'.
473 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
474
61163dfa
HS
4752015-07-09 Han Shen <shenhan@google.com>
476
477 Drop missing symbol warning for arm/aarch64.
478
479 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
480 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
481 symbol warning.
482
b91deca9
HS
4832015-07-07 Han Shen <shenhan@google.com>
484
485 Make gold aarch64 accept long form of mapping symbols.
486
487 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
488 of mapping symbols.
489
15162bef
DK
4902015-06-29 Doug Kwan <dougkwan@google.com>
491
492 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
493 at address expected by test.
494 * testsuite/arm_cortex_a8_b.s: Ditto.
495 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
496 * testsuite/arm_cortex_a8_bl.s: Ditto.
497 * testsuite/arm_cortex_a8_blx.s: Ditto.
498 * testsuite/arm_cortex_a8_local.s: Ditto.
499 * testsuite/arm_fix_v4bx.s: Ditto.
500 * testsuite/arm_unaligned_reloc.s: Ditto.
501 * testsuite/thumb_bl_out_of_range.s: Ditto.
502 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
503 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 504
56b06706
HS
5052015-06-29 Han Shen <shenhan@google.com>
506
507 Patch for erratum 843419 internal error.
508
72f4393d
L
509 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
510 (Erratum_stub::update_erratum_insn): New method.
511 (Stub_table::relocate_stubs): Modified to place relocated insn.
512 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 513
2f0c79aa
HS
5142015-06-12 Han Shen <shenhan@google.com>
515
516 Fix erratum 835769.
517
72f4393d
L
518 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
519 defintion outside class definition.
520 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
521 (AArch64_insn_utilities::aarch64_op31): New member.
522 (AArch64_insn_utilities::aarch64_ra): New member.
523 (AArch64_insn_utilities::aarch64_mac): New member.
524 (AArch64_insn_utilities::aarch64_mlxl): New member.
525 (ST_E_835769): New global enum member.
526 (Stub_table::relocate_stubs): Add 835769 handler.
527 (Stub_template_repertoire::Stub_template_repertoire): Install new
528 stub type.
529 (AArch64_relobj::scan_errata): This func is renamed from
530 scan_erratum_843419.
531 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
532 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
533 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
534 (Target_aarch64::scan_erratum_835769_span): New method.
535 (Target_aarch64::create_erratum_stub): New method.
536 (Target_aarch64::is_erratum_835769_sequence): New method.
537 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
538 code into create_erratum_stub.
539 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 540
5d7908e0
CC
5412015-06-11 Cary Coutant <ccoutant@gmail.com>
542
543 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
544 outside class body.
545 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
546
dd68f8fa
CC
5472015-06-11 Cary Coutant <ccoutant@gmail.com>
548
549 PR gold/17731
550 * layout.cc (corresponding_uncompressed_section_name): New function.
551 (Layout::choose_output_section): Call it.
552 * layout.h (corresponding_uncompressed_section_name): New function.
553 * script-sections.cc (Input_section_info::set_section_name): Check
554 for compressed debug section (.zdebug style).
555
a3a0c391
JY
5562015-06-11 Jing Yu <jingyu@google.com>
557
558 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
559 * testsuite/Makefile.in: Regenerate.
560
970cdef2
DI
5612015-06-11 Davide Italiano <dccitaliano@gmail.com>
562
563 * gold.h (is_cident): Correct typo.
564
a48d0c12
HS
5652015-06-10 Han Shen <shenhan@google.com>
566 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
567
568 Now fixing for 843419 is fully functional.
569
570 The first part of the erratum fix CL is here -
571 https://sourceware.org/ml/binutils/2015-04/msg00229.html
572
573 * aarch64.cc(global enum): New constants representing stub types.
574 (Stub_template): New POD struct.
575 (Stub_template_repertoire): New class.
576 (Stub_base): New class.
577 (Erratum_stub): New class.
578 (Reloc_stub): Refactored to be a subclass of Stub_base.
579 (Reloc_stub::Stub_type): Removed.
580 (Reloc_stub::offset): Moved to Stub_base.
581 (Reloc_stub::set_offset): Moved to Stub_base.
582 (Reloc_stub::destination_address): Moved to Stub_base.
583 (Reloc_stub::set_destination_address): Moved to Stub_base.
584 (Reloc_stub::reset_destination_address): Moved to Stub_base.
585 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
586 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
587 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
588 (Reloc_stub::write): Moved to Stub_base.
589 (Reloc_stub::invalid_offset): Moved to Stub_base.
590 (Reloc_stub::invalid_address): Moved to Stub_base.
591 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
592 (Reloc_stub::stub_insns_): Moved to Stub_base.
593 (Reloc_stub::offset_): Moved to Stub_base.
594 (Reloc_stub::destination_address_): Moved to Stub_base.
595 (Stub_table::The_aarch64_relobj): New typedef.
596 (Stub_table::The_erratum_stub): New typedef.
597 (Stub_table::The_erratum_stub_less): New typedef.
598 (Stub_table::The_erratum_stub_set): New typedef.
599 (Stub_table::The_erratum_stub_set_iter): New typedef.
600 (Stub_table::empty): Added emptiness testing for erratum stubs.
601 (Stub_table::add_erratum_stub): New method to add an erratum stub.
602 (Stub_table::find_erratum_stub): New method.
603 (Stub_table::find_erratum_stubs_for_input_section): New method.
604 (Stub_table::erratum_stub_address): New method.
605 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
606 (Stub_table::do_addralign): Modified to handle erratum stubs.
607 (Stub_table::erratum_stubs_): New member.
608 (Stub_table::erratum_stub_size_): New member.
609 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
610 (Stub_table::do_write): Modified to handle erratum stubs.
611 (AArch64_relobj::The_erratum_stub): New typedef.
612 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
613 (AArch64_relobj::fix_errata): New method.
614 (Target_aarch64::The_reloc_stub_type): Removed.
615 (Target_aarch64::The_erratum_stub): New typede.
616 (AArch64_relocate_functions::construct_b): New method.
617
1e1b2efc
NC
6182015-06-08 Nick Clifton <nickc@redhat.com>
619
620 * po/fr.po: New French Translation.
621
b8cf5075
CC
6222015-06-07 Cary Coutant <ccoutant@gmail.com>
623
624 PR gold/18288
625 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
626 callers. Don't use STT_COMMON to check for common symbols.
627 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
628 symbol that's not in a common section.
629 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
630 common symbols.
631
bdd2d2b7
CC
6322015-06-04 Cary Coutant <ccoutant@gmail.com>
633
634 PR gold/18200
635 * Makefile.am (diststuff): Add target.
636 * Makefile.in: Regenerate.
637
cd3c333f
CC
6382015-06-04 Cary Coutant <ccoutant@gmail.com>
639
640 PR gold/17498
641 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
642 temporary locals in merge sections.
643 * options.cc (General_options::parse_discard_all): New method.
644 (General_options::parse_discard_locals): New method.
645 (General_options::parse_discard_none): New method.
646 (General_options::General_options): Initialize discard_locals_.
647 * options.h (--discard-all): Convert to special option.
648 (--discard-locals): Likewise.
649 (--discard-none): New option.
650 (General_options::discard_all): New method.
651 (General_options::discard_locals): New method.
652 (General_options::discard_sec_merge): New method.
653 (General_options::Discard_locals): New enum.
654 (General_options::discard_locals_): New data member.
655
8086551f
CC
6562015-06-03 Cary Coutant <cary@google.com>
657
658 * script-sections.cc (Script_sections::Script_sections): Initialize
659 segments_created_.
660 (Script_sections::create_note_and_tls_segments): Set flag when
661 segments are created.
662 (Script_sections::expected_segment_count): Count PT_INTERP.
663 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
664 segments are created.
665 * script-sections.h (Script_sections::segments_created_): New data
666 member.
667
374082df
CC
6682015-06-03 Cary Coutant <ccoutant@gmail.com>
669
670 PR gold/15370
671 * script-sections.cc
672 (Output_section_element_input::set_section_addresses): When there
673 are several patterns with no sort spec, put all sections in the same
674 bin.
675 * testsuite/Makefile.am (script_test_12): New testcase.
676 (script_test_12i): New testcase.
677 * testsuite/Makefile.in: Regenerate.
678 * testsuite/script_test_12.t: New test linker script.
679 * testsuite/script_test_12i.t: New test linker script.
680 * testsuite/script_test_12a.c: New test source file.
681 * testsuite/script_test_12b.c: New test source file.
682
775ed62e
CC
6832015-06-02 Cary Coutant <ccoutant@gmail.com>
684
685 * nacl.h (Sniff_file): Switch parameters to get_view to get an
686 aligned view.
687
9c7fe3c5
CC
6882015-06-03 Cary Coutant <ccoutant@gmail.com>
689
72f4393d
L
690 PR gold/17819
691 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
692 separate task to schedule the build id computation.
693 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
694 add Output_file and offset.
695 (Hash_task::run): Get and release the input views.
696 (Hash_task::is_runnable): Always return NULL (always runnable).
697 (Layout::queue_build_id_tasks): Remove.
698 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
699 parameters; use them instead of class members.
700 (Build_id_task_runner::run): New function.
701 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
702 to write_build_id.
703 * layout.h (Layout::queue_build_id_tasks): Remove.
704 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
705 parameters.
706 (Layout::array_of_hashes_): Remove.
707 (Layout::size_of_array_of_hashes_): Remove.
708 (Layout::input_view_): Remove.
709 (Build_id_task_runner): New class.
710 (Close_task_runner::Close_task_runner): Add array_of_hashes and
711 size_of_hashes parameters.
712 (Close_task_runner::array_of_hashes_): New data member.
713 (Close_task_runner::size_of_hashes_): New data member.
714 * testsuite/Makefile.am
715 (flagstest_compress_debug_sections_and_build_id_tree): New test.
716 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 717
400f8944
RÁE
7182015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
719
720 * merge.cc (get_input_merge_map): Update for data structure change.
721 (get_or_make_input_merge_map): Update for data structure change.
722 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
723 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
724
bbec1a5d
AM
7252015-05-16 Alan Modra <amodra@gmail.com>
726
727 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
728 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
729 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
730 (lis_0): Rename from lis_0_0.
731
efc6fa12
CC
7322015-04-29 Cary Coutant <cary@google.com>
733 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
734
735 * gc.h (Garbage_collection::is_section_garbage): Change Object*
736 to Relobj*.
737 (Garbage_collection::add_reference): Likewise.
738 (Garbage_collection::gc_process_relocs): Likewise. Don't push
739 object/shndx pair onto *secvec for dynamic objects. Don't follow
740 relocations pointing to dynamic objects for GC.
741 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
742 (Icf::unfold_section): Likewise.
743 (Icf::is_section_folded): Likewise.
744 (Icf::get_folded_section): Likewise.
745 * icf.h: (Icf::get_folded_section): Likewise.
746 (Icf::unfold_section): Likewise.
747 (Icf::is_section_folded): Likewise.
748 (Icf::section_has_function_pointers): Likewise.
749 (Icf::set_section_has_function_pointers): Likewise.
750 * object.h (Section_id): Likewise.
751 (Const_section_id): Likewise.
752 * output.cc (Output_section::update_section_layout): Likewise.
753 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
754 Likewise.
755 * plugin.cc (update_section_order): Likewise.
756 (unique_segment_for_sections): Likewise.
757 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
758 (Target_powerpc::do_gc_add_reference): Likewise.
759 (Target_powerpc::gc_process_relocs): Likewise.
760 (Target_powerpc::do_gc_add_reference): Likewise.
761 * symtab.cc (Symbol_table::is_section_folded): Likewise.
762 (Symbol_table::gc_mark_symbol): Likewise.
763 * symtab.h: (Symbol_table::is_section_folded): Likewise.
764 * target.h: (Sized_target::gc_add_reference): Likewise.
765 (Sized_target::do_gc_add_reference): Likewise.
766
f9d3ecaa
NC
7672015-04-29 Nick Clifton <nickc@redhat.com>
768
769 * po/fi.po: Updated Finnish translation.
770
faa2211d
AM
7712015-04-28 Alan Modra <amodra@gmail.com>
772
773 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
774 than unsigned int for find_global_entry result temp. Compare
775 against invalid_address.
776 (Target_powerpc::do_plt_address_for_global): Likewise.
777 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
778 on plt call stub existence for debug info. Do assert for plt
779 and global entry stub existence if an alloc section.
780
6ec65f28
AM
7812015-04-28 Alan Modra <amodra@gmail.com>
782
783 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
784 on missing global entry stub due to bogus debug info.
785
7a2a1c79
HS
7862015-04-27 Han Shen <shenhan@google.com>
787
788 * options.h (--fix-cortex-a53-843419): Rename option.
789 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
790 option.
791 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
792
cfbf0e3c
RÁE
7932015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
794
795 PR gold/18327
796 * output.cc (Output_section::is_input_address_mapped): Assume a missing
797 entry is mapped.
798 * testsuite/Makefile.am: Add the eh_test test.
799 * testsuite/Makefile.in: Regenerate.
800 * testsuite/eh_test_a.cc: New test.
801 * testsuite/eh_test_b.cc: New test.
802
6ec65f28
AM
8032015-04-23 Sriraman Tallam <tmsriram@google.com>
804
a100d66f
ST
805 * options.h (--weak-unresolved-symbols): New option.
806 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
807 binding to weak with new option.
808 * symtab.h (is_weak_undefined): Check for new option.
809 (is_strong_undefined): Check for new option.
810 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
811 * testsuite/Makefile.in: Regenerate.
812 * testsuite/weak_unresolved_symbols_test.cc: New file.
813
4b889c30
IC
8142015-04-20 Ian Coolidge <icoolidge@google.com>
815
816 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
817 GNU_UNIQUE.
818
4277535c
RÁE
8192015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
820
821 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
822 push_back.
823 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
824 * object.cc (Sized_relobj_file::do_layout): Use push_back.
825 * powerpc.cc (process_gc_mark): Use push_back.
826 (Target_powerpc::do_gc_mark_symbol): Use push_back.
827 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
828
7a2a1c79 8292015-04-16 Han Shen <shenhan@google.com>
5019d64a 830
6ec65f28
AM
831 * aarch64.cc (AArch64_insn_utilities): New utility class.
832 (AArch64_relobj::Mapping_symbol_position): New struct.
833 (AArch64_relobj::Mapping_symbol_info): New typedef.
834 (AArch64_relobj::do_count_local_symbols): New function overriding
835 parent's implementation.
836 (AArch64_relobj::mapping_symbol_info_): New member
837 (AArch64_relobj::scan_erratum_843419): New method.
838 (Target_aarch64::scan_erratum_843419_span): New method.
839 (Target_aarch64::is_erratum_843419_sequence): New method.
840 * options.h (fix_cortex_a53): New option.
5019d64a 841
a6a17750
CC
8422015-04-09 Cary Coutant <ccoutant@google.com>
843
844 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
845 in a PIE link.
846 * testsuite/Makefile.am (tls_pie_test.sh): New test.
847 * testsuite/Makefile.in: Regenerate.
848 * testsuite/tls_pie_test.sh: New.
849
437ddf0c
CC
8502015-04-09 Cary Coutant <ccoutant@google.com>
851
852 * debug.h (DEBUG_LOCATION): New.
853 (DEBUG_ALL): Include DEBUG_LOCATION.
854 (debug_string_to_enum): Add DEBUG_LOCATION.
855 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
856 output to print correct context.
857 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
858 up to 4 more locations at the beginning of the function.
859 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
860 result before sorting list of line numbers.
861 * testsuite/debug_msg.sh: Allow range of line numbers for
862 canonical results on optimized code.
863
24491327
HS
8642015-04-07 HC Yen <hc.yen@mediatek.com>
865
866 Add AArch32 support for gold linker.
867 gold/
868 * arm.cc: Add V8 arch combine table.
869
7fa5525f
RÁE
8702015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
871
872 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
873
5368dcf2
RÁE
8742015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
875
876 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
877 to find by using the return value of insert.
878
9dbb4b02
RÁE
8792015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
880
881 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
882 constructor call.
883
1fa29f10
IT
8842015-04-06 Ilya Tocar <ilya.tocar@intel.com>
885
886 PR gold/17641
887 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
888 (Target_x86_64::Scan::local): Don't create GOT entry, when we
889 can convert mov to lea.
890 (Target_x86_64::Scan::global): Ditto.
891 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
892 %reg to lea foo(%rip), %reg if possible.
893 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
894 * testsuite/x86_64_mov_to_lea1.s: New.
895 * testsuite/x86_64_mov_to_lea2.s: Ditto.
896 * testsuite/x86_64_mov_to_lea3.s: Ditto.
897 * testsuite/x86_64_mov_to_lea4.s: Ditto.
898 * testsuite/x86_64_mov_to_lea.sh: Ditto.
899
39f3de7c
L
9002015-04-02 H.J. Lu <hongjiu.lu@intel.com>
901
902 * configure: Regenerated.
903
c4fc4724
IT
9042015-04-01 Ilya Tocar <ilya.tocar@intel.com>
905
906 PR gold/17640
907 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
908 (Target_i386::Scan::local): Don't create GOT entry, when we
909 can convert GOT to GOTOFF.
910 (Target_i386::Scan::global): Ditto.
911 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
912 lea foo@GOTOFF(%reg), %reg if possible.
913 * testsuite/Makefile.am (i386_mov_to_lea): New test.
914 * testsuite/i386_mov_to_lea1.s: New.
915 * testsuite/i386_mov_to_lea2.s: Ditto.
916 * testsuite/i386_mov_to_lea3.s: Ditto.
917 * testsuite/i386_mov_to_lea4.s: Ditto.
918 * testsuite/i386_mov_to_lea5.s: Ditto.
919 * testsuite/i386_mov_to_lea.sh: Ditto.
920
918357b9
L
9212015-04-01 H.J. Lu <hongjiu.lu@intel.com>
922
923 * Makefile.am (ZLIB): New.
924 (ZLIBINC): Likewise.
925 (AM_CFLAGS): Add $(ZLIBINC).
926 (AM_CXXFLAGS): Likewise.
927 (ldadd_varldadd_var): Add $(ZLIB).
928 (incremental_dump_LDADD): Likewise.
929 (dwp_LDADD): Likewise.
930 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
931 <zlib.h>.
932 (zlib_compress): Don't check HAVE_ZLIB_H.
933 (zlib_decompress): Likewise.
934 * options.h (compress_debug_sections): Likewise.
935 * configure.ac (AM_CONDITIONAL): Removed.
936 * testsuite/Makefile.am (ZLIB): New.
937 (LDADD): Add $(ZLIB).
938 Don't check HAVE_ZLIB.
939 * Makefile.in: Regenerated.
940 * config.in: Likewise.
941 * configure: Likewise.
942 * testsuite/Makefile.in: Likewise.
943
6b0ad2eb
JY
9442015-03-30 Jing Yu <jingyu@google.com>
945
946 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
947 TLSLD_ADD_DTPREL_LO12_NC.
948 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
949 _TLS_MODULE_BASE_ point to the start of tls segment.
950 (Target_aarch64::optimize_tls_reloc): Add cases for
951 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
952 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
953 (Target_aarch64::Scan::local): Likewise.
954 (Target_aarch64::Scan::global): Likewise.
955 (Target_aarch64::Relocate::relocate): Likewise.
956 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
957 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
958 relocations.
959
0916f9e7
RÁE
9602015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
961
962 * merge.cc (Object_merge_map::add_mapping): call
963 Object_merge_map::Input_merge_map::add_mapping.
964 (Object_merge_map::Input_merge_map::add_mapping): New.
965 (Output_merge_data::do_add_input_section): Call
966 get_or_make_input_merge_map before a loop.
967 (Output_merge_string<Char_type>::finalize_merged_data): Call
968 get_or_make_input_merge_map before a loop.
969 * merge.h (Object_merge_map): Make Input_merge_map public.
970 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
971 (Relobj::get_or_create_merge_map): New.
972 * object.h (Relobj::get_or_create_merge_map): New.
973
282c9750
AM
9742015-03-24 Alan Modra <amodra@gmail.com>
975
976 PR 18147
977 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
978 relocation errors for branches to strong undefined symbols.
979
67f95b96
RÁE
9802015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
981
982 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
983 (Object_merge_map::is_merge_section_for): Remove.
984 (Object_merge_map::find_merge_section): New.
985 * merge.h (Object_merge_map::is_merge_section_for): Remove.
986 (Object_merge_map::find_merge_section): New.
987 (Object_merge_map::get_input_merge_map): Add a const version.
988 * object.cc (Relobj::is_merge_section_for): Remove.
989 (Relobj::find_merge_section): New.
990 * object.h (Relobj::is_merge_section_for): Remove.
991 (Relobj::find_merge_section): New.
992 * output.cc
993 (Output_section::Input_section::is_merge_section_for): Remove.
994 (Output_section::add_merge_input_section): Don't call
995 add_merge_input_section.
996 (Output_section::find_merge_section): Return const. Use
997 object->find_merge_section.
998 (Output_section::build_lookup_maps): Don't build a map for
999 merge sections.
1000 (Output_section::is_input_address_mapped): Return false if
1001 section is not found.
1002 (Output_section::find_starting_output_address): Use
1003 find_merge_section instead of is_merge_section_for.
1004 (Output_section::add_script_input_section): Don't build a map for
1005 merge sections.
1006 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1007 (Output_section_lookup_maps::find_merge_section): Remove.
1008 (Output_section_lookup_maps::add_merge_input_section) Remove.
1009 (Output_section::find_merge_section): Return const.
1010
152f7024
CC
10112015-03-22 Cary Coutant <cary@google.com>
1012
1013 PR gold/18106
1014 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1015 non-SIB form of lea, with nop after the call.
1016
bccffdfd
CC
10172015-03-21 Cary Coutant <cary@google.com>
1018
1019 PR gold/14217
1020 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1021 .tdata section.
1022 (Output_segment::set_section_addresses): Don't align size of relro
1023 segment for .tbss.
1024
1c582fe7
CC
10252015-03-21 Cary Coutant <cary@google.com>
1026
1027 PR gold/18010
1028 * stringpool.cc (Stringpool_template): Don't optimize if section
1029 alignment is greater than sizeof(char).
1030
410da591
CC
10312015-03-21 Cary Coutant <cary@google.com>
1032
1033 PR gold/18048
1034 * script-c.h (script_include_directive): Add first_token parameter.
1035 * script.cc (script_include_directive): Add first_token parameter, and
1036 pass it to read_script_file.
1037 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1038 (PARSING_MEMORY_DEF): New tokens.
1039 (top): Add new productions for INCLUDE files.
1040 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1041 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1042 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1043 (section_cmd): Pass PARSING_SECTION_CMDS.
1044 (file_or_sections_cmd): Remove.
1045 (memory_def): Pass PARSING_MEMORY_DEF.
1046 * testsuite/Makefile.am (memory_test_2): New test.
1047 * testsuite/Makefile.in: Regenerate.
1048 * testsuite/memory_test_inc.t: New script file.
1049 * testsuite/memory_test_inc_1.t.src: New script file.
1050 * testsuite/memory_test_inc_2.t.src: New script file.
1051 * testsuite/memory_test_inc_3.t.src: New script file.
1052
0d5bbdb0
CC
10532015-03-21 Cary Coutant <cary@google.com>
1054
1055 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1056 (Sized_relobj_dwo::setup): Build compressed section map.
1057 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1058 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1059 section map.
1060 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1061 compressed_sections_ field.
1062 (build_compressed_section_map): Take Object instead of
1063 Sized_relobj_file parameter; add decompress_if_needed parameter.
1064 (Sized_relobj_file::do_find_special_sections): Store compressed
1065 section map in parent Object.
1066 (Sized_relobj_file::do_decompressed_section_contents): Move
1067 implementation to Object::decompressed_section_contents.
1068 (Sized_relobj_file::do_discard_decompressed_sections): Move
1069 implementation to Object::discard_decompressed_sections.
1070 * object.h (build_compressed_section_map): Declare.
1071 (Object::Object): Add compressed_sections_ field.
1072 (Object::section_is_compressed): Move implementation here.
1073 (Object::decompressed_section_contents): De-virtualize.
1074 (Object::discard_decompressed_sections): De-virtualize.
1075 (Object::do_section_is_compressed): Delete.
1076 (Object::do_decompressed_section_contents): Delete.
1077 (Object::set_compressed_sections): New method.
1078 (Object::compressed_sections): New method.
1079 (Object::compressed_sections_): New data member.
1080 (Compressed_section_info, Compressed_section_map): Move to top of file.
1081 (Sized_relobj_file::do_section_is_compressed): Delete.
1082 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1083 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1084 (Sized_relobj_file::compressed_sections_): Move to Object class.
1085
bd9e0d46
CC
10862015-03-21 Cary Coutant <ccoutant@google.com>
1087
1088 PR gold/18152
1089 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1090 deferred objects.
1091
943c8b43
CC
10922015-03-11 Cary Coutant <ccoutant@google.com>
1093
1094 * options.cc (General_options::finalize): Don't allow -z relro
1095 with incremental linking.
1096 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1097 (incremental_test_2): Likewise.
1098 (incremental_test_3): Likewise.
1099 (incremental_test_4): Likewise.
1100 (incremental_test_5): Likewise.
1101 (incremental_test_6): Likewise.
1102 (incremental_copy_test): Likewise.
1103 (incremental_common_test_1): Likewise.
1104 (incremental_comdat_test_1): Likewise.
1105 * testsuite/Makefile.in: Regenerate.
1106
e1663197
CC
11072015-03-09 Cary Coutant <ccoutant@google.com>
1108
1109 PR gold/14675
1110 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1111 return enum indicating whether .eh_frame section is empty, optimizable,
1112 unrecognized, or an end marker. Adjust explicit instantiations.
1113 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1114 (Eh_frame::add_ehframe_input_section): Change return type.
1115 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1116 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1117 to the .eh_frame output section until we see the end marker.
1118 (Layout::finalize_eh_frame_section): New.
1119 * layout.h: (Layout::finalize_eh_frame_section): New.
1120
beb8418f
L
11212015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1122
1123 * output.cc (Relobj::initialize_input_to_output_map<size>):
1124 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1125
48c73428
CC
11262015-03-04 Cary Coutant <ccoutant@google.com>
1127
1128 * parameters.cc (Parameters::set_target_once): Call
1129 Target::select_as_default_target just once from here...
1130 (set_parameters_target): ...instead of from here.
1131
11322015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1133
1134 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1135 Output_section_data instead of a Merge_map.
1136 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1137 (Eh_frame::read_cie): Use add_merge_mapping instead of
1138 Merge_map::add_mapping.
1139 (Eh_frame::read_fde): Ditto.
1140 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1141 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1142 merge_map_->get_output_offset.
1143 (Eh_frame::do_is_merge_section_for): Delete.
1144 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1145 instead of a Merge_map.
1146 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1147 Merge_map.
1148 (Eh_frame::do_is_merge_section_for): Delete.
1149 (Eh_frame::merge_map_): Delete.
1150 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1151 and use a Output_section_data instead of a Merge_map.
1152 (Object_merge_map::add_mapping): Ditto.
1153 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1154 (Object_merge_map::is_merge_section_for): Pass in and use a
1155 Output_section_data instead of a Merge_map.
1156 (Merge_map): Delete.
1157 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1158 of merge_map_.get_output_offset.
1159 (Output_merge_base::do_is_merge_section_for): Delete.
1160 (Output_merge_data::do_add_input_section): Use
1161 object->add_merge_mapping instead of add_mapping.
1162 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1163 * merge.h (Merge_map): Delete forward declaration.
1164 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1165 instead of a Merge_map.
1166 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1167 (Object_merge_map::is_merge_section_for): Pass in and use a
1168 Output_section_data instead of a Merge_map.
1169 (Input_merge_map::Object_merge_map::merge_map): Replace with
1170 output_data.
1171 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1172 Output_section_data instead of a Merge_map.
1173 (Merge_map): Delete.
1174 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1175 (Output_merge_base::do_is_merge_section_for): Delete.
1176 (Output_merge_base::add_mapping): Delete.
1177 (Output_merge_base::merge_map_): Delete.
1178 * object.cc (Relobj::initialize_input_to_output_map): New.
1179 (Relobj::initialize_input_to_output_map): New.
1180 (Relobj::merge_output_offset): New.
1181 (Relobj::is_merge_section_for): New.
1182 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1183 bits.
1184 * object.h (Relobj::merge_map): Delete.
1185 (initialize_input_to_output_map): New.
1186 (set_merge_map): Delete.
1187 (add_merge_mapping): New.
1188 (merge_output_offset): New.
1189 (is_merge_section_for): New.
1190 * output.cc (Output_section::Input_section::is_merge_section_for):
1191 Use object->is_merge_section_for.
1192 * output.h (Output_section_data::is_merge_section_for): Delete.
1193 (Output_section_data::do_is_merge_section_for): Delete.
1194 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1195 Use object->initialize_input_to_output_map.
1196 (Merged_symbol_value<size>::value_from_output_section): Use
1197 object->merge_output_offset.
1198
48c73428 11992015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1200 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1201
1202 * output.cc (Output_section::add_merge_input_section): Do not
1203 attempt to merge sections with an entsize of 0.
1204
48c73428 12052015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1206
1207 * attributes.h (class Output_attributes_section_data ): Add
1208 do_print_to_mapfile function.
1209
ec86f434
AM
12102015-02-24 Alan Modra <amodra@gmail.com>
1211
1212 PR 18010
1213 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1214 complain if value is not a multiple of four.
1215 (Target_powerpc::Relocate::relocate): Correct handling of
1216 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1217
be66981e
L
12182015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1219
1220 * configure.ac (default_size): Set to 32 for x32.
1221 * configure: Regenerated.
1222
e3ee8ed4
AM
12232015-02-18 Alan Modra <amodra@gmail.com>
1224
1225 PR 17954
1226 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1227 visibility.
1228
3a935c6c
RÁE
12292015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1230
1231 * gc.h (Garbage_collection::add_reference): Don't use find.
1232
e0a1e121
RÁE
12332015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1234
1235 * object.cc (write_local_symbols): avoid std::vector copy.
1236
45a4fb1a
RÁE
12372015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1238
1239 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1240
2d9afefe
MW
12412015-02-09 Mark Wielaard <mjw@redhat.com>
1242
1243 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1244 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1245
e9c1bdad
CC
12462015-02-16 Cary Coutant <ccoutant@google.com>
1247
1248 PR gold/13577
1249 PR gold/16992
1250 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1251 DF_SYMBOLIC if --dynamic-list option is used.
1252 * options.cc (General_options::finalize): --dynamic-list is not
1253 mutually exclusive with -Bsymbolic.
1254 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1255 listed in --dynamic-list.
1256 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1257 -Bsymbolic-functions.
1258 * testsuite/Makefile.in: Regenerate.
1259
0ed4b0bf
CC
12602015-02-16 Cary Coutant <ccoutant@google.com>
1261
1262 PR gold/17971
1263 * incremental.cc: Remove redundant include of "output.h".
1264
1a920511
JY
12652015-02-12 Jing Yu <jingyu@google.com>
1266
1267 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1268 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1269 New relocation.
1270 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1271 TLSLE_MOVW_* relocations.
1272 (Target_aarch64::Scan::global): Likewise.
1273 (Target_aarch64::Relocate::relocate): Likewise.
1274 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1275 for new TLSLE_MOVW_* relocations.
1276
07f107f3
WN
12772015-02-11 Will Newton <will.newton@linaro.org>
1278
1279 PR gold/13321
1280 * arm.cc (Target_arm::make_plt_section): Create an ARM
1281 state mapping symbol at the start of the PLT.
1282
e051a5b5
L
12832015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1284
1285 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1286 Replace two_file_shared_2.so with two_file_shared_1.so.
1287 * testsuite/Makefile.in: Regenerated.
1288
dddcc5b9
AM
12892015-02-09 Alan Modra <amodra@gmail.com>
1290
1291 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1292 plugin_test_thin.a and defsym_test.
1293 * testsuite/Makefile.in: Regenerate.
1294
b39b8b9d
RÁE
12952015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1296
1297 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1298 body.
1299
b66d1c52
CC
13002015-02-04 Peter Collingbourne <pcc@google.com>
1301
1302 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1303 forwarding symbols when computing symbol resolution info for plugins.
1304 * plugin.h (Plugin_manager::symtab): New method.
1305 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1306
23081de0
CC
13072015-02-03 Cary Coutant <ccoutant@google.com>
1308 Peter Collingbourne <pcc@google.com>
1309
1310 PR gold/15660
1311 * archive.cc (Thin_archive_object_unlocker): New class.
1312 (Archive::include_member): Unlock external members of thin archives.
1313 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1314 (plugin_test_2): Likewise.
1315 (plugin_test_3): Likewise.
1316 (plugin_test_4): Likewise.
1317 (plugin_test_5): Likewise.
1318 (plugin_test_6): Likewise.
1319 (plugin_test_7): Likewise.
1320 (plugin_test_8): Likewise.
1321 (plugin_test_9): Likewise.
1322 (plugin_test_10): Likewise.
1323 (plugin_test_11): New test case.
1324 * testsuite/Makefile.in: Regenerate.
1325 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1326 file to decide whether to claim file.
1327 (all_symbols_read_hook): Likewise.
1328 * testsuite/plugin_test_1.sh: Adjust expected output.
1329 * testsuite/plugin_test_2.sh: Likewise.
1330 * testsuite/plugin_test_3.sh: Likewise.
1331 * testsuite/plugin_test_6.sh: Likewise.
1332 * testsuite/plugin_test_tls.sh: Likewise.
1333 * testsuite/plugin_test_11.sh: New testcase.
1334
13352015-02-03 Cary Coutant <ccoutant@google.com>
1336
1337 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1338 file descriptors when debugging enabled. Add debug output.
1339 (Descriptors::release): Add debug output.
1340 (Descriptors::close_some_descriptor): Likewise.
1341 (Descriptors::close_all): Likewise.
1342 * fileread.cc (File_read::lock): Likewise.
1343 (File_read::unlock): Likewise.
1344
24dd5808
CC
13452015-02-02 Cary Coutant <ccoutant@google.com>
1346
1347 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1348 executable output file.
1349
fa89cc82
HS
13502015-01-22 Han Shen <shenhan@google.com>
1351
1352 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1353 (Target_arm::do_plt_address_for_global): New method.
1354 (Target_arm::do_plt_address_for_local): New method.
1355 (Target_arm::rel_irelative_section): New method.
1356 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1357 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1358 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1359 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1360 (Target_arm::Scan::check_non_pic): Add ifunc support.
1361 (Target_arm::Scan::local): Add ifunc support.
1362 (Target_arm::Scan::global): Add ifunc support.
1363 (Target_arm::make_plt_section): New method.
1364 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1365 (Target_arm::make_local_ifunc_plt_entry): New method.
1366 (Target_arm::got_irelative_): New member.
1367 (Target_arm::rel_irelative_): New member.
1368 (Target_arm::got_section): Add creation for got_irelative_.
1369 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1370 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1371 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1372 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1373 (Output_data_plt_arm::IRelative_data): New type.
1374 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1375 (Output_data_plt_arm::add_entry): Add more parameters.
1376 (Output_data_plt_arm::add_relocation): New method.
1377 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1378 (Output_data_plt_arm::rel_irelative): New method.
1379 (Output_data_plt_arm::entry_count): Modified.
1380 (Output_data_plt_arm::address_for_global): New method.
1381 (Output_data_plt_arm::address_for_local): New method.
23081de0 1382gold/
fa89cc82
HS
1383 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1384 (Output_data_plt_arm::insert_irelative_data): New method.
1385 (Output_data_plt_arm::irelative_rel_): New member.
1386 (Output_data_plt_arm::got_): New member.
1387 (Output_data_plt_arm::got_irelative_): New member.
1388 (Output_data_plt_arm::irelative_count_): New member.
1389 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1390 (Output_data_plt_arm::irelative_data_vec_): New member.
1391 (Output_data_plt_arm::do_write): Write out irelative entries.
1392 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1393 more parameters to ctor.
1394 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1395 more parameters to ctor.
1396 * output.h (Output_data_reloc::add_local_relative): New method.
1397 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1398
0f81d3f0
AM
13992015-01-29 Alan Modra <amodra@gmail.com>
1400
1401 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1402 and GOT_TLSGD to LE optimization.
1403
65d92137
CC
14042015-01-28 Cary Coutant <ccoutant@google.com>
1405
1406 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1407 for undef TLS symbols.
1408 (Target_x86_64::Relocate::relocate_tls): Likewise.
1409 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1410
5485698a
CC
14112015-01-25 Cary Coutant <ccoutant@google.com>
1412
1413 * output.cc (Output_segment::set_section_addresses): Fix calculation
1414 of size of relro segment.
1415
b01a4b04
AM
14162015-01-22 Alan Modra <amodra@gmail.com>
1417
1418 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1419 condition for need of ifunc plt entry.
1420 (Target_powerpc::Scan::global <got relocs>): Likewise.
1421
3d0064a9
CC
14222015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1423
1424 * mips.cc (reloc_high): Add r_sym.
1425 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1426 reloc_high constructor.
1427 (Mips_relocate_functions::relgot16_local): Likewise.
1428 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1429 r_type to decide whether LO16 matches HI16.
1430 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1431 rello16 and relgot16_local.
1432
a5cd8f05
CC
14332015-01-09 Cary Coutant <ccoutant@google.com>
1434
1435 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1436 unless alignment is larger than page size.
1437
4fc1b9d4
L
14382015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1439 Cary Coutant <ccoutant@google.com>
1440
1441 PR gold/17729
1442 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1443 (DEFAULT_TARGET_X32): Set for x32.
1444 * x86_64.cc (cmp_insn_32): New.
1445 (lea_r10_insn_32): Likewise.
1446 (lea_r11_insn_32): Likewise.
1447 (cmp_insn_64): Likewise.
1448 (lea_r10_insn_64): Likewise.
1449 (lea_r11_insn_64): Likewise.
1450 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1451 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1452 (check_DATA): Add split_x32 files.
1453 (split_x32_[1234n].o): New targets.
1454 (split_x32_[124]): New targets.
1455 (split_x32_[1234r].stdout): New targets.
1456 * testsuite/split_x32.sh: New file.
1457 * testsuite/split_x32_1.s: Likewise.
1458 * testsuite/split_x32_2.s: Likewise.
1459 * testsuite/split_x32_3.s: Likewise.
1460 * testsuite/split_x32_4.s: Likewise.
1461 * testsuite/split_x32_n.s: Likewise.
1462 * configure: Regenerated.
1463 * testsuite/Makefile.in: Likewise.
1464
e749cab8
L
14652015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1466
1467 PR gold/17809
1468 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1469 x32.
1470
af759df0
AM
14712015-01-02 Alan Modra <amodra@gmail.com>
1472
1473 * version.cc (print_version): Just print current year.
1474 * dwp.cc (print_version): Likewise.
1475
b90efa5b
AM
14762015-01-01 Alan Modra <amodra@gmail.com>
1477
1478 Update year range in copyright notice of all files.
1479
f12d1e8a
AM
14802014-12-25 Alan Modra <amodra@gmail.com>
1481
1482 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1483 new enums.
1484 (Target_arm::merge_object_attributes, ): Likewise.
1485
5c294fee
TG
14862014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1487
1488 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1489 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1490 AEABI_VFP_args_vfp to check that.
1491 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1492 value and replace hardcoded values by enum values.
1493
e30880c2
CC
14942014-12-22 Cary Coutant <ccoutant@google.com>
1495
1496 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1497
bd040da1
L
14982014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1499
1500 PR gold/14608
1501 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1502 to "return i * i * 3;".
1503
e02a4046
CC
15042014-12-16 Cary Coutant <ccoutant@google.com>
1505
1506 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1507 (Mapfile::print_output_data): Use current_data_size() to avoid
1508 assert for sections requiring postprocessing; if address is not valid,
1509 print 0.
1510 (Mapfile::print_output_section): Use current_data_size(); print note
1511 that addresses and sizes are before compression.
1512
add6016b
L
15132014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1514
1515 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1516 Cast current_group_size to unsigned long when reporting error.
1517
0bf32ea9
JY
15182014-12-10 Jing Yu <jingyu@google.com>
1519
1520 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1521 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1522 Update error message.
1523 (Target_aarch64::do_relax): Use absolute value of option
1524 stub_group_size. Replace local variable with class member
1525 stub_group_size_.
1526
cbcb23fa
AM
15272014-12-04 Alan Modra <amodra@gmail.com>
1528
1529 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1530 addend of PLTREL24 reloc when not generating a plt stub. Make
1531 max_branch_offset an "Address".
fbad6518 1532 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1533 (Target_powerpc::Relocate::relocate): Likewise.
1534
1611bc4a
AM
15352014-12-04 Alan Modra <amodra@gmail.com>
1536
1537 PR 17670
1538 * symtab.cc (Symbol::set_undefined): Remove assertion.
1539 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1540 on symbols defined in discarded sections, instead return false.
1541 Rearrange params, update all callers.
1542 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1543 branches to syms in discarded sections.
1544 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1545 undefined and flag as discarded.
1546 (Target_powerpc::Relocate::relocate): Localize variable.
1547
4759c34e
L
15482014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1549
1550 PR gold/17675
1551 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1552 * testsuite/Makefile.in: Regenerated.
1553
1f98a074
AM
15542014-12-03 Alan Modra <amodra@gmail.com>
1555
1556 PR 17566
1557 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1558 when adding dynamic relocations against section symbols.
1559
fb257835
DI
15602014-12-01 Dimitry Ivanov <dimitry@google.com>
1561
1562 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1563 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1564 * options.h (General_options): New -z option (global).
1565
d8e60314
CC
15662014-12-01 Cary Coutant <ccoutant@google.com>
1567
1568 PR gold/17578
1569 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1570 is given.
1571 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1572 given but some inputs require executable stack.
1573
982bbd97
CC
15742014-11-26 Cary Coutant <ccoutant@google.com>
1575
1576 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1577 .debug_str_offsets; strip .debug_gnu_pubnames and
1578 .debug_gnu_pubtypes.
1579 (lines_only_debug_sections): Strip all four new sections.
1580
bb779192
HS
15812014-11-26 Jing Yu <jingyu@google.com>
1582
1583 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1584 register to be x0 when to relax TLSDESC_LD64_LO12.
1585
a3e60ddb
AM
15862014-11-26 Alan Modra <amodra@gmail.com>
1587
1588 * powerpc.cc (struct Stub_table_owner): New.
1589 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1590 unsigned int vector. Update all references.
1591 (powerpc_relobj::set_stub_table): Take an unsigned int param
1592 rather than a Stub_table. Update callers.
1593 (Powerpc_relobj::clear_stub_table): New function.
1594 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1595 stub_group_size_ vars.
1596 (Target_powerpc::new_stub_table): Delete.
1597 (max_branch_delta): New function, extracted from..
1598 (Target_powerpc::Relocate::relocate): ..here..
1599 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1600 status on whether stub created successfully.
1601 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1602 default sizing to..
1603 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1604 reduce on relax failure.
1605 (Target_powerpc::group_sections): Add "no_size_errors" param.
1606 Use stub_group_size_. Set up group info in a temp vector,
1607 before building Stub_table vector. Account for input sections
1608 possibly already converted to relaxed sections.
1609 (Stub_table::init): Delete. Merge into..
1610 (Stub_table::Stub_table): ..here.
1611 (Stub_table::can_reach_stub): New function.
1612 (Stub_table::add_plt_call_entry): Add "from" parameter and
1613 return true iff stub could be reached.
1614 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1615 param too.
1616 (Stub_table::clear_stubs): Add "all" param.
1617
a20605cf
AM
16182014-11-26 Alan Modra <amodra@gmail.com>
1619
1620 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1621 (Target_powerpc::group_sections): Use it.
1622
43b64deb
CC
16232014-11-25 Cary Coutant <ccoutant@google.com>
1624
1625 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1626 (Binary_to_elf::write_symbol): Add st_size parameter.
1627 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1628
c924eb67
CC
16292014-11-25 Cary Coutant <ccoutant@google.com>
1630
1631 PR gold/17639
1632 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1633 (Sized_relobj_file::do_layout): Handle deferred sections properly
1634 during GC pass 1. Don't add reloc sections to deferred list twice.
1635 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1636 (Sized_relobj_file::is_deferred_layout_): New data member.
1637
9d585188
L
16382014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1639
1640 PR gold/17619
1641 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1642 Check PC-relative offset overflow in PLT entry.
1643
3ffaac20
AM
16442014-11-21 Alan Modra <amodra@gmail.com>
1645
1646 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1647 for undefined weaks.
1648
0cfb0717
AM
16492014-11-20 Alan Modra <amodra@gmail.com>
1650
1651 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1652 from --stub-group-size parameter divided by 1024.
1653 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1654 template parameter. Update all uses.
1655 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1656 has_stub_value. Set for long branches. Don't report overflow for
1657 branch to undefined weak symbols. Print info message on
1658 overflowing branch to stub.
1659
f9dffbf0
AM
16602014-11-20 Alan Modra <amodra@gmail.com>
1661
1662 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1663
e88ba8d5
L
16642014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1667 entry for R_X86_64_GOTPLT64.
1668 (Target_x86_64<size>::Relocate::relocate): Update comments for
1669 R_X86_64_GOTPLT64.
1670
d37ffe25
ED
16712014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1672
1673 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1674 * plugin.h: add lock definition
1675
9726c3c1
HS
16762014-10-29 Han Shen <shenhan@google.com>
1677 Jing Yu <jingyu@google.com>
1678
1679 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1680 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1681 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1682 Symbol::TLS_REF.
1683 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1684 method.
1685 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1686 (Target_aarch64::tls_ld_to_le): New method.
1687 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1688 for 64bit targets.
1689 (Output_data_plt_aarch64::irelative_rel_): New data member.
1690 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1691 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1692 (Output_data_plt_aarch64::add_relocation): New method.
1693 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1694 offset. Add got_irelative size to got size.
1695 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1696 type string with the new typename.
1697 (AArch64_relocate_functions::update_adr): Replace parameter x with
1698 immed.
1699 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1700 (AArch64_relocate_functions::reloc_common): New method.
1701 (AArch64_relocate_funcsions::rela_general): Extract common part out
1702 into reloc_common method.
1703 (AArch64_relocate_functions::rela_general): Likewise.
1704 (AArch64_relocate_functions::pcrela_general): Likewise.
1705 (AArch64_relocate_functions::adr): New method.
1706 (AArch64_relocate_functions::adrp): Calculate immed before calling
1707 update_adr.
1708 (AArch64_relocate_functions::adrp): Likewise.
1709 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1710 comparing x to 0. Calculate immed from ~x when x < 0.
1711 (Target_aarch64::optimize_tls_reloc): Add new cases for
1712 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1713 TLSLD_MOVW_DTPREL_G0_NC.
1714 (Target_aarch64::possible_function_pointer_reloc): Implement this
1715 method.
1716 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1717 comment.
1718 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1719 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1720 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1721 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1722 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1723 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1724 (Target_aarch64::make_plt_entry): Call add_entry with two more
1725 parameters.
1726 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1727 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1728 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1729 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1730 (Target_aarch64::Relocate::relocate_tls): Add cases for
1731 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1732 TLSLD_MOVW_DTPREL_G0_NC.
1733 * testsuite/icf_safe_so_test.cc: Correct test comment.
1734 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1735
80272b8c
AM
17362014-10-22 Alan Modra <amodra@gmail.com>
1737
1738 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1739 thread_starter.
1740
998a69f4
AS
17412014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1742
1743 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1744
aed56ec5
CC
17452014-10-17 Cary Coutant <ccoutant@google.com>
1746
1747 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1748 Add "typename" keyword.
1749
bb779192 17502014-10-15 Han Shen <shenhan@google.com>
72f4393d 1751 Jing Yu <jingyu@google.com>
83a01957
HS
1752
1753 Patch for gold aarch64 backend to support relaxation.
1754 * aarch64-reloc.def: Change format.
1755 * aarch64.cc (class Reloc_stub): New class.
1756 (class Stub_table): New class.
1757 (class AArch64_relobj): New class.
1758 (class AArch64_input_section): New class.
1759 (class AArch64_output_section): New class.
1760 (Target_aarch64::new_stub_table): New method.
1761 (Target_aarch64::new_aarch64_input_section): New method.
1762 (Target_aarch64::find_aarch64_input_section): New method.
1763 (Target_aarch64::scan_section_for_stubs): New method.
1764 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1765 (Target_aarch64::relocate_stub): New method.
1766 (Target_aarch64::current_target): New method.
1767 (Target_aarch64::do_make_elf_object): New method.
1768 (Target_aarch64::do_may_relax): New method.
1769 (Target_aarch64::do_relax): New method.
1770 (Target_aarch64::group_sections): New method.
1771 (Target_aarch64::scan_reloc_for_stub): New method.
1772 (Target_aarch64::do_make_output_section): New method.
1773 (Target_aarch64::stub_tables_): New data member.
1774 (Target_aarch64::aarch64_input_section_map_): New data member.
1775 (AArch64_relocate_functions::maybe_apply_stub): New method.
1776
db4c9594
CC
17772014-09-30 Cary Coutant <ccoutant@google.com>
1778
1779 PR gold/17432
1780 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1781
cd6da036
KC
17822014-09-30 Kito Cheng <kito@0xlab.org>
1783
1784 PR gold/13597
1785 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1786 hash table before sysv-style hash table.
1787
5f772412
ST
17882014-09-29 Sriraman Tallam <tmsriram@google.com>
1789
1790 * options.h (--pic-executable): Add negative to alias to -no-pie.
1791
5efeedf6
CC
17922014-09-26 Cary Coutant <ccoutant@google.com>
1793
1794 PR gold/16773
1795 * object.cc (Sized_relobj_file): Compute value of section symbols
1796 for TLS sections the same as TLS symbols.
1797
1707f183
CC
17982014-09-25 Cary Coutant <ccoutant@google.com>
1799
1800 PR gold/17432
1801 * resolve.cc (Symbol_table::resolve): Override common placeholder
1802 symbols, but adjust sizes.
1803 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1804 symbols to common lists.
1805
00cac886
AM
18062014-09-24 Alan Modra <amodra@gmail.com>
1807
1808 * po/POTFILES.in: Regenerate.
1809
635aa30e 18102014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1811 Cary Coutant <ccoutant@google.com>
635aa30e 1812
71b9b91b 1813 PR gold/14860
635aa30e
CC
1814 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1815 on input_sections_blocker.
1816 * layout.cc (Write_sections_task::locks): Unblock
1817 input_sections_blocker_.
1818 * layout.h (Write_sections_task::Write_sections_task): Add
1819 input_sections_blocker.
1820 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1821 to DEPENDENCIES.
1822 * testsuite/Makefile.in: Regenerate.
1823
c0c71592
RÁE
18242014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1825
1826 * testsuite/Makefile.am (plugin_test_10): New test.
1827 * testsuite/Makefile.in: Regenerate
1828 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1829 * testsuite/plugin_test_10.sh: New file.
1830
6168c2a1
RÁE
18312014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1832
1833 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1834 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1835 during the replacement phase.
1836
3a531937
JY
18372014-09-17 Han Shen <shenhan@google.com>
1838 Jing Yu <jingyu@google.com>
1839
1840 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1841 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1842 * aarch64.cc (Target_aarch64): Add data members
1843 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1844 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1845 constructor.
1846 (Target_aarch64::do_reloc_symbol_index): New method.
1847 (Target_aarch64::do_reloc_addend): New method.
1848 (Target_aarch64::add_tlsdesc_info): New method.
1849 (Target_aarch64::do_dynsym_value): New method.
1850 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1851 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1852 (Target_aarch64::make_data_plt): Add new parameters: got,
1853 got_irelative. Pass them to do_make_data_plt.
1854 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1855 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1856 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1857 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1858 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1859 (Target_aarch64::got_tlsdesc_section): New method.
1860 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1861 (Target_aarch64::define_tls_base_symbol): New method.
1862 (Target_aarch64::reserve_tlsdesc_entries): New method.
1863 (Target_aarch64::got_mod_index_entry): New method.
1864 (Target_aarch64::rela_tlsdesc_section): New method.
1865 (Target_aarch64::rela_irelative_section): New method.
1866 (Target_aarch64::Tlsdesc_info): New struct.
1867 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1868 relocations and tlsdesc relocations.
1869 (Target_aarch64::optimize_tls_reloc): Implement method.
1870 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1871 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1872 in constructor.
1873 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1874 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1875 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1876 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1877 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1878 (Output_data_plt_aarch64::rela_irelative): New method.
1879 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1880 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1881 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1882 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1883 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1884 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1885 (Output_data_plt_aarch64_standard): New member variables:
1886 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1887 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1888 New parameter: got, got_irelative.
1889 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1890 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1891 (Output_data_plt_aarch64::do_write): Replace got_address with
1892 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1893 (AArch64_relocate_functions::update_movnz): New method.
1894 (AArch64_relocate_functions): Correct format.
1895 (AArch64_relocate_functions::movnz): New method.
1896 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1897 before the switch. Add new cases to switch.
00cac886 1898 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1899 tlsgd tlsdesc cases.
1900 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1901 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1902 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1903 Call reloc_name_in_error_message to print unsupported reloc.
1904 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1905 make_data_plt.
1906 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1907 relocs. Fill in some more dynamic tags.
1908 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1909 Skip call tls_get_addr when tlsgd is relaxed.
1910 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1911 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1912 tlsdesc->ie relaxation.
1913
62661c93
SS
19142014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1915
1916 * mips.cc (Target_mips_nacl): New class.
1917 (Target_selector_mips_nacl): New class.
1918 (target_selector_mips32): Rename from target_selector_mips32be and use
1919 Target_selector_mips_nacl instead of Target_selector_mips.
1920 (target_selector_mips32el): Rename from target_selector_mips32 and use
1921 Target_selector_mips_nacl instead of Target_selector_mips.
1922 (target_selector_mips64): Rename from target_selector_mips64be and use
1923 Target_selector_mips_nacl instead of Target_selector_mips.
1924 (target_selector_mips64el): Rename from target_selector_mips64 and use
1925 Target_selector_mips_nacl instead of Target_selector_mips.
1926 (Target_mips::mips_info): Add const attribute.
1927
54674d38
CC
19282014-09-02 Cary Coutant <ccoutant@google.com>
1929
1930 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1931 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1932 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1933 (Sized_incr_dynobj::do_section_name): Likewise.
1934 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1935 (Sized_incr_dynobj::do_section_name): Likewise.
1936 * object.h (Object::section_name): Likewise.
1937 (Object::do_section_name): Likewise.
1938 (Sized_relobj_file::do_section_name): Likewise.
1939 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1940 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1941
9860cbcf
CC
19422014-09-02 Cary Coutant <ccoutant@google.com>
1943
1944 PR gold/17005
1945 * ehframe.cc (Fde::write): Add output_offset parameter.
1946 (Cie::write): Likewise.
1947 (Eh_frame::set_final_data_size): Account for offset within output
1948 section.
1949 (Eh_frame::do_sized_write): Likewise.
1950 * ehframe.h (Fde::write): Add output_offset parameter.
1951 (Cie::write): Likewise.
1952 * output.cc (Output_section::Input_section_sort_entry): Remove
1953 section_has_name_; add output_section_name parameter. Use
1954 output section name for non-input sections.
1955 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1956 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1957 (Output_section::Input_section_sort_compare): Remove logic for
1958 sections without names.
1959 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1960 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1961 Likewise.
1962 (Output_section::Input_section_sort_section_name_compare): Likewise.
1963
8e33481e
HS
19642014-08-29 Han Shen <shenhan@google.com>
1965 Jing Yu <jingyu@google.com>
1966
1967 * aarch64-reloc-property.cc
1968 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1969 reference reloc property in the table.
1970 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1971 3 other entries.
1972 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1973 2 new overloaded methods.
1974 (Output_data_got_aarch64::do_write): Add code to write out
1975 static relocs.
1976 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1977 static relocs.
1978 (Output_data_got_aarch64::static_relocs): New vector to
1979 hold static relocs.
1980 (Target_aarch64::TCB_SIZE): New const static memeber.
1981 (Target_aarch64::tcb_size): New method.
1982 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1983 (Target_aarch64::Relocate::relocate_tls): New method.
1984 (Target_aarch64::Scan::local): Add code handling new reloc types.
1985 (Target_aarch64::Scan::global): Add code handling new reloc types.
1986
81233653
ST
19872014-08-13 Sriraman Tallam <tmsriram@google.com>
1988
1989 * options.h (-no-pie): Add option.
1990
9363c7c3
JY
19912014-08-08 Jing Yu <jingyu@google.com>
1992 Han Shen <shenhan@google.com>
1993
1994 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1995 (DEFFILES): add aarch64-reloc.def.
1996 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1997 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1998 * Makefile.in: Regenerate.
1999 * aarch64-reloc-property.cc: New file.
2000 * aarch64-reloc-property.h: New file.
2001 * aarch64-reloc.def: New file.
2002 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2003 with tab to make the format consistent.
2004 (Output_data_got_aarch64::symbol_table_): New method.
2005 (Target_aarch64::do_plt_address_for_global): New method.
2006 (Target_aarch64::do_plt_address_for_local): New method.
2007 (Target_aarch64::do_select_as_default_target): New method.
2008 (Target_aarch64::do_make_data_plt): New method.
2009 (Target_aarch64::make_data_plt): New method.
2010 (Output_data_plt_aarch64::has_irelative_section): New method.
2011 (Output_data_plt_aarch64::address_for_global): New method.
2012 (Output_data_plt_aarch64::address_for_local): New method.
2013 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2014 (Output_data_plt_aarch64::add_entry): Implement contents.
2015 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2016 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2017 the got_pov entry to plt0.
2018 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2019 Implement contents.
2020 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2021 (AArch64_howto): New struct.
2022 (aarch64_howto[]): New static const array.
2023 (AArch64_relocate_functions): New class.
2024 (Target_aarch64::Scan::get_reference_flags): Remove method.
2025 (Target_aarch64::Scan::local): Implement to support a few relocations.
2026 (Target_aarch64::Scan::global): Implement to support a few relocations.
2027 (Target_aarch64::make_plt_section): Implement contents.
2028 (Target_aarch64::make_plt_entry): Implement contents.
2029 (Target_aarch64::do_finalize_sections): Implement contents.
2030 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2031 (Target_aarch64::relocate_section): Implement contents.
2032
ad9fe6c1
AM
20332014-08-06 Alan Modra <amodra@gmail.com>
2034
2035 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2036
7cd4e5b7
AM
20372014-08-06 Alan Modra <amodra@gmail.com>
2038
2039 PR 13227
2040 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2041
5ad9b0a7
ST
20422014-07-21 Sriraman Tallam <tmsriram@google.com>
2043
2044 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2045 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2046
e051745c
CC
20472014-07-08 Cary Coutant <ccoutant@google.com>
2048
2049 * expression.cc (struct Expression::Expression_eval_info): Add
2050 new fields type_pointer, vis_pointer, and nonvis_pointer.
2051 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2052 nonvis_pointer parameters. Adjust all calls.
2053 (Symbol_expression::value): Update type, visibility, and nonvis bits
2054 in caller.
2055 * script.cc (Symbol_assignment::sized_finalize): Update type,
2056 visibility, and remaining st_other bits for new symbol.
2057 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2058 vis_pointer, and nonvis_pointer parameters.
2059 * symtab.h (Symbol::set_type): New method.
2060
2061 * testsuite/Makefile.am (defsym_test): New test.
2062 * testsuite/Makefile.in: Regenerate.
2063 * testsuite/defsym_test.c: New file.
2064 * testsuite/defsym_test.sh: New file.
2065
f35c4853
CC
20662014-07-08 Cary Coutant <ccoutant@google.com>
2067
2068 PR gold/15639
2069 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2070 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2071 (Sized_dynobj::base_read_symbols): ...new method.
2072 * object.h (Sized_relobj_file::base_read_symbols): New method.
2073 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2074 (Sized_relobj_file::base_read_symbols): ...new method.
2075 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2076 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2077 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2078
2900af2d
AM
20792014-07-04 Alan Modra <amodra@gmail.com>
2080
2081 * po/POTFILES.in: Regenerate.
2082
053a4d68
JY
20832014-07-02 Jing Yu <jingyu@google.com>
2084
2085 * aarch64.cc: New file
2086 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2087 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2088 * Makefile.in: Regenerate.
2089 * configure.tgt: Add entries for aarch64*.
2090 * configure.ac: Likewise.
2091 * configure: Likewise.
2092
7b549045
AM
20932014-06-27 Alan Modra <amodra@gmail.com>
2094
2095 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2096
cb818dbf
CC
20972014-06-24 Cary Coutant <ccoutant@google.com>
2098
2099 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2100 sections.
2101 (Dwo_file::sized_read_unit_index): Likewise.
2102
9810d34d
SS
21032014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2104
2105 * mips.cc: New file.
2106 * Makefile.am (TARGETSOURCES): Add mips.cc
2107 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2108 * configure.tgt: Add entries for mips*.
2109 * configure.ac: Likewise.
2110 * Makefile.in: Regenerate.
2111 * configure: Likewise.
2112
9baa787b
CC
21132014-06-09 Cary Coutant <ccoutant@google.com>
2114
2115 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2116 unit_length is within section bounds.
2117
8f89af0a
CC
21182014-06-09 Cary Coutant <ccoutant@google.com>
2119
2120 PR gold/16980
2121 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2122 map.
2123
a47622ac
AM
21242014-06-07 Alan Modra <amodra@gmail.com>
2125
2126 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2127
4320c691
CC
21282014-06-06 Cary Coutant <ccoutant@google.com>
2129
2130 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2131 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2132 (Dwarf_pubnames_table::read_header): Likewise.
2133 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2134 .debug_gnu_pubtypes.
2135
270c9937
JB
21362014-06-05 Joel Brobecker <brobecker@adacore.com>
2137
2138 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2139 * Makefile.in, configure: Regenerate.
2140
397998fc
AM
21412014-06-03 Alan Modra <amodra@gmail.com>
2142
2143 * powerpc.cc (addis_12_2): Define.
2144 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2145
61f5c66f
AM
21462014-06-03 Alan Modra <amodra@gmail.com>
2147
2148 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2149 st_other output.
2150
f6971787
AM
21512014-06-02 Alan Modra <amodra@gmail.com>
2152
2153 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2154 Only ignore relocs on ELFv1.
2155 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2156
f6fb8322
CC
21572014-05-30 Cary Coutant <ccoutant@google.com>
2158
2159 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2160 * testsuite/Makefile.in: Regenerate.
2161 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2162
c23dd342
L
21632014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2164
2165 PR gold/16945
2166 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2167 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2168
5fe7ffdc
AM
21692014-05-15 Alan Modra <amodra@gmail.com>
2170
2171 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2172 Compare FDE contents with DW_CFA_nop rather than 0.
2173
a82bef93
ST
21742014-05-13 Sriraman Tallam <tmsriram@google.com>
2175
2176 * symtab.h (may_need_copy_reloc): Remove check for position independent
2177 code.
2178 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2179 position independence before pc absolute may_need_copy_reloc call.
2180 Add check for executable output befor pc relative may_need_copy_reloc
2181 call.
2182 * i386.cc: Ditto.
2183 * arm.cc: Ditto.
2184 * sparc.cc: Ditto.
2185 * tilegx.cc: Ditto.
2186 * powerpc.cc: Add check for no position independence before
2187 may_need_copy_reloc calls.
2188 * testsuite/pie_copyrelocs_test.cc: New file.
2189 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2190 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2191 * Makefile.in: Regenerate.
a82bef93 2192
53c66605
ML
21932014-05-08 Martin Liška <mliska@suse.cz>
2194
2195 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2196
57b2284c
CC
21972014-05-06 Cary Coutant <ccoutant@google.com>
2198
2199 PR gold/16900
2200 * i386.cc (Output_data_got_plt_i386): New class.
2201 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2202 parameter. Change all callers.
2203 (Output_data_plt_i386::layout_): Remove.
2204 (Output_data_plt_i386::got_plt_): Change type.
2205 (Target_i386::got_plt_): Change type. Change all references.
2206 (Target_i386::got_section): Create instance of new class.
2207 (Output_data_got_plt_i386::do_write): New function.
2208 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2209 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2210 parameter. Change all callers.
2211 (Output_data_plt_x86_64::layout_): Remove.
2212 (Output_data_plt_x86_64::got_plt_): Change type.
2213 (Target_x86_64::got_plt_): Change type. Change all references.
2214 (Target_x86_64::got_section): Create instance of new class.
2215 (Output_data_got_plt_x86_64::do_write): New function.
2216 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2217 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2218 class.
2219
6b97515d 22202014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2221
6b97515d
CC
2222 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2223 if we have pubnames/pubtypes.
2224
d1bddd3c
CC
22252014-05-02 Cary Coutant <ccoutant@google.com>
2226
5fe7ffdc
AM
2227 * defstd.cc (in_segment): Define __ehdr_start here...
2228 * layout.cc (Layout::finalize): ...Instead of here. Set the
2229 output segment when known.
2230 * resolve.cc (Symbol::override_base_with_special): Remember
2231 the original binding.
2232 * symtab.cc (Symbol::set_output_segment): New function.
2233 (Symbol::set_undefined): New function.
2234 * symtab.h (Symbol::is_weak_undefined): Check original undef
2235 binding.
2236 (Symbol::is_strong_undefined): New function.
2237 (Symbol::set_output_segment): New function.
2238 (Symbol::set_undefined): New function.
2239 * target-reloc.h (is_strong_undefined): Remove.
2240 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2241 Check for hidden undefs.
2242 (relocate_section): Call Symbol::is_strong_undefined.
2243
2244 * testsuite/Makefile.am (ehdr_start_test_1)
2245 (ehdr_start_test_2, ehdr_start_test_3)
2246 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2247 * testsuite/Makefile.in: Regenerate.
2248 * testsuite/ehdr_start_def.cc: New source file.
2249 * testsuite/ehdr_start_test.cc: New source file.
2250 * testsuite/ehdr_start_test.t: New linker script.
2251 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2252
7849f6d8
CC
22532014-04-23 Cary Coutant <ccoutant@google.com>
2254
bf2cc635 2255 PR gold/16870
7849f6d8
CC
2256 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2257
99fd8cff
CC
22582014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2259
2260 * layout.cc (Layout::include_section): Allow a target to decide
2261 whether to include a section.
2262 * target.h (Target::should_include_section): New function.
2263 (Target::do_should_include_section): New function.
2264
91f43acd
CC
22652014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2266
2267 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2268 inline into ...
2269 (Copy_relocs::emit): ... here.
2270 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2271 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2272 (Copy_reloc_entry::entries_): Change from private to protected.
2273
c4eb27e1
ST
22742014-04-02 Sriraman Tallam <tmsriram@google.com>
2275
2276 * icf.cc (get_section_contents): Replace copies of reloc
2277 vectors with const references.
2278
ae447ddd
CC
22792014-04-02 Cary Coutant <ccoutant@google.com>
2280
2281 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2282 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2283 * configure: Regenerate.
2284 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2285 -fno-use-linker-plugin.
2286 (LINK1, CXXLINK1): Add it to the link command.
2287 * testsuite/Makefile.in: Regenerate.
2288
fa47fa92
AM
22892014-03-12 Alan Modra <amodra@gmail.com>
2290
2291 * Makefile.in: Regenerate.
2292
9b12c500
CC
22932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2294
2295 * symtab.h (Symbol::set_nonvis): New function.
2296
beacaa96
CC
22972014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2298
2299 * symtab.cc (Sized_symbol<32>::init_output_data):
2300 Instantiate the template.
2301 (Sized_symbol<64>::init_output_data): Likewise.
2302
800d9823
CC
23032014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2304
2305 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2306 adjust dynamic symbol value.
2307 * target.h (Target::adjust_dyn_symbol): New function.
2308 (Target::do_adjust_dyn_symbol): New function.
2309
918fc1f8 23102014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2311
918fc1f8
CC
2312 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2313 Get the value of DYNAMIC_CUSTOM dynamic entry.
2314 * output.h (Output_data_dynamic::add_custom): New function.
2315 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2316 dynamic entry.
2317 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2318 * target.h (Target::dynamic_tag_custom_value): New function.
2319 (Target::do_dynamic_tag_custom_value): New function.
2320
98ff9231
CC
23212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2322
2323 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2324 dynsym indexes.
2325 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2326 (Target::do_has_custom_set_dynsym_indexes): New function.
2327 (Target::set_dynsym_indexes): New function.
2328 (Target::do_set_dynsym_indexes): New function.
2329
b80eed39
AM
23302014-03-07 Alan Modra <amodra@gmail.com>
2331
2332 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2333 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2334 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2335 (Powerpc_relocate_functions::has_overflow_bitfield,
2336 overflowed): Use the above.
2337 (Target_powerpc::Relocate::relocate): Correct overflow checking
2338 for a number of relocations. Modify overflow test for 16-bit
2339 fields in instructions to signed/unsigned according to whether
2340 the field takes a signed or unsigned value.
2341
4b95cf5c
AM
23422014-03-05 Alan Modra <amodra@gmail.com>
2343
2344 Update copyright years.
2345
45965137
AM
23462014-03-05 Alan Modra <amodra@gmail.com>
2347
2348 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2349 R_PPC64_ADDR64_LOCAL.
2350 (Target_powerpc::Relocate::relocate): Likewise.
2351
2c80b753
AM
23522014-03-03 Alan Modra <amodra@gmail.com>
2353
2354 * dwp.cc (print_version): Update copyright year to current.
2355
c1c69e83
AM
23562014-02-10 Alan Modra <amodra@gmail.com>
2357
2358 * po/gold.pot: Regenerate.
2359
dd0c4e70
CC
23602014-02-06 Cary Coutant <ccoutant@google.com>
2361
2362 Fix problem where -u is ignored when a weak undef is seen.
2363
2364 * archive.cc (Library_base::should_include_member): Reorder
2365 code to check for -u option if a weak undef has already been seen.
2366 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2367 * testsuite/Makefile.in: Regenerate.
2368 * testsuite/weak_undef_file3.cc: New file.
2369 * testsuite/weak_undef_file4.cc: New file.
2370 * testsuite/weak_undef_test_2.cc: New file.
2371
1a221d3d
CC
23722014-02-05 Cary Coutant <ccoutant@google.com>
2373
2374 Fix issues with gold undefined symbol diagnostics.
2375
2376 PR binutils/15435
2377 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2378 check to here.
2379 * target-reloc.h (is_strong_undefined): New function.
2380 (relocate_section): Move undef vtable symbol check from here.
2381 Check for is_strong_undefined.
2382
e889f0a4 23832014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2384
e889f0a4
CC
2385 Fix problems with the --dynamic-list option.
2386
2387 PR gold/13577
2388 * options.cc (General_options::parse_dynamic_list):
2389 Set have_dynamic_list_.
2390 (General_options::General_options): Initialize have_dynamic_list_.
2391 (General_options::finalize): Turn off -Bsymbolic and
2392 -Bsymbolic-functions if --dynamic-list provided.
2393 * options.h (General_options::have_dynamic_list): New function.
2394 (General_options::have_dynamic_list_): New data member.
2395 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2396 correctly.
5fe7ffdc 2397
e889f0a4
CC
2398 PR gold/16530
2399 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2400 in --dynamic-list, mark it.
5fe7ffdc 2401
e889f0a4
CC
2402 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2403 (dynamic_list_2): New test case.
2404 * testsuite/Makefile.in: Regenerate.
2405 * testsuite/dynamic_list_2.cc: New file.
2406 * testsuite/dynamic_list_2.t: New file.
2407 * testsuite/dynamic_list_lib1.cc: New file.
2408 * testsuite/dynamic_list_lib2.cc: New file.
2409 * testsuite/gc_dynamic_list_test.c: New file.
2410 * testsuite/gc_dynamic_list_test.sh: New file.
2411 * testsuite/gc_dynamic_list_test.t: New file.
2412
ec673e64
CC
24132014-01-28 Cary Coutant <ccoutant@google.com>
2414
2415 Add .gdb_index version 7 support.
2416
2417 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2418 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2419 debug sections.
2420 (Dwarf_ranges_table::read_ranges_table): Likewise.
2421 (Dwarf_pubnames_table::read_section): Check for GNU-style
2422 sections, and for compressed debug sections.
2423 (Dwarf_pubnames_table::read_header): Compute end address of table.
2424 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2425 for end of list by offset, not by offset == 0.
2426 (Dwarf_info_reader::do_read_string_table): Check for compressed
2427 debug sections.
2428 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2429 Initialize new data members.
2430 (Dwarf_pubnames_table::next_name): return flag_byte.
2431 (Dwarf_pubnames_table::end_of_table_): New data member.
2432 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2433 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2434 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2435 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2436 read skeleton type unit DIEs.
2437 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2438 (Gdb_index::do_write): Write flag_byte.
2439 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2440 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2441 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2442 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2443
221fd5d5
L
24442014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2445
2446 * version.cc (print_version): Update copyright year to 2014.
2447
6c09fb0b
ILT
24482013-12-19 Dimitry Andric <dimitry@andric.com>
2449
2450 * stringpool.cc (Stringpool_template::reserve): Add
2451 HAVE_UNORDERED_MAP case.
2452 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2453
8356f2d0
CC
24542013-12-18 Cary Coutant <ccoutant@google.com>
2455
2456 * configure.ac: Check for <unordered_set> and <unordered_map>.
2457 * config.in: Regenerate.
2458 * configure: Regenerate.
2459 * system.h: Use <unordered_set> and <unordered_map> if available.
2460
f2c7d7ee
RM
24612013-12-10 Roland McGrath <mcgrathr@google.com>
2462
2463 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2464 with $(INSTALL_PROGRAM_ENV).
2465 * Makefile.in: Regenerate.
2466
6632e8cc
CC
24672013-11-22 Cary Coutant <ccoutant@google.com>
2468
2469 * configure.ac: Add check for which library is needed for
2470 dlopen.
2471 * configure: Regenerate.
2472
0c075858
CC
24732013-11-22 Cary Coutant <ccoutant@google.com>
2474
2475 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2476 assembler.
2477 * testsuite/Makefile.in: Regenerate.
2478
f49fe902
L
24792013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2480
2481 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2482 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2483 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2484 (Target_x86_64<size>::Scan::local): Likewise.
2485 (Target_x86_64<size>::Scan::global): Likewise.
2486 (Target_x86_64<size>::Relocate::relocate): Likewise.
2487 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2488 Likewise.
2489 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2490 R_X86_64_PC32_BND.
2491
2492 * testsuite/Makefile.am (check_PROGRAMS): Add
2493 exception_x86_64_bnd_test.
2494 (exception_x86_64_bnd_test_SOURCES): New macro.
2495 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2496 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2497 (exception_x86_64_bnd_test_LDADD): Likewise.
2498 (exception_x86_64_bnd_1.o): New rule.
2499 (exception_x86_64_bnd_2.o): Likewise.
2500 * testsuite/Makefile.in: Regenerated.
2501
9055360d
AM
25022013-11-15 Alan Modra <amodra@gmail.com>
2503
2504 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2505 accessor.
2506 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2507 Only call ppc64_local_entry_offset for 64-bit. Restrict
2508 symval_for_branch lookup to ELFv1.
2509 (Stub_table::add_plt_call_entry): Use unsigned int off.
2510 (Output_data_glink::Address, invalid_address): New.
2511 (Output_data_glink::add_eh_frame): Move out of line. Add
2512 support for ELFv2.
2513 (Output_data_glink::add_global_entry, find_global_entry,
2514 global_entry_address): New functions.
2515 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2516 ge_size): New variables.
2517 (Output_data_glink::set_final_data_size): Add global entry
2518 stub sizing.
2519 (Output_data_glink::do_write): Write global entry stubs.
2520 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2521 parameter. Return true for ELFv2. Adjust callers.
2522 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2523 ELFv1. Similarly for ifunc and dynamic relocation processing
2524 specific to ELFv1. Recognize that symbols are defined on
2525 their plt entries for ELFv2.
2526 (Target_powerpc::symval_for_branch): Assert if called for
2527 ELFv2 or ppc32.
2528 (Target_powerpc::Relocate::relocate): Use global entry plt
2529 stub for symbol value if such exists on ELFv2.
2530 (Target_powerpc::Relocate::relocate): Don't call
2531 symval_for_branch when ELFv2. Do adjust for local entry
2532 offset when ELFv2.
2533 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2534 plt stub for ELFv2.
2535 (Target_powerpc::do_plt_address_for_global): Similarly.
2536
cafdd569
CC
25372013-11-14 Cary Coutant <ccoutant@google.com>
2538
2539 Revert patch -- this did not fix the problem, and there is
2540 no race there.
2541
2542 2013-11-14 Cary Coutant <ccoutant@google.com>
2543
2544 PR gold/14860
2545 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2546 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2547 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2548 updating fde_offsets_.
2549 (Eh_frame_hdr::lock_): New data member.
2550
94e49e16
CC
25512013-11-14 Cary Coutant <ccoutant@google.com>
2552
2553 * dwp.cc (Dwo_file_entry): New type.
2554 (File_list): Use Dwo_file_entry.
2555 (Dwo_file::verify): New function.
2556 (Dwo_file::verify_dwo_list): New function.
2557 (Dwo_file::sized_verify_dwo_list): New function.
2558 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2559 list.
2560 (Dwp_options): New enum type.
2561 (dwp_options): Add --verify-only.
2562 (usage): Likewise.
2563 (main): Likewise.
2564 * dwp.h (gold_info): Add declaration.
2565
7cdd7d57
CC
25662013-11-14 Cary Coutant <ccoutant@google.com>
2567
2568 PR gold/14860
2569 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2570 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2571 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2572 updating fde_offsets_.
2573 (Eh_frame_hdr::lock_): New data member.
2574
1d946cb3
CC
25752013-11-06 Cary Coutant <ccoutant@google.com>
2576
2577 PR gold/15758
2578 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2579 before reloc sections.
2580
4f65b40e
AM
25812013-11-04 Alan Modra <amodra@gmail.com>
2582
2583 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2584 (Symbol::needs_dynamic_reloc): Test new flag.
2585 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2586 (Target_powerpc::Scan::get_reference_flags): Add target param.
2587 Return FUNC_DESC_ABI for 64-bit ELFv1.
2588 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2589 call.
2590 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2591 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2592
908794a9
CC
25932013-10-31 Cary Coutant <ccoutant@google.com>
2594
2595 Restore support for dwp v2 DWARF package file format.
2596
2597 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2598 tu_length parameter. Adjust all callers.
2599 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2600 * dwp.cc: Include dwarf.h.
2601 (Section_bounds): New struct type.
2602 (Unit_set): New struct type.
2603 (Dwo_file::Dwo_file): Initialize new data member.
2604 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2605 Combine and rename to...
2606 (Dwo_file::read_unit_index): ...this.
2607 (Dwo_file::sized_read_compunit_index)
2608 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2609 (Dwo_file::sized_read_unit_index): ...this.
2610 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2611 parameters; add section_id parameter.
2612 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2613 (Dwo_file::add_unit_set): ...this.
2614 (Dwo_file::shndx_map_): Remove.
2615 (Dwo_file::sect_offsets_): New data member.
2616 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2617 (Dwp_output_file::add_section): Rename to...
2618 (Dwp_output_file::add_contribution): ...this.
2619 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2620 (Dwp_output_file::add_tu_set): Likewise.
2621 (Dwp_output_file::Contribution): New type.
2622 (Dwp_output_file::Section::contributions): New data member.
2623 (Dwp_output_file::Cu_or_tu_set): Remove.
2624 (Dwp_output_file::Section::Section): New ctor.
2625 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2626 (Dwp_output_file::Dwp_index::Section_table): New type.
2627 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2628 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2629 parameter.
2630 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2631 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2632 (Dwp_output_file::Dwp_index::section_table): New member function.
2633 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2634 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2635 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2636 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2637 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2638 (Dwp_output_file::Dwp_index::section_table_): New data member.
2639 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2640 (Dwp_output_file::add_output_section): New member function.
2641 (Dwp_output_file::write_new_section): New member function.
2642 (Dwp_output_file::write_contributions): New member function.
2643 (Dwp_output_file::section_id_map_): New data member.
2644 (class Dwo_id_info_reader): Remove.
2645 (class Unit_reader): New class.
2646 (get_dwarf_section_name): New function.
2647 (Dwo_file::read_executable): Adjust initializations of class data.
2648 (Dwo_file::read): Add support for v2 package file format.
2649 (Dwo_file::read_unit_index): Likewise.
2650 (Dwo_file::sized_read_unit_index): Likewise.
2651 (Dwo_file::copy_section): Likewise.
2652 (Dwo_file::add_unit_set): Likewise.
2653 (Dwp_output_file::add_output_section): Likewise.
2654 (Dwp_output_file::add_contribution): Likewise.
2655 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2656 for empty slot.
2657 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2658 file format.
2659 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2660 slot.
2661 (Dwp_output_file::initialize): Remove unused function.
2662 (Dwp_output_file::finalize): Add support for v2 package file format.
2663 (Dwp_output_file::write_index): Likewise.
2664 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2665 function prototype.
2666
2500c017
CC
26672013-10-31 Cary Coutant <ccoutant@google.com>
2668
2669 * configure.ac: Fix check for -fmerge-constants.
2670 * configure.ac: Regenerate.
2671
dd0845d7
RM
26722013-10-30 Roland McGrath <mcgrathr@google.com>
2673
2674 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2675 Correct 9-byte nop sequence to match what the assembler generates.
2676
b4f7960d
AM
26772013-10-30 Alan Modra <amodra@gmail.com>
2678
2679 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2680 ppc64_local_entry_offset, ppc64_local_entry_offset,
2681 do_read_symbols): New functions.
2682 (Powerpc_relobj::e_flags_, st_other_): New vars.
2683 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2684 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2685 (Powerpc_relobj::e_flags_): New var.
2686 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2687 and adjust for ELFv2.
2688 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2689 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2690 (Powerpc_dynobj::do_find_special_sections): Likewise.
2691 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2692 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2693 to ELFv2 local entry.
2694 (Target_powerpc::do_relax): No thread safe barriers needed for
2695 ELFv2.
2696 (Output_data_plt_powerpc::initial_plt_entry_size_,
2697 plt_entry_size): Delete. Replace all uses with
2698 first_plt_entry_offset() and plt_entry_size().
2699 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2700 reserved_size parm. Update callers.
2701 (Output_data_plt_powerpc::entry_count): Update.
2702 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2703 and use Target_powerpc::first_plt_entry_offset().
2704 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2705 rename to plt_entry_size.
2706 (Output_data_plt_powerpc::add_ifunc_entry,
2707 add_local_ifunc_entry): Adjust reloc for ELFv2.
2708 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2709 (glink_eh_frame_fde_64v2): New.
2710 (Stub_table::plt_call_size): Support ELFv2 sizing.
2711 (Output_data_glink::add_eh_frame): Use the new FDE.
2712 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2713 (Stub_table::do_write): Write ELFv2 stubs and glink.
2714 (Target_powerpc::Relocate::relocate): Replaces nop after call
2715 with ld 2,24(1) and adjust local offset destination for ELFv2.
2716
f9c6b907
AM
27172013-10-30 Alan Modra <amodra@gmail.com>
2718
2719 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2720 (Target_powerpc::Scan::global, local): Likewise.
2721 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2722 on all ppc64 @h and @ha relocs.
2723
e84fe78f
AM
27242013-10-14 Alan Modra <amodra@gmail.com>
2725
2726 * output.h (Output_data_got::add_constant): Tidy.
2727 (Output_data_got::add_constant_pair): New function.
2728 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2729 methods used so as to first call reserve_ent().
2730
679e4abf
RM
27312013-10-11 Roland McGrath <mcgrathr@google.com>
2732
44dcb735
RM
2733 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2734 add_got_entry and add_got_entry_pair.
2735
13323c49
RM
2736 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2737 (HAVE_PUBNAMES): Likewise.
2738 * configure: Regenerate.
2739
1496b446
RM
2740 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2741 * testsuite/Makefile.in: Regenerate.
2742
cc84c10b
RM
2743 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2744 Remove const from declaration.
2745 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2746 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2747 * output.h (Output_file_header): Remove const from member target_
2748 and corresponding constructor argument.
2749 * output.cc (Output_file_header::Output_file_header): Update prototype.
2750 (Output_file_header::do_sized_write): Use this->target_ in place
2751 of parameters()->target().
2752
52f66a2c
RM
2753 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2754
2b64b551
RM
2755 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2756 * configure: Regenerate.
2757 * Makefile.in: Regenerate.
2758 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2759 * testsuite/merge_string_literals_2.c: Likewise.
2760 * testsuite/Makefile.am
2761 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2762 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2763 literal -fmerge-constants.
2764 * testsuite/Makefile.in: Regenerate.
2765
43819297
RM
2766 * i386.cc (Target_i386): Remove unused member dynbss_.
2767 * arm.cc (Target_arm): Likewise.
2768 * powerpc.cc (Target_powerpc): Likewise.
2769 * sparc.cc (Target_sparc): Likewise.
2770 * tilegx.cc (Target_tilegx): Likewise.
2771 * x86_64.cc (Target_x86_64): Likewise.
2772 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2773 type_signature_, type_offset_.
2774 * plugin.h (Plugin_hook): Remove unused member layout_.
2775 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2776 mapfile_.
2777 (Read_member): Remove unused members input_objects_, symtab_,
2778 mapfile_, layout_.
2779 (Check_library): Remove unused member symtab_.
2780 * archive.h (Lib_group): Remove unused member lib_.
2781 * archive.cc (Lib_group::Lib_group): Update initializer.
2782 * incremental.h (Incremental_binary): Remove unused member target_.
2783 (Incremental_script_entry): Removed unused member script_.
2784 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2785 * icf.h (Icf): Remove unused member num_tracked_relocs.
2786
39d9ead7
RM
2787 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2788 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2789 its only use.
2790 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2791
679e4abf
RM
2792 * archive.h: Use struct rather than class for forward declaration
2793 of Read_symbols_data.
2794
54de2ea6
CC
27952013-10-07 Cary Coutant <ccoutant@google.com>
2796
2797 PR gold/16010
2798 * testsuite/Makefile.am (icf_test): Fix dependencies.
2799 (icf_safe_test): Likewise.
2800 (icf_safe_so_test): Likewise.
2801 (large_symbol_alignment): Add empty _LDADD rule.
2802 * testsuite/Makefile.in: Regenerate.
2803
b14016f0
L
28042013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2805
2806 PR gold/15927
2807 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2808 relocation for R_X86_64_32 on x32.
2809
eb426534
RM
28102013-08-27 Roland McGrath <mcgrathr@google.com>
2811
2812 * output.cc (Output_segment::set_section_addresses): Take new
2813 Target* argument. If target->isolate_execinstr() and the segment
2814 is executable and starts at a target->abi_pagesize() boundary,
2815 pad its end out to a target->abi_pagesize() boundary with code fill.
2816 * output.h (Output_segment::set_section_addresses): Update decl.
2817 * layout.h (Layout::check_output_data_for_reset_values): Take new
2818 argument RELAX_OUTPUTS.
2819 (Layout): New member relax_output_list_.
2820 (Layout::add_relax_output): New method.
2821 * layout.cc (Layout::Layout): Update constructor.
2822 (Layout::reset_relax_output): New method.
2823 (Layout::clean_up_after_relaxation): Call it.
2824 (Layout::prepare_for_relaxation): Update caller.
2825 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2826 Call reset_relax_output before re-processing segments for
2827 isolate_execinstr case.
2828 (Layout::write_data): Handle relax_output_list_.
2829 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2830 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2831
9aff4b7a
NC
28322013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2833
2834 PR binutils/15834
2835 * object.h: Fix typos.
2836
93f8221c
RM
28372013-08-16 Roland McGrath <mcgrathr@google.com>
2838
2839 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2840 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2841
e44c3715
CC
28422013-08-07 Cary Coutant <ccoutant@google.com>
2843
2844 Revert support for v2 DWP files:
2845
2846 2013-03-01 Cary Coutant <ccoutant@google.com>
2847
2848 Add dwp support for v2 DWARF package file format.
2849 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2850 tu_length parameter. Adjust all callers.
2851 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2852 * dwp.cc: Include dwarf.h.
2853 (Section_bounds): New struct type.
2854 (Unit_set): New struct type.
2855 (Dwo_file::Dwo_file): Initialize new data member.
2856 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2857 Combine and rename to...
2858 (Dwo_file::read_unit_index): ...this.
2859 (Dwo_file::sized_read_compunit_index)
2860 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2861 (Dwo_file::sized_read_unit_index): ...this.
2862 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2863 parameters; add section_id parameter.
2864 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2865 (Dwo_file::add_unit_set): ...this.
2866 (Dwo_file::shndx_map_): Remove.
2867 (Dwo_file::sect_offsets_): New data member.
2868 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2869 (Dwp_output_file::add_section): Rename to...
2870 (Dwp_output_file::add_contribution): ...this.
2871 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2872 (Dwp_output_file::add_tu_set): Likewise.
2873 (Dwp_output_file::Contribution): New type.
2874 (Dwp_output_file::Section::contributions): New data member.
2875 (Dwp_output_file::Cu_or_tu_set): Remove.
2876 (Dwp_output_file::Section::Section): New ctor.
2877 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2878 (Dwp_output_file::Dwp_index::Section_table): New type.
2879 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2880 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2881 parameter.
2882 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2883 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2884 (Dwp_output_file::Dwp_index::section_table): New member function.
2885 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2886 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2887 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2888 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2889 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2890 (Dwp_output_file::Dwp_index::section_table_): New data member.
2891 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2892 (Dwp_output_file::add_output_section): New member function.
2893 (Dwp_output_file::write_new_section): New member function.
2894 (Dwp_output_file::write_contributions): New member function.
2895 (Dwp_output_file::section_id_map_): New data member.
2896 (class Dwo_id_info_reader): Remove.
2897 (class Unit_reader): New class.
2898 (get_dwarf_section_name): New function.
2899 (Dwo_file::read_executable): Adjust initializations of class data.
2900 (Dwo_file::read): Add support for v2 package file format.
2901 (Dwo_file::read_unit_index): Likewise.
2902 (Dwo_file::sized_read_unit_index): Likewise.
2903 (Dwo_file::copy_section): Likewise.
2904 (Dwo_file::add_unit_set): Likewise.
2905 (Dwp_output_file::add_output_section): Likewise.
2906 (Dwp_output_file::add_contribution): Likewise.
2907 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2908 for empty slot.
2909 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2910 file format.
2911 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2912 slot.
2913 (Dwp_output_file::initialize): Remove unused function.
2914 (Dwp_output_file::finalize): Add support for v2 package file format.
2915 (Dwp_output_file::write_index): Likewise.
2916 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2917 function prototype.
2918
c6905c28
CC
29192013-07-31 Cary Coutant <ccoutant@google.com>
2920
2921 * object.cc (Sized_relobj::do_output_section_address): New function.
2922 (Sized_relobj): Instantiate explicitly.
2923 * object.h (Object::output_section_address): New function.
2924 (Object::do_output_section_address): New function.
2925 (Sized_relobj::do_output_section_address): New function.
2926 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2927
29282013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2929 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2930
2931 * parameters.cc (Parameters::entry): Return target-specific entry
2932 symbol name.
2933 * target.h (Target::entry_symbol_name): New function.
2934 (Target_info::entry_symbol_name): New data member.
2935
2936 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2937 * i386.cc (Target_i386::i386_info): Likewise.
2938 (Target_i386_nacl::i386_nacl_info): Likewise.
2939 * sparc.cc (Target_sparc::sparc_info): Likewise.
2940 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2941 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2942 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2943 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2944
234d4ab8
SA
29452013-07-22 Sterling Augustine <saugustine@google.com>
2946
2947 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2948 Convert parameter shndx to local variable. Add parameters symtab
2949 and symtab_size. Scan over section names. Find relocation
2950 section corresponding to current section. Create and initialize
2951 reloc_mapper_ and reloc_type_.
2952 (Dwarf_pubnames_table::read_header): Add assertion. Change
2953 unit_length to off_t. Initialize member unit_length_. Fill in field
2954 cu_offset_.
2955 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2956 Initialize new fields unit_length_ and cu_offset_.
2957 (Dwarf_pubnames_table::read_section): Update prototype.
2958 (Dwarf_pubnames_table::cu_offset): New member function.
2959 (Dwarf_pubnames_table::subsection_size): Likewise.
2960 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2961 New fields.
2962 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2963 member functions public.
2964 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2965 Update comment. Rework logic. Move repeated parts to...
2966 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2967 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2968 pubtypes_table_, and stmt_list_offset.
2969 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2970 Gdb_index::find_pubtype_offset,
2971 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2972 (Gdb_index::pubnames_read): Update prototype and rework logic.
2973 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2974 Forward declare.
2975 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2976 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2977 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2978 Gdb_index::map_pubtable_to_dies):
2979 Declare functions.
2980 (Gdb_index::pubnames_read): Update declaration.
2981 (Gdb_index::Pubname_offset_map): New type.
2982 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2983 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2984 Gdb_index::stmt_list_offset): Declare.
2985 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2986 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2987 Gdb_index::pubtypes_offset_): Remove.
2988
a3ed37d8
RM
29892013-07-19 Roland McGrath <mcgrathr@google.com>
2990
2991 * options.h (General_options): Add -Trodata-segment option.
2992 * parameters.cc (Parameters::check_rodata_segment): New function.
2993 (Parameters::set_target_once): Call it.
2994 * parameters.h (Parameters): Declare it (private member function).
2995 * layout.cc (load_seg_unusable_for_headers): New function, broken
2996 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2997 then validate rodata segment rather than text segment.
2998 (relaxation_loop_body): Call that.
2999 (is_text_segment): New function. Don't admit a non-executable
3000 segment if TARGET->isolate_execinstr().
3001 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3002
eb5b4ded
CC
30032013-07-15 Shawn Landden <shawnlandden@gmail.com>
3004
3005 PR gold/15070
3006 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3007 * nacl.h (Sniff_file::View::View): Request aligned view.
3008
4d5effb9
CC
30092013-07-11 Cary Coutant <ccoutant@google.com>
3010
3011 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3012 correct BRLT entry size.
3013
ba8ca3e7
AM
30142013-07-03 Alan Modra <amodra@gmail.com>
3015
3016 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3017 comment.
3018
267257d2
CC
30192013-07-01 Cary Coutant <ccoutant@google.com>
3020
3021 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3022 reloc_type_.
3023 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3024 (Dwarf_ranges_table::lookup_reloc): New function.
3025 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3026 reloc_type_.
3027 (Dwarf_ranges_table::lookup_reloc): New function.
3028 (Dwarf_ranges_table::reloc_type_): New data member.
3029
06f30c9d
CC
30302013-06-27 Jing Yu <jingyu@google.com>
3031
3032 PR gold/15662
3033 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3034 function.
3035 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3036 (Target_powerpc::do_relax): Call the above.
3037
a2d7bf59
AM
30382013-06-27 Cary Coutant <ccoutant@google.com>
3039
3040 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3041 on garbage collected .opd section.
3042
30432013-06-27 Alan Modra <amodra@gmail.com>
3044
3045 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3046 is non-zero.
3047 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3048 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3049
32364e50
CC
30502013-06-14 Cary Coutant <ccoutant@google.com>
3051
3052 * resolve.cc (Symbol::override_base): Don't override st_type
3053 from plugin placeholder symbols.
3054 (Symbol_table::resolve): Likewise.
3055 (Symbol_table::should_override): Don't complain about TLS mismatch
3056 if the TO symbol is a plugin placeholder.
3057 * testsuite/Makefile.am (plugin_test_tls): New test.
3058 * testsuite/Makefile.in: Regenerate.
3059 * testsuite/plugin_test_tls.sh: New test script.
3060 * testsuite/two_file_test_2_tls.cc: New test source.
3061 * testsuite/two_file_test_tls.cc: New test source.
3062
7fb47cc9
CC
30632013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3064
3065 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3066 the maximum segment alignment is larger than the page size.
3067 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3068 correctly aligns the symbols with large alignemnt.
3069 * testsuite/Makefile.in: Regenerate.
3070 * testsuite/large_symbol_alignment.cc: New file.
3071
6934001a
CC
30722013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3073 Sriraman Tallam <tmsriram@google.com>
3074
3075 * options.h (sort_section): New option.
3076 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3077 Rename from Input_section_sort_section_name_special_ordering_compare.
3078 (Input_section_sort_section_name_compare): New struct.
3079 * output.cc (Output_section::Input_section_sort_section_name_compare::
3080 operator()): New function.
3081 (Output_section::sort_attached_input_sections): Use new sort function
3082 for .text if --sort-section=name is specified.
3083 * layout.cc (Layout::make_output_section):
3084 Add sorting by name when --sort-section=name is specified.
3085 * testsuite/Makefile.am (text_section_grouping): Test option
3086 --sort-section=name.
3087 * testsuite/Makefile.in: Regenerate.
3088 * testsuite/section_sorting_name.cc: New file.
3089 * testsuite/section_sorting_name.sh: New file.
3090
93acabad
CC
30912013-05-21 Cary Coutant <ccoutant@google.com>
3092
3093 * symtab.h (Symbol::is_cxx_vtable): New function.
3094 * target-reloc.h (relocate_section): Check for vtable symbol.
3095 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3096 * testsuite/Makefile.in: Regenerate.
3097 * testsuite/missing_key_func.cc: New test source.
3098 * testsuite/missing_key_func.sh: New test script.
3099
60e8b3fc
CC
31002013-05-21 Cary Coutant <ccoutant@google.com>
3101
2b64b551
RM
3102 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3103 type of enclosing symbol.
3104 (Relocate_info::location): Check symbol type when describing symbol.
3105 * object.h (Symbol_location_info): Remove unused line_number;
3106 add enclosing_symbol_type.
3107 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3108
9df9de2c
CC
31092013-05-13 Cary Coutant <ccoutant@google.com>
3110
2b64b551
RM
3111 * configure.ac: Export DEFAULT_TARGET.
3112 * configure: Regenerate.
3113 * Makefile.in: Regenerate.
3114 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3115 * testsuite/Makefile.in: Regenerate.
3116 * testsuite/debug_msg.sh: Delete duplicate tests.
3117 Don't check undef_int error message match for powerpc where the
3118 source file and line number aren't available.
9df9de2c 3119
bbc5ae17
RM
31202013-05-10 Roland McGrath <mcgrathr@google.com>
3121
3122 * options.h (General_options): Add --rosegment-gap option.
3123 * options.cc (finalize): --rosegment-gap implies --rosegment.
3124 * layout.cc (set_segment_offsets): Let user option override
3125 target->rosegment_gap().
3126
0c6e6c39
RM
31272013-05-10 Roland McGrath <mcgrathr@google.com>
3128
3129 * options.h (General_options): Remove leading space from help
3130 messages for -nostdlib and --rosegment.
3131
cde7cb01
MR
31322013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3133
3134 PR ld/15365
3135 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3136
f31ae5b8
AM
31372013-05-03 Alan Modra <amodra@gmail.com>
3138
3139 * merge.cc (Output_merge_string::do_add_input_section): Correct
3140 scan for number of strings. Rename vars to avoid shadowing.
3141 Include missing terminator in input_size_.
3142
d3a7cd45
L
31432013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3144
3145 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3146 Restore empty string handling.
3147
6ad3daba
CC
31482013-05-01 Cary Coutant <ccoutant@google.com>
3149
3150 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3151 uninitialized warning.
3152
e31908b6
CC
31532013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3154
3155 * output.cc (Output_section::add_merge_input_section): Allow
3156 to merge sections if the alignment is more than character size.
3157 * merge.h (Output_merge_string::Output_merge_string): Remove
3158 assert.
3159 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3160 only not-null strings. Check the alignment of strings.
3161 * stringpool.h
3162 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3163 alignment as the argument.
3164 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3165 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3166 Align non-zero length strings according to the addralign_.
3167 (Stringpool_template<Stringpool_char>::set_string_offsets):
3168 Updating offsets according to the given alignment.
3169 * testsuite/Makefile.am (text_section_grouping): Test if string
3170 literals are getting merged.
3171 * testsuite/Makefile.in: Regenerate.
3172 * testsuite/merge_string_literals_1.c: New file.
3173 * testsuite/merge_string_literals_2.c: Ditto.
3174 * testsuite/merge_string_literals.sh: Ditto.
3175
0e804863
ILT
31762013-04-26 Ian Lance Taylor <iant@google.com>
3177
3178 * target-reloc.h (relocate_section): If the reloc offset is out of
3179 range, pass VIEW as NULL to relocate.relocate.
3180 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3181 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3182 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3183 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3184 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3185 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3186
e7c5ea40
CC
31872013-04-26 Geoff Pike <gpike@chromium.org>
3188
3189 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3190 * layout.cc (Hash_task): New class.
3191 (Layout::queue_build_id_tasks): New function.
3192 (Layout::write_build_id): Handle single-thread portion of build ID
3193 computation. (In some cases, all of it is single-threaded.) Replace
3194 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3195 functionality in fewer lines of code.
3196 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3197 * options.h (General_options): make "--build-id" default to tree
3198 rather than sha1. Add two new options related to --build-id=tree:
3199 --build-id-chunk-size-for-treehash and
3200 --build-id-min-file-size-for-treehash.
3201 * Makefile.am: add testing of --build-id=tree and related new options
3202 (these tests will be invoked by "make check").
3203 * Makefile.in: Regenerate.
3204
49926cd0
AM
32052013-04-25 Alan Modra <amodra@gmail.com>
3206
3207 * configure.tgt: Add powerpcle and powerpc64le.
3208
a4034750
AM
32092013-04-22 Alan Modra <amodra@gmail.com>
3210
3211 PR gold/15355
3212 * layout.cc (Layout::segment_precedes): Allow more than one
3213 segment with the same type and flags.
3214
e79c84aa
CC
32152013-04-15 Cary Coutant <ccoutant@google.com>
3216
3217 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3218 allocate space in file for BSS sections.
3219
2199fbe7
CC
32202013-04-15 Cary Coutant <ccoutant@google.com>
3221
3222 * script-sections.cc (Orphan_output_section): Reset address
3223 to zero after each orphaned section for relocatable links.
3224
502e8a84
CC
32252013-04-15 Cary Coutant <ccoutant@google.com>
3226
a4034750
AM
3227 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3228 section starting address for relocatable link.
3229 * testsuite/Makefile.am (script_test_11): New test.
3230 * testsuite/Makefile.in: Regenerate.
3231 * testsuite/script_test_11.c: New source file.
3232 * testsuite/script_test_11.t: New linker script.
502e8a84 3233
0cfdc767
AM
32342013-04-13 Alan Modra <amodra@gmail.com>
3235
3236 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3237 owner when sections are not adjacent and exceed group size.
3238 (Target_powerpc::group_sections): Handle corner case.
3239 (Target_powerpc::Branch_info::make_stub): Handle case where
3240 stub table doesn't exist due to branches in non-exec sections.
3241 (Target_powerpc::Relocate::relocate): Likewise.
3242
6830ee24
AM
32432013-04-11 Alan Modra <amodra@gmail.com>
3244
3245 PR gold/15354
3246 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3247 .branch_lt to match bfd ld. Adjust comments throughout file.
3248
54a3d865
ILT
32492013-04-04 Ian Lance Taylor <iant@google.com>
3250
3251 GCC PR c++/56840
3252 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3253 sections before checking whether they are included in the link.
3254
9993ba11
ST
32552013-03-29 Sriraman Tallam <tmsriram@google.com>
3256
3257 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3258 object before calling the plugin claim_file handler. Pass the elf
3259 object of the archive to the plugin. Delete the elf object if the
3260 plugin claims the file.
3261
ebacd51e
AM
32622013-03-21 Alan Modra <amodra@gmail.com>
3263
3264 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3265 segment when omagic.
3266
117be58f
AM
32672013-03-21 Alan Modra <amodra@gmail.com>
3268
3269 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3270 comparison warning.
3271 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3272 uninitialized" warning.
3273
32e2b61d
AM
32742013-03-20 Alan Modra <amodra@gmail.com>
3275
3276 * symtab.h (Symbol::clear_version): New function.
3277 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3278 is_needed by weak references. Clear version for symbols defined
3279 in as-needed objects that are not needed.
3280
b3ccdeb5
AM
32812013-03-15 Alan Modra <amodra@gmail.com>
3282
3283 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3284 static and public. Add report_err param. Return false for data refs.
3285 (Target_powerpc::rela_dyn_section): New overloaded function.
3286 (Target_powerpc::plt_, iplt_): Elucidate.
3287 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3288 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3289 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3290 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3291 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3292 push_branch and make_plt_entry for ifunc syms when
3293 reloc_needs_plt_for_ifunc.
3294 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3295 for ifunc unless reloc_needs_plt_for_ifunc.
3296
ad3d8a2f
AM
32972013-03-15 Alan Modra <amodra@gmail.com>
3298
3299 * gc.h (gc_process_relocs): Don't look through function descriptors.
3300 * icf.cc (get_section_contents): Do so here instead.
3301
4d9aa155
AM
33022013-03-13 Alan Modra <amodra@gmail.com>
3303
3304 * powerpc.cc (is_branch_reloc): Forward declare.
3305 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3306 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3307 false for 64-bit, true for 32-bit non-branch relocs.
3308 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3309 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3310 nm output.
3311 (icf_safe_test): Generate linker map file as well as nm output.
3312 (icf_safe_so_test): Likewise.
3313 * testsuite/Makefile.in: Regenerate.
3314 * testsuite/icf_test.sh: Parse linker map file to determine
3315 section folding.
3316 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3317 * testsuite/icf_safe_so_test.sh: Likewise.
3318 (X86_32_or_ARM_specific_safe_fold): Merge into..
3319 (arch_specific_safe_fold): ..this.
3320 (X86_64_specific_safe_fold): Delete unused function.
3321
57420c20
AM
33222013-03-12 Alan Modra <amodra@gmail.com>
3323
3324 * gc.h (gc_process_relocs): Look through function descriptors
3325 to determine shndx, symvalue and addend used by ICF. Tidy
3326 variable duplication.
3327
dc3714f3
AM
33282013-03-11 Alan Modra <amodra@gmail.com>
3329
3330 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3331 * layout.cc (Layout_task_runner::run): ..to here.
3332 * symtab.h (struct Symbol_location): Extract from..
3333 (class Symbol_table): ..here.
3334 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3335 * target.h (class Target): Add function_location and
3336 do_function_location functions.
3337 (class Sized_target): Add do_function_location.
3338 * object.h (class Sized_relobj_file): Move find_shdr..
3339 (class Object): ..to here.
3340 * object.cc: Likewise. Update to suit. Instantiate.
3341 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3342 * powerpc.cc (class Powerpc_dynobj): New.
3343 (Target_powerpc::do_function_location): New function.
3344 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3345 (Powerpc_dynobj::do_read_symbols): New function.
3346 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3347
956b03bb
ILT
33482013-03-08 Ian Lance Taylor <iant@google.com>
3349
3350 * options.cc (General_options::string_to_object_format): Accept
3351 "default".
3352
4bead2d5
AM
33532013-03-08 Alan Modra <amodra@gmail.com>
3354
3355 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3356 pointer to Post_fde.
3357 (struct Post_fde): Move definition to here..
3358 * ehframe.cc (struct Post_fde): ..from here.
3359 (Cie::write): Don't alloc Post_fde.
3360 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3361
02e60bf7
AM
33622013-03-07 Alan Modra <amodra@gmail.com>
3363
3364 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3365 relocation referencing .LC0.
3366 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3367
8343f03a
AM
33682013-03-07 Alan Modra <amodra@gmail.com>
3369
3370 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3371 always_inline. Add assembly for powerpc to avoid GOT.
3372
3366d57c
AM
33732013-03-07 Alan Modra <amodra@gmail.com>
3374
3375 * testsuite/script_test_10.sh: Don't test .bss section
3376 header number.
3377
6c77229c
AM
33782013-03-06 Alan Modra <amodra@gmail.com>
3379
3380 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3381 (Target_powerpc::symval_for_branch): Add symtab param. Update
3382 all callers. Handle folded sections.
3383 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3384 to Powerpc_relobj.
3385 (Global_symbol_visitor_opd::operator()): Likewise.
3386
a39e4af6
AM
33872013-03-04 Alan Modra <amodra@gmail.com>
3388
3389 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3390 * testsuite/Makefile.in: Regenerate.
3391
d5834edb
CC
33922013-03-01 Cary Coutant <ccoutant@google.com>
3393
3394 Add dwp support for v2 DWARF package file format.
3395 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3396 tu_length parameter. Adjust all callers.
3397 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3398 * dwp.cc: Include dwarf.h.
3399 (Section_bounds): New struct type.
3400 (Unit_set): New struct type.
3401 (Dwo_file::Dwo_file): Initialize new data member.
3402 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3403 Combine and rename to...
3404 (Dwo_file::read_unit_index): ...this.
3405 (Dwo_file::sized_read_compunit_index)
3406 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3407 (Dwo_file::sized_read_unit_index): ...this.
3408 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3409 parameters; add section_id parameter.
3410 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3411 (Dwo_file::add_unit_set): ...this.
3412 (Dwo_file::shndx_map_): Remove.
3413 (Dwo_file::sect_offsets_): New data member.
3414 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3415 (Dwp_output_file::add_section): Rename to...
3416 (Dwp_output_file::add_contribution): ...this.
3417 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3418 (Dwp_output_file::add_tu_set): Likewise.
3419 (Dwp_output_file::Contribution): New type.
3420 (Dwp_output_file::Section::contributions): New data member.
3421 (Dwp_output_file::Cu_or_tu_set): Remove.
3422 (Dwp_output_file::Section::Section): New ctor.
3423 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3424 (Dwp_output_file::Dwp_index::Section_table): New type.
3425 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3426 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3427 parameter.
3428 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3429 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3430 (Dwp_output_file::Dwp_index::section_table): New member function.
3431 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3432 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3433 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3434 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3435 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3436 (Dwp_output_file::Dwp_index::section_table_): New data member.
3437 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3438 (Dwp_output_file::add_output_section): New member function.
3439 (Dwp_output_file::write_new_section): New member function.
3440 (Dwp_output_file::write_contributions): New member function.
3441 (Dwp_output_file::section_id_map_): New data member.
3442 (class Dwo_id_info_reader): Remove.
3443 (class Unit_reader): New class.
3444 (get_dwarf_section_name): New function.
3445 (Dwo_file::read_executable): Adjust initializations of class data.
3446 (Dwo_file::read): Add support for v2 package file format.
3447 (Dwo_file::read_unit_index): Likewise.
3448 (Dwo_file::sized_read_unit_index): Likewise.
3449 (Dwo_file::copy_section): Likewise.
3450 (Dwo_file::add_unit_set): Likewise.
3451 (Dwp_output_file::add_output_section): Likewise.
3452 (Dwp_output_file::add_contribution): Likewise.
3453 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3454 for empty slot.
3455 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3456 file format.
3457 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3458 slot.
3459 (Dwp_output_file::initialize): Remove unused function.
3460 (Dwp_output_file::finalize): Add support for v2 package file format.
3461 (Dwp_output_file::write_index): Likewise.
3462 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3463 function prototype.
3464
a68a081d
CC
34652013-03-01 Cary Coutant <ccoutant@google.com>
3466
3467 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3468 function into class definition in header file.
3469 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3470 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3471 New function.
3472 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3473
9d5781f8
AM
34742013-02-28 Alan Modra <amodra@gmail.com>
3475
3476 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3477 * target.cc (Target::do_plt_fde_location): New function.
3478 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3479 accessor function, and constructor param.
3480 (struct Post_fde, Post_fdes): Declare.
3481 (Cie::write): Add post_fdes param.
3482 * ehframe.cc (Fde::write): Use plt_fde_location.
3483 (struct Post_fde): Define.
3484 (Cie::write): Stash FDEs added post merge mapping.
3485 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3486 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3487 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3488 other FDEs.
3489 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3490 (Target_powerpc::has_glink): New function.
3491 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3492 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3493 glink_eh_frame_fde_32, default_fde): New data.
3494 (Stub_table::eh_frame_added_): New var.
3495 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3496 Make const.
3497 (Stub_table::add_eh_frame): New function.
3498 (Output_data_glink::add_eh_frame): New function.
3499 (Target_powerpc::make_glink_section): Call add_eh_frame.
3500
214383dd
ILT
35012013-02-15 Ian Lance Taylor <iant@google.com>
3502
3503 * options.h (DEFINE_uint64_alias): Define.
3504 (class General_options): Add -Ttext-segment as an alias for
3505 -Ttext.
3506
91c2b899
AM
35072013-02-15 Alan Modra <amodra@gmail.com>
3508
3509 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3510 (Stub_table::do_write): ..here, two places.
3511 (Stub_table::plt_call_size): Use it here too.
3512
20e2a8aa
ILT
35132013-02-11 Ian Lance Taylor <iant@google.com>
3514
3515 * descriptors.cc (Descriptors::close_all): New function.
3516 * descriptors.h (class Descriptors): Declare close_all.
3517 (close_all_descriptors): New inline function.
3518 * plugin.cc: Include "descriptors.h".
3519 (Plugin_manager::cleanup): Call close_all_descriptors.
3520
8952bc69
AM
35212013-02-06 Alan Modra <amodra@gmail.com>
3522
3523 * README: Update coding style link.
3524
29bd8b6b
CC
35252013-01-28 Cary Coutant <ccoutant@google.com>
3526
a4034750
AM
3527 * dwp.cc (File_list): New typedef.
3528 (Dwo_name_info_reader): New class.
3529 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3530 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3531 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3532 (Dwo_file::read_executable): New function.
3533 (Dwo_file::read): Move common setup code to ...
3534 (Dwo_file::make_object): ... here.
3535 (dwp_options): Add --exec/-e.
3536 (usage): Likewise.
3537 (main): Likewise.
29bd8b6b 3538
c6ac678d
ST
35392013-01-24 Sriraman Tallam <tmsriram@google.com>
3540
3541 * layout.cc (Layout::layout): Check for option text_reorder.
3542 (Layout::make_output_section): Ditto.
3543 * options.h (text_reorder): New option.
3544 * output.cc (Input_section_sort_compare): Remove special ordering
3545 of section names.
3546 (Output_section::
3547 Input_section_sort_section_name_special_ordering_compare::
3548 operator()): New function.
3549 (Output_section::sort_attached_input_sections): Use new sort function
3550 for .text.
3551 * output.h (Input_section_sort_section_name_special_ordering_compare):
3552 New struct.
3553 * testsuite/Makefile.am (text_section_grouping): Test option
3554 --no-text-reorder
3555 * testsuite/Makefile.in: Regenerate.
3556 * testsuite/text_section_grouping.sh: Check order of functions without
3557 default text reordering.
3558
50701cc1
MF
35592013-01-18 Mike Frysinger <vapier@gentoo.org>
3560
3561 * options.h (General_options): Change default to true for new_dtags.
3562
b1b00fcc
MF
35632013-01-18 Mike Frysinger <vapier@gentoo.org>
3564
3565 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3566 when enable_new_dtags is false. Only add DT_RUNPATH when
3567 enable_new_dtags is true.
3568
ec5b8187
AM
35692013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3570
3571 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3572 used in declaration and definition consistent.
3573 (Target_powerpc::symval_for_branch): Ditto.
3574
a880d4c4
ST
35752013-01-16 Sriraman Tallam <tmsriram@google.com>
3576
3577 * testsuite/plugin_final_layout.cc: Fix comment.
3578
7c381248
ST
35792013-01-16 Sriraman Tallam <tmsriram@google.com>
3580
3581 * layout.cc (Layout::layout): Do not do default sorting for
3582 text sections when section ordering is specified.
3583 (make_output_section): Ditto.
3584 * testsuite/plugin_final_layout.cc: Name the function sections
3585 to catch reordering issues.
3586
e2458743
AM
35872013-01-15 Alan Modra <amodra@gmail.com>
3588
3589 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3590 plt-thread-safe.
3591
431ed302
AM
35922013-01-15 Alan Modra <amodra@gmail.com>
3593
3594 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3595 * testsuite/Makefile.in: Regenerate.
3596
0ec6429b
AM
35972013-01-14 Alan Modra <amodra@gmail.com>
3598
3599 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3600 * testsuite/Makefile.in: Regenerate.
3601
0bf402d5
ILT
36022013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3603
36af3926 3604 PR bfd/14430
0bf402d5
ILT
3605 Fix mingw gold build with plugins enabled
3606 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3607 * configure.ac: Export DLOPEN_LIBS and add headers check.
3608 * plugin.cc: Handle non-dlfcn case.
3609 * Makefile.in: Regenerate.
3610 * config.in: Regenerate.
3611 * configure: Regenerate.
3612 * testsuite/Makefile.in: Regenerate.
3613
9e9143bc
ST
36142013-01-09 Sriraman Tallam <tmsriram@google.com>
3615
3616 * output.h (sort_attached_input_sections): Change to be public.
3617 * script-sections.cc
3618 (Output_section_definition::set_section_addresses): Sort
3619 attached input sections according to section order before linker
3620 script assigns section addresses.
3621 (Orphan_output_section::set_section_addresses): Sort
3622 attached input sections according to section order before linker
3623 script assigns section addresses.
3624 * Makefile.am (final_layout.sh): Use a simple linker script to
3625 check if section ordering still works.
3626 * Makefile.in: Regenerate.
3627
679af368
ILT
36282013-01-09 Ben Cheng <bccheng@google.com>
3629
3630 * arm.cc (Target_arm::attributes_accept_div): New function.
3631 (Target_arm::attributes_forbid_div): New function.
3632 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3633 attribute using the same new functions as what bfd/elf32_arm.c
3634 does.
3635
3136a00e
CC
36362013-01-07 Cary Coutant <ccoutant@google.com>
3637
3638 PR gold/14993
3639 * output.cc (Output_section::add_input_section): For incremental
3640 updates, don't track input sections that are allocated from patch
3641 space.
3642
f2a6224b
L
36432013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3644 Ian Lance Taylor <iant@google.com>
3645
3646 PR gold/14897
3647 * configure.ac (--enable-ld): Removed.
3648 (install_as_default): Set to yes only for --enable-gold=default
3649 or --disable-ld.
3650 * configure: Regenerated.
3651
4f46f626
L
36522013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3653
3654 * options.h (General_options): Add -fuse-ld= for GCC linker
3655 option compatibility.
3656
26e4ef59
CC
36572013-01-04 Cary Coutant <ccoutant@google.com>
3658
3659 * configure.ac: Fix typo restoring CXXFLAGS.
3660 * configure: Regenerate.
3661
3d587466
CC
36622013-01-04 Cary Coutant <ccoutant@google.com>
3663
4f46f626
L
3664 * testsuite/Makefile.am (CXXLINK_S): New macro.
3665 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3666 * testsuite/Makefile.in: Regenerate.
3d587466 3667
44db6695
L
36682013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3669
3670 * version.cc (print_version): Update copyright year to 2013.
3671
edcac0c1
ILT
36722012-12-20 Ian Lance Taylor <iant@google.com>
3673
3674 * layout.cc (Layout::special_ordering_of_input_section): New
3675 function.
3676 (Layout::layout): If input section requires special ordering, must
3677 sort input sections.
3678 (Layout::make_output_section): May sort .text input sections.
3679 (Layout::is_section_name_prefix_grouped): Remove.
3680 * layout.h (class Layout): Declare
3681 special_ordering_of_input_section. Don't declare
3682 is_section_name_prefix_grouped.
3683 * output.cc (Output_section::add_input_section): Revert last
3684 change.
3685 (Output_section::Input_section_sort::match_file_name): Don't crash
3686 if called on output section data.
3687 (Output_section::Input_section_sort_compare): Sort based on
3688 special ordering.
3689 (Output_section::Input_section_sort_section_order_index_compare):
3690 Revert last patch.
3691 (Output_section::sort_attached_input_sections): Likewise.
3692
28f2a4ac
ST
36932012-12-18 Sriraman Tallam <tmsriram@google.com>
3694
edcac0c1 3695 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3696 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3697 * output.cc (Output_section::add_input_section): Check if section
3698 name contains special prefix. Keep input sections to sort such
3699 sections.
3700 (Output_section::Input_section_sort_section_order_index_compare
3701 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3702 (Output_section::sort_attached_input_sections): Add condition to
3703 Input_section_entry constructor call.
28f2a4ac
ST
3704 * testsuite/Makefile.am (text_section_grouping): New test.
3705 * testsuite/Makefile.in: Regenerate.
3706 * testsuite/text_section_grouping.cc: New file.
3707 * testsuite/text_section_grouping.sh: New file.
3708
5bf135a7
NC
37092012-12-17 Nick Clifton <nickc@redhat.com>
3710
3711 * Makefile.am: Add copyright notice.
3712 * NEWS: Likewise.
3713 * README: Likewise.
3714 * configure.ac: Likewise.
3715 * ftruncate.c: Likewise.
3716 * Makefile.in: Regenerate.
3717
59965708
CC
37182012-12-14 Cary Coutant <ccoutant@google.com>
3719
a4034750
AM
3720 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3721 --no-as-needed flag.
3722 (exception_separate_shared_12_test): Likewise.
3723 (incremental_copy_test): Likewise.
3724 * testsuite/Makefile.in: Regenerate.
59965708 3725
2a77e2ab
CC
37262012-12-14 Cary Coutant <ccoutant@google.com>
3727
3728 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3729 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3730
e3deeb9c
AM
37312012-12-12 Alan Modra <amodra@gmail.com>
3732
3733 * powerpc.cc (class Track_tls): New.
3734 (class Relocate, class Scan): Inherit Track_tls.
3735 (Target_powerpc::Scan::local, global): Track tls optimization
3736 and avoid creating plt entry for __tls_get_addr if all uses
3737 are optimized away.
3738 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3739
d8f5a274
AM
37402012-12-12 Alan Modra <amodra@gmail.com>
3741
3742 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3743 Replace no_toc_optimize with toc_optimize.
3744 * output.h (Output_section::input_sections): Provide non-const variant.
3745 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3746 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3747 accessors.
3748 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3749 (class Sort_toc_sections): New.
3750 (Target_powerpc::do_finalize_sections): Sort toc sections.
3751 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3752
4c8a1de1
RM
37532012-12-10 Roland McGrath <mcgrathr@google.com>
3754
3755 * testsuite/binary_unittest.cc (read_all): New function.
3756 (Sized_binary_test): Use it instead of ::read.
3757 * fileread.cc (do_read): Don't assume pread always reads the whole
3758 amount in a single call.
3759
edc27beb
AM
37602012-12-10 Alan Modra <amodra@gmail.com>
3761
3762 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3763 Set EM_PPC64 or EM_PPC here.
3764 (Target_selector_powerpc::do_recognize): Delete.
3765
906b9150
AM
37662012-12-10 Alan Modra <amodra@gmail.com>
3767
3768 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3769 stub_table_.
3770 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3771
418c15ae
RM
37722012-12-07 Roland McGrath <mcgrathr@google.com>
3773
3774 * testsuite/binary_unittest.cc (Sized_binary_test):
3775 Use open_descriptor rather than ::open.
3776
decdd3bc
AM
37772012-12-07 Alan Modra <amodra@gmail.com>
3778
3779 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3780 typedef and invalid_address constant.
3781 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3782 instantiate constants.
3783
db399005
ILT
37842012-12-06 Roland McGrath <mcgrathr@google.com>
3785
3786 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3787 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3788 * aclocal.m4: Regenerate.
3789 * configure: Regenerate.
3790 * Makefile.in: Regenerate.
3791 * testsuite/Makefile.in: Regenerate.
3792
aba6bc71
AM
37932012-12-07 Alan Modra <amodra@gmail.com>
3794
3795 * options.h (General_options): Add no_toc_optimize.
3796 * powerpc.cc (ok_lo_toc_insn): New function.
3797 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3798
9e69ed50
AM
37992012-12-06 Alan Modra <amodra@gmail.com>
3800
3801 * options.h (General_options): Add plt_align, plt_static_chain,
3802 plt_thread_safe. Update stub_group_size help text.
3803 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3804 for new plt_thread_safe_ var.
3805 (use_plt_offset): Correct comments.
3806 (Target_powerpc::do_relax): Look for thread creation symbols to
3807 determine default plt_thread_safe value. Clear plt call stubs
3808 as well as branch stubs each iteration.
3809 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3810 insn constants.
3811 (l, hi, ha, write_insn): Move earlier.
3812 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3813 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3814 plt stubs too.
3815 (Stub_table::update_size): Adjust.
3816 (Stub_table::prev_size, set_prev_size): Delete.
3817 (Stub_table::stub_align): Let --plt-align affect result.
3818 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3819 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3820 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3821 (Stub_table::do_write): Support more stub variants.
3822
f43ba157
AM
38232012-12-04 Alan Modra <amodra@gmail.com>
3824
3825 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3826 (Target_powerpc::do_define_standard_symbols): New function.
3827
34171bc5
AM
38282012-12-03 Alan Modra <amodra@gmail.com>
3829
3830 * output.h: Formatting, whitespace.
3831
dc9589e9 38322012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3833
3834 * layout.h (Layout::get_executable_sections): Declare.
3835 * layout.cc (Layout::get_executable_sections): New function.
3836 * arm.cc (Target_arm::group_sections): Use it.
3837 (Arm_output_section::group_sections): Delete now redundant test.
3838 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3839 param to handle relative relocs.
3840 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3841 (Output_data_reloc::add_absolute): Adjust.
3842 (Output_data_reloc::add_relative): New function.
3843 (Output_data::reset_data_size): New function.
3844 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3845 (Output_section::set_addralign): New function.
3846 (Output_section::checkpoint_set_addralign): New function.
3847 (Output_section::clear_section_offsets_need_adjustment): New function.
3848 (Output_section::input_sections): Make public.
3849 * powerpc.cc (class Output_data_brlt_powerpc): New.
3850 (class Stub_table, class Stub_control): New.
3851 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3852 stub_table_, set_stub_table, stub_table): New vectors and accessor
3853 functions.
3854 (Target_powerpc::do_may_relax, do_relax, push_branch,
3855 new_stub_table, stub_tables, brlt_section, group_sections,
3856 add_branch_lookup_table, find_branch_lookup_table,
3857 write_branch_lookup_table, make_brlt_section): New functions.
3858 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3859 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3860 branch_info_): New vars.
3861 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3862 make call stubs here.
3863 (Output_data_glink): Remove all call stub handling from this class.
3864 (Target_powerpc::Scan::local, global): Save interesting branch
3865 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3866 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3867 functions on final link.
3868 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3869 Handle long branch destinations too.
3870 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3871 do_plt_address_for_local): Adjust lookup of plt call stubs.
3872
627b30b7
AM
38732012-11-30 Alan Modra <amodra@gmail.com>
3874
3875 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3876 relocs against protected symbols when building 32-bit shared libs.
3877
40b469d7
AM
38782012-11-30 Alan Modra <amodra@gmail.com>
3879
3880 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3881 param. Call got_section() to make .got. Update all callers
3882 and their callers and so on.
3883
bb66a627
AM
38842012-11-30 Alan Modra <amodra@gmail.com>
3885
3886 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3887 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3888 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3889 value if it already exists.
3890
d2cf1c6c
L
38912012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3892
3893 PR gold/14858
3894 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3895
edccdf7c
RM
38962012-11-14 Roland McGrath <mcgrathr@google.com>
3897
3898 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3899 than bfc instruction for data sandboxing.
3900
6febeb74
AM
39012012-11-08 Alan Modra <amodra@gmail.com>
3902
3903 * po/POTFILES.in: Regenerate.
3904
0a6f1bf2
AM
39052012-11-05 Alan Modra <amodra@gmail.com>
3906
3907 * configure.ac: Apply 2012-09-10 change to config.in here.
3908 * configure: Regenerate.
3909
26a4e9cb
AM
39102012-11-05 Alan Modra <amodra@gmail.com>
3911
3912 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3913 (struct Opd_ent): Use "Address" rather than "Offset".
3914 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3915 (Target_powerpc::got_section): Make public.
3916 (Target_powerpc::scan_relocs): Move code setting symbols..
3917 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3918 Create _SDA_BASE_ only when referenced.
3919
cc928013
RM
39202012-11-02 Roland McGrath <mcgrathr@google.com>
3921
3922 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3923 from last change.
3924
50ed5eb1
RM
39252012-11-01 Roland McGrath <mcgrathr@google.com>
3926
62fe925a
RM
3927 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3928 for offset_in_output_section parameter.
3929 (Sized_target::relocate_special_relocatable): Likewise.
3930 * arm.cc (Target_arm::relocate_relocs): Likewise.
3931 (Target_arm::relocate_special_relocatable): Likewise.
3932 * i386.cc (Target_i386::relocate_relocs): Likewise.
3933 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3934 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3935 * target-reloc.h (relocate_relocs): Likewise.
3936 * testsuite/testfile.cc (Target_test): Likewise.
3937 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3938 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3939
3940 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3941 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3942
3943 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3944 parameter, which is unused in the [!F_SETFD] case.
3945
50ed5eb1
RM
3946 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3947 SYMNDX to off_t before comparing it to this->data_size().
3948 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3949 * incremental.cc (Output_section_incremental_inputs::do_write):
3950 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3951
2cadc0bf
RM
3952 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3953
3bfcb652
NC
39542012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3955
3956 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3957 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3958 in EABI_VER5.
3959
c1a8d56e
CC
39602012-10-29 Cary Coutant <ccoutant@google.com>
3961
3962 * dwp.cc (usage): Add file and exit status parameters;
3963 add --help and --version options.
3964 (print_version): New function.
3965 (main): Add --help and --version options.
3966
b2490a7b
L
39672012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3968
3969 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3970 final_layout_sequence.txt.
3971 * testsuite/Makefile.in: Regenerated.
3972
aa543512
L
39732012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3974
3975 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3976 COMPILE generated by automake.
3977 (LINK1): Likewise.
3978 (CXXCOMPILE1): Likewise.
3979 (CXXLINK1): Likewise.
3980 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3981 (LINK): Likewise.
3982 (CXXCOMPILE): Likewise.
3983 (CXXLINK): Likewise.
3984 * testsuite/Makefile.in: Regenerated.
3985
d361fafb
L
39862012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3987
3988 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3989 on bad fwrite return.
3990
598c7410
L
39912012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3992
3993 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3994 on val.
3995
35c813e2
CC
39962012-10-23 Cary Coutant <ccoutant@google.com>
3997
3998 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3999 * testsuite/Makefile.in: Regenerate.
4000 * testsuite/dwp_test.h: New source file.
4001 * testsuite/dwp_test_1.cc: New source file.
4002 * testsuite/dwp_test_1.s: New source file.
4003 * testsuite/dwp_test_1.sh: New source file.
4004 * testsuite/dwp_test_1b.cc: New source file.
4005 * testsuite/dwp_test_1b.s: New source file.
4006 * testsuite/dwp_test_2.cc: New source file.
4007 * testsuite/dwp_test_2.s: New source file.
4008 * testsuite/dwp_test_2.sh: New source file.
4009 * testsuite/dwp_test_main.cc: New source file.
4010 * testsuite/dwp_test_main.s: New source file.
4011
77429909
CC
40122012-10-23 Cary Coutant <ccoutant@google.com>
4013
4014 * dwp.h: New header file.
4015 * dwp.cc: New source file.
4016 * gold.h: Move shared declarations to system.h.
4017 * system.h: New header file.
4018 * Makefile.am: Add dwp.
4019 * Makefile.in: Regenerate.
4020
ed5d6712
CC
40212012-10-23 Cary Coutant <ccoutant@google.com>
4022
4023 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4024 Dwarf_info_reader::read_from_pointer.
4025 (Dwarf_pubnames_table::read_header): Likewise.
4026 (Dwarf_pubnames_table::next_name): Likewise.
4027 (Dwarf_die::read_attributes): Likewise.
4028 (Dwarf_die::skip_attributes): Likewise.
4029 (Dwarf_info_reader::read_from_pointer): New function template.
4030 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4031 (Dwarf_pubnames_table): Likewise.
4032 (Dwarf_info_reader::read_from_pointer): New function template.
4033 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4034 Dwarf_pubnames_table ctor.
4035
8787852d
CC
40362012-10-23 Cary Coutant <ccoutant@google.com>
4037
4038 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4039 abbrev_shndx.
4040 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4041 abbrev_shndx_.
4042 (Dwarf_info_reader::set_abbrev_shndx): New method.
4043 (Dwarf_info_reader::abbrev_shndx_): New data member.
4044
9fc236f3
CC
40452012-10-23 Cary Coutant <ccoutant@google.com>
4046
4047 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4048 from object, not parameters.
4049 (Dwarf_info_reader::parse): Likewise.
4050 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4051 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4052 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4053 methods.
4054
effe8365
CC
40552012-10-23 Cary Coutant <ccoutant@google.com>
4056
4057 * fileread.cc (Input_file::Input_file): New constructor.
4058 * fileread.h (class Input_file): Add new constructor.
4059
1698990d
AM
40602012-10-18 Alan Modra <amodra@gmail.com>
4061
4062 PR gold/14727
4063 * object.cc (Relobj::is_section_name_included): Also match
4064 .sdata personality section.
4065
168a4726
AM
40662012-10-18 Alan Modra <amodra@gmail.com>
4067
4068 * target-reloc.h (class Default_comdat_behavior): New, package up..
4069 (get_comdat_behaviour): ..this.
4070 (relocate_section): Add Relocate_comdat_behavior template arg,
4071 adjust code to suit.
4072 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4073 (Target_arm::scan_reloc_section): Likewise.
4074 * i386.cc (Target_i386::relocate_section): Likewise.
4075 * sparc.cc (Target_sparc::relocate_section): Likewise.
4076 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4077 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4078 * powerpc.cc (class Relocate_comdat_behavior): New.
4079 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4080 gold::relocate_section with new template arg.
4081
acc276d8
AM
40822012-10-18 Alan Modra <amodra@gmail.com>
4083
4084 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4085 dynamic relocs for GOT_TPREL got entries, without symbol if
4086 resolving locally.
4087 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4088 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4089 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4090
e10f9870
AM
40912012-10-17 Alan Modra <amodra@gmail.com>
4092
4093 PR gold/14726
4094 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4095
ae034989
ST
40962012-10-16 Sriraman Tallam <tmsriram@google.com>
4097
4098 * layout.cc (Layout::include_section): Keep sections marked
4099 SHF_EXCLUDE when doing relocatable links.
4100
f3a0ed29
AM
41012012-10-16 Alan Modra <amodra@gmail.com>
4102
4103 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4104 (Target_powerpc::do_finalize_sections): Call it.
4105 (Output_data_save_res): New class and supporting functions.
4106 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4107 normal symbols defined in object files.
4108
c6de8ed4
AM
41092012-10-12 Alan Modra <amodra@gmail.com>
4110
4111 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4112 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4113 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4114 section if scan_opd_relocs not yet called.
4115 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4116
03e25981
AM
41172012-10-12 Alan Modra <amodra@gmail.com>
4118
4119 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4120 add_local_ifunc_entry): Revert last change.
4121 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4122
c9824451
AM
41232012-10-05 Alan Modra <amodra@gmail.com>
4124
4125 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4126 do_plt_address_for_global): New functions.
4127 (Output_data_got_powerpc::do_write): Don't segfault when linking
4128 statically.
4129 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4130 add_local_ifunc_entry): Return true on adding entry..
4131 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4132 glink->add_entry call. Remove unused symtab param. Adjust calls.
4133 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4134 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4135 set up symbols here.
4136 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4137 syms here. Do so even when no .iplt. Don't segfault when linking
4138 statically.
4139 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4140 new variants without reloc param.
4141 (Glink_sym_ent::Glink_sym_ent): Likewise.
4142 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4143 reloc when refs will resolve to plt call stub.
4144 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4145 R_PPC_PLTREL24 to resolve locally.
4146 (Target_powerpc::Scan::global): Correct ifunc handling.
4147 (Target_powerpc::Relocate::relocate): Correct local sym glink
4148 lookup. Don't destroy "value" when we have a plt call stub,
4149 and when checking plt call validity.
4150 (Target_powerpc::do_dynsym_value): Simplify.
4151
19fec8c1
AM
41522012-10-05 Alan Modra <amodra@gmail.com>
4153
4154 * i386.cc (Output_data_plt_i386::address_for_global,
4155 address_for_local): Add plt offset to returned value. Adjust uses.
4156 * sparc.cc (Output_data_plt_sparc::address_for_global,
4157 address_for_local): Likewise.
4158 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4159 address_for_local): Likewise.
4160 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4161 address_for_local): Likewise.
4162 * target.h (Target::plt_address_for_global, plt_address_for_local):
4163 Update comment.
4164 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4165 (Output_data_got::Got_entry::write): Nor here.
4166 * output.h: Comment fix.
4167
e867b647
WL
41682012-10-02 Jiong Wang <jiwang@tilera.com>
4169
4170 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4171 global_offset_table_ value for larget got.
4172 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4173
e5d5f5ed
AM
41742012-09-29 Alan Modra <amodra@gmail.com>
4175
4176 * powerpc.cc (Target_powerpc::iplt_): New output section.
4177 (Target_powerpc::iplt_section, make_iplt_section,
4178 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4179 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4180 Target_powerpc::plt_entry_count): Count iplt entries too.
4181 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4182 reloc section in constructor. New params.
4183 (Target_powerpc::make_plt_section): Create reloc section here instead.
4184 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4185 functions.
4186 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4187 (Output_data_glink::add_entry, find_entry): New functions to
4188 deal with local syms.
4189 (Glink_sym_ent): Add support for local syms.
4190 (Output_data_glink::do_write): Handle ifunc plt entries.
4191 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4192 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4193 (Target_powerpc::Relocate::relocate): Likewise.
4194 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4195
ec4dbad3
AM
41962012-09-25 Alan Modra <amodra@gmail.com>
4197
4198 * object.h (Sized_relobj_file::adjust_local_symbol,
4199 do_adjust_local_symbol): New functions.
4200 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4201 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4202 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4203 and irregular opd entry spacing.
4204 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4205 (Global_symbol_visitor_opd): New functor.
4206 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4207 on deleted opd entries.
4208
5c0b3823
WL
42092012-09-15 Jiong Wang <jiwang@tilera.com>
4210
4211 * tilegx.cc: New file.
4212 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4213 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4214 * configure.tgt: Add entries for tilegx*.
4215 * configure.ac: Likewise.
4216 * Makefile.in: Rebuild.
4217 * configure: Likewise.
4218 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4219 tilegx.
4220
bfdfa4cd
AM
42212012-09-13 Alan Modra <amodra@gmail.com>
4222
4223 * target-reloc.h (scan_relocs): Call scan.local for relocs
4224 against symbols in discarded sections. Pass is_discarded
4225 param.
4226 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4227 Add is_discarded param.
4228 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4229 is_discarded to flag opd entry as discarded. Don't emit dyn
4230 relocs on such entries.
4231 (Target_powerpc::Scan::global): Similarly detect and handle
4232 such opd entries.
4233 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4234 opd_ent_. Update all uses.
4235 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4236 (Target_powerpc::relocate_section): Zero out discarded opd
4237 entry relocs.
4238
d77a0555
ILT
42392012-09-12 Ian Lance Taylor <iant@google.com>
4240
4241 PR gold/14570
4242 * output.cc: Rename Output_data_got template parameter from size
4243 to got_size for all functions. Compile all variants of
4244 Output_data_got.
4245 (Output_data_got::Got_entry::write): Correct use of size for
4246 symbol value. Use local_is_tls rather than casting to
4247 Sized_relobj_file.
4248 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4249 (class Sized_relobj_file): Add do_local_is_tls.
4250 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4251
815a1205
AM
42522012-09-11 Alan Modra <amodra@gmail.com>
4253
4254 PR gold/14566
4255 * layout.cc (Layout::set_segment_offsets): When using
4256 common-page-size alignment, ensure we are on a new max-page-size
4257 page.
4258 * output.cc (Output_segment::set_section_addresses): Use
4259 abi_pagesize, not common_pagesize for relro boundary.
4260 (Output_segment::set_offset): Likewise.
4261
bd73a62d
AM
42622012-09-11 Alan Modra <amodra@gmail.com>
4263
4264 * output.h (Output_data_got::add_global_tls, add_local_tls,
4265 add_local_tls_pair): New functions.
4266 (Output_data_got::add_local_pair_with_rel): Remove second
4267 reloc param. Expand comment.
4268 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4269 use_plt_or_tls_offset_, similarly for constructor param.
4270 (Output_data_got::Got_entry::write): Add got_index param.
4271 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4272 add_local_tls_pair): New functions.
4273 (Output_data_got::Got_entry::write): Handle tls symbols
4274 with use_plt_or_tls_offset_ set specially.
4275 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4276 (Output_data_got::do_write): Replace iterator with index, pass
4277 index to entry write function.
4278 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4279 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4280 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4281 call.
4282 * i386.cc (Target_i386::Scan::local): Likewise.
4283 * sparc.cc (Target_sparc::Scan::local): Likewise.
4284 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4285 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4286 do_tls_offset_for_global): New functions.
4287 (Target_powerpc::Scan::local): Correct TLS relocations and got
4288 entry values.
4289 (Target_powerpc::Scan::global): Don't emit unnecessary
4290 dynamic relocations on TLS GOT entries.
4291
00716ab1
AM
42922012-09-10 Matthias Klose <doko@ubuntu.com>
4293
4294 * config.in: Disable sanity check for kfreebsd.
4295
c891b3f9
SA
42962012-09-10 Sterling Augustine <saugustine@google.com>
4297
4298 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4299 (Gdb_index::pubtypes_read): New parameter.
4300 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4301 to calls.
4302 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4303 pubtypes_object_.
4304
e81fea4d
AM
43052012-09-09 Alan Modra <amodra@gmail.com>
4306
4307 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4308 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4309 * gc.h (gc_process_relocs): Call target gc_add_reference.
4310 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4311 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4312 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4313 unnecessary cast.
4314 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4315 to cater for when we don't need code offset. Update use.
4316 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4317 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4318 set_opd_valid): New functions.
4319 (Target_powerpc::do_gc_add_reference): New function.
4320 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4321 stashed refs.
4322 (Target_powerpc::do_gc_mark_symbol): New function.
4323
d2d60eef
CC
43242012-09-06 Cary Coutant <ccoutant@google.com>
4325
4326 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4327 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4328 (Dwarf_die::skip_attributes): Likewise.
4329 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4330 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4331 (main): Call it.
4332 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4333
32ed4573
L
43342012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4335
4336 * testsuite/script_test_3.t: Add .got.plt output section
4337 statement.
4338 * testsuite/script_test_4.t: Likewise.
4339
f4baf0d4
AM
43402012-09-05 Alan Modra <amodra@gmail.com>
4341
4342 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4343 update all uses and lose "enum" when using type.
4344
864a1b56
AM
43452012-09-05 Alan Modra <amodra@gmail.com>
4346
4347 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4348 * configure: Regenerate.
4349 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4350 (plugin_final_layout.stdout): Likewise.
4351 (memory_test): Set page sizes to 0x1000.
4352 * testsuite/Makefile.in: Regenerate.
4353 * testsuite/discard_locals_test.sh: Add FIXME comment.
4354 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4355 * testsuite/pr14265.t: Add .got output section statement.
4356 * testsuite/script_test_2.t: Likewise.
4357 * testsuite/script_test_3.t: Likewise.
4358 * testsuite/script_test_4.t: Likewise.
4359 * testsuite/script_test_5.t: Likewise.
4360 * testsuite/script_test_6.t: Likewise.
4361 * testsuite/script_test_7.t: Likewise.
4362 * testsuite/script_test_9.t: Likewise.
4363
3ea0a085
AM
43642012-09-05 Alan Modra <amodra@gmail.com>
4365
4366 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4367 (Powerpc_relocate_functions::Status): New typedef.
4368 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4369 (Target_powerpc::Scan::local): Handle REL64.
4370 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4371 for REL32 and REL64.
4372 (Target_powerpc::symval_for_branch): New function, extracted from..
4373 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4374 checks. Report overflow errors.
4375
7404fe1b
AM
43762012-09-05 Alan Modra <amodra@gmail.com>
4377
4378 * object.h (Sized_relobj_file::emit_relocs): Delete.
4379 (Sized_relobj_file::emit_relocs_reltype): Delete.
4380 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4381 relocate_relocs for --emit-relocs.
4382 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4383 * output.h: Update comment.
4384 (Output_segment::first_section): New function.
4385 (Output_segment::first_section_load_address): Use first_section.
4386 * output.cc (Output_segment::first_section): New function extracted..
4387 (Output_segment::first_section_load_address): ..from here. Delete.
4388 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4389 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4390 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4391 adjust call to target.h function.
4392 * i386.cc (Target_i386): Likewise.
4393 * sparc.cc (Target_sparc): Likewise.
4394 * x86_64.cc (Target_x86_64): Likewise.
4395 * powerpc.cc (Target_powerpc): Likewise.
4396 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4397 first tls section has section symbol for optimised local dynamic
4398 output relocs.
4399 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4400 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4401 optimised tls code.
4402 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4403 Rename to relocate_relocs. Update error message.
4404
957564c9
AS
44052012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4406
4407 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4408 --just-symbols.
4409
dd93cd0a
AM
44102012-08-31 Alan Modra <amodra@gmail.com>
4411
4412 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4413 (Powerpc_relobj::toc_base_offset): New stub function.
4414 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4415 got_mod_index_offset to tlsld_got_offset. Update all refs.
4416 (Target_powerpc::Relocate::enum skip_tls): New.
4417 (Target_powerpc::call_tls_get_addr_): New var.
4418 (Target_powerpc::is_branch_reloc): Move to file scope.
4419 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4420 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4421 New functions.
4422 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4423 (powerpc_info): Correct common_pagesize for ppc64.
4424 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4425 (Powerpc_relocate_functions): Add overflow check enums and functions.
4426 Add non-shift version of rela, rela_ua. Delete all rel public
4427 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4428 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4429 addr16_ha3, addr14 functions.
4430 (Output_data_got_powerpc::add_constant_pair): New function.
4431 (Output_data_got_powerpc::got_base_offset): Likewise.
4432 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4433 (instruction constants): Sort, add some more.
4434 (Output_data_glink::do_write): Add and use Address typedef. Use
4435 object->toc_base_offset() stub for 64-bit.
4436 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4437 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4438 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4439 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4440 Always treat .opd relocs as against locally defined symbol.
4441 Correct condition for RELATIVE relocs.
4442 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4443 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4444 for 32-bit syms with a plt entry. Correct ppc64 toc base
4445 calculations. Handle TLS relocs, and more. Add overflow
4446 checking and adjust for Powerpc_relocate_functions changes.
4447 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4448 Reinstate --emit-relocs code with FIXME.
4449
a1373b60
AM
44502012-08-30 Alan Modra <amodra@gmail.com>
4451
4452 * layout.cc (Layout::set_segment_offsets): Set p_align to
4453 abi_pagesize, not common_pagesize.
4454 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4455 to determine whether file header can go in segment.
4456
703d02da
AM
44572012-08-30 Alan Modra <amodra@gmail.com>
4458
4459 * output.h (Output_reloc::Output_reloc <output section>): Add
4460 is_relative param. Adjust calls.
4461 (Output_reloc::add_output_section_relative): New functions.
4462 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4463 is_relative.
4464 (Output_reloc::symbol_value): Handle SECTION_CODE.
4465
16164a6b
ST
44662012-08-24 Sriraman Tallam <tmsriram@google.com>
4467
4468 * gold.cc (queue_middle_tasks): Call layout again when unique
4469 segments for sections is desired.
4470 * layout.cc (Layout::Layout): Initialize new members.
4471 (Layout::get_output_section_flags): New function.
4472 (Layout::choose_output_section): Call get_output_section_flags.
4473 (Layout::layout): Make output section for mapping to a unique segment.
4474 (Layout::insert_section_segment_map): New function.
4475 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4476 output sections marked so.
16164a6b
ST
4477 (Layout::segment_precedes): Check for unique segments when sorting.
4478 * layout.h (Layout::Unique_segment_info): New struct.
4479 (Layout::Section_segment_map): New typedef.
4480 (Layout::insert_section_segment_map): New function.
4481 (Layout::get_output_section_flags): New function.
4482 (Layout::is_unique_segment_for_sections_specified): New function.
4483 (Layout::set_unique_segment_for_sections_specified): New function.
4484 (Layout::unique_segment_for_sections_specified_): New member.
4485 (Layout::section_segment_map_): New member.
4486 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4487 Rename is_gc_pass_one to is_pass_one.
4488 Rename is_gc_pass_two to is_pass_two.
4489 Rename is_gc_or_icf to is_two_pass.
4490 Check for which pass based on whether symbols data is present.
4491 Make it two pass when unique segments for sections is desired.
4492 * output.cc (Output_section::Output_section): Initialize new
4493 members.
4494 * output.h (Output_section::is_unique_segment): New function.
4495 (Output_section::set_is_unique_segment): New function.
4496 (Output_section::is_unique_segment_): New member.
4497 (Output_section::extra_segment_flags): New function.
4498 (Output_section::set_extra_segment_flags): New function.
4499 (Output_section::extra_segment_flags_): New member.
4500 (Output_section::segment_alignment): New function.
4501 (Output_section::set_segment_alignment): New function.
4502 (Output_section::segment_alignment_): New member.
4503 (Output_segment::Output_segment): Initialize is_unique_segment_.
4504 (Output_segment::is_unique_segment): New function.
4505 (Output_segment::set_is_unique_segment): New function.
4506 (Output_segment::is_unique_segment_): New member.
4507 * plugin.cc (allow_unique_segment_for_sections): New function.
4508 (unique_segment_for_sections): New function.
4509 (Plugin::load): Add new functions to transfer vector.
4510 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4511 * Makefile.in: Regenerate.
4512 * testsuite/plugin_final_layout.sh: Check if unique segment
4513 functionality works.
4514 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4515 are available.
4516 (allow_unique_segment_for_sections): New global.
4517 (unique_segment_for_sections): New global.
4518 (claim_file_hook): Call allow_unique_segment_for_sections.
4519 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4520
1e2bee4f
CC
45212012-08-22 Cary Coutant <ccoutant@google.com>
4522
4523 * layout.cc (Layout::include_section): Don't assert on GROUP
4524 sections with --emit-relocs.
4525
1d5dfe78
CC
45262012-08-21 Cary Coutant <ccoutant@google.com>
4527
4528 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4529 if --export-dynamic-symbol names an undef symbol.
4530
c9269dff
AM
45312012-08-18 Alan Modra <amodra@gmail.com>
4532
4533 * powerpc.cc: Formatting and white space.
4534 (Powerpc_relobj): Rename got2_section_ to special_.
4535 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4536 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4537 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4538 (Target_powerpc): Add Address typedef and invalid_address. Use
4539 throughout.
4540 (Target_powerpc::is_branch_reloc): New function.
4541 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4542 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4543 for dst_mask, value and addend.
4544 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4545 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4546 (Output_data_glink::do_write): Correct toc base. Don't try to use
4547 uint16_t for 24-bit offset. Use get_output_section_offset and
4548 check return.
4549 (Target_powerpc::Scan::local): Handle more relocs.
4550 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4551 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4552 Plug in toc restoring insn after plt calls. Translate branches
4553 to function descriptor symbols to corresponding entry point.
4554 (Target_powerpc::relocate_for_relocatable): Check return from
4555 get_output_section_offset.
4556 * symtab.h: Comment typo.
4557
b1759dce
ILT
45582012-08-14 Ian Lance Taylor <iant@google.com>
4559
4560 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4561 unsupported_relocal_local to call unsupported_reloc_global.
4562
b9b2ae8b
NC
45632012-08-14 Nick Clifton <nickc@redhat.com>
4564
4565 PR ld/14265
4566 * script-sections.cc (Sections_element::output_section_name): Add
4567 keep return parameter.
4568 (Output_section_element::match_name): Add keep return parameter.
4569 Return the value of the keep_ member.
4570 * script-sections.h (class Output_section): Update
4571 output_section_name prototype.
4572 * layout.cc (Layout::keep_input_section): New public member
4573 function.
4574 (Layout::choose_output_section): Pass keep parameter to
4575 output_section_name.
4576 * layout.h (class Layout): Add keep_input_section.
4577 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4578 sections.
4579 * testsuite/Makefile.am: Add a test.
4580 * testsuite/Makefile.in: Regenerate.
4581 * testsuite/pr14265.c: Source file for the test.
4582 * testsuite/pr14265.t: Linker script for the test.
4583 * testsuite/pr14265.sh: Shell script for the test.
4584
921b5322
AM
45852012-08-14 Alan Modra <amodra@gmail.com>
4586
4587 * target.h (Target::output_section_name): New function.
4588 (Target::do_output_section_name): New function.
4589 * layout.cc (Layout::choose_output_section): Call the above.
4590 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4591
6ce78956
AM
45922012-08-14 Alan Modra <amodra@gmail.com>
4593
4594 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4595 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4596 for replace_constant call.
4597 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4598 (Output_data_glink::do_print_to_mapfile): New function.
4599 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4600 (Target_powerpc::Relocate::relocate): Likewise.
4601
d1a8cabd
AM
46022012-08-14 Alan Modra <amodra@gmail.com>
4603
4604 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4605 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4606 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4607 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4608 all references to shndx_. Handle special case for R_PPC_PLTREL24
4609 here.
4610 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4611 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4612 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4613 here.
4614 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4615 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4616
d83ce4e3
AM
46172012-08-12 Alan Modra <amodra@gmail.com>
4618
4619 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4620 (glink insn constants): Use uint32_t.
4621 (Output_data_glink::add_entry): Use insert, not [] operator.
4622
cf43a2fe
AM
46232012-08-11 Alan Modra <amodra@gmail.com>
4624
4625 * object.h (Sized_relobj_file::find_shdr): New function.
4626 (Sized_relobj_file::find_special_sections): New function.
4627 * object.cc (Sized_relobj_file::find_shdr): New function.
4628 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4629 (Sized_relobj_file::find_special_sections): New function, split out..
4630 (Sized_relobj_file::do_read_symbols): ..from here.
4631 * output.h (Output_data_got::replace_constant): New function.
4632 (Output_data_got::num_entries): New function.
4633 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4634 (Output_data_got::got_offset): Protected rather than private.
4635 (Output_data_got::replace_got_entry): New function.
4636 * output.cc (Output_data_got::replace_got_entry): New function.
4637 * powerpc.cc (class Powerpc_relobj): New.
4638 (class Powerpc_relocate_functions): Delete all psymval variants or
4639 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4640 Implement _ha functions using corresponding _hi function.
4641 (Powerpc_relobj::find_special_sections): New function.
4642 (Target_powerpc::do_make_elf_object): New function.
4643 (class Output_data_got_powerpc): New.
4644 (class Output_data_glink): New.
4645 (class Powerpc_scan_relocatable_reloc): New.
4646 Many more changes througout file.
4647
3c892704
NC
46482012-08-09 Nick Clifton <nickc@redhat.com>
4649
4650 * po/vi.po: Updated Vietnamese translation.
4651
82435b3b
ILT
46522012-08-07 Ian Lance Taylor <iant@google.com>
4653
4654 * layout.cc (Layout::add_target_dynamic_tags): If
4655 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4656 plt_rel.
4657
a6dc81d2
NC
46582012-07-30 Nick Clifton <nickc@redhat.com>
4659
4660 * po/gold.pot: Updated template.
4661 * po/es.po: Updated Spanish translation.
4662
f1415016
CC
46632012-07-18 Cary Coutant <ccoutant@google.com>
4664
4665 PR gold/14344
4666 * configure.ac: Add check for -gpubnames support.
4667 * configure: Regenerate.
4668 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4669 support; force -gno-pubnames.
4670 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4671 support.
4672 (gdb_index_test_4): New test.
4673 * testsuite/Makefile.in: Regenerate.
4674 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4675 * testsuite/gdb_index_test_2.sh: Likewise.
4676 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4677 * testsuite/gdb_index_test_4.sh: New script.
4678 * testsuite/gdb_index_test_comm.sh: New script with common code;
4679 don't look for space after colon.
4680
b7fd7c37
ST
46812012-07-16 Sriraman Tallam <tmsriram@google.com>
4682
4683 * gold.cc (queue_middle_tasks): Update function order only after
4684 deferred objects due to plugins are processed.
4685
1f3212db
ILT
46862012-07-11 Ian Lance Taylor <iant@google.com>
4687
4688 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4689 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4690 (Target_arm::scan_reloc_for_stub): Likewise.
4691 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4692 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4693 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4694 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4695 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4696
81c82a68
ILT
46972012-07-10 Dodji Seketeli <dodji@redhat.com>
4698 Ian Lance Taylor <iant@google.com>
4699
4700 PR gold/14309
4701 * configure.ac: Test whether std::tr1::hash<off_t> works.
4702 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4703 needed.
4704 * output.h (class Output_fill): Add virtual destructor.
4705 * configure, config.in: Rebuild.
4706
eabc84f4
RM
47072012-06-22 Roland McGrath <mcgrathr@google.com>
4708
4709 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4710
370e30b6
RÁE
47112012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4712
4713 * plugin.cc (Plugin::load): Handle position independent executables.
4714
fb1b895d
CC
47152012-06-06 Cary Coutant <ccoutant@google.com>
4716
4717 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4718 add .debug_macro.
4719 (lines_only_debug_sections): Likewise.
4720 (gdb_fast_lookup_sections): New static array.
4721 (is_gdb_debug_section): Rename formal parameter.
4722 (is_lines_only_debug_section): Likewise.
4723 (is_gdb_fast_lookup_section): New function.
4724 (Layout::include_section): Check for ".zdebug_" prefix; pass
4725 section name suffix to is_gdb_debug_section, et al.; check for
4726 fast-lookup sections when building .gdb_index.
4727 * options.h (--strip-debug-gdb): Update GDB version number.
4728
7c0640fa
CC
47292012-06-06 Cary Coutant <ccoutant@google.com>
4730
4731 * configure.ac: Add check for fallocate.
4732 * configure: Regenerate.
4733 * config.in: Regenerate.
4734
4735 * options.h (class General_options): Add --mmap-output-file and
4736 --posix-fallocate options.
4737 * output.cc: (posix_fallocate): Remove; replace with...
4738 (gold_fallocate): New function.
4739 (Output_file::map_no_anonymous): Call gold_fallocate.
4740 (Output_file::map): Check --mmap-output-file option.
4741
2a49eb69
DK
47422012-06-05 Jing Yu <jingyu@google.com>
4743
4744 * gold.h (textdomain): Add do {} to empty while(0).
4745 (bindtextdomain): Likewise.
4746
fad072ac
CC
47472012-06-04 Cary Coutant <ccoutant@google.com>
4748
4749 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4750 has_dynsym_index.
4751
8cc69fb6
ST
47522012-05-25 Sriraman Tallam <tmsriram@google.com>
4753
4754 * symtab.cc (Symbol_table::define_special_symbol):
4755 Initialize *poldsym to prevent uninitialized variable errors.
4756
1be75daa
CC
47572012-05-23 Cary Coutant <ccoutant@google.com>
4758
4759 * layout.cc (Layout::section_name_mapping): Add rules to handle
4760 exact match on .data.rel.ro.local or .data.rel.ro.
4761 (Layout::output_section_name): Check for exact matches.
4762
9b689de0
CC
47632012-05-23 Cary Coutant <ccoutant@google.com>
4764
4765 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4766 more carefully.
4767
b24fdbf5
CC
47682012-05-22 Cary Coutant <ccoutant@google.com>
4769
4770 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4771 object before exporting symbol.
4772
e550e1a2
L
47732012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4774
4775 * testsuite/tls_test.cc: Include "config.h" first.
4776 * testsuite/tls_test_c.c: Likewise.
4777
df7b86aa
NC
47782012-05-17 Daniel Richard G. <skunk@iskunk.org>
4779 Nick Clifton <nickc@redhat.com>
4780
4781 PR 14072
4782 * configure.in: Add check that sysdep.h has been included before
4783 any system header files.
4784 * configure: Regenerate.
4785 * config.in: Regenerate.
4786
1007b503
CC
47872012-05-14 Cary Coutant <ccoutant@google.com>
4788
4789 * layout.cc (Layout::make_output_section): Mark .tdata section
4790 as RELRO.
4791 * testsuite/relro_test.cc: Add a TLS variable.
4792
fd885f3a
L
47932012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4794
4795 PR gold/14091
4796 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4797 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4798 R_X86_64_64.
4799
80f5885c
CC
48002012-05-08 Cary Coutant <ccoutant@google.com>
4801
4802 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4803 (lines_only_debug_sections): Likewise.
4804
2e702c99
RM
48052012-05-02 Roland McGrath <mcgrathr@google.com>
4806
4807 * nacl.cc: New file.
4808 * nacl.h: New file.
4809 * Makefile.am (CCFILES, HFILES): Add them.
4810 * Makefile.in: Regenerate.
4811 * i386.cc (Output_data_plt_i386_nacl): New class.
4812 (Output_data_plt_i386_nacl_exec): New class.
4813 (Output_data_plt_i386_nacl_dyn): New class.
4814 (Target_i386_nacl): New class.
4815 (Target_selector_i386_nacl): New class.
4816 (target_selector_i386): Use it instead of Target_selector_i386.
4817 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4818 (Target_x86_64_nacl): New class.
4819 (Target_selector_x86_64_nacl): New class.
4820 (target_selector_x86_64, target_selector_x32): Use it instead of
4821 Target_selector_x86_64.
4822 * arm.cc (Output_data_plt_arm_nacl): New class.
4823 (Target_arm_nacl): New class.
4824 (Target_selector_arm_nacl): New class.
4825 (target_selector_arm, target_selector_armbe): Use it instead of
4826 Target_selector_arm.
4827
4828 * target-select.cc (select_target): Take new Input_file* and off_t
4829 arguments, pass them on to recognize method of selector.
4830 * object.cc (make_elf_sized_object): Update caller.
4831 * parameters.cc (parameters_force_valid_target): Likewise.
4832 * incremental.cc (make_sized_incremental_binary): Likewise.
4833 * target-select.h: Update decl.
4834 (Target_selector::recognize): Take new Input_file* argument,
4835 pass it on to do_recognize.
4836 (Target_selector::do_recognize): Take new Input_file* argument.
4837 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4838 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4839 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4840 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4841
4842 * target.h (Target::Target_info): New members isolate_execinstr
4843 and rosegment_gap.
4844 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4845 * arm.cc (Target_arm::arm_info): Update initializer.
4846 * i386.cc (Target_i386::i386_info): Likewise.
4847 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4848 * sparc.cc (Target_sparc::sparc_info): Likewise.
4849 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4850 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4851 * layout.cc (Layout::attach_allocated_section_to_segment):
4852 Take new const Target* argument. If target->isolate_execinstr(), act
4853 like --rosegment.
4854 (Layout::find_first_load_seg): Take new const Target* argument;
4855 if target->isolate_execinstr(), reject PF_X segments.
4856 (Layout::relaxation_loop_body): Update caller.
4857 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4858 reset file offset to zero when we hit LOAD_SEG, and then do a second
4859 loop over the segments before LOAD_SEG to reassign offsets after
4860 addresses have been determined. Handle target->rosegment_gap().
4861 (Layout::attach_section_to_segment): Take new const Target* argument;
4862 pass it to attach_allocated_section_to_segment.
4863 (Layout::make_output_section): Update caller.
4864 (Layout::attach_sections_to_segments): Take new const Target* argument;
4865 pass it to attach_section_to_segment.
4866 * gold.cc (queue_middle_tasks): Update caller.
4867 * layout.h (Layout): Update method decls with new arguments.
4868
4869 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4870 Target_info pointer to use.
4871 (Target_arm::do_make_data_plt): New virtual method.
4872 (Target_arm::make_data_plt): New method that calls it.
4873 (Target_arm::make_plt_entry): Use it.
4874 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4875 for the section alignment.
4876 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4877 method.
4878 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4879 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4880 method.
4881 (Output_data_plt_arm::get_plt_entry_size): Call it.
4882 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4883 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4884 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4885 method.
4886 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4887 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4888 method instead of sizeof(plt_entry).
4889 (Output_data_plt_arm::add_entry): Likewise.
4890 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4891 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4892 than static method.
4893 (Target_arm::plt_entry_size): Likewise.
4894 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4895 Move to ...
4896 (Output_data_plt_arm_standard): ... here, new class.
4897 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4898 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4899 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4900
4901 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4902 Take additional argument for the PLT entry size.
4903 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4904 Use get_plt_entry_size method rather than plt_entry_size variable.
4905 (Output_data_plt_x86_64::reserve_slot): Likewise.
4906 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4907 (Output_data_plt_x86_64::add_entry): Likewise.
4908 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4909 (Output_data_plt_x86_64::address_for_global): Likewise.
4910 (Output_data_plt_x86_64::address_for_local): Likewise.
4911 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4912 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4913 Make method non-static.
4914 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4915 method.
4916 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4917 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4918 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4919 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4920 virtual method.
4921 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4922 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4923 virtual method.
4924 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4925 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4926 virtual method.
4927 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4928 (Output_data_plt_x86_64::plt_entry_size)
4929 (Output_data_plt_x86_64::first_plt_entry)
4930 (Output_data_plt_x86_64::plt_entry)
4931 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4932 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4933 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4934 (Output_data_plt_x86_64_standard): ... here, new class.
4935 (Target_x86_64::Target_x86_64): Take optional argument for the
4936 Target_info pointer to use.
4937 (Target_x86_64::do_make_data_plt): New virtual method.
4938 (Target_x86_64::make_data_plt): New method to call it.
4939 (Target_x86_64::init_got_plt_for_update): Use that.
4940 Call this->plt_->add_eh_frame method here.
4941 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4942 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4943 rather than static method.
4944 (Target_x86_64::plt_entry_size): Likewise.
4945 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4946 rather than plt_entry_size variable. Move guts of PLT filling to...
4947 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4948 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4949 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4950
4951 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4952 additional argument for the section alignment.
4953 Don't do add_eh_frame_for_plt here.
4954 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4955 non-static. Use get_plt_entry_size method rather than plt_entry_size
4956 variable.
4957 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4958 method.
4959 (Output_data_plt_i386::get_plt_entry_size): Call it.
4960 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4961 (Output_data_plt_i386::add_eh_frame): New method to call it.
4962 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4963 method.
4964 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4965 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4966 method.
4967 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4968 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4969 method instead of plt_entry_size.
4970 (Output_data_plt_i386::plt_entry_size)
4971 (Output_data_plt_i386::plt_eh_frame_fde_size)
4972 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4973 (Output_data_plt_i386_standard): ... here, new class.
4974 (Output_data_plt_i386_exec): New class.
4975 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4976 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4977 (Output_data_plt_i386::exec_plt_entry): Move to ...
4978 (Output_data_plt_i386_exec::plt_entry): ... here.
4979 (Output_data_plt_i386_dyn): New class.
4980 (Output_data_plt_i386::first_plt_entry): Move to ...
4981 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4982 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4983 (Output_data_plt_i386_dyn::plt_entry): ... here.
4984 (Target_i386::Target_i386): Take optional argument for the Target_info
4985 pointer to use.
4986 (Target_i386::do_make_data_plt): New virtual method.
4987 (Target_i386::make_data_plt): New method to call it.
4988 (Target_i386::make_plt_section): Use that.
4989 Call this->plt_->add_eh_frame method here.
4990 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4991 rather than plt_entry_size variable.
4992 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4993 (Output_data_plt_i386::address_for_local): Likewise.
4994 (Output_data_plt_i386::do_write): Likewise.
4995 Move guts of PLT filling to...
4996 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4997 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4998 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4999 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5000
b9b9f2ee
CC
50012012-05-01 Cary Coutant <ccoutant@google.com>
5002
5003 * dwarf_reader.cc (Dwarf_die::read_attributes)
5004 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5005 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5006 * reduced_debug_output.cc
5007 (Output_reduced_debug_info_section::get_die_end): Remove
5008 DW_FORM_GNU_ref_index. Add default case.
5009
57923f48
MW
50102012-04-26 Mark Wielaard <mjw@redhat.com>
5011
5012 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5013 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5014 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5015 DW_AT_high_pc as offset from DW_AT_low_pc.
5016
5017 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5018 * testsuite/Makefile.in: Regenerate.
5019 * testsuite/gdb_index_test_3.c: New test source file.
5020 * testsuite/gdb_index_test_3.sh: New test source file.
5021
2c54b4f4
ILT
50222012-04-25 Ian Lance Taylor <iant@google.com>
5023
5024 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5025 pointer.
5026 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5027 as a class, not a struct.
5028 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5029 (Target_arm::apply_cortex_a8_workaround): Likewise.
5030 * gc.h: Declare Reloc_types as a struct, not a class.
5031 * object.h: Declare Symbols_data as a struct.
5032 * reloc.h: Declare Read_relocs_data as a struct.
5033 * target.h: Declare Relocate_info as a struct.
5034
a5a5f7a3
DM
50352012-04-24 David S. Miller <davem@davemloft.net>
5036
5037 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5038 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5039 and R_SPARC_WPLT30.
5040
f038d496
CC
50412012-04-24 Cary Coutant <ccoutant@google.com>
5042
5043 * incremental-dump.cc (find_input_containing_global): Replace
5044 magic number with symbolic constant.
5045 (dump_incremental_inputs): Update version number.
5046 * incremental.cc (Output_section_incremental_inputs): Update version
5047 number; import symbolic constants from Incremental_inputs_reader.
5048 (Incremental_inputs::create_data_sections): Align relocations
5049 section correctly for 64-bit targets.
5050 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5051 constants; add padding.
5052 (Output_section_incremental_inputs::write_header): Add assert for
5053 header_size.
5054 (Output_section_incremental_inputs::write_input_files): Add assert
5055 for input_entry_size.
5056 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5057 add assert for object_info_size, input_section_entry_size,
5058 global_sym_entry_size.
5059 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5060 for data structure sizes; use them.
5061 (Incremental_input_entry_reader): Import symbolic constants from
5062 Incremental_inputs_reader; use them.
5063
a4d85145
DM
50642012-04-23 David S. Miller <davem@davemloft.net>
5065
5066 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5067 and elf_flags_set_.
5068 (Target_sparc::Target_sparc): Initialize new fields.
5069 (Target_sparc::do_make_elf_object): New function.
5070 (Target_sparc::do_adjust_elf_header): New function.
5071
1d509098
CC
50722012-04-23 Cary Coutant <ccoutant@google.com>
5073
5074 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5075 CU range table of gdb index.
5076
7ebeff7f
DM
50772012-04-20 David S. Miller <davem@davemloft.net>
5078
5079 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5080 instead of false.
5081
13cf9988
DM
50822012-04-16 David S. Miller <davem@davemloft.net>
5083
2a1079e8
DM
5084 * sparc.cc (Target_sparc::got_address): New function.
5085 (Sparc_relocate_functions::gdop_hix22): New function.
5086 (Sparc_relocate_functions::gdop_lox10): New function.
5087 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5088 relocs.
5089 (Target_sparc::Scan::local): Likewise if the global symbol is not
5090 preemptible and is not IFUNC.
5091 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5092 transformations for local and non-preemptible non-IFUNC global
5093 symbols.
5094
0bc964fc
DM
5095 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5096 writing out 64-bit part of ranges.
5097
661d7a80
DM
5098 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5099 -fpic and -fpie respectively.
5100 * Makefile.in: Regenerate.
5101
8c2bf391
DM
5102 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5103 (Target_sparc::Target_sparc): Initialize new field.
5104 (Target_sparc::do_plt_section_for_global): New function.
5105 (Target_sparc::do_plt_section_for_local): New function.
5106 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5107 (Target_sparc::make_plt_section): New function, broken out of
5108 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5109 (Target_sparc::make_plt_entry): Call make_plt_section.
5110 (Target_sparc::make_local_ifunc_plt_entry): New function.
5111 (Target_sparc::rela_ifunc_section): New function.
5112 (Target_sparc::plt_section): Remove const.
5113 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5114 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5115 and ifunc_count_ fields.
5116 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5117 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5118 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5119 (Output_data_plt_sparc::rela_ifunc): New function.
5120 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5121 (Output_data_plt_sparc::has_ifunc_section): New function.
5122 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5123 (Output_data_plt_sparc::address_for_global): New function.
5124 (Output_data_plt_sparc::address_for_local): New function.
5125 (Output_data_plt_sparc::plt_index_to_offset): New function.
5126 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5127 and entry_count.
5128 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5129 entry_count.
5130 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5131 R_SPARC_JMP_IREL to switch.
5132 (Target_sparc::Scan::check_non_pic): Likewise.
5133 (Target_sparc::Scan::local): Handle IFUNC symbols.
5134 (Target_sparc::Scan::local): Likewise.
5135 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5136 and plt_address_for_local.
5137 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5138 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5139
13cf9988
DM
5140 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5141 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5142 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5143 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5144 global relocs too.
5145 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5146 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5147 calls.
5148 * sparc.cc (Target_sparc::Scan::global): Likewise.
5149 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5150
31821be0
CC
51512012-04-16 Cary Coutant <ccoutant@google.com>
5152
5153 * archive.cc (Library_base::should_include_member): Check for
5154 --export-dynamic-symbol.
5155 * options.h (class General_options): Add --export-dynamic-symbol.
5156 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5157 --export-dynamic-symbol.
5158 (Symbol_table::gc_mark_undef_symbols): Likewise.
5159 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5160
2615994e
DM
51612012-04-12 David S. Miller <davem@davemloft.net>
5162
5163 * sparc.cc (Reloc::wdisp10): New relocation method.
5164 (Reloc::h34): Likewise.
5165 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5166 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5167 R_SPARC_WDISP10.
5168 (Target_sparc::Scan::local): Likewise.
5169 (Target_sparc::Scan::global): Likewise.
5170 (Target_sparc::Relocate::relocate): Likewise.
5171
6782735d
CC
51722012-04-09 Cary Coutant <ccoutant@google.com>
5173
5174 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5175 low_pc == 0.
5176
8c7a0b00
ILT
51772012-04-06 Ian Lance Taylor <iant@google.com>
5178
5179 * timer.cc: #include <unistd.h>.
5180
58797674
RM
51812012-04-06 Roland McGrath <mcgrathr@google.com>
5182
5183 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5184 * config.in: Regenerate.
5185 * configure: Regenerate.
5186
44350750
NC
51872012-04-05 Nick Clifton <nickc@redhat.com>
5188
5189 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5190 (AM_LC_MESSAGES): Add.
5191 * aclocal.m4: Regenerate.
5192 * config.in: Regenerate.
5193 * configure: Regenerate.
5194
c1027032
CC
51952012-03-21 Cary Coutant <ccoutant@google.com>
5196
5197 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5198 * Makefile.in: Regenerate.
5199 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5200 (Sized_elf_reloc_mapper::symbol_section): New function.
5201 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5202 (make_elf_reloc_mapper): New function.
5203 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5204 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5205 (Dwarf_abbrev_table::do_get_abbrev): New function.
5206 (Dwarf_ranges_table::read_ranges_table): New function.
5207 (Dwarf_ranges_table::read_range_list): New function.
5208 (Dwarf_pubnames_table::read_section): New function.
5209 (Dwarf_pubnames_table::read_header): New function.
5210 (Dwarf_pubnames_table::next_name): New function.
5211 (Dwarf_die::Dwarf_die): New function.
5212 (Dwarf_die::read_attributes): New function.
5213 (Dwarf_die::skip_attributes): New function.
5214 (Dwarf_die::set_name): New function.
5215 (Dwarf_die::set_linkage_name): New function.
5216 (Dwarf_die::attribute): New function.
5217 (Dwarf_die::string_attribute): New function.
5218 (Dwarf_die::int_attribute): New function.
5219 (Dwarf_die::uint_attribute): New function.
5220 (Dwarf_die::ref_attribute): New function.
5221 (Dwarf_die::child_offset): New function.
5222 (Dwarf_die::sibling_offset): New function.
5223 (Dwarf_info_reader::check_buffer): New function.
5224 (Dwarf_info_reader::parse): New function.
5225 (Dwarf_info_reader::do_parse): New function.
5226 (Dwarf_info_reader::do_read_string_table): New function.
5227 (Dwarf_info_reader::lookup_reloc): New function.
5228 (Dwarf_info_reader::get_string): New function.
5229 (Dwarf_info_reader::visit_compilation_unit): New function.
5230 (Dwarf_info_reader::visit_type_unit): New function.
5231 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5232 Sized_elf_reloc_mapper.
5233 (Sized_dwarf_line_info::symbol_section): Remove function.
5234 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5235 (Sized_dwarf_line_info::read_line_mappings): Remove object
5236 parameter, adjust callers.
5237 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5238 * dwarf_reader.h: Include <sys/types.h>.
5239 (class Track_relocs): Remove forward declaration.
5240 (class Elf_reloc_mapper): New class.
5241 (class Sized_elf_reloc_mapper): New class.
5242 (class Dwarf_abbrev_table): New class.
5243 (class Dwarf_range_list): New class.
5244 (class Dwarf_ranges_table): New class.
5245 (class Dwarf_pubnames_table): New class.
5246 (class Dwarf_die): New class.
5247 (class Dwarf_info_reader): New class.
5248 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5249 (Sized_dwarf_line_info::symbol_section): Remove member function.
5250 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5251 base class.
5252 * gdb-index.cc: New source file.
5253 * gdb-index.h: New source file.
5254 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5255 and .debug_types sections, call Layout::add_to_gdb_index.
5256 (Sized_relobj_incr::do_section_name): Implement.
5257 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5258 return type; Implement.
5259 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5260 return type.
5261 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5262 parameter list and return type.
5263 (Sized_incr_dynobj::do_section_contents): Likewise.
5264 * layout.cc: Include gdb-index.h.
5265 (Layout::Layout): Initialize gdb_index_data_.
5266 (Layout::init_fixed_output_section): Check for .gdb_index section.
5267 (Layout::add_to_gdb_index): New function. Instantiate.
5268 * layout.h: Add forward declaration for class Gdb_index.
5269 (Layout::add_to_gdb_index): New member function.
5270 (Layout::gdb_index_data_): New data member.
5271 * main.cc: Include gdb-index.h.
5272 (main): Print statistics for gdb index.
5273 * object.cc (Object::section_contents): Move code into
5274 do_section_contents.
5275 (need_decompressed_section): Check for sections needed when building
5276 gdb index.
5277 (build_compressed_section_map): Likewise.
5278 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5279 gdb index.
5280 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5281 sections; call Layout::add_to_gdb_index.
5282 (Sized_relobj_file::do_decompressed_section_contents): Call
5283 do_section_contents directly.
5284 * object.h (Object::do_section_contents): Adjust parameter list and
5285 return type.
5286 (Object::do_decompressed_section_contents): Call do_section_contents
5287 directly.
5288 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5289 return type.
5290 * options.h (class General_options): Add --gdb-index option.
5291 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5292 list and return type.
5293 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5294 * reloc.h (Track_relocs::checkpoint): New function.
5295 (Track_relocs::reset): New function.
5296
5297 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5298 New test cases.
5299 * testsuite/Makefile.in: Regenerate.
5300 * testsuite/gdb_index_test.cc: New test source file.
5301 * testsuite/gdb_index_test_1.sh: New test source file.
5302 * testsuite/gdb_index_test_2.sh: New test source file.
5303
647f1574
DK
53042012-03-19 Doug Kwan <dougkwan@google.com>
5305
5306 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5307 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5308 __exidx_start and __exidx_end. Make symbol table parameter
5309 anonymous as it is not used.
5310 * gold.cc (queue_middle_tasks): Call target hook to define any
5311 target-specific symbols.
5312 * target.h (Target::define_standard_symbols): New method.
5313 (Target::do_define_standard_symbols): Same.
5314 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5315 * testsuite/Makefile.in: Regenerate.
5316 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5317 and __exidx_end.
5318 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5319 relocations are generated for __exidx_start and __exidx_end.
5320
7c6109da
DK
53212012-03-16 Doug Kwan <dougkwan@google.com>
5322
5323 * testsuite/Makefile.am: Disable test initpri3b.
5324 * testsuite/Makefile.in: Regenerate.
5325
7b8957f8
DK
53262012-03-15 Doug Kwan <dougkwan@google.com>
5327
5328 * arm.cc (Target_arm::got_section): Make .got section read-only
5329 if -z now is given.
5330
14dc9ef7
ILT
53312012-03-15 Ian Lance Taylor <iant@google.com>
5332
5333 PR gold/13850
5334 * layout.cc (Layout::make_output_section): Correctly mark
5335 SHT_INIT_ARRAY, et. al., as relro.
5336
fa40b62a
DK
53372012-03-14 Doug Kwan <dougkwan@google.com>
5338
5339 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5340 dynamic relocations for protected symbols in shared objects.
5341
fd325007
ILT
53422012-03-13 Ian Lance Taylor <iant@google.com>
5343
5344 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5345 keep the larger alignment.
5346
e8dd54e1
CC
53472012-03-12 Cary Coutant <ccoutant@google.com>
5348
5349 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5350 handling of DW_LNE_define_file.
5351
feb5f3b0
CC
53522012-03-12 Cary Coutant <ccoutant@google.com>
5353
5354 * reduced_debug_output.cc
5355 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5356 codes to switch.
5357
a1fb4256
CC
53582012-02-29 Cary Coutant <ccoutant@google.com>
5359
5360 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5361
5dd8762a
CC
53622012-02-29 Cary Coutant <ccoutant@google.com>
5363
5364 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5365 Call Object::decompressed_section_contents.
5366 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5367 New dtor.
5368 (Sized_dwarf_line_info::buffer_start_): New data member.
5369 * merge.cc (Output_merge_data::do_add_input_section): Call
5370 Object::decompressed_section_contents.
5371 (Output_merge_string::do_add_input_section): Likewise.
5372 * object.cc (need_decompressed_section): New function.
5373 (build_compressed_section_map): Decompress sections needed later.
5374 (Sized_relobj_file::do_decompressed_section_contents): New function.
5375 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5376 * object.h (Object::decompressed_section_contents): New function.
5377 (Object::discard_decompressed_sections): New function.
5378 (Object::do_decompressed_section_contents): New function.
5379 (Object::do_discard_decompressed_sections): New function.
5380 (Compressed_section_info): New type.
5381 (Compressed_section_map): Include decompressed section contents.
5382 (Sized_relobj_file::do_decompressed_section_contents): New function.
5383 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5384
7b5de7ee
CC
53852012-02-16 Cary Coutant <ccoutant@google.com>
5386
5387 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5388 * testsuite/Makefile.in: Regenerate.
5389
f9fa4a63
CC
53902012-02-14 Cary Coutant <ccoutant@google.com>
5391
5392 * options.cc (General_options::finalize): Disallow -pie and -static.
5393
2c175ebc
DK
53942012-02-03 Doug Kwan <dougkwan@google.com>
5395
5396 * arm.cc (Arm_relocate_functions::abs8,
5397 Arm_relocate_functions::abs16): Use
5398 Bits::has_signed_unsigned_overflow32.
5399 (Arm_relocate_functions::thm_abs8): Correct range of
5400 overflow check.
5401 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5402 in assertions.
5403
90cff06f
DK
54042012-02-02 Doug Kwan <dougkwan@google.com>
5405
5406 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5407 position independent outputs, not just shared objects.
5408
63887f3d
L
54092012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5410
5411 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5412 * configure: Regenerated.
5413
bef2b434
ILT
54142012-01-27 Ian Lance Taylor <iant@google.com>
5415
5416 * reloc.h (Bits): New class with static functions, copied from
5417 namespace utils in arm.cc.
5418 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5419 instead.
5420
c335b55d
L
54212012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5422
5423 * incremental.cc (write_info_blocks): Correct relocation offset.
5424
41194d9f
L
54252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5426
5427 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5428 (Relocate::tls_gd_to_le): Likewise.
5429
1bae613c
L
54302012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5431
5432 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5433
24482ca0
L
54342012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5435
5436 * configure.ac: Check if -mcmodel=medium works.
5437 * configure: Regenerated.
5438
c2c7840a
CC
54392012-01-24 Cary Coutant <ccoutant@google.com>
5440
5441 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5442 definition and ...
5443 (read_unsigned_LEB_128_x): ... this new function.
5444 (read_signed_LEB_128): Replaced with inline definition and ...
5445 (read_signed_LEB_128_x): ... this new function.
5446 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5447 (read_unsigned_LEB_128): Add inline definition.
5448 (read_signed_LEB_128_x): New function.
5449 (read_signed_LEB_128): Add inline definition.
5450 * testsuite/Makefile.am (leb128_unittest): New unit test.
5451 * testsuite/Makefile.in: Regenerate.
5452 * testsuite/leb128_unittest.cc: New unit test.
5453
833de760 54542012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5455
5456 PR gold/13617
5457 * i386.cc (Target_i386::do_code_fill): When using a jmp
5458 instruction, pad with nop instructions.
5459 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5460
618d6666
L
54612012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5462
5463 * x86_64.cc (gc_process_relocs): Add typename on types used in
5464 template.
5465 (scan_relocs): Likewise.
5466 (relocate_section): Likewise.
5467 (apply_relocation): Likewise.
5468
3660ff06
L
54692012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5470
5471 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5472 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5473 under x32.
5474
fc51264f
L
54752012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5476
5477 * x86_64.cc: Initial support for x32.
5478
dd74ae06
CC
54792012-01-03 Cary Coutant <ccoutant@google.com>
5480
5481 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5482 Use abstract base class for GOT.
5483 * gold/output.h (class Output_data_got_base): New abstract base class.
5484 (class Output_data_got): Derive from new base class, adjust ctors.
5485 (Output_data_got::reserve_slot): Make virtual; rename to
5486 do_reserve_slot; Adjust callers.
5487 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5488 pointer to abstract base class.
5489 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5490
83896202
ILT
54912011-12-18 Ian Lance Taylor <iant@google.com>
5492
5493 * object.h (Relobj::local_symbol_value): New function.
5494 (Relobj::local_plt_offset): New function.
5495 (Relobj::local_has_got_offset): New function.
5496 (Relobj::local_got_offset): New function.
5497 (Relobj::set_local_got_offset): New function.
5498 (Relobj::do_local_symbol_value): New pure virtual function.
5499 (Relobj::do_local_plt_offset): Likewise.
5500 (Relobj::do_local_has_got_offset): Likewise.
5501 (Relobj::do_local_got_offset): Likewise.
5502 (Relobj::do_set_local_got_offset): Likewise.
5503 (Sized_relobj::do_local_has_got_offset): Rename from
5504 local_has_got_offset.
5505 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5506 (Sized_relobj::do_set_local_got_offset): Rename from
5507 set_local_got_offset.
5508 (Sized_relobj_file::do_local_plt_offset): Rename from
5509 local_plt_offset.
5510 (Sized_relobj_file::do_local_symbol_value): New function.
5511 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5512 local_plt_offset.
5513 * output.cc (Output_data_got::Got_entry::write): Change object to
5514 Relobj. Use local_symbol_value.
5515 (Output_data_got::add_global_with_rel): Change rel_dyn to
5516 Output_data_reloc_generic*. Use add_global_generic.
5517 (Output_data_got::add_global_with_rela): Remove. Change all
5518 callers to use add_global_with_rel.
5519 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5520 Output_data_reloc_generic*. Use add_global_generic.
5521 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5522 callers to use add_global_pair_with_rel.
5523 (Output_data_got::add_local): Change object to Relobj*.
5524 (Output_data_got::add_local_plt): Likewise.
5525 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5526 change rel_dyn to Output_data_reloc_generic*. Use
5527 add_local_generic.
5528 (Output_data_got::add_local_with_rela): Remove. Change all
5529 callers to use all_local_with_rel.
5530 (Output_data_got::add_local_pair_with_rel): Change object to
5531 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5532 add_output_section_generic.
5533 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5534 callers to use add_local_pair_with_rel.
5535 (Output_data_got::reserve_local): Change object to Relobj*.
5536 * output.h: (class Output_data_reloc_generic): Add pure virtual
5537 declarations for add_global_generic, add_local_generic,
5538 add_output_section_generic.
5539 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5540 functions for Output_data_reloc_generic. Update declarations for
5541 changes listed in output.cc.
5542 (class Output_data_got): Change template parameter to got_size.
5543 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5544 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5545 function.
5546 (Sized_relobj_incr::do_local_plt_offset): New function.
5547 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5548 add_global_generic.
5549
76677ad0
CC
55502011-12-17 Cary Coutant <ccoutant@google.com>
5551
5552 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5553 * resolve.cc (Symbol_table::resolve): Likewise.
5554 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5555 arrays.
5556 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5557
8b8dd8d5
ILT
55582011-12-16 Ian Lance Taylor <iant@google.com>
5559
5560 * output.h (Output_data_reloc_generic::add): Only call
5561 add_dynamic_reloc if this is a dynamic reloc section.
5562
d55525b9
L
55632011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5564
5565 PR gold/13505
5566 * target-reloc.h (apply_relocation): Replace <64, false> with
5567 <size, big_endian>.
5568
ff81c7c1
NC
55692011-11-25 Nick Clifton <nickc@redhat.com>
5570
5571 * po/it.po: New Italian translation.
5572
628f39be
SA
55732011-11-17 Sterling Augustine <saugustine@google.com>
5574
5575 * script.cc (script_include_directive): Implement.
5576 (read_script_file): New local variables name and search_path. Update
5577 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5578 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5579 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5580
98ef3ea4
SA
55812011-11-11 Sterling Augustine <saugustine@google.com>
5582
5583 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5584 (file_or_sections_cmd): Likewise.
5585
f4a8b6d7
DK
55862011-11-11 Doug Kwan <dougkwan@google.com>
5587
5588 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5589 if --just-symbols is given.
5590
29ab395d
DK
55912011-11-10 Doug Kwan <dougkwan@google.com>
5592
5593 PR gold/13362
5594 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5595 when processing data relocs.
5596 * reloc.h (Relocate_functions::rel_unaligned): New method.
5597 (Relocate_functions::pcrel_unaligned): Ditto.
5598 (Relocate_functions::rel32_unaligned): Ditto.
5599 (Relocate_functions::pcrel32_unaligned): Ditto.
5600
2c339f71
DK
56012011-11-09 Doug Kwan <dougkwan@google.com>
5602
5603 PR gold/13362
5604 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5605 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5606 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5607 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5608 (Relocate_functions::rel_unaligned): New.
5609 (Relocate_functions::rel32_unaligned): New.
5610 * target-reloc.h (relocate_for_relocatable): Add code to handle
5611 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5612 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5613 arm_unaligned_reloc_r): New targets.
5614 * testsuite/Makefile.in: Regenerate.
5615 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5616 linking.
5617
3f3cddf1
ILT
56182011-11-02 Ian Lance Taylor <iant@google.com>
5619
5620 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5621 NATIVE_LINKER.
5622 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5623 * options.cc (General_options::finalize): Use library search path
5624 from configure script if specified. If not native and no sysroot,
5625 only search TOOLLIBDIR.
5626 * options.h (Search_directory::Search_directory): Change name to
5627 const std::string&.
5628 (General_options::add_to_library_path_with_sysroot): Change arg to
5629 const std::string&.
5630 * configure, Makefile.in, config.in: Rebuild.
5631
a8e2273b
ILT
56322011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5633
5634 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5635 we are working around the ARM1176 Erratum.
5636 * options.h (General_options::fix_arm1176): Add option.
5637 * testsuite/Makefile.am: Add testcases, and keep current ones
5638 working.
5639 * testsuite/Makefile.in: Regenerate.
5640 * testsuite/arm_fix_1176.s: New file.
5641 * testsuite/arm_fix_1176.sh: Likewise.
5642
cd6eab1c
ILT
56432011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5644
5645 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5646 may_use_blx_.
5647 (Target_arm::may_use_blx): Remove method.
5648 (Target_arm::set_may_use_blx): Likewise.
5649 (Target_arm::may_use_v4t_interworking): New method.
5650 (Target_arm::may_use_v5t_interworking): Likewise.
5651 (Target_arm::may_use_blx_): Remove member variable.
5652 (Arm_relocate_functions::arm_branch_common): Check for v5T
5653 interworking.
5654 (Arm_relocate_functions::thumb_branch_common): Likewise.
5655 (Reloc_stub::stub_type_for_reloc): Likewise.
5656 (Target_arm::do_finalize_sections): Correct interworking checks.
5657 * testsuite/Makefile.am: Add new tests.
5658 * testsuite/Makefile.in: Regenerate.
5659 * testsuite/arm_farcall_arm_arm.s: New test.
5660 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5661 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5662 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5663 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5664 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5665 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5666 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5667
286adcf4
CC
56682011-10-31 Cary Coutant <ccoutant@google.com>
5669
5670 PR gold/13023
5671 * expression.cc (Expression::eval_with_dot): Add
5672 is_section_dot_assignment parameter.
5673 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5674 absolute and assigning to dot within a section.
5675 * script-sections.cc
5676 (Output_section_element_assignment::set_section_addresses): Pass
5677 dot_section to set_if_absolute.
5678 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5679 as is_section_dot_assignment flag to eval_with_dot.
5680 (Output_section_element_dot_assignment::set_section_addresses):
5681 Likewise.
5682 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5683 parameter. Also set value if relative to dot_section; set the
5684 symbol's output_section.
5685 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5686 parameter. Adjust all callers.
5687 (Expression::eval_maybe_dot): Likewise.
5688 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5689 Adjust all callers.
5690 * testsuite/script_test_2.t: Test assignment of an absolute value
5691 to dot within an output section element.
5692
9634ed06
CC
56932011-10-31 Cary Coutant <ccoutant@google.com>
5694
5695 * options.h (class General_options): Add --[no-]gnu-unique options.
5696 * symtab.cc (Symbol_table::sized_write_globals): Convert
5697 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5698
de4101c7
CC
56992011-10-31 Cary Coutant <ccoutant@google.com>
5700
5701 PR gold/13359
5702 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5703 unnecessary assertion.
5704 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5705
7257cc92
ST
57062011-10-31 Sriraman Tallam <tmsriram@google.com>
5707
5708 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5709 gc_mark_symbol.
5710 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5711 gc_mark_symbol.
5712 Change to just keep the section associated with symbol.
5713 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5714 they are externally visible and --export-dynamic is turned on.
5715 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5716
bfc34b3f
ILT
57172011-10-19 Ian Lance Taylor <iant@google.com>
5718
5719 PR gold/13163
5720 * script-sections.cc
5721 (Output_section_element_dot_assignment::needs_output_section): New
5722 function.
5723
ea0d8c47
ILT
57242011-10-19 Ian Lance Taylor <iant@google.com>
5725
5726 PR gold/13204
5727 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5728 --section-start option was seen.
5729 * options.h (General_options::any_section_start): New function.
5730
abd242a9
DM
57312011-10-18 David S. Miller <davem@davemloft.net>
5732
5733 PR binutils/13301
5734 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5735 member to track relocation locations that have moved during TLS
5736 reloc optimizations.
5737 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5738 (Target_sparc::Relocate::relocate): Adjust view down by 4
5739 bytes if it matches reloc_adjust_addr_.
5740 (Target_sparc::Relocate::relocate_tls): Always move the
5741 __tls_get_addr call delay slot instruction forward 4 bytes when
5742 performing relaxation.
5743
bab9090f
CC
57442011-10-18 Cary Coutant <ccoutant@google.com>
5745
5746 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5747 (Output_file::map_no_anonymous): Check for non-zero
5748 return code from posix_fallocate.
5749
f7c5b166
CC
57502011-10-17 Cary Coutant <ccoutant@google.com>
5751
5752 PR gold/13245
5753 * plugin.cc (is_visible_from_outside): Check for symbols
5754 referenced from dynamic objects.
5755 * resolve.cc (Symbol_table::resolve): Don't count references
5756 from dynamic objects as references from real ELF files.
5757 * testsuite/plugin_test_2.sh: Adjust expected result.
5758
b490c0bb
CC
57592011-10-17 Cary Coutant <ccoutant@google.com>
5760
5761 * gold.cc: Include timer.h.
5762 (queue_middle_tasks): Stamp time.
5763 (queue_final_tasks): Likewise.
5764 * main.cc (main): Store timer in parameters. Print timers
5765 for each pass.
5766 * parameters.cc (Parameters::Parameters): Initialize timer_.
5767 (Parameters::set_timer): New function.
5768 (set_parameters_timer): New function.
5769 * parameters.h (Parameters::set_timer): New function.
5770 (Parameters::timer): New function.
5771 (Parameters::timer_): New data member.
5772 (set_parameters_timer): New function.
5773 * timer.cc (Timer::stamp): New function.
5774 (Timer::get_pass_time): New function.
5775 * timer.h (Timer::stamp): New function.
5776 (Timer::get_pass_time): New function.
5777 (Timer::pass_times_): New data member.
5778
f475cf7b
CC
57792011-10-17 Cary Coutant <ccoutant@google.com>
5780
5781 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5782 task for members of lib groups.
5783
cdd7e244
CC
57842011-10-17 Cary Coutant <ccoutant@google.com>
5785
5786 PR gold/13288
4f95c8b4 5787 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5788 (File_read::make_view): Move bounds check (replace with assert)...
5789 (File_read::find_or_make_view): ... to here.
5790
dfb45471
CC
57912011-10-12 Cary Coutant <ccoutant@google.com>
5792
4f95c8b4 5793 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5794 ::read returns less than requested size.
5795
53bbcc1b
CC
57962011-10-10 Cary Coutant <ccoutant@google.com>
5797
4f95c8b4 5798 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5799 Initialize defined_count_.
5800 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5801 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5802 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5803 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5804 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5805 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5806 member.
5807 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5808 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5809 Return zeroes instead of internal error.
5810
397b129b
CC
58112011-10-10 Cary Coutant <ccoutant@google.com>
5812
5813 PR gold/13249
4f95c8b4 5814 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5815 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5816 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5817 (Output_reloc::type_): Adjust size of bit field.
5818 (Output_reloc::use_plt_offset_): New bit field.
5819 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5820 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5821 flag. Adjust all callers.
4f95c8b4 5822 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5823 creating RELATIVE relocations.
5824
d5698657
NC
58252011-10-10 Nick Clifton <nickc@redhat.com>
5826
5827 * po/es.po: Updated Spanish translation.
5828 * po/fi.po: Updated Finnish translation.
5829
6a59a5c2
DN
58302011-10-03 Diego Novillo <dnovillo@google.com>
5831
5832 * options.cc (parse_uint): Fix dereference of RETVAL.
5833
f0558624
ST
58342011-09-29 Sriraman Tallam <tmsriram@google.com>
5835
5836 * layout.h (section_order_map_): New member.
5837 (get_section_order_map): New member function.
5838 * output.cc (Output_section::add_input_section): Check for patterns
5839 only when --section-ordering-file is specified.
5840 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5841 output_sections have been formed.
5842 * layout.cc (Layout_Layout): Initialize section_order_map_.
5843 * plugin.cc (update_section_order): Store order in order_map. Do not
5844 update the order.
5845 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5846 * testsuite/Makefile.in: Regenerate.
5847 * testsuite/plugin_section_order.c: New file.
5848 * testsuite/plugin_final_layout.cc: New file.
5849 * testsuite/plugin_final_layout.sh: New file.
5850
a7dac153
CC
58512011-09-29 Cary Coutant <ccoutant@google.com>
5852
4f95c8b4 5853 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5854 Check for NULL.
4f95c8b4 5855 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5856 symbols during incremental update.
5857 (Symbol_table::add_from_dynobj): Likewise.
5858
eebd87a5
ILT
58592011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5860 Ian Lance Taylor <iant@google.com>
5861
5862 * symtab.cc (Symbol_table::define_special_symbol): Always
5863 canonicalize version string.
5864
403a3331
CC
58652011-09-26 Cary Coutant <ccoutant@google.com>
5866
4f95c8b4
CC
5867 * gold.cc (queue_initial_tasks): Move option checks ...
5868 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5869 some options; make others fatal.
5870
235061c2
CC
58712011-09-26 Cary Coutant <ccoutant@google.com>
5872
5873 gcc PR lto/47247
5874 * plugin.cc (get_symbols_v2): New function.
5875 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5876 (is_referenced_from_outside): New function.
5877 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5878 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5879 (get_symbols): Pass version parameter.
5880 (get_symbols_v2): New function.
5881 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5882 parameter.
5883 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5884 (onload): Add LDPT_GET_SYMBOLS_V2.
5885 (all_symbols_read_hook): Use get_symbols_v2; check for
5886 LDPR_PREVAILING_DEF_IRONLY_EXP.
5887 * testsuite/plugin_test_3.sh: Update expected results.
5888
dc87f620
ILT
58892011-09-23 Simon Baldwin <simonb@google.com>
5890
5891 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5892 configuration options.
5893 * configure: Regenerate.
5894 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5895 * Makefile.in: Regenerate.
5896 * testsuite/Makefile.in: Regenerate.
5897
a8279f82
ST
58982011-09-19 Sriraman Tallam <tmsriram@google.com>
5899
5900 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5901
0c9350c8
CC
59022011-09-19 Cary Coutant <ccoutant@google.com>
5903
5904 * incremental.cc (can_incremental_update): Fix typo in comment.
5905 * incremental.h (can_incremental_update): Likewise.
5906
aa06ae28
CC
59072011-09-18 Cary Coutant <ccoutant@google.com>
5908
5909 * incremental.cc (can_incremental_update): New function.
5910 * incremental.h (can_incremental_update): New function.
5911 * layout.cc (Layout::init_fixed_output_section): Call it.
5912 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5913 * object.cc (Sized_relobj_file::do_layout): Call
5914 can_incremental_update.
5915
ebb300b2
CC
59162011-09-13 Cary Coutant <ccoutant@google.com>
5917
5918 * configure.ac: Check for glibc support for gnu_indirect_function
5919 support with static linking, setting automake conditional
5920 IFUNC_STATIC.
5921 * Makefile.in: Regenerate.
5922 * configure: Regenerate.
5923
5924 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5925 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5926 for IFUNC_STATIC.
5927 * testsuite/Makefile.in: Regenerate.
5928
1206d0d5
CC
59292011-09-13 Cary Coutant <ccoutant@google.com>
5930
5931 * incremental.cc (Sized_relobj_incr::do_layout): Call
5932 report_comdat_group for kept comdat sections.
5933 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5934 * testsuite/Makefile.in: Regenerate.
5935 * testsuite/incr_comdat_test_1.cc: New source file.
5936 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5937 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5938 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5939
40b29874
ILT
59402011-09-13 Ian Lance Taylor <iant@google.com>
5941
5942 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5943 variable external_symbols_offset.
5944
1b045aac
ILT
59452011-09-12 Ian Lance Taylor <iant@google.com>
5946
5947 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5948 triggered if object has no symbols.
5949
24c6c55a
DM
59502011-09-09 David S. Miller <davem@davemloft.net>
5951
5952 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5953 (Output_fill_debug_line::do_write): Likewise.
5954
66570254
CC
59552011-08-29 Cary Coutant <ccoutant@google.com>
5956
5957 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5958 casts to match formatting specs.
5959 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5960
8ea8cd50
CC
59612011-08-26 Cary Coutant <ccoutant@google.com>
5962
5963 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5964 remaining hole size when allocating.
5965 (Layout::make_output_section): Set fill methods for debug sections.
5966 * layout.h (Free_list::Free_list_node): Move from private to
5967 public.
5968 (Free_list::set_min_hole_size): New function.
5969 (Free_list::begin, Free_list::end): New functions.
5970 (Free_list::min_hole_): New data member.
5971 * output.cc: Include dwarf.h.
5972 (Output_fill_debug_info::do_minimum_hole_size): New function.
5973 (Output_fill_debug_info::do_write): New function.
5974 (Output_fill_debug_line::do_minimum_hole_size): New function.
5975 (Output_fill_debug_line::do_write): New function.
5976 (Output_section::Output_section): Initialize new data member.
5977 (Output_section::set_final_data_size): Ensure patch space is larger
5978 than minimum hole size.
5979 (Output_section::do_write): Fill holes in debug sections.
5980 * output.h (Output_fill): New class.
5981 (Output_fill_debug_info): New class.
5982 (Output_fill_debug_line): New class.
5983 (Output_section::set_free_space_fill): New function.
5984 (Output_section::free_space_fill_): New data member.
5985 * testsuite/Makefile.am (incremental_test_3): Add
5986 --incremental-patch option.
5987 (incremental_test_4): Likewise.
5988 (incremental_test_5): Likewise.
5989 (incremental_test_6): Likewise.
5990 (incremental_copy_test): Likewise.
5991 (incremental_common_test_1): Likewise.
5992 * testsuite/Makefile.in: Regenerate.
5993
7cf80422
NC
59942011-08-26 Nick Clifton <nickc@redhat.com>
5995
5996 * po/es.po: Updated Spanish translation.
5997
c3f7b0e5
CC
59982011-08-01 Cary Coutant <ccoutant@google.com>
5999
6000 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6001 * gold/testsuite/Makefile.in: Regenerate.
6002 * gold/testsuite/justsyms_exec.c: New source file.
6003 * gold/testsuite/justsyms_lib.c: New source file.
6004
9590bf25
CC
60052011-08-01 Cary Coutant <ccoutant@google.com>
6006
6007 * layout.cc (Layout::set_segment_offsets): Don't realign text
6008 segment if -Ttext was specified.
6009 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6010 file type.
6011 * object.h (Sized_relobj_file::e_type): New function.
6012 (Sized_relobj_file::e_type_): New data member.
6013 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6014 base address for ET_EXEC files.
6015 * target.cc (Target::do_make_elf_object_implementation): Allow
6016 ET_EXEC files with --just-symbols option.
6017
dcd8d12e
CC
60182011-07-28 Cary Coutant <ccoutant@google.com>
6019
6020 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6021 Add thread_number parameter.
6022 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6023 * workqueue-threads.cc
6024 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6025 current thread if its thread number is greater than desired thread
6026 count.
6027 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6028 Add thread_number parameter.
6029 (Workqueue::should_cancel_thread): Likewise.
6030 (Workqueue::find_runnable_or_wait): Pass thread_number to
6031 should_cancel_thread.
6032 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6033 parameter.
6034
804eb480
ST
60352011-07-22 Sriraman Tallam <tmsriram@google.com>
6036
6037 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6038 only after checking if it cannot be forced local.
6039 * symtab.h (is_externally_visible): Check if the symbol is not forced
6040 local.
6041
f1ddb600
ILT
60422011-07-15 Ian Lance Taylor <iant@google.com>
6043
6044 * options.h (class General_options): Add --print-output-format.
6045 Move -EL next to -EB, for better --help output.
6046 * target-select.cc: Include <cstdio>, "options.h", and
6047 "parameters.h".
6048 (Target_selector::do_target_bfd_name): New function.
6049 (print_output_format): New function.
6050 * target-select.h (class Target_selector): Update declarations.
6051 (Target_selector::target_bfd_name): New function.
6052 (print_output_format): Declare.
6053 * main.cc: Include "target-select.h".
6054 (main): Handle --print-output-format.
6055 * gold.cc: Include "target-select.h".
6056 (queue_initial_tasks): Handle --print-output-format when there are
6057 no input files.
6058 * parameters.cc (parameters_force_valid_target): Give a better
6059 error message if -EB/-EL does not match target.
6060 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6061 function.
6062
7d172687
ILT
60632011-07-15 Ian Lance Taylor <iant@google.com>
6064
6065 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6066 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6067 (Output_data_plt_i386::do_write): Write address of .dynamic
6068 section to first entry in .got.plt section.
6069 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6070 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6071 Initialize layout_.
6072 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6073 section to first entry in .got.plt section.
6074 * layout.h (Layout::dynamic_section): New function.
6075
e9552f7e
ST
60762011-07-13 Sriraman Tallam <tmsriram@google.com>
6077
6078 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6079 to claim_file call.
6080 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6081 input_section_position_, and input_section_glob_.
6082 (read_layout_from_file): Call function section_ordering_specified.
6083 * layout.h (is_section_ordering_specified): New function.
6084 (section_ordering_specified): New function.
6085 (section_ordering_specified_): New boolean member.
6086 * main.cc(main): Call load_plugins after layout object is defined.
6087 * output.cc (Output_section::add_input_section): Use
6088 function section_ordering_specified to check if section ordering is
6089 needed.
6090 * output.cc (Output_section::add_relaxed_input_section): Use
6091 function section_ordering_specified to check if section ordering is
6092 needed.
6093 (Output_section::update_section_layout): New function.
6094 (Output_section::sort_attached_input_sections): Check if input section
6095 must be reordered.
6096 * output.h (Output_section::update_section_layout): New function.
6097 * plugin.cc (get_section_count): New function.
6098 (get_section_type): New function.
6099 (get_section_name): New function.
6100 (get_section_contents): New function.
6101 (update_section_order): New function.
58797674 6102 (allow_section_ordering): New function.
e9552f7e
ST
6103 (Plugin::load): Add the new interfaces to the transfer vector.
6104 (Plugin_manager::load_plugins): New parameter.
6105 (Plugin_manager::all_symbols_read): New parameter.
6106 (Plugin_manager::claim_file): New parameter. Save the elf object for
6107 unclaimed objects.
6108 (Plugin_manager::get_elf_object): New function.
6109 (Plugin_manager::get_view): Change to directly use the bool to check
6110 if get_view is called from claim_file_hook.
6111 * plugin.h (input_objects): New function
6112 (Plugin__manager::load_plugins): New parameter.
6113 (Plugin_manager::claim_file): New parameter.
6114 (Plugin_manager::get_elf_object): New function.
6115 (Plugin_manager::in_claim_file_handler): New function.
6116 (Plugin_manager::in_claim_file_handler_): New member.
6117 (layout): New function.
6118 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6119 handler with an extra parameter. Make the elf object before calling
6120 claim_file handler.
6121 * testsuite/plugin_test.c (get_section_count): New function pointer.
6122 (get_section_type): New function pointer.
6123 (get_section_name): New function pointer.
6124 (get_section_contents): New function pointer.
6125 (update_section_order): New function pointer.
6126 (allow_section_ordering): New function pointer.
6127 (onload): Check if the new interfaces exist.
6128
9446efde
ILT
61292011-07-13 Ian Lance Taylor <iant@google.com>
6130
6131 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6132 relro section.
6133 * x86_64.cc (Target_x86_64::got_section): Likewise.
6134 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6135 (relro_now_test_SOURCES): New variable.
6136 (relro_now_test_DEPENDENCIES): New variable.
6137 (relro_now_test_LDFLAGS): New variable.
6138 (relro_now_test_LDADD): New variable.
6139 (relro_now_test.so): New target.
6140 * testsuite/Makefile.in: Rebuild.
6141
07aa62f2
ILT
61422011-07-12 Ian Lance Taylor <iant@google.com>
6143
6144 PR gold/12980
6145 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6146 GLOB_DAT relocation rather than a RELATIVE relocation for a
6147 protected symbol when creating a shared library.
6148 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6149 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6150 * testsuite/protected_main_1.cc (main): Test that protected
6151 function has same address.
6152
e2153196
ILT
61532011-07-11 Ian Lance Taylor <iant@google.com>
6154
6155 PR gold/12979
6156 * options.h (class General_options): Add -Bgroup.
6157 * options.cc (General_options::finalize): If -Bgroup is set,
6158 default to --unresolved-symbols=report-all.
6159 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6160 * target-reloc.h (issue_undefined_symbol_error): Handle
6161 --unresolved-symbols=report-all.
6162
6daf5215
ILT
61632011-07-08 Ian Lance Taylor <iant@google.com>
6164
6165 PR gold/11985
6166 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6167 if linker script discards key sections.
6168 (Layout::create_dynamic_symtab): Likewise.
6169 (Layout::assign_local_dynsym_offsets): Likewise.
6170 (Layout::sized_create_version_sections): Likewise.
6171 (Layout::create_interp): Likewise.
6172 (Layout::finish_dynamic_section): Likewise.
6173 (Layout::set_dynamic_symbol_size): Likewise.
6174
beabb2c6
ILT
61752011-07-08 Ian Lance Taylor <iant@google.com>
6176
6177 PR gold/12386
6178 * options.h (class General_options): Add --unresolved-symbols.
6179 * target-reloc.h (issue_undefined_symbol_error): Check
6180 --unresolved-symbols. Add comments.
6181
9c16daf1
ILT
61822011-07-08 Ian Lance Taylor <iant@google.com>
6183
6184 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6185 expression more complex.
6186
191f1a2d
ILT
61872011-07-08 Ian Lance Taylor <iant@google.com>
6188
6189 PR gold/11317
6190 * target-reloc.h (issue_undefined_symbol_error): New inline
6191 function, broken out of relocate_section.
6192 (relocate_section): Call issue_undefined_symbol_error.
6193 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6194 there is no TLS segment if we are about to issue an undefined
6195 symbol error.
6196 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6197
62855347
ILT
61982011-07-08 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12279
6201 * resolve.cc (Symbol_table::should_override): Add fromtype
6202 parameter. Change all callers. Give error when linking together
6203 TLS and non-TLS symbol.
6204 (Symbol_table::should_override_with_special): Add fromtype
6205 parameter. Change all callers.
6206 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6207 there is no TLS segment if we have reported some errors.
6208 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6209
67181c72
ILT
62102011-07-08 Ian Lance Taylor <iant@google.com>
6211
6212 PR gold/12372
6213 * target.h (Target::plt_address_for_global): New function.
6214 (Target::plt_address_for_local): New function.
6215 (Target::plt_section_for_global): Remove.
6216 (Target::plt_section_for_local): Remove.
6217 (Target::do_plt_address_for_global): New virtual function.
6218 (Target::do_plt_address_for_local): New virtual function.
6219 (Target::do_plt_section_for_global): Remove.
6220 (Target::do_plt_section_for_local): Remove.
6221 (Target::register_global_plt_entry): Add Symbol_table and Layout
6222 parameters.
6223 * output.cc (Output_data_got::Got_entry::write): Use
6224 plt_address_for_global and plt_address_for_local.
6225 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6226 address of output section.
6227 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6228 got_irelative_, and irelative_count_ fields. Update
6229 declarations.
6230 (Output_data_plt_i386::has_irelative_section): New function.
6231 (Output_data_plt_i386::entry_count): Add irelative_count_.
6232 (Output_data_plt_i386::set_final_data_size): Likewise.
6233 (class Target_i386): Add got_irelative_ and rel_irelative_
6234 fields. Update declarations.
6235 (Target_i386::Target_i386): Initialize new fields.
6236 (Target_i386::do_plt_address_for_global): New function replacing
6237 do_plt_section_for_global.
6238 (Target_i386::do_plt_address_for_local): New function replacing
6239 do_plt_section_for_local.
6240 (Target_i386::got_section): Create got_irelative_.
6241 (Target_i386::rel_irelative_section): New function.
6242 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6243 fields. Don't define __rel_iplt_{start,end}.
6244 (Output_data_plt_i386::add_entry): Add symtab and layout
6245 parameters. Change all callers. Use different PLT and GOT for
6246 IFUNC symbols.
6247 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6248 layout parameters. Change all callers. Use different PLT and
6249 GOT.
6250 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6251 (Output_data_plt_i386::rel_irelative): New function.
6252 (Output_data_plt_i386::address_for_global): New function.
6253 (Output_data_plt_i386::address_for_local): New function.
6254 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6255 IRELATIVE GOT when changing IFUNC GOT entries.
6256 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6257 reloc.
6258 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6259 if we didn't create an IRELATIVE GOT.
6260 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6261 plt_address_for_local.
6262 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6263 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6264 got_irelative_, and irelative_count_ fields. Update
6265 declarations.
6266 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6267 Initialize new fields. Remove symtab parameter. Change all
6268 callers.
6269 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6270 irelative_count_.
6271 (Output_data_plt_x86_64::has_irelative_section): New function.
6272 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6273 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6274 fields. Update declarations.
6275 (Target_x86_64::Target_x86_64): Initialize new fields.
6276 (Target_x86_64::do_plt_address_for_global): New function replacing
6277 do_plt_section_for_global.
6278 (Target_x86_64::do_plt_address_for_local): New function replacing
6279 do_plt_section_for_local.
6280 (Target_x86_64::got_section): Create got_irelative_.
6281 (Target_x86_64::rela_irelative_section): New function.
6282 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6283 all callers. Don't create __rel_iplt_{start,end}.
6284 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6285 parameters. Change all callers. Use different PLT and GOT for
6286 IFUNC symbols.
6287 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6288 layout parameters. Change all callers. Use different PLT and
6289 GOT.
6290 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6291 parameters. Change all callers. Use different PLT and GOT for
6292 IFUNC symbols.
6293 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6294 (Output_data_plt_x86_64::rela_irelative): New function.
6295 (Output_data_plt_x86_64::address_for_global): New function.
6296 (Output_data_plt_x86_64::address_for_local): New function.
6297 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6298 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6299 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6300 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6301 parameters.
6302 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6303 reloc.
6304 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6305 symbols if we didn't create an IRELATIVE GOT.
6306 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6307 plt_address_for_local.
6308 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6309 * testsuite/ifuncvar1.c: New test file.
6310 * testsuite/ifuncvar2.c: New test file.
6311 * testsuite/ifuncvar3.c: New test file.
6312 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6313 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6314 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6315 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6316 * testsuite/Makefile.in: Rebuild.
6317
33c15b45
CC
63182011-07-07 Cary Coutant <ccoutant@google.com>
6319
6320 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6321 (two_file_test_1_ndebug.o): Likewise.
6322 (two_file_test_1b_ndebug.o): Likewise.
6323 (two_file_test_2_ndebug.o): Likewise.
6324 (two_file_test_main_ndebug.o): Likewise.
6325 (incremental_test_2): Link with no-debug versions.
6326
f48b5fb7
CC
63272011-07-06 Cary Coutant <ccoutant@google.com>
6328
6329 * gold/incremental.cc
6330 (Output_section_incremental_inputs::write_info_blocks): Check for
6331 hidden and internal symbols.
6332
221597a5
CC
63332011-07-06 Cary Coutant <ccoutant@google.com>
6334
6335 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6336 Check disposition for startup file.
6337 (Incremental_inputs::report_command_line): Ignore
6338 --incremental-startup-unchanged option.
6339 * options.cc (General_options::parse_incremental_startup_unchanged):
6340 New function.
6341 (General_options::General_options): Initialize new data member.
6342 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6343 (General_options): Add --incremental-startup-unchanged option.
6344 (General_options::incremental_startup_disposition): New function.
6345 (General_options::incremental_startup_disposition_): New data member.
6346
e24719f6
CC
63472011-07-06 Cary Coutant <ccoutant@google.com>
6348
6349 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6350 input file index to Script_info ctor.
6351 (Sized_incremental_binary::do_file_has_changed): Find the
6352 command-line argument for files named in scripts.
6353 * incremental.h (Script_info::Script_info): New ctor
6354 with input file index.
6355 (Script_info::input_file_index): New function.
6356 (Script_info::input_file_index_): New data member.
6357 (Incremental_binary::get_library): Add const.
6358 (Incremental_binary::get_script_info): Add const.
6359 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6360 * testsuite/Makefile.am (incremental_test_5): New test case.
6361 (incremental_test_6): New test case.
6362 * testsuite/Makefile.in: Regenerate.
6363
8f7c81e8
CC
63642011-07-06 Cary Coutant <ccoutant@google.com>
6365
6366 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6367 debug output when command lines differ.
6368
9fbd3822
CC
63692011-07-06 Cary Coutant <ccoutant@google.com>
6370
6371 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6372 --incremental-patch option.
6373 * layout.cc (Free_list::allocate): Extend allocation beyond original
6374 end if enabled.
6375 (Layout::make_output_section): Mark sections that should get
6376 patch space.
6377 * options.cc (parse_percent): New function.
6378 * options.h (parse_percent): New function.
6379 (DEFINE_percent): New macro.
6380 (General_options): Add --incremental-patch option.
6381 * output.cc (Output_section::Output_section): Initialize new data
6382 members.
6383 (Output_section::add_input_section): Print section name when out
6384 of patch space.
6385 (Output_section::add_output_section_data): Likewise.
6386 (Output_section::set_final_data_size): Add patch space when
6387 doing --incremental-full.
6388 (Output_section::do_reset_address_and_file_offset): Remove patch
6389 space.
6390 (Output_segment::set_section_list_addresses): Print debug output
6391 only if --incremental-update.
6392 * output.h (Output_section::set_is_patch_space_allowed): New function.
6393 (Output_section::is_patch_space_allowed_): New data member.
6394 (Output_section::patch_space_): New data member.
6395 * parameters.cc (Parameters::incremental_full): New function.
6396 * parameters.h (Parameters::incremental_full): New function
6397 * testsuite/Makefile.am (incremental_test_2): Add test for
6398 --incremental-patch option.
6399 * testsuite/Makefile.in: Regenerate.
6400 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6401 (t18): Remove function body.
6402
f6cccc2c
DK
64032011-07-05 Doug Kwan <dougkwan@google.com>
6404
6405 PR gold/12771
6406 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6407 Arm_Address type for relocation result.
6408 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6409 overflow check.
6410 (Arm_relocate_functions::abs32): Use unaligned access.
6411 (Arm_relocate_functions::rel32): Ditto.
6412 (Arm_relocate_functions::prel31): Ditto.
6413 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6414 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6415 static data relocations.
6416 * testsuite/Makefile.in: Regnerate.
6417 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6418
28a13fec
ILT
64192011-07-05 Ian Lance Taylor <iant@google.com>
6420
6421 PR gold/12392
6422 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6423 symbols if necessary.
6424 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6425
24d47b34
ILT
64262011-07-05 Ian Lance Taylor <iant@google.com>
6427
6428 PR gold/12952
6429 * resolve.cc (Symbol::override_base_with_special): Simply override
6430 version with special symbol version, ignoring previous version.
6431
41f9cbbe
ILT
64322011-07-05 Ian Lance Taylor <iant@google.com>
6433
6434 * object.cc (Sized_relobj_file::include_section_group): Add
6435 information to comment about signature location.
6436
886288f1
ILT
64372011-07-02 Ian Lance Taylor <iant@google.com>
6438
6439 PR gold/12957
6440 * options.h (class General_options): Add -f and -F.
6441 * options.cc (General_options::finalize): Fatal error if -f/-F
6442 are used without -shared.
6443 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6444
ae3a6d4f
ILT
64452011-07-02 Ian Lance Taylor <iant@google.com>
6446
6447 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6448
21131061
ILT
64492011-07-01 Ian Lance Taylor <iant@google.com>
6450
6451 PR gold/12525
6452 PR gold/12952
6453 * resolve.cc (Symbol::override_base_with_special): Don't override
6454 the version if the overriding symbol has a different name.
6455 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6456 all callers. If we give an error about an undefined version,
6457 define the base version if necessary.
6458 * dynobj.h (class Versions): Update declaration.
6459 * testsuite/weak_alias_test_5.cc: New file.
6460 * testsuite/weak_alias_test.script: New file.
6461 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6462 and versioned_alias have the right value, and call t2.
6463 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6464 weak_alias_test_5.so.
6465 (weak_alias_test_LDADD): Likewise.
6466 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6467 * testsuite/Makefile.in: Rebuild.
6468
611062c0
ILT
64692011-07-01 Ian Lance Taylor <iant@google.com>
6470
6471 PR gold/12525
6472 * options.h (class General_options): Support -z notext.
6473 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6474 -Wl,-z,notext.
6475 (two_file_shared_nonpic.so): Likewise.
6476 (two_file_shared_mixed.so): Likewise.
6477 (two_file_shared_mixed_1.so): Likewise.
6478 (weak_undef_lib_nonpic.so): Likewise.
6479 (alt/weak_undef_lib_nonpic.so): Likewise.
6480 (tls_test_shared_nonpic.so): Likewise.
6481 * testsuite/Makefile.in: Rebuild.
6482
328c7c2f
ILT
64832011-07-01 Ian Lance Taylor <iant@google.com>
6484
6485 PR gold/12525
6486 * configure.ac: Test whether static linking works, setting
6487 the automake conditional HAVE_STATIC.
6488 * testsuite/Makefile.am: Disable tests using -static if
6489 HAVE_STATIC is not true.
6490 * configure, testsuite/Makefile.in: Rebuild.
6491
02d7cd44
ILT
64922011-07-01 Ian Lance Taylor <iant@google.com>
6493
6494 PR gold/12525
6495 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6496 Assert if we see DW_EH_PE_indirect.
6497 * target.h (Target::ehframe_datarel_base): New function.
6498 (Target::do_ehframe_datarel_base): New target function.
6499 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6500 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6501 function.
6502
07a60597
ILT
65032011-07-01 Ian Lance Taylor <iant@google.com>
6504
6505 PR gold/12571
6506 * options.h (class General_options): Add
6507 --ld-generated-unwind-info.
6508 * ehframe.cc (Fde::write): Add address parameter. Change all
6509 callers. If associated with PLT, fill in address and size.
6510 (Cie::set_output_offset): Only add merge mapping if there is an
6511 object.
6512 (Cie::write): Add address parameter. Change all callers.
6513 (Eh_frame::add_ehframe_for_plt): New function.
6514 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6515 input_offset_ fields into union u_, with new plt field.
6516 (Fde::Fde): Adjust for new union field.
6517 (Fde::Fde) [Output_data version]: New constructor.
6518 (Fde::add_mapping): Only add merge mapping if there is an object.
6519 (class Cie): Update declarations.
6520 (class Eh_frame): Declare add_ehframe_for_plt.
6521 * layout.cc (Layout::layout_eh_frame): Break out code into
6522 make_eh_frame_section, and call it.
6523 (Layout::make_eh_frame_section): New function.
6524 (Layout::add_eh_frame_for_plt): New function.
6525 * layout.h (class Layout): Update declarations.
6526 * merge.cc (Merge_map::add_mapping): Add assertion.
6527 * i386.cc: Include "dwarf.h".
6528 (class Output_data_plt_i386): Make first_plt_entry,
6529 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6530 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6531 and plt_eh_frame_fde.
6532 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6533 boundary. Call add_eh_frame_for_plt if appropriate.
6534 * x86_64.cc: Include "dwarf.h".
6535 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6536 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6537 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6538 and plt_eh_frame_fde.
6539 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6540 appropriate.
6541
14788a3f
ILT
65422011-06-29 Ian Lance Taylor <iant@google.com>
6543
6544 PR gold/12629
6545 * object.cc (Sized_relobj_file::layout_section): Change shdr
6546 parameter to be const.
6547 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6548 out of do_layout.
6549 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6550 appropriate. Call layout_eh_frame_section.
6551 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6552 sections.
6553 * object.h (class Sized_relobj_file): Update declarations.
6554
6c21fce1
ILT
65552011-06-29 Ian Lance Taylor <iant@google.com>
6556
37e41b03 6557 PR gold/12652
6c21fce1
ILT
6558 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6559 modifier.
6560 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6561
4d5e4e62
ILT
65622011-06-29 Ian Lance Taylor <iant@google.com>
6563
6564 PR gold/12675
6565 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6566 SHT_X86_64_UNWIND.
6567 * layout.cc (Layout::layout_eh_frame): Likewise.
6568
886f533a
ILT
65692011-06-29 Ian Lance Taylor <iant@google.com>
6570
6571 PR gold/12695
6572 * layout.cc (Layout::symtab_section_shndx): New function.
6573 * layout.h (class Layout): Declare symtab_section_shndx.
6574 * output.cc (Output_section::write_header): Call it.
6575
f3ae1b28
ILT
65762011-06-29 Ian Lance Taylor <iant@google.com>
6577
6578 PR gold/12818
6579 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6580 symbols which are not used in a relocation.
6581
aecf301f
ILT
65822011-06-28 Ian Lance Taylor <iant@google.com>
6583
6584 PR gold/12898
6585 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6586 script create indistinguishable segments.
6587 (Layout::set_segment_offsets): Use stable_sort when sorting
6588 segments. Pass this to Compare_segments constructor.
6589 * layout.h (class Layout): Make segment_precedes non-static.
6590 (class Compare_segments): Change from struct to class. Add
6591 layout_ field. Add constructor.
6592 * script-sections.cc
6593 (Script_sections::attach_sections_using_phdrs_clause): Rename
6594 local orphan to is_orphan. Don't report failure to put empty
6595 section in segment. On attachment failure, report name of
6596 section, and attach to first PT_LOAD segment.
6597
03ef7571
ILT
65982011-06-28 Ian Lance Taylor <iant@google.com>
6599
6600 PR gold/12934
6601 * target-select.cc (Target_selector::Target_selector): Add
6602 emulation parameter. Change all callers.
6603 (select_target_by_bfd_name): Rename from select_target_by_name.
6604 Change all callers.
6605 (select_target_by_emulation): New function.
6606 (supported_emulation_names): New function.
6607 * target-select.h (class Target_selector): Add emulation_ field.
6608 Update declarations.
6609 (Target_selector::recognize_by_bfd_name): Rename from
6610 recognize_by_name. Change all callers.
6611 (Target_selector::supported_bfd_names): Rename from
6612 supported_names. Change all callers.
6613 (Target_selector::recognize_by_emulation): New function.
6614 (Target_selector::supported_emulations): New function.
6615 (Target_selector::emulation): New function.
6616 (Target_selector::do_recognize_by_bfd_name): Rename from
6617 do_recognize_by_name. Change all callers.
6618 (Target_selector::do_supported_bfd_names): Rename from
6619 do_supported_names. Change all callers.
6620 (Target_selector::do_recognize_by_emulation): New function.
6621 (Target_selector::do_supported_emulations): New function.
6622 (select_target_by_bfd_name): Change name in declaration.
6623 (select_target_by_emulation): Declare.
6624 (supported_emulation_names): Declare.
6625 * parameters.cc (parameters_force_valid_target): Try to find
6626 target based on emulation from -m option.
6627 * options.h (class General_options): Change doc string for -m.
6628 * options.cc (help): Print emulations.
6629 (General_options::parse_V): Likewise.
6630 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6631 Add emulation parameter. Change all callers.
6632
200b2bb9
ILT
66332011-06-28 Ian Lance Taylor <iant@google.com>
6634
6635 * target.h (class Target): Add osabi_ field.
6636 (Target::osabi): New function.
6637 (Target::set_osabi): New function.
6638 (Target::Target): Initialize osabi_.
6639 (Target::do_adjust_elf_header): Make pure virtual.
6640 (Sized_target::do_adjust_elf_header): Declare.
6641 * target.cc (Sized_target::do_adjust_elf_header): New function.
6642 (class Sized_target): Instantiate all versions.
6643 * freebsd.h (class Target_freebsd): Remove.
6644 (Target_selector_freebsd::do_recognize): Call set_osabi on
6645 Target.
6646 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6647 (Target_selector_freebsd::set_osabi): Remove.
6648 * i386.cc (class Target_i386): Inherit from Sized_target rather
6649 than Target_freebsd.
6650 * x86_64.cc (class Target_x86_64): Likewise.
6651
b3ce541e
ILT
66522011-06-28 Ian Lance Taylor <iant@google.com>
6653
6654 * target.h (Target::can_check_for_function_pointers): Rewrite.
6655 Make non-virtual.
6656 (Target::can_icf_inline_merge_sections): Likewise.
6657 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6658 (Target::Target_info): Add can_icf_inline_merge_sections field.
6659 (Target::do_can_check_for_function_pointers): New virtual
6660 function.
6661 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6662 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6663 from can_check_for_function_pointers, move in file.
6664 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6665 section_may_have_icf_unsafe_poineters, move in file.
6666 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6667 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6668 Rename from can_check_for_function_pointers, move in file.
6669 (Target_i386::can_icf_inline_merge_sections): Remove.
6670 (Target_i386::i386_info): Initialize
6671 can_icf_inline_merge_sections.
6672 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6673 Initialize can_icf_inline_merge_sections.
6674 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6675 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6676 Rename from can_check_for_function_pointers, move in file.
6677 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6678 (Target_x86_64::x86_64_info): Initialize
6679 can_icf_inline_merge_sections.
6680 * testsuite/testfile.cc (Target_test::test_target_info):
6681 Likewise.
6682 * icf.cc (get_section_contents): Correct formatting.
6683
6d1c4efb
ILT
66842011-06-27 Ian Lance Taylor <iant@google.com>
6685
6686 * symtab.cc (Symbol::versioned_name): New function.
6687 (Symbol_table::add_to_final_symtab): Use versioned_name when
6688 appropriate.
6689 (Symbol_table::sized_write_symbol): Likewise.
6690 * symtab.h (class Symbol): Declare versioned_name.
6691 * stringpool.h (class Stringpool_template): Add variant of add
6692 which takes a std::basic_string.
6693 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6694 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6695 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6696 (ver_test_12.o): New target.
6697 * testsuite/Makefile.in: Rebuild.
6698
57eb9b50
DK
66992011-06-27 Doug Kwan <dougkwan@google.com>
6700
6701 * arm.cc (Arm_relocate_functions::thm_jump8,
6702 Arm_relocate_functions::thm_jump11): Use a wider signed
6703 type to compute offset.
6704 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6705 arm_thm_jump8.
6706 * testsuite/Makefile.in: Regenerate.
6707 * testsuite/arm_branch_in_range.sh: Check test results of
6708 arm_thm_jump11 and arm_thm_jump8.
6709 * testsuite/arm_thm_jump11.s: New test source file.
6710 * testsuite/arm_thm_jump11.t: New linker script.
6711 * testsuite/arm_thm_jump8.s: New test source file.
6712 * testsuite/arm_thm_jump8.t: New linker script.
6713
487b39df
ILT
67142011-06-24 Ian Lance Taylor <iant@google.com>
6715
6716 * layout.cc: Include "object.h".
6717 (ctors_sections_in_init_array): New static variable.
6718 (Layout::is_ctors_in_init_array): New function.
6719 (Layout::layout): Add entry to ctors_sections_in_init_array if
6720 appropriate.
6721 * layout.h (class Layout): Declare is_ctors_in_init_array.
6722 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6723 is_ctors_reverse_view is set.
6724 (Sized_relobj_file::write_sections): Add layout parameter. Change
6725 all callers. Set is_ctors_reverse_view field of View_size.
6726 (Sized_relobj_file::reverse_words): New function.
6727 * object.h (Sized_relobj_file::View_size): Add
6728 is_ctors_reverse_view field.
6729 (class Sized_relobj_file): Update declarations.
6730 * testsuite/initpri3.c: New test.
6731 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6732 initpri3b.
6733 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6734 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6735 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6736 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6737 * testsuite/Makefile.in: Rebuild.
6738
472076e4
CC
67392011-06-24 Cary Coutant <ccoutant@google.com>
6740
6741 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6742 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6743 (debug_msg_cdebug.err): New targets.
6744 * testsuite/Makefile.in: Regenerate.
6745 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6746 Fix checks for link with shared library.
6747
a60af0db
DK
67482011-06-24 Doug Kwan <dougkwan@google.com>
6749
6750 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6751 skip empty text sections.
6752 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6753
5393d741
ILT
67542011-06-22 Ian Lance Taylor <iant@google.com>
6755
6756 PR gold/12910
6757 * options.h (class General_options): Add --ctors-in-init-array.
6758 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6759 friends as SHT_PROGBITS for merging sections.
6760 (Layout::layout): Remove special handling of .init_array and
6761 friends. Don't sort if doing relocatable link. Sort for .ctors
6762 and .dtors if ctors_in_init_array.
6763 (Layout::make_output_section): Force correct section types for
6764 .init_array and friends. Don't sort if doing relocatable link,
6765 Don't sort .ctors and .dtors if ctors_in_init_array.
6766 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6767 (Layout::output_section_name): Add relobj parameter. Change all
6768 callers. Handle .ctors. and .dtors. in code rather than table.
6769 Handle .ctors and .dtors if ctors_in_init_array.
6770 (Layout::match_file_name): New function, moved from output.cc.
6771 * layout.h (class Layout): Update declarations.
6772 * output.cc: Include "layout.h".
6773 (Input_section_sort_entry::get_priority): New function.
6774 (Input_section_sort_entry::match_file_name): Just call
6775 Layout::match_file_name.
6776 (Output_section::Input_section_sort_init_fini_compare::operator()):
6777 Handle .ctors and .dtors. Sort by explicit priority rather than
6778 by name.
6779 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6780 * testsuite/initpri2.c: New test.
6781 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6782 (check_PROGRAMS): Add initpri2.
6783 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6784 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6785 * configure, testsuite/Makefile.in: Rebuild.
6786
e1f74f98
ILT
67872011-06-19 Ian Lance Taylor <iant@google.com>
6788
6789 PR gold/12880
6790 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6791 .interp section to a PT_INTERP segment even if we have seen a
6792 --dynamic-linker option. Don't do it if we have seen a PHDRS
6793 clause in a linker script.
6794 (Layout::finalize): Don't create a .interp section if we've
6795 already create a PT_INTERP segment.
6796 (Layout::create_interp): Always call choose_output_section (revert
6797 patch of 2011-06-17). Don't create PT_INTERP segment.
6798 * script-sections.cc
6799 (Script_sections::create_note_and_tls_segments): Add a .interp
6800 section to a PT_INTERP segment even if we have seen a
6801 --dynamic-linker option.
6802
766f91bb
ILT
68032011-06-18 Ian Lance Taylor <iant@google.com>
6804
6805 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6806 merely because a non-PT_LOAD segment has a dynamic reloc.
6807
0d212c3a
ILT
68082011-06-18 Ian Lance Taylor <iant@google.com>
6809
6810 * layout.cc (Layout::finish_dynamic_section): Don't create
6811 DT_FLAGS entry if not needed.
6812
911a5072
ILT
68132011-06-18 Ian Lance Taylor <iant@google.com>
6814
6815 PR gold/12745
6816 * layout.cc (Layout::layout_eh_frame): Correct handling of
6817 writable .eh_frame section.
6818
534b4e5f
ILT
68192011-06-17 Ian Lance Taylor <iant@google.com>
6820
6821 PR gold/12893
6822 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6823 symbol is redefined with the exact same object and value.
6824
10b4f102
ILT
68252011-06-17 Ian Lance Taylor <iant@google.com>
6826
6827 PR gold/12880
6828 * layout.h (class Layout): Add interp_segment_ field.
6829 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6830 (Layout::attach_allocated_section_to_segment): If making shared
6831 library, put .interp section in PT_INTERP segment.
6832 (Layout::finalize): Also call create_interp if -dynamic-linker
6833 option was used.
6834 (Layout::create_interp): Assert that there is no PT_INTERP
6835 segment. If not using a SECTIONS clause, use make_output_section.
6836 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6837 * script-sections.cc
6838 (Script_sections::create_note_and_tls_segments): If making shared
6839 library, put .interp section in PT_INTERP segment.
6840
a29b0dad
ILT
68412011-06-17 Ian Lance Taylor <iant@google.com>
6842
e588ea8d
ILT
6843 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6844 when making a shared library.
6845
68462011-06-17 Ian Lance Taylor <iant@google.com>
6847
6848 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6849 parameter. Change all callers. Don't issue warning about PC32
6850 against locally defined symbol.
a29b0dad 6851
9d3b0698
ILT
68522011-06-16 Ian Lance Taylor <iant@google.com>
6853
6854 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6855 occurs in same object.
6856
85b0f90c
AM
68572011-06-14 Alan Modra <amodra@gmail.com>
6858
6859 * po/POTFILES.in: Regenerate.
6860
a94907d9
ILT
68612011-06-09 Ian Lance Taylor <iant@google.com>
6862
6863 * script-sections.cc
6864 (Orphan_output_section::set_section_addresses): For a relocatable
6865 link set address to 0.
6866
4fb3a1c3
CC
68672011-06-09 Cary Coutant <ccoutant@google.com>
6868
6869 PR gold/12804
6870 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6871 used with --compress-debug-sections.
6872 * gold/object.cc (Sized_relobj_file::do_layout): Report
6873 uncompressed size of compressed input sections.
6874
61220854
CC
68752011-06-08 Cary Coutant <ccoutant@google.com>
6876
6877 PR gold/12804
6878 * testsuite/two_file_test_2_v1.cc: Change initialization of
6879 v2 to keep it in .data.
6880
e6455dfb
CC
68812011-06-07 Cary Coutant <ccoutant@google.com>
6882
6883 * common.cc (Symbol_table::do_allocate_commons_list): Call
6884 gold_fallback.
6885 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6886 (Errors::fallback): New function.
6887 (gold_fallback): New function.
6888 * errors.h (Errors::fallback): New function.
6889 * gold.cc (gold_exit): Change status parameter to enum; adjust
6890 all callers.
6891 (queue_initial_tasks): Call gold_fallback.
6892 * gold.h: Include cstdlib.
6893 (Exit_status): New enum type.
6894 (gold_exit): Change status parameter to enum.
6895 (gold_fallback): New function.
6896 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6897 (Layout::create_symtab_sections): Likewise.
6898 (Layout::create_shdrs): Likewise.
6899 * main.cc (main): Adjust call to gold_exit.
6900 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6901 (Output_data_got::add_got_entry_pair): Likewise.
6902 (Output_section::add_input_section): Likewise.
6903 (Output_section::add_output_section_data): Likewise.
6904 (Output_segment::set_section_list_addresses): Likewise.
6905 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6906
fb0e076f
CC
69072011-06-07 Cary Coutant <ccoutant@google.com>
6908
6909 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6910 for incremental links.
6911 * output.cc (Output_segment::set_section_list_addresses): Remove
6912 FIXME and test for TLS or BSS.
6913
a5ee4d5d
CC
69142011-06-07 Cary Coutant <ccoutant@google.com>
6915
6916 * testsuite/Makefile.am: Add incremental_copy_test,
6917 incremental_common_test_1.
6918 * testsuite/Makefile.in: Regenerate.
6919 * testsuite/common_test_1_v1.c: New source file.
6920 * testsuite/common_test_1_v2.c: New source file.
6921 * testsuite/copy_test_v1.cc: New source file.
6922
5146f448
CC
69232011-06-07 Cary Coutant <ccoutant@google.com>
6924
6925 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6926 update, allocate common from bss section's free list.
6927 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6928 linker-defined symbols.
6929 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6930 Skip GOT and PLT entries that are no longer referenced.
6931 (Output_section_incremental_inputs::write_info_blocks): Mark
6932 linker-defined symbols.
6933 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6934 * output.cc (Output_section::allocate): New function.
6935 * output.h (Output_section::allocate): New function.
6936 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6937 linker-defined symbols.
6938 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6939 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6940 (Symbol::init_base_output_data): Likewise.
6941 (Symbol::init_base_output_segment): Likewise.
6942 (Symbol::init_base_constant): Likewise.
6943 (Sized_symbol::init_output_data): Likewise.
6944 (Sized_symbol::init_output_segment): Likewise.
6945 (Sized_symbol::init_constant): Likewise.
6946 (Symbol_table::do_define_in_output_data): Likewise.
6947 (Symbol_table::do_define_in_output_segment): Likewise.
6948 (Symbol_table::do_define_as_constant): Likewise.
6949 * symtab.h (Symbol::is_predefined): New function.
6950 (Symbol::init_base_output_data): Add is_predefined parameter.
6951 (Symbol::init_base_output_segment): Likewise.
6952 (Symbol::init_base_constant): Likewise.
6953 (Symbol::is_predefined_): New data member.
6954 (Sized_symbol::init_output_data): Add is_predefined parameter.
6955 (Sized_symbol::init_output_segment): Likewise.
6956 (Sized_symbol::init_constant): Likewise.
6957 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6958
26d3c67d
CC
69592011-06-07 Cary Coutant <ccoutant@google.com>
6960
6961 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6962 instead of emit_copy_reloc.
6963 (Copy_relocs::emit_copy_reloc): Refactor.
6964 (Copy_relocs::make_copy_reloc): New function.
6965 (Copy_relocs::add_copy_reloc): Remove.
6966 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6967 section.
6968 (Copy_relocs::make_copy_reloc): New function.
6969 (Copy_relocs::add_copy_reloc): Remove.
6970 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6971 unchanged input files.
6972 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6973 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6974 Reserve BSS space for COPY relocations.
6975 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6976 (Output_section_incremental_inputs::write_info_blocks): Record
6977 whether a symbol is copied from a shared object.
6978 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6979 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6980 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6981 (Incremental_input_entry_reader::get_output_symbol_index): Add
6982 is_copy parameter.
6983 (Incremental_binary::emit_copy_relocs): New function.
6984 (Incremental_binary::do_emit_copy_relocs): New function.
6985 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6986 new data member.
6987 (Sized_incremental_binary::add_copy_reloc): New function.
6988 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6989 (Sized_incremental_binary::Copy_reloc): New struct.
6990 (Sized_incremental_binary::Copy_relocs): New typedef.
6991 (Sized_incremental_binary::copy_relocs_): New data member.
6992 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6993 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6994 * target.h (Sized_target::emit_copy_reloc): New function.
6995 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6996
7cdb37d9
CC
69972011-06-02 Cary Coutant <ccoutant@google.com>
6998
6999 PR gold/12163
7000 * gold/archive.cc (Archive::Archive): Initialize new data member.
7001 (Archive::include_all_members): Return if archive has already been
7002 included.
7003 * gold/archive.h (Archive::include_all_members_): New data member.
7004
cc643b88
NC
70052011-06-02 Nick Clifton <nickc@redhat.com>
7006
7007 * dynobj.h: Fix spelling mistake in comment.
7008 * output.cc: Likewise.
7009
f62a3ca7 70102011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7011 Asier Llano
f62a3ca7
DK
7012
7013 PR gold/12826
cc643b88 7014 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7015 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7016 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7017 redundant arm_exidx_test.so.
7018 * testsuite/Makefile.in: Regenerate.
7019 (check_SCRIPTS): Add pr12826.sh
7020 (check_DATA): Add pr12826.stdout
7021 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7022 * testsuite/pr12826.sh: New file.
7023 * testsuite/pr12826_1.s: Ditto.
7024 * testsuite/pr12826_1.s: Ditto.
7025
8dbe1edc
ILT
70262011-05-30 Ian Lance Taylor <iant@google.com>
7027
7028 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7029 sections.
7030
c49875be
ILT
70312011-05-29 Ian Lance Taylor <iant@google.com>
7032
7033 PR gold/12804
7034 * testsuite/Makefile.am: Use different file name for two_file_test
7035 temporary file for each incremental test.
7036 * testsuite/Makefile.in: Rebuild.
7037
69d53f7a
ILT
70382011-05-29 Ian Lance Taylor <iant@google.com>
7039
7040 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7041 binary input file is empty.
7042
41d0ab5f
ILT
70432011-05-27 Ian Lance Taylor <iant@google.com>
7044
7045 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7046 (ver_test_9.so): Likewise.
7047 * testsuite/Makefile.in: Rebuild.
7048
89d8a36b
CC
70492011-05-26 Cary Coutant <ccoutant@google.com>
7050
7051 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7052 * incremental.cc (Incremental_inputs::report_input_section): Fix
7053 comment, indentation.
7054 (Incremental_inputs::report_comdat_group): New function.
7055 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7056 of data for incremental input file entry.
7057 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7058 group count, COMDAT group signatures.
7059 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7060 an unchanged input file.
7061 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7062 Initialize new data member.
7063 (Incremental_object_entry::add_comdat_group): New function.
7064 (Incremental_object_entry::get_comdat_group_count): New function.
7065 (Incremental_object_entry::get_comdat_signature_key): New function.
7066 (Incremental_object_entry::groups_): New data member.
7067 (Incremental_inputs::report_comdat_group): New function.
7068 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7069 data for incremental input file entry.
7070 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7071 (Incremental_input_entry_reader::get_input_section): Adjust size of
7072 data for incremental input file entry.
7073 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7074 (Incremental_input_entry_reader::get_comdat_group_signature): New
7075 function.
7076 * object.cc (Sized_relobj::include_section_group): Report kept
7077 COMDAT groups for incremental links.
7078
1706a06f
ILT
70792011-05-24 David Meyer <pdox@google.com>
7080
7081 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7082 with name parameter. Add found_name parameter.
7083 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7084 * dirsearch.h (class Dirsearch): Update declaration.
7085
a10ae760
ILT
70862011-05-24 Ian Lance Taylor <iant@google.com>
7087
7088 * archive.cc (Library_base::should_include_member): Pull in object
7089 from archive if it defines the entry symbol.
7090 * parameters.cc (Parameters::entry): New function.
7091 * parameters.h (class Parameters): Declare entry.
7092 * output.h (class Output_file_header): Remove entry_ field.
7093 * output.cc (Output_file_header::Output_file_header): Remove entry
7094 parameter. Change all callers.
7095 (Output_file_header::entry): Use parameters->entry.
7096 * gold.cc (queue_middle_tasks): Likewise.
7097 * plugin.cc (Plugin_hook::run): Likewise.
7098
aa92d6ed
CC
70992011-05-24 Cary Coutant <ccoutant@google.com>
7100
7101 * gold.cc (queue_initial_tasks): Pass incremental base filename
7102 to Output_file::open_base_file; don't print error message.
7103 * incremental-dump.cc (main): Adjust call to
7104 Output_file::open_for_modification.
7105 * incremental-dump.cc (main): Likewise.
7106 * incremental.cc (Incremental_inputs::report_command_line):
7107 Ignore --incremental-base option when comparing command lines.
7108 Ignore parameter when given as separate argument.
7109 * options.h (class General_options): Add --incremental-base.
7110 * output.cc (Output_file::Output_file):
7111 (Output_file::open_base_file): Add base_name and writable parameters;
7112 read base file into new file; print error message here.
7113 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7114 callers.
7115 * output.h (Output_file::open_for_modification): Rename to...
7116 (Output_file::open_base_file): ...this; add base_name and
7117 writable parameters; adjust all callers.
7118 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7119 callers.
7120 * testsuite/Makefile.am (incremental_test_4): Test
7121 --incremental-base.
7122 * testsuite/Makefile.in: Regenerate.
7123
2eedd706
CC
71242011-05-24 Cary Coutant <ccoutant@google.com>
7125
7126 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7127 incremental_test_4.
7128 * testsuite/Makefile.in: Regenerate.
7129 * testsuite/two_file_test_1_v1.cc: New test source file.
7130 * testsuite/two_file_test_1b_v1.cc: New test source file.
7131 * testsuite/two_file_test_2_v1.cc: New test source file.
7132
0f1c85a6
CC
71332011-05-24 Cary Coutant <ccoutant@google.com>
7134
7135 * dynobj.h (Dynobj::do_dynobj): New function.
7136 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7137 flag and soname for shared objects.
7138 * incremental.cc (Incremental_inputs::report_object): Make
7139 either Incremental_object_entry or Incremental_dynobj_entry; add
7140 soname to string table.
7141 (Incremental_inputs::report_input_section): Add assertion.
7142 (Output_section_incremental_inputs::set_final_data_size): Adjust
7143 type of input file entry for shared libraries; adjust size of
7144 shared library info entry.
7145 (Output_section_incremental_inputs::write_input_files): Write
7146 as_needed flag for shared libraries.
7147 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7148 of input file entry for shared libraries; write soname.
7149 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7150 soname from incremental info.
7151 * incremental.h (enum Incremental_input_flags): Add
7152 INCREMENTAL_INPUT_AS_NEEDED.
7153 (Incremental_input_entry::Incremental_input_entry): Initialize new
7154 data member.
7155 (Incremental_input_entry::set_as_needed): New function.
7156 (Incremental_input_entry::as_needed): New function.
7157 (Incremental_input_entry::do_dynobj_entry): New function.
7158 (Incremental_input_entry::as_needed_): New data member.
7159 (Incremental_object_entry::Incremental_object_entry): Don't check
7160 for shared library.
7161 (Incremental_object_entry::do_type): Likewise.
7162 (class Incremental_dynobj_entry): New class.
7163 (Incremental_input_entry_reader::as_needed): New function.
7164 (Incremental_input_entry_reader::get_soname): New function.
7165 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7166 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7167 size of shared library info entry.
58797674 7168 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7169 incremental link when adding DT_NEEDED entries.
7170 * object.h (Object::Object): Initialize new data member.
7171 (Object::dynobj): New function.
7172 (Object::set_as_needed): New function.
7173 (Object::as_needed): New function.
7174 (Object::do_dynobj): New function.
7175 (Object::as_needed_): New data member.
7176
6fa2a40b
CC
71772011-05-24 Cary Coutant <ccoutant@google.com>
7178
7179 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7180 info; adjust display of GOT entries.
7181 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7182 vector of input objects; remove file_status_.
7183 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7184 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7185 got_plt reader; call target hooks to reserve GOT entries.
7186 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7187 of input file info header and GOT info entry.
7188 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7189 relocation info.
7190 (Got_plt_view_info::got_descriptor): Remove.
7191 (Got_plt_view_info::sym_index): New data member.
7192 (Got_plt_view_info::input_index): New data member.
7193 (Local_got_offset_visitor::visit): Write input file index.
7194 (Global_got_offset_visitor::visit): Write 0 for input file index.
7195 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7196 with sym_index and input_index.
7197 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7198 incremental info GOT entry; replace got_descriptor with input_index.
7199 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7200 map from input file index to object.
7201 (Sized_relobj_incr::do_layout): Replace direct data member reference
7202 with accessor function.
7203 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7204 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7205 Adjust size of input file info header.
7206 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7207 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7208 (Incremental_input_entry_reader::get_input_section): Adjust size of
7209 input file info header.
7210 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7211 of incremental info GOT entry.
7212 (Incremental_got_plt_reader::get_got_desc): Remove.
7213 (Incremental_got_plt_reader::get_got_symndx): New function.
7214 (Incremental_got_plt_reader::get_got_input_index): New function.
7215 (Sized_incremental_binary::Sized_incremental_binary): Remove
7216 file_status_; add input_objects_.
7217 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7218 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7219 (Sized_incremental_binary::file_is_unchanged): Remove.
7220 (Sized_incremental_binary::set_input_object): New function.
7221 (Sized_incremental_binary::input_object): New function.
7222 (Sized_incremental_binary::file_status_): Remove.
7223 (Sized_incremental_binary::input_objects_): New data member.
7224 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7225 references.
7226 (Sized_relobj_incr::invalid_address): Move to base class.
7227 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7228 class.
7229 (Sized_relobj_incr::do_output_section_offset): Likewise.
7230 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7231 (Sized_relobj_incr::section_offsets_): Likewise.
7232 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7233 function.
7234 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7235 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7236 with accessor function.
7237 (Sized_relobj_file::do_layout): Likewise.
7238 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7239 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7240 (Sized_relobj_file::compute_final_local_value): Replace refs to
7241 section_offsets_ with accessor function.
7242 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7243 * object.h (Relobj::Relobj): Initialize new data members.
7244 (Relobj::add_dyn_reloc): New function.
7245 (Relobj::first_dyn_reloc): New function.
7246 (Relobj::dyn_reloc_count): New function.
7247 (Relobj::first_dyn_reloc_): New data member.
7248 (Relobj::dyn_reloc_count_): New data member.
7249 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7250 references.
7251 (Sized_relobj::Address): New typedef.
7252 (Sized_relobj::invalid_address): Move here from child class.
7253 (Sized_relobj::Sized_relobj): Initialize new data members.
7254 (Sized_relobj::sized_relobj): New function.
7255 (Sized_relobj::is_output_section_offset_invalid): Move here from
7256 child class.
7257 (Sized_relobj::get_output_section_offset): Likewise.
7258 (Sized_relobj::local_has_got_offset): Likewise.
7259 (Sized_relobj::local_got_offset): Likewise.
7260 (Sized_relobj::set_local_got_offset): Likewise.
7261 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7262 (Sized_relobj::clear_got_offsets): New function.
7263 (Sized_relobj::section_offsets): Move here from child class.
7264 (Sized_relobj::do_output_section_offset): Likewise.
7265 (Sized_relobj::do_set_section_offset): Likewise.
7266 (Sized_relobj::Local_got_offsets): Likewise.
7267 (Sized_relobj::local_got_offsets_): Likewise.
7268 (Sized_relobj::section_offsets_): Likewise.
7269 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7270 references.
7271 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7272 class.
7273 (Sized_relobj_file::sized_relobj): New function
7274 (Sized_relobj_file::local_has_got_offset): Move to base class.
7275 (Sized_relobj_file::local_got_offset): Likewise.
7276 (Sized_relobj_file::set_local_got_offset): Likewise.
7277 (Sized_relobj_file::get_output_section_offset): Likewise.
7278 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7279 (Sized_relobj_file::do_output_section_offset): Likewise.
7280 (Sized_relobj_file::do_set_section_offset): Likewise.
7281 (Sized_relobj_file::Local_got_offsets): Likewise.
7282 (Sized_relobj_file::local_got_offsets_): Likewise.
7283 (Sized_relobj_file::section_offsets_): Likewise.
7284 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7285 (all constructors).
7286 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7287 (Output_reloc::get_symbol_index): Likewise.
7288 (Output_reloc::local_section_offset): Likewise.
7289 (Output_reloc::get_address): Likewise.
7290 (Output_reloc::symbol_value): Likewise.
7291 (Output_data_got::reserve_slot): Move to class definition.
7292 (Output_data_got::reserve_local): New function.
7293 (Output_data_got::reserve_slot_for_global): Remove.
7294 (Output_data_got::reserve_global): New function.
7295 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7296 (all constructors, two instantiations).
7297 (Output_reloc::get_relobj): New function (two instantiations).
7298 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7299 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7300 (Output_data_reloc::add_global): Adjust type of relobj.
7301 (Output_data_reloc::add_global_relative): Likewise.
7302 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7303 (Output_data_reloc::add_local): Likewise.
7304 (Output_data_reloc::add_local_relative): Likewise.
7305 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7306 (Output_data_reloc::add_local_section): Likewise.
7307 (Output_data_reloc::add_output_section): Likewise.
7308 (Output_data_reloc::add_absolute): Likewise.
7309 (Output_data_reloc::add_target_specific): Likewise.
7310 (Output_data_got::reserve_slot): Move definition here.
7311 (Output_data_got::reserve_local): New function.
7312 (Output_data_got::reserve_global): New function.
7313 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7314 section_offsets_ with accessor function.
7315 (Sized_relobj_file::write_sections): Likewise.
7316 (Sized_relobj_file::do_relocate_sections): Likewise.
7317 * target.h (Sized_target::reserve_local_got_entry): New function.
7318 (Sized_target::reserve_global_got_entry): New function.
7319 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7320 (Target_x86_64::reserve_global_got_entry): New function.
7321 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7322
4829d394
CC
73232011-05-23 Cary Coutant <ccoutant@google.com>
7324
7325 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7326 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7327 bit when checking got_type.
7328 * incremental.cc (Sized_incremental_binary::setup_readers):
7329 Store symbol table and string table locations; initialize bit vector
7330 of file status flags.
7331 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7332 unchanged files.
7333 (Sized_incremental_binary::do_process_got_plt): New function.
7334 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7335 (Output_section_incremental_inputs::set_final_data_size): Record
7336 file index for each input file.
7337 (Output_section_incremental_inputs::write_got_plt): Store file index
7338 instead of input entry offset for each GOT entry.
7339 * incremental.h
7340 (Incremental_input_entry::Incremental_input_entry): Initialize new
7341 data member.
7342 (Incremental_input_entry::set_offset): Store file index.
7343 (Incremental_input_entry::get_file_index): New function.
7344 (Incremental_input_entry::file_index_): New data member.
7345 (Incremental_binary::process_got_plt): New function.
7346 (Incremental_binary::do_process_got_plt): New function.
7347 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7348 data members.
7349 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7350 (Sized_incremental_binary::set_file_is_unchanged): New function.
7351 (Sized_incremental_binary::file_is_unchanged): New function.
7352 (Sized_incremental_binary::do_process_got_plt): New function.
7353 (Sized_incremental_binary::file_status_): New data member.
7354 (Sized_incremental_binary::main_symtab_loc_): New data member.
7355 (Sized_incremental_binary::main_strtab_loc_): New data member.
7356 * output.cc (Output_data_got::Got_entry::write): Add case
7357 RESERVED_CODE.
7358 (Output_data_got::add_global): Call add_got_entry.
7359 (Output_data_got::add_global_plt): Likewise.
7360 (Output_data_got::add_global_with_rel): Likewise.
7361 (Output_data_got::add_global_with_rela): Likewise.
7362 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7363 (Output_data_got::add_global_pair_with_rela): Likewise.
7364 (Output_data_got::add_local): Call add_got_entry.
7365 (Output_data_got::add_local_plt): Likewise.
7366 (Output_data_got::add_local_with_rel): Likewise.
7367 (Output_data_got::add_local_with_rela): Likewise.
7368 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7369 (Output_data_got::add_local_pair_with_rela): Likewise.
7370 (Output_data_got::reserve_slot): New function.
7371 (Output_data_got::reserve_slot_for_global): New function.
7372 (Output_data_got::add_got_entry): New function.
7373 (Output_data_got::add_got_entry_pair): New function.
7374 (Output_section::add_output_section_data): Edit FIXME.
7375 * output.h
7376 (Output_section_data_build::Output_section_data_build): New
7377 constructor with size parameter.
7378 (Output_data_space::Output_data_space): Likewise.
7379 (Output_data_got::Output_data_got): Initialize new data member; new
7380 constructor with size parameter.
7381 (Output_data_got::add_constant): Call add_got_entry.
7382 (Output_data_got::reserve_slot): New function.
7383 (Output_data_got::reserve_slot_for_global): New function.
7384 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7385 (Output_data_got::add_got_entry): New function.
7386 (Output_data_got::add_got_entry_pair): New function.
7387 (Output_data_got::free_list_): New data member.
7388 * target.h (Sized_target::init_got_plt_for_update): New function.
7389 (Sized_target::register_global_plt_entry): New function.
7390 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7391 Initialize new data member; call init; add constructor with PLT count.
7392 (Output_data_plt_x86_64::init): New function.
7393 (Output_data_plt_x86_64::add_relocation): New function.
7394 (Output_data_plt_x86_64::reserve_slot): New function.
7395 (Output_data_plt_x86_64::free_list_): New data member.
7396 (Target_x86_64::init_got_plt_for_update): New function.
7397 (Target_x86_64::register_global_plt_entry): New function.
7398 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7399 incremental updates.
7400 (Output_data_plt_x86_64::add_relocation): New function.
7401 * testsuite/object_unittest.cc (Object_test): Set default options.
7402
ec69d6da
ILT
74032011-05-16 Ian Lance Taylor <iant@google.com>
7404
7405 * options.h (class General_options): Make -i a synonym for -r.
7406
732e31de
ILT
74072011-05-16 Ian Lance Taylor <iant@google.com>
7408
7409 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7410
403676b5
CC
74112011-05-10 Cary Coutant <ccoutant@google.com>
7412
7413 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7414 strip_all (-s).
7415
5b7b7d6e
ILT
74162011-05-06 Ian Lance Taylor <iant@google.com>
7417
7418 * layout.cc (Layout::layout): If the output section flags change,
7419 update the ordering.
7420
f0f9babf
CC
74212011-04-25 Cary Coutant <ccoutant@google.com>
7422
7423 * incremental-dump.cc (dump_incremental_inputs): Print local
7424 symbol info for each input file.
7425 * incremental.cc
7426 (Output_section_incremental_inputs::set_final_data_size): Add local
7427 symbol info to input file entries in incremental info.
7428 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7429 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7430 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7431 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7432 implementation.
7433 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7434 (Sized_incr_relobj::do_relocate): Write the local symbols.
7435 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7436 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7437 Adjust size of input file header.
7438 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7439 (Incremental_inputs_reader::get_local_symbol_count): New function.
7440 (Incremental_inputs_reader::get_input_section): Adjust size of input
7441 file header.
7442 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7443 (Sized_incr_relobj::This): New typedef.
7444 (Sized_incr_relobj::sym_size): New const data member.
7445 (Sized_incr_relobj::Local_symbol): New struct.
7446 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7447 (Sized_incr_relobj::do_local_symbol_offset): New function.
7448 (Sized_incr_relobj::local_symbol_count_): New data member.
7449 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7450 (Sized_incr_relobj::local_symbol_index_): New data member.
7451 (Sized_incr_relobj::local_symbol_offset_): New data member.
7452 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7453 (Sized_incr_relobj::local_symbols_): New data member.
7454 * object.h (Relobj::output_local_symbol_count): New function.
7455 (Relobj::local_symbol_offset): New function.
7456 (Relobj::do_output_local_symbol_count): New function.
7457 (Relobj::do_local_symbol_offset): New function.
7458 (Sized_relobj::do_output_local_symbol_count): New function.
7459 (Sized_relobj::do_local_symbol_offset): New function.
7460
d0a9ace3
ILT
74612011-04-22 Vladimir Simonov <sv@sw.ru>
7462
7463 * descriptors.cc (set_close_on_exec): New function.
7464 (Descriptors::open): Use set_close_on_exec.
7465 * output.cc (S_ISLNK): Define if not defined.
7466
94a3fc8b
CC
74672011-04-22 Cary Coutant <ccoutant@google.com>
7468
7469 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7470 global symbol map.
7471 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7472 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7473 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7474 relocations.
7475 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7476 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7477 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7478 * incremental.h
7479 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7480 function.
7481 (Incremental_binary::apply_incremental_relocs): New function.
7482 (Incremental_binary::do_apply_incremental_relocs): New function.
7483 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7484 data member.
7485 (Sized_incremental_binary::add_global_symbol): New function.
7486 (Sized_incremental_binary::global_symbol): New function.
7487 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7488 (Sized_incremental_binary::symbol_map_): New data member.
7489 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7490 * target.h (Sized_target::apply_relocation): New function.
7491 * target-reloc.h (apply_relocation): New function.
7492 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7493
c87e4302
DK
74942011-04-22 Doug Kwan <dougkwan@google.com>
7495
7496 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7497 flag of a SHT_ARM_EXIDX section.
2e702c99 7498 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7499 * testsuite/Makefile.in: Regenerate.
7500 * testsuite/arm_exidx_test.s: New file.
7501 * testsuite/arm_exidx_test.sh: Same.
7502
e7782cf6
CC
75032011-04-20 Cary Coutant <ccoutant@google.com>
7504
7505 PR gold/12689
7506 * archive.h (Incremental_archive_entry::Archive_member):
7507 Initialize arg_serial_ (second constructor).
7508
308ecdc7
ILT
75092011-04-17 Ian Lance Taylor <iant@google.com>
7510
7511 * object.cc (Relocate_info::location): Simplify location string.
7512 * errors.cc (Errors::error_at_location): Don't print program
7513 name.
7514 (Errors::warning_at_location): Likewise.
7515 (Errors::undefined_symbol): Likewise.
7516 * testsuite/debug_msg.sh: Update accordingly.
7517
bec5b579
CC
75182011-04-14 Cary Coutant <ccoutant@google.com>
7519
7520 * gold/layout.cc (Layout::symtab_section_offset): New function.
7521 * gold/layout.h (Layout::symtab_section_offset): New function.
7522 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7523
88597d34
ILT
75242011-04-12 Ian Lance Taylor <iant@google.com>
7525
7526 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7527 with MREMAP_MAYMOVE.
7528 * output.h (class Output_file): Add map_is_allocated_ field.
7529 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7530 not available, provide stubs. If mremap is not available, #define
7531 it to gold_mremap.
7532 (MREMAP_MAYMOVE): Define if not defined.
7533 (Output_file::Output_file): Initialize map_is_allocated_.
7534 (Output_file::resize): Check map_is_allocated_.
7535 (Output_file::map_anonymous): If mmap fails, use malloc.
7536 (Output_file::unmap): Don't do anything for an anonymous map.
7537 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7538 is not available, provide stubs.
7539 (File_read::View::~View): Use free rather than delete[].
7540 (File_read::make_view): Use malloc rather than new[]. If mmap
7541 fails, use malloc.
7542 (File_read::find_or_make_view): Use malloc rather than new[].
7543 * gold.h: Remove HAVE_REMAP code.
7544 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7545 exists. Rename mremap to gold_mremap. If mmap is not available
7546 don't do anything.
7547 * configure, config.in: Rebuild.
7548
11e361bc
ILT
75492011-04-11 Ian Lance Taylor <iant@google.com>
7550
7551 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7552 initialize local variable v.
7553
cdc29364
CC
75542011-04-11 Cary Coutant <ccoutant@google.com>
7555
7556 * archive.cc (Archive::include_member): Adjust call to
7557 report_object.
7558 (Add_archive_symbols::run): Track argument serial numbers.
7559 (Lib_group::include_member): Likewise.
7560 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7561 * archive.h (Incremental_archive_entry::Archive_member):
7562 Initialize arg_serial_.
7563 (Archive_member::arg_serial_): New data member.
7564 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7565 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7566 incremental link.
7567 (Sized_dynobj::do_for_all_local_got_entries): New function.
7568 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7569 function.
7570 * fileread.cc (get_mtime): New function.
7571 * fileread.h (get_mtime): New function.
7572 * gold.cc (queue_initial_tasks): Check for incremental update.
7573 (process_incremental_input): New function.
7574 (queue_middle_tasks): Don't force valid target for incremental
7575 update.
7576 * incremental-dump.cc (find_input_containing_global): Adjust
7577 size of symbol info entry.
7578 (dump_incremental_inputs): Dump argument serial number and
7579 in_system_directory flag; bias shndx by 1; print symbol names
7580 when dumping per-file symbol lists; use new symbol info readers.
7581 * incremental.cc
7582 (Output_section_incremental_inputs:update_data_size): New function.
7583 (Sized_incremental_binary::setup_readers): Setup input readers
7584 for each input file; build maps for files added from libraries
7585 and scripts.
7586 (Sized_incremental_binary::check_input_args): New function.
7587 (Sized_incremental_binary::do_check_inputs): Build map of argument
7588 serial numbers to input arguments.
7589 (Sized_incremental_binary::do_file_has_changed): Rename
7590 do_file_is_unchanged to this; compare file modification times.
7591 (Sized_incremental_binary::do_init_layout): New function.
7592 (Sized_incremental_binary::do_reserve_layout): New function.
7593 (Sized_incremental_binary::do_get_input_reader): Remove.
7594 (Sized_incremental_binary::get_symtab_view): New function.
7595 (Incremental_checker::can_incrementally_link_output_file): Remove.
7596 (Incremental_inputs::report_command_line): Exclude --debug options.
7597 (Incremental_inputs::report_archive_begin): Add parameter; track
7598 argument serial numbers; don't put input file entry for archive
7599 before archive members.
7600 (Incremental_inputs::report_archive_end): Put input file entry
7601 for archive after archive members.
7602 (Incremental_inputs::report_object): Add parameter; track argument
7603 serial numbers and in_system_directory flag.
7604 (Incremental_inputs::report_script): Add parameter; track argument
7605 serial numbers.
7606 (Output_section_incremental_inputs::set_final_data_size): Adjust
7607 size of symbol info entry; check for forwarding symbols.
7608 (Output_section_incremental_inputs::write_input_files): Write
7609 in_system_directory flag and argument serial number.
7610 (Output_section_incremental_inputs::write_info_blocks): Map section
7611 indices between incremental info and original input file; store
7612 input section index for each symbol.
7613 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7614 change operator() to visit().
7615 (class Global_got_offset_visitor): Likewise.
7616 (class Global_symbol_visitor_got_plt):
7617 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7618 classes.
7619 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7620 (Sized_incr_relobj::do_read_symbols): New function.
7621 (Sized_incr_relobj::do_layout): New function.
7622 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7623 (Sized_incr_relobj::do_add_symbols): New function.
7624 (Sized_incr_relobj::do_should_include_member): New function.
7625 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7626 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7627 (Sized_incr_relobj::do_section_size): New function.
7628 (Sized_incr_relobj::do_section_name): New function.
7629 (Sized_incr_relobj::do_section_contents): New function.
7630 (Sized_incr_relobj::do_section_flags): New function.
7631 (Sized_incr_relobj::do_section_entsize): New function.
7632 (Sized_incr_relobj::do_section_address): New function.
7633 (Sized_incr_relobj::do_section_type): New function.
7634 (Sized_incr_relobj::do_section_link): New function.
7635 (Sized_incr_relobj::do_section_info): New function.
7636 (Sized_incr_relobj::do_section_addralign): New function.
7637 (Sized_incr_relobj::do_initialize_xindex): New function.
7638 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7639 (Sized_incr_relobj::do_read_relocs): New function.
7640 (Sized_incr_relobj::do_gc_process_relocs): New function.
7641 (Sized_incr_relobj::do_scan_relocs): New function.
7642 (Sized_incr_relobj::do_count_local_symbols): New function.
7643 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7644 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7645 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7646 (Sized_incr_relobj::do_relocate): New function.
7647 (Sized_incr_relobj::do_set_section_offset): New function.
7648 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7649 (Sized_incr_dynobj::do_read_symbols): New function.
7650 (Sized_incr_dynobj::do_layout): New function.
7651 (Sized_incr_dynobj::do_add_symbols): New function.
7652 (Sized_incr_dynobj::do_should_include_member): New function.
7653 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7654 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7655 (Sized_incr_dynobj::do_section_size): New function.
7656 (Sized_incr_dynobj::do_section_name): New function.
7657 (Sized_incr_dynobj::do_section_contents): New function.
7658 (Sized_incr_dynobj::do_section_flags): New function.
7659 (Sized_incr_dynobj::do_section_entsize): New function.
7660 (Sized_incr_dynobj::do_section_address): New function.
7661 (Sized_incr_dynobj::do_section_type): New function.
7662 (Sized_incr_dynobj::do_section_link): New function.
7663 (Sized_incr_dynobj::do_section_info): New function.
7664 (Sized_incr_dynobj::do_section_addralign): New function.
7665 (Sized_incr_dynobj::do_initialize_xindex): New function.
7666 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7667 (make_sized_incremental_object): New function.
7668 (Incremental_library::copy_unused_symbols): New function.
7669 (Incremental_library::do_for_all_unused_symbols): New function.
7670 * incremental.h (enum Incremental_input_flags): New type.
7671 (class Incremental_checker): Remove.
7672 (Incremental_input_entry::Incremental_input_entry): Add argument
7673 serial number.
7674 (Incremental_input_entry::arg_serial): New function.
7675 (Incremental_input_entry::set_is_in_system_directory): New function.
7676 (Incremental_input_entry::is_in_system_directory): New function.
7677 (Incremental_input_entry::arg_serial_): New data member.
7678 (Incremental_input_entry::is_in_system_directory_): New data member.
7679 (class Script_info): Move here from script.h.
7680 (Script_info::Script_info): Add filename parameter.
7681 (Script_info::filename): New function.
7682 (Script_info::filename_): New data member.
7683 (Incremental_script_entry::Incremental_script_entry): Add argument
7684 serial number.
7685 (Incremental_object_entry::Incremental_object_entry): Likewise.
7686 (Incremental_object_entry::add_input_section): Build list of input
7687 sections with map to original shndx.
7688 (Incremental_object_entry::get_input_section_index): New function.
7689 (Incremental_object_entry::shndx_): New data member.
7690 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7691 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7692 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7693 serial number.
7694 (Incremental_inputs::report_archive_begin): Likewise.
7695 (Incremental_inputs::report_object): Likewise.
7696 (Incremental_inputs::report_script): Likewise.
7697 (class Incremental_global_symbol_reader): New class.
7698 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7699 and store flags and input file type.
7700 (Incremental_input_entry_reader::arg_serial): New function.
7701 (Incremental_input_entry_reader::type): Extract type from flags.
7702 (Incremental_input_entry_reader::is_in_system_directory): New function.
7703 (Incremental_input_entry_reader::get_input_section_count): Call
7704 accessor function for type.
7705 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7706 function for type; adjust size of global symbol entry.
7707 (Incremental_input_entry_reader::get_global_symbol_count): Call
7708 accessor function for type.
7709 (Incremental_input_entry_reader::get_object_count): Likewise.
7710 (Incremental_input_entry_reader::get_object_offset): Likewise.
7711 (Incremental_input_entry_reader::get_member_count): Likewise.
7712 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7713 (Incremental_input_entry_reader::get_member_offset): Likewise.
7714 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7715 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7716 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7717 (Incremental_input_entry_reader::get_global_symbol_reader): New
7718 function.
7719 (Incremental_input_entry_reader::get_output_symbol_index): New
7720 function.
7721 (Incremental_input_entry_reader::type_): Remove.
7722 (Incremental_input_entry_reader::flags_): New data member.
7723 (Incremental_inputs_reader::input_file_offset): New function.
7724 (Incremental_inputs_reader::input_file_index): New function.
7725 (Incremental_inputs_reader::input_file): Call input_file_offset.
7726 (Incremental_inputs_reader::input_file_at_offset): New function.
7727 (Incremental_relocs_reader::get_r_type): Reformat.
7728 (Incremental_relocs_reader::get_r_shndx): Reformat.
7729 (Incremental_relocs_reader::get_r_offset): Reformat.
7730 (Incremental_relocs_reader::data): New function.
7731 (Incremental_binary::Incremental_binary): Initialize new data members.
7732 (Incremental_binary::check_inputs): Add cmdline parameter.
7733 (Incremental_binary::file_is_unchanged): Remove.
7734 (Input_reader::arg_serial): New function.
7735 (Input_reader::get_unused_symbol_count): New function.
7736 (Input_reader::get_unused_symbol): New function.
7737 (Input_reader::do_arg_serial): New function.
7738 (Input_reader::do_get_unused_symbol_count): New function.
7739 (Input_reader::do_get_unused_symbol): New function.
7740 (Incremental_binary::input_file_count): New function.
7741 (Incremental_binary::get_input_reader): Change signature to use
7742 index instead of filename.
7743 (Incremental_binary::file_has_changed): New function.
7744 (Incremental_binary::get_input_argument): New function.
7745 (Incremental_binary::get_library): New function.
7746 (Incremental_binary::get_script_info): New function.
7747 (Incremental_binary::init_layout): New function.
7748 (Incremental_binary::reserve_layout): New function.
7749 (Incremental_binary::output_file): New function.
7750 (Incremental_binary::do_check_inputs): New function.
7751 (Incremental_binary::do_file_is_unchanged): Remove.
7752 (Incremental_binary::do_file_has_changed): New function.
7753 (Incremental_binary::do_init_layout): New function.
7754 (Incremental_binary::do_reserve_layout): New function.
7755 (Incremental_binary::do_input_file_count): New function.
7756 (Incremental_binary::do_get_input_reader): Change signature.
7757 (Incremental_binary::input_args_map_): New data member.
7758 (Incremental_binary::library_map_): New data member.
7759 (Incremental_binary::script_map_): New data member.
7760 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7761 new data members.
7762 (Sized_incremental_binary::output_section): New function.
7763 (Sized_incremental_binary::inputs_reader): Add const.
7764 (Sized_incremental_binary::symtab_reader): Add const.
7765 (Sized_incremental_binary::relocs_reader): Add const.
7766 (Sized_incremental_binary::got_plt_reader): Add const.
7767 (Sized_incremental_binary::get_symtab_view): New function.
7768 (Sized_incremental_binary::Inputs_reader): New typedef.
7769 (Sized_incremental_binary::Input_entry_reader): New typedef.
7770 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7771 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7772 (Sized_incremental_binary::do_file_has_changed): New function.
7773 (Sized_incremental_binary::do_init_layout): New function.
7774 (Sized_incremental_binary::do_reserve_layout): New function.
7775 (Sized_input_reader::Inputs_reader): Remove.
7776 (Sized_input_reader::Input_entry_reader): Remove.
7777 (Sized_input_reader::do_arg_serial): New function.
7778 (Sized_input_reader::do_get_unused_symbol_count): New function.
7779 (Sized_input_reader::do_get_unused_symbol): New function.
7780 (Sized_incremental_binary::do_input_file_count): New function.
7781 (Sized_incremental_binary::do_get_input_reader): Change signature;
7782 use index instead of filename.
7783 (Sized_incremental_binary::section_map_): New data member.
7784 (Sized_incremental_binary::input_entry_readers_): New data member.
7785 (class Sized_incr_relobj): New class.
7786 (class Sized_incr_dynobj): New class.
7787 (make_sized_incremental_object): New function.
7788 (class Incremental_library): New class.
7789 * layout.cc (Free_list::num_lists): New static data member.
7790 (Free_list::num_nodes): New static data member.
7791 (Free_list::num_removes): New static data member.
7792 (Free_list::num_remove_visits): New static data member.
7793 (Free_list::num_allocates): New static data member.
7794 (Free_list::num_allocate_visits): New static data member.
7795 (Free_list::init): New function.
7796 (Free_list::remove): New function.
7797 (Free_list::allocate): New function.
7798 (Free_list::dump): New function.
7799 (Free_list::print_stats): New function.
7800 (Layout_task_runner::run): Resize output file for incremental updates.
7801 (Layout::Layout): Initialize new data members.
7802 (Layout::set_incremental_base): New function.
7803 (Layout::init_fixed_output_section): New function.
7804 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7805 incremental updates.
7806 (Layout::create_gold_note): Do not create gold note section for
7807 incremental updates.
7808 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7809 for incremental updates.
7810 (Layout::set_section_offsets): For incremental updates, allocate space
7811 from free list.
7812 (Layout::create_symtab_sections): Layout with offsets relative to
7813 start of section; for incremental updates, allocate space from free
7814 list.
7815 (Layout::create_shdrs): For incremental updates, allocate space from
7816 free list.
7817 (Layout::finish_dynamic_section): For incremental updates, do not
7818 check --as-needed (fixed in subsequent patch).
7819 * layout.h (class Free_list): New class.
7820 (Layout::set_incremental_base): New function.
7821 (Layout::incremental_base): New function.
7822 (Layout::init_fixed_output_section): New function.
7823 (Layout::allocate): New function.
7824 (Layout::incremental_base_): New data member.
7825 (Layout::free_list_): New data member.
7826 * main.cc (main): Print Free_list statistics.
7827 * object.cc (Relobj::finalize_incremental_relocs): Add
7828 clear_counts parameter; clear counts only when clear_counts is set.
7829 (Sized_relobj::Sized_relobj): Initialize new base class.
7830 (Sized_relobj::do_layout): Don't report special sections.
7831 (Sized_relobj::do_for_all_local_got_entries): New function.
7832 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7833 symtab_off to all symbol table offsets.
7834 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7835 * object.h (class Got_offset_list): Move to top of file.
7836 (Object::Object): Allow case where input_file == NULL.
7837 (Object::~Object): Likewise.
7838 (Object::input_file): Assert that input_file != NULL.
7839 (Object::lock): Allow case where input_file == NULL.
7840 (Object::unlock): Likewise.
7841 (Object::is_locked): Likewise.
7842 (Object::token): Likewise.
7843 (Object::release): Likewise.
7844 (Object::is_incremental): New function.
7845 (Object::get_mtime): New function.
7846 (Object::for_all_local_got_entries): New function.
7847 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7848 (Object::set_is_in_system_directory): New function.
7849 (Object::is_in_system_directory): New function.
7850 (Object::do_is_incremental): New function.
7851 (Object::do_get_mtime): New function.
7852 (Object::do_for_all_local_got_entries): New function.
7853 (Object::is_in_system_directory_): New data member.
7854 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7855 (class Sized_relobj_base): New class.
7856 (class Sized_relobj): Derive from Sized_relobj_base.
7857 (class Sized_relobj::Symbols): Redeclare from base class.
7858 (class Sized_relobj::local_got_offset_list): Remove.
7859 (class Sized_relobj::Output_sections): Redeclare from base class.
7860 (class Sized_relobj::do_for_all_local_got_entries): New function.
7861 (class Sized_relobj::write_local_symbols): Add offset parameter.
7862 (class Sized_relobj::local_symbol_offset_): Update comment.
7863 (class Sized_relobj::local_dynsym_offset_): Update comment.
7864 * options.cc (Input_arguments::add_file): Remove const.
7865 * options.h (Input_file_argument::Input_file_argument):
7866 Initialize arg_serial_ (all constructors).
7867 (Input_file_argument::set_arg_serial): New function.
7868 (Input_file_argument::arg_serial): New function.
7869 (Input_file_argument::arg_serial_): New data member.
7870 (Input_arguments::Input_arguments): Initialize file_count_.
7871 (Input_arguments::add_file): Remove const.
7872 (Input_arguments::number_of_input_files): New function.
7873 (Input_arguments::file_count_): New data member.
7874 (Command_line::number_of_input_files): Call
7875 Input_arguments::number_of_input_files.
7876 * output.cc (Output_segment_headers::Output_segment_headers):
7877 Set current size.
7878 (Output_section::Input_section::current_data_size): New function.
7879 (Output_section::Output_section): Initialize new data members.
7880 (Output_section::add_input_section): Don't do merge sections for
7881 an incremental link; allocate space from free list for an
7882 incremental update.
7883 (Output_section::add_output_section_data): Allocate space from
7884 free list for an incremental update.
7885 (Output_section::update_data_size): New function.
7886 (Output_section::set_fixed_layout): New function.
7887 (Output_section::reserve): New function.
7888 (Output_segment::set_section_addresses): Remove const.
7889 (Output_segment::set_section_list_addresses): Remove const; allocate
7890 space from free list for an incremental update.
7891 (Output_segment::set_offset): Adjust size of RELRO segment for an
7892 incremental update.
7893 * output.h (Output_data::current_data_size): Move here from
7894 child classes.
7895 (Output_data::pre_finalize_data_size): New function.
7896 (Output_data::update_data_size): New function.
7897 (Output_section_headers::update_data_size): new function.
7898 (Output_section_data_build::current_data_size): Move to Output_data.
7899 (Output_data_strtab::update_data_size): New function.
7900 (Output_section::current_data_size): Move to Output_data.
7901 (Output_section::set_fixed_layout): New function.
7902 (Output_section::has_fixed_layout): New function.
7903 (Output_section::reserve): New function.
7904 (Output_section::update_data_size): New function.
7905 (Output_section::has_fixed_layout_): New data member.
7906 (Output_section::free_list_): New data member.
7907 (Output_segment::set_section_addresses): Remove const.
7908 (Output_segment::set_section_list_addresses): Remove const.
7909 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7910 New function.
7911 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7912 New function.
7913 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7914 parameter when calling Add_symbols constructor; store argument
7915 serial number for members of a lib group.
7916 (Add_symbols::locks): Allow case where token == NULL.
7917 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7918 (Read_member::~Read_member): New function.
7919 (Read_member::is_runnable): New function.
7920 (Read_member::locks): New function.
7921 (Read_member::run): New function.
7922 (Check_script::~Check_script): New function.
7923 (Check_script::is_runnable): New function.
7924 (Check_script::locks): New function.
7925 (Check_script::run): New function.
7926 (Check_library::~Check_library): New function.
7927 (Check_library::is_runnable): New function.
7928 (Check_library::locks): New function.
7929 (Check_library::run): New function.
7930 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7931 (Add_symbols::library_): New data member.
7932 (class Read_member): New class.
7933 (class Check_script): New class.
7934 (class Check_library): New class.
7935 * reloc.cc (Read_relocs::is_runnable): Allow case where
7936 token == NULL.
7937 (Read_relocs::locks): Likewise.
7938 (Scan_relocs::locks): Likewise.
7939 (Relocate_task::locks): Likewise.
7940 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7941 to clear counters.
7942 (Sized_relobj::incremental_relocs_scan): Fix comment.
7943 (Sized_relobj::do_relocate): Pass output file offset to
7944 write_local_symbols.
7945 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7946 from class declaration.
7947 * script.cc (read_input_script): Allocate Script_info; pass
7948 argument serial number to report_script.
7949 * script.h (class Script_info): Move to incremental.h.
7950 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7951 * symtab.h (Symbol_table::add_from_incrobj): New function.
7952 (Symbol_table::set_file_offset): New function.
7953
b961d0d7
CC
79542011-04-05 Cary Coutant <ccoutant@google.com>
7955
7956 * incremental-dump.cc (dump_incremental_inputs): Change signature
7957 to take a Sized_incremental_binary; change caller. Use readers
7958 in Sized_incremental_binary.
7959 * incremental.cc
7960 (Sized_incremental_binary::find_incremental_inputs_sections):
7961 Rename do_find_incremental_inputs_sections to this.
7962 (Sized_incremental_binary::setup_readers): New function.
7963 (Sized_incremental_binary::do_check_inputs): Check
7964 has_incremental_info_ flag; move setup code to setup_readers;
7965 use input readers.
7966 (Sized_incremental_binary::do_file_is_unchanged): New function.
7967 (Sized_incremental_binary::do_get_input_reader): New function.
7968 * incremental.h (class Incremental_binary): Move to end of file.
7969 (Incremental_binary::file_is_unchanged): New function.
7970 (Incremental_binary::do_file_is_unchanged): New function.
7971 (Incremental_binary::Input_reader): New class.
7972 (Incremental_binary::get_input_reader): New function.
7973 (class Sized_incremental_binary): Move to end of file.
7974 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7975 input section reader classes.
7976 (Sized_incremental_binary::has_incremental_info): New function.
7977 (Sized_incremental_binary::inputs_reader): New function.
7978 (Sized_incremental_binary::symtab_reader): New function.
7979 (Sized_incremental_binary::relocs_reader): New function.
7980 (Sized_incremental_binary::got_plt_reader): New function.
7981 (Sized_incremental_binary::do_file_is_unchanged): New function.
7982 (Sized_incremental_binary::Sized_input_reader): New class.
7983 (Sized_incremental_binary::get_input_reader): New function.
7984 (Sized_incremental_binary::find_incremental_inputs_sections):
7985 Rename do_find_incremental_inputs_sections to this.
7986 (Sized_incremental_binary::setup_readers): New function.
7987 (Sized_incremental_binary::has_incremental_info_): New data member.
7988 (Sized_incremental_binary::inputs_reader_): New data member.
7989 (Sized_incremental_binary::symtab_reader_): New data member.
7990 (Sized_incremental_binary::relocs_reader_): New data member.
7991 (Sized_incremental_binary::got_plt_reader_): New data member.
7992 (Sized_incremental_binary::current_input_file_): New data member.
7993
a869183f
PP
79942011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7995
7996 PR gold/12640
7997 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7998 violation.
7999
80002011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8001
8002 * archive.cc (Archive::include_member): Adjust call to report_object.
8003 (Add_archive_symbols::run): Add script_info to call to
8004 report_archive_begin.
8005 (Lib_group::include_member): Adjust call to report_object.
8006 (Add_lib_group_symbols::run): Adjust call to report_object.
8007 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8008 blocks. Add object count for script input files.
8009 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8010 script_info parameter; change all callers.
8011 (Incremental_inputs::report_object): Add script_info parameter;
8012 change all callers.
8013 (Incremental_inputs::report_script): Store backpointer to
8014 incremental info entry.
8015 (Output_section_incremental_inputs::set_final_data_size): Record
8016 additional information for scripts.
8017 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8018 * incremental.h (Incremental_script_entry::add_object): New function.
8019 (Incremental_script_entry::get_object_count): New function.
8020 (Incremental_script_entry::get_object): New function.
8021 (Incremental_script_entry::objects_): New data member; adjust
8022 constructor.
8023 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8024 (Incremental_inputs::report_object): Add script_info parameter.
8025 (Incremental_inputs_reader::get_object_count): New function.
8026 (Incremental_inputs_reader::get_object_offset): New function.
8027 * options.cc (Input_arguments::add_file): Return reference to
8028 new input argument.
8029 * options.h (Input_argument::set_script_info): New function.
8030 (Input_argument::script_info): New function.
8031 (Input_argument::script_info_): New data member; adjust all
8032 constructors.
8033 (Input_file_group::add_file): Return reference to new input argument.
8034 (Input_file_lib::add_file): Likewise.
8035 (Input_arguments::add_file): Likewise.
8036 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8037 * script.cc (Parser_closure::Parser_closure): Add script_info
8038 parameter; adjust all callers.
8039 (Parser_closure::script_info): New function.
8040 (Parser_closure::script_info_): New data member.
8041 (read_input_script): Report scripts earlier to incremental info.
8042 (script_add_file): Set script_info in Input_argument.
8043 (script_add_library): Likewise.
8044 * script.h (Script_options::Script_info): Rewrite class.
8045
a869183f 80462011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8047
8048 * archive.cc (Library_base::should_include_member): Move
8049 method here from class Archive.
8050 (Archive::Archive): Initialize base class.
8051 (Archive::should_include_member): Move to base class.
8052 (Archive::do_for_all_unused_symbols): New function.
8053 (Add_archive_symbols::run): Remove redundant access to
8054 incremental_inputs.
8055 (Lib_group::Lib_group): Initialize base class.
8056 (Lib_group::do_filename): New function.
8057 (Lib_group::include_member): Pass pointer to Lib_group to
8058 report_object.
8059 (Lib_group::do_for_all_unused_symbols): New function.
8060 (Add_lib_group_symbols::run): Report archive information for
8061 incremental links.
8062 * archive.h (class Library_base): New base class.
8063 (class Archive): Derive from Library_base.
8064 (Archive::filename): Move to base class.
8065 (Archive::set_incremental_info): Likewise.
8066 (Archive::incremental_info): Likewise.
8067 (Archive::Should_include): Likewise.
8068 (Archive::should_include_member): Likewise.
8069 (Archive::Armap_entry): Remove.
8070 (Archive::Unused_symbol_iterator): Remove.
8071 (Archive::unused_symbols_begin): Remove.
8072 (Archive::unused_symbols_end): Remove.
8073 (Archive::do_filename): New function.
8074 (Archive::do_get_mtime): New function.
8075 (Archive::do_for_all_unused_symbols): New function.
8076 (Archive::task_): Move to base class.
8077 (Archive::incremental_info_): Likewise.
8078 (class Lib_group): Derive from Library_base.
8079 (Lib_group::do_filename): New function.
8080 (Lib_group::do_get_mtime): New function.
8081 (Lib_group::do_for_all_unused_symbols): New function.
8082 (Lib_group::task_): Move to base class.
8083 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8084 function.
8085 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8086 function.
8087 * incremental.cc (Incremental_inputs::report_archive_begin):
8088 Use Library_base; call library's get_mtime; add incremental inputs
8089 entry before members.
8090 (class Unused_symbol_visitor): New class.
8091 (Incremental_inputs::report_archive_end): Use Library_base; use
8092 visitor class to record unused symbols; don't add incremental inputs
8093 entry after members.
8094 (Incremental_inputs::report_object): Use Library_base.
8095 * incremental.h
8096 (Incremental_archive_entry::Incremental_archive_entry): Remove
8097 unused Archive parameter.
8098 (Incremental_inputs::report_archive_begin): Use Library_base.
8099 (Incremental_inputs::report_archive_end): Likewise.
8100 (Incremental_inputs::report_object): Likewise.
8101 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8102 function.
8103 * object.h (Object::for_all_global_symbols): New function.
8104 (Object::do_for_all_global_symbols): New function.
8105 (Sized_relobj::do_for_all_global_symbols): New function.
8106 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8107 function.
8108 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8109 function.
8110
61ab3e40
ILT
81112011-03-27 Ian Lance Taylor <iant@google.com>
8112
8113 * archive.cc (Archive::interpret_header): Return -1 if something
8114 goes wrong. Change callers accordingly.
8115
30e1f9e6
CC
81162011-03-25 Cary Coutant <ccoutant@google.com>
8117
8118 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8119 * testsuite/Makefile.in: Regenerate.
8120
9370ce59 81212011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8122
8123 * plugin.cc (get_view): New.
8124 (Plugin::load): Pass get_view to the plugin.
8125 (Plugin_manager::get_view): New.
8126
9312bb0a
ILT
81272011-03-21 Ian Lance Taylor <iant@google.com>
8128
8129 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8130 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8131
7e12ba9e
ST
81322011-03-21 Sriraman Tallam <tmsriram@google.com>
8133
8134 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8135 Change == to -eq.
8136 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8137 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8138 Change == to -eq.
8139 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8140 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8141
fd7a005d
ILT
81422011-03-14 Ian Lance Taylor <iant@google.com>
8143
8144 * script-sections.cc (Sort_output_sections::script_compare):
8145 Rename from is_before, change return type.
8146 (Sort_output_sections::operator()): Adjust accordingly.
8147
ed16fd1b
ILT
81482011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8149
8150 PR gold/12572
8151 * testsuite/odr_violation2.cc: Add comment to make all error line
8152 numbers double digits.
8153 * testsuite/debug_msg.sh: Adjust expected errors.
8154
71ff8986
ILT
81552011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8156
8157 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8158 but mark earlier ones as non-canonical
8159 (offset_to_iterator): Update search target and example
8160 (do_addr2line): Return extra lines in a vector*
8161 (format_file_lineno): Extract from do_addr2line
8162 (one_addr2line): Add vector* out-param
8163 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8164 when a lineno entry appeared last for its instruction
8165 (Dwarf_line_info): Add vector* out-param
8166 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8167 * symtab.cc (Odr_violation_compare): Include the lineno in the
8168 comparison again.
8169 (linenos_from_loc): New. Combine the canonical line for an
8170 address with its other lines.
8171 (True_if_intersect): New. Helper functor to make
8172 std::set_intersection a query.
8173 (detect_odr_violations): Compare sets of lines instead of just
8174 one line for each function. This became less deterministic, but
8175 has fewer false positives.
8176 * symtab.h: Declarations.
8177 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8178 mix an optimized and non-optimized object in the same binary
8179 (odr_violation2.so): Same.
8180 * testsuite/Makefile.in: Regenerate from Makefile.am.
8181 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8182 * testsuite/debug_msg.sh: Update line numbers and add
8183 assertions.
8184 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8185 non-optimized context.
8186 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8187 isn't inlined, and use OdrDerived in an optimized context.
8188 * testsuite/odr_header1.h: Defines OdrDerived, where
8189 optimization will change the
8190 first-instruction-in-the-destructor's file and line number.
8191 * testsuite/odr_header2.h: Defines OdrBase.
8192
a19fefdc
ILT
81932011-03-09 Ian Lance Taylor <iant@google.com>
8194
8195 * fileread.cc (File_read::clear_views): Don't delete the whole
8196 file view.
8197
ecb351e9
ILT
81982011-03-08 Ian Lance Taylor <iant@google.com>
8199
8200 PR gold/12525
8201 * fileread.cc: #include <climits>.
8202 (GOLD_IOV_MAX): Define.
8203 (File_read::read_multiple): Limit number of entries by iov_max.
8204 * fileread.h (class File_read): Always set max_readv_entries to
8205 128.
8206
b821d13c
ILT
82072011-03-07 Ian Lance Taylor <iant@google.com>
8208
8209 PR gold/12525
8210 * options.h (class General_options): Add -dy and -dn.
8211
89243142
CC
82122011-03-02 Cary Coutant <ccoutant@google.com>
8213
8214 * testsuite/script_test_9.t: Add TLS segment.
8215
d0773f31
ILT
82162011-03-02 Simon Baldwin <simonb@google.com>
8217
8218 * configure.ac: Add check for gnu_indirect_function support in
8219 the toolchain building binutils.
8220 * configure: Rebuild.
8221
9370ce59 82222011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8223
8224 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8225 plugin only symbols.
8226 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8227 in plugin files as not needed in the symbol table.
8228
4cf7a849
ST
82292011-02-11 Sriraman Tallam <tmsriram@google.com>
8230
8231 * output.cc (Output_section::add_input_section): Delay fill
8232 generation for section ordering.
8233
b578bd7d
ILT
82342011-02-09 Ian Lance Taylor <iant@google.com>
8235
8236 PR gold/12316
8237 * object.h (class Sized_relobj): Remove clear_local_symbols.
8238 * reloc.cc (Sized_relobj::do_relocate): Don't call
8239 clear_local_symbols.
8240
9370ce59 82412011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8242
8243 * plugin.cc (is_visible_from_outside): Return true for symbols
8244 in the -u option.
8245
55382fb7
ILT
82462011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8247
8248 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8249 filename.
8250
4e271fff
ST
82512011-02-02 Sriraman Tallam <tmsriram@google.com>
8252
8253 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8254 to std::string.
4e271fff 8255 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8256 section_name to be std::string.
4e271fff
ST
8257 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8258
d433c3ac
ILT
82592011-01-25 Ian Lance Taylor <iant@google.com>
8260
8261 * script.cc (script_add_extern): Rewrite to use
8262 add_symbol_reference.
8263
880473a6
DK
82642011-01-25 Doug Kwan <dougkwan@google.com>
8265
d433c3ac 8266 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8267
f30f86fa
ILT
82682011-01-24 Ian Lance Taylor <iant@google.com>
8269
8270 * options.h (class General_options): Accept
8271 --no-detect-odr-violations.
8272
8e51a0b9
ILT
82732011-01-24 Ian Lance Taylor <iant@google.com>
8274
8275 * version.cc (version_string): Bump to 1.11.
8276
0f3b89d8
ILT
82772011-01-24 Ian Lance Taylor <iant@google.com>
8278
8279 * plugin.cc (class Plugin_rescan): Define new class.
8280 (Plugin_manager::claim_file): Set any_claimed_.
8281 (Plugin_manager::save_archive): New function.
8282 (Plugin_manager::save_input_group): New function.
8283 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8284 necessary.
8285 (Plugin_manager::new_undefined_symbol): New function.
8286 (Plugin_manager::rescan): New function.
8287 (Plugin_manager::rescannable_defines): New function.
8288 (Plugin_manager::add_input_file): Set any_added_.
8289 * plugin.h (class Plugin_manager): define new fields rescannable_,
8290 undefined_symbols_, any_claimed_, and any_added_. Declare
8291 Plugin_rescan as friend. Declare new functions.
8292 (Plugin_manager::Rescannable): Define type.
8293 (Plugin_manager::Rescannable_list): Define type.
8294 (Plugin_manager::Undefined_symbol_list): Define type.
8295 (Plugin_manager::Plugin_manager): Initialize new fields.
8296 * archive.cc (Archive::defines_symbol): New function.
8297 (Add_archive_symbols::run): Pass archive to plugins if any.
8298 * archive.h (class Archive): Declare defines_symbol.
8299 * readsyms.cc (Input_group::~Input_group): New function.
8300 (Finish_group::run): Pass input_group to plugins if any.
8301 * readsyms.h (class Input_group): Declare destructor.
8302 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8303 any.
8304
3bb951e5
ILT
83052011-01-10 Ian Lance Taylor <iant@google.com>
8306
8307 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8308 section as relro.
8309 (Layout::set_segment_offsets): Reset increase_relro before calling
8310 set_section_addresses a second time.
8311
0aa45fac
CC
83122011-01-04 Cary Coutant <ccoutant@google.com>
8313
8314 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8315 sections before NOBITS sections.
8316
0db46eb4
L
83172011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8318
8319 * version.cc (print_version): Update copyright to 2011.
8320
829c9745
CC
83212010-12-23 Cary Coutant <ccoutant@google.com>
8322
8323 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8324 of OS to this->add. Add OD parameter to second form of the function.
8325
7500420b
ILT
83262010-12-20 Ian Lance Taylor <iant@google.com>
8327
8328 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8329 second of two consecutive entries with same offset.
8330
f8e9a930
RW
83312010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8332
8333 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8334 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8335 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8336 to avoid unneeded links against $(LDADD).
8337 * testsuite/Makefile.in: Regenerate.
8338
2fbb4320
ILT
83392010-12-15 Ian Lance Taylor <iant@google.com>
8340
8341 PR gold/12324
8342 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8343 for R_X86_64_32 and R_X86_64_PC32.
8344 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8345 ver_matching_def_pic.o.
8346 (ver_matching_def_pic.o): New target.
8347
fedb228d
RW
83482010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8349
8350 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8351 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8352 Move definition before File_read::View member definitions.
8353 (File_read::View::~View): Initialize and hold lock before
8354 updating current_mapped_bytes.
8355
9b547ce6
RW
83562010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8357
8358 * dwarf_reader.cc: Remove outdated comment.
8359 * gold-threads.cc: Fix typo in error message.
8360 * archive.cc: Fix typos in comments.
8361 * archive.h: Likewise.
8362 * arm-reloc-property.cc: Likewise.
8363 * arm-reloc-property.h: Likewise.
8364 * arm-reloc.def: Likewise.
8365 * arm.cc: Likewise.
8366 * attributes.h: Likewise.
8367 * cref.cc: Likewise.
8368 * ehframe.cc: Likewise.
8369 * fileread.h: Likewise.
8370 * gold.h: Likewise.
8371 * i386.cc: Likewise.
8372 * icf.cc: Likewise.
8373 * incremental.h: Likewise.
8374 * int_encoding.cc: Likewise.
8375 * layout.h: Likewise.
8376 * main.cc: Likewise.
8377 * merge.h: Likewise.
8378 * object.cc: Likewise.
8379 * object.h: Likewise.
8380 * options.cc: Likewise.
8381 * readsyms.cc: Likewise.
8382 * reduced_debug_output.cc: Likewise.
8383 * reloc.cc: Likewise.
8384 * script-sections.cc: Likewise.
8385 * sparc.cc: Likewise.
8386 * symtab.h: Likewise.
8387 * target-reloc.h: Likewise.
8388 * target.cc: Likewise.
8389 * target.h: Likewise.
8390 * timer.cc: Likewise.
8391 * timer.h: Likewise.
8392 * x86_64.cc: Likewise.
8393
83e17bd5
CC
83942010-12-09 Cary Coutant <ccoutant@google.com>
8395
8396 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8397 stack.
8398 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8399 parameter; change all callers.
8400 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8401 * options.h (warn_execstack): New option.
8402
017257f8
DK
84032010-12-07 Doug Kwan <dougkwan@google.com>
8404
8405 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8406 like function call relocations.
8407
c20cbc06
ILT
84082010-12-07 Ian Lance Taylor <iant@google.com>
8409
8410 * archive.cc (Archive::get_elf_object_for_member): Permit
8411 punconfigured to be NULL.
8412 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8413 (Archive::include_member): Pass NULL to get_elf_object_for_member
8414 if we searched for the archive and this is the first included
8415 object.
8416
4dbfafcc
ILT
84172010-12-01 Ian Lance Taylor <iant@google.com>
8418
8419 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8420 track_relocs_type_ field.
8421 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8422 Set track_relocs_type_.
8423 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8424 contents when using RELA relocs.
8425 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8426 reloc_map_.
8427 * reloc.cc (Track_relocs::next_addend): New function.
8428 * reloc.h (class Track_relocs): Declare next_addend.
8429
e5e19edd
ILT
84302010-12-01 Ian Lance Taylor <iant@google.com>
8431
8432 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8433 virtual destructor.
8434
9a5ce24c
ILT
84352010-12-01 Ian Lance Taylor <iant@google.com>
8436
8437 * README: Update compilers known to work and fail.
8438
c7791212
NC
84392010-11-23 Matthias Klose <doko@ubuntu.com>
8440
8441 * configure.in: For --enable-gold, handle value `default' instead of
8442 `both*'. Always install ld as ld.bfd, install as ld if gold is
8443 not the default.
8444 * configure: Regenerate.
8445
0ad220c9
DK
84462010-11-18 Doug Kwan <dougkwan@google.com>
8447
8448 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8449 and right_alignment to be zero. Store result alignment only if it is
8450 greater than existing alignment.
8451
ab8056e0
CC
84522010-11-16 Cary Coutant <ccoutant@google.com>
8453
8454 PR gold/12220
8455 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8456 Check for ".zdebug_line".
8457
fd064a5b
CC
84582010-11-16 Doug Kwan <dougkwan@google.com>
8459 Cary Coutant <ccoutant@google.com>
8460
8461 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8462 by reference; adjust all callers.
8463 * output.cc (Output_segment::set_section_addresses): Adjust references
8464 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8465 list is empty.
8466 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8467 end at page boundary.
8468
6fc6ea19
CC
84692010-11-16 Cary Coutant <ccoutant@google.com>
8470
8471 PR gold/12220
8472 * layout.cc (Layout::choose_output_section): Transform names of
8473 compressed sections even when using a script with a SECTIONS clause.
8474 (Layout::output_section_name): Remove code to transform
8475 compressed debug section names.
8476 * output.cc (Output_section::add_input_section): Use uncompressed
8477 section size when tracking input sections.
8478
95a2c8d6
RS
84792010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8480
8481 * symtab.h (Symbol::NON_PIC_REF): Remove.
8482 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8483 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8484 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8485 (Symbol::use_plt_offset): Take a flags argument and pass it
8486 directly to needs_dynamic_reloc. Restrict check for undefined
8487 weak symbols to function calls.
8488 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8489 (Target_arm::Scan::global): Use it.
8490 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8491 (Target_arm::Relocate::relocate): Likewise.
8492 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8493 parameter with an r_type parameter. Use get_reference_flags
8494 to get the flags.
8495 (Target_arm::Relocate::relocate): Update accordingly.
8496 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8497 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8498 (Target_i386::Scan::global): Likewise.
8499 (Target_i386::Relocate::relocate): Likewise.
8500 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8501 parameter with an r_type parameter. Use get_reference_flags
8502 to get the flags.
8503 (Target_i386::Relocate::relocate): Update accordingly.
8504 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8505 (Target_powerpc::Scan::global): Use it.
8506 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8507 (Target_powerpc::Relocate::relocate): Likewise.
8508 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8509 (Target_sparc::Scan::global): Use it.
8510 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8511 (Target_sparc::Relocate::relocate): Likewise.
8512 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8513 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8514 (Target_x86_64::Scan::global): Likewise.
8515 (Target_x86_64::Relocate::relocate): Likewise.
8516
f625ae50
DK
85172010-11-08 Doug Kwan <dougkwan@google.com>
8518 Cary Coutant <ccoutant@google.com>
8519
8520 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8521 (Arm_exidx_merge_section::section_contents_): New data member.
8522 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8523 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8524 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8525 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8526 in parameters instead of calling Object::section_contents without
8527 locking.
8528 (Arm_output_section::group_section): New parameter TASK. Pass it
8529 to callees that need locking objects.
8530 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8531 to lock EXIDX input sections. Fix a formatting issue. Call
8532 Arm_exidx_merged_section::build_contents to create merged section
8533 contents.
8534 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8535 to lock object of stub table owner.
8536 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8537 TEXT_SIZE to initialize data member TEXT_SIZE_.
8538 (Arm_exidx_input_section::addralign): Fix typo in comment.
8539 (Arm_exidx_input_section::text_size): New method.
8540 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8541 that require locking objects. Lock objects before scanning for stubs
8542 and updating local symbols.
8543 (Arm_input_section<big_endian>::init): Copy contents of original
8544 input section.
2e702c99 8545 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8546 original input section instead of calling Object::section_contents
8547 without locking.
8548 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8549 size without calling Object::section_size().
8550 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8551 for size. Allocate a buffer for merged EXIDX entries.
8552 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8553 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8554 building code to Arm_exidx_merged_section::build_contetns. Write
8555 out contetns in buffer instead of building it on the fly.
8556 (Arm_relobj::make_exidx_input_section): Also pass text section size
8557 to Arm_exidx_input_section constructor.
8558 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8559 (Arm_dynobj::do_read_symbols): Fix memory leak.
8560 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8561 * target.h: (class Task): Add forward declaration.
8562 (Target::relax): Add new parameter TASK and pass it to
8563 Target::do_relax().
8564 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8565
5f9bcf58
CC
85662010-11-05 Cary Coutant <ccoutant@google.com>
8567
8568 PR gold/10708
8569 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8570 object when reading from the file.
8571 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8572 second layout pass.
8573 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8574 when reading section contents.
8575 (get_section_contents): Likewise.
8576 (icf::find_identical_sections): Likewise.
8577 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8578 object when reading from the file.
8579 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8580 the object when doing deferred section layout.
8581
e597fa08
NC
85822010-11-03 Nick Clifton <nickc@redhat.com>
8583
8584 PR gold/12001
8585 * script.h (class Symbol_assignment: name): New member. Returns
8586 the name of the symbol.
8587 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8588 Returns true if the given symbol name is on the list of
8589 assignments wating to be processed.
8590 * archive.cc (should_incldue_member): If the symbol is undefined,
8591 check to see if it is on the list of symbols pending assignment.
8592
3f9a3278
ILT
85932010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8594
8595 * script-sections.cc (Script_sections::find_memory_region): Check
8596 for a NULL output section pointer.
8597
d06fb4d1
DK
85982010-10-29 Doug Kwan <dougkwan@google.com>
8599
8600 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8601 Output_section::add_relaxed_input_section.
8602 * output.cc (Output_section::add_relaxed_input_section): Add new
8603 arguments LAYOUT and NAME. Set section order index.
8604 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8605 Copy section order index.
8606 * output.h (Output_section::add_relaxed_input_section): Add new
8607 arguments LAYOUT and NAME.
8608
90e24de5
ILT
86092010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8610
8611 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8612 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8613 * testsuite/Makefile.in: Regenerate.
8614
c9484ea5
DK
86152010-10-20 Doug Kwan <dougkwan@google.com>
8616
8617 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8618 without SHF_LINK_ORDER flags.
8619 * layout.cc (Layout::choose_output_section): Do not filter
8620 SHF_LINK_ORDER flag in a relocatable link.
8621
5bc2f5be
CC
86222010-10-17 Cary Coutant <ccoutant@google.com>
8623
8624 * output.h (Output_segment::set_section_addresses): Change function
8625 signature. Update all callers.
8626 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8627 sections.
8628 (Output_segment::set_section_addresses): Align after last TLS
8629 section. Add padding before last relro section instead of after.
8630
0c91cf04
DK
86312010-10-17 Doug Kwan <dougkwan@google.com>
8632
8633 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8634 GOT output section to be writable.
8635
8c21d9d3
CC
86362010-10-14 Cary Coutant <ccoutant@google.com>
8637
8638 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8639 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8640 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8641 mode.
8642 * incremental.cc (report_command_line): Ignore all forms of
8643 --incremental.
8644 * layout.cc (Layout::Layout): Check parameters for incremental link
8645 mode.
8646 * options.cc (General_options::parse_incremental): New function.
8647 (General_options::parse_no_incremental): New function.
8648 (General_options::parse_incremental_full): New function.
8649 (General_options::parse_incremental_update): New function.
8650 (General_options::incremental_mode_): New data member.
8651 (General_options::finalize): Check incremental_mode_.
8652 * options.h (General_options): Update help text for --incremental.
8653 Add --no-incremental, --incremental-full, --incremental-update.
8654 (General_options::Incremental_mode): New enum type.
8655 (General_options::incremental_mode): New function.
8656 (General_options::incremental_mode_): New data member.
8657 * parameters.cc (Parameters::incremental_mode_): New data member.
8658 (Parameters::set_options): Set incremental_mode_.
8659 (Parameters::set_incremental_full): New function.
8660 (Parameters::incremental): New function.
8661 (Parameters::incremental_update): New function.
8662 (set_parameters_incremental_full): New function.
8663 * parameters.h (Parameters::set_incremental_full): New function.
8664 (Parameters::incremental): New function.
8665 (Parameters::incremental_update): New function.
8666 (Parameters::incremental_mode_): New data member.
8667 (set_parameters_incremental_full): New function.
8668 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8669 incremental link mode.
8670 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8671 (Sized_relobj::do_relocate_sections): Likewise.
8672 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8673 option.
8674 * testsuite/Makefile.in: Regenerate.
8675 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8676
bb32aa18 86772010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8678
8679 * script-sections.h (class Script_sections): Make
8680 Sections_elements typedef public.
8681 * script-sections.cc (class Sort_output_sections): Add elements_
8682 field. Add constructor which sets it; change all callers.
8683 (Sort_output_sections::is_before): New function.
8684 (Sort_output_sections::operator()): Call is_before.
8685 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8686 conditional.
8687 * testsuite/script_test_10.sh: New test. Test script section
8688 order.
8689 * testsuite/script_test_10.t: Likewise.
8690 * testsuite/script_test_10.s: Likewise.
8691 * testsuite/Makefile.am: Wrap the cross linker tests and the
8692 common tests into NATIVE_OR_CROSS_LINKER.
8693 (check_SCRIPTS): Add script_test_10.sh.
8694 (check_DATA): Add script_test_10.stdout.
8695 (script_test_10.o, script_test_10): New targets.
8696 (script_test_10.stdout): New target.
8697 * configure, testsuite/Makefile.in: Regenerate.
8698
3cef7179
ILT
86992010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8700
8701 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8702 error for the deprecated relocations.
8703 (Target_arm::Scan::global): Likewise.
8704 (Target_arm::Relocate::relocate): Likewise.
8705
7411e9a8
RS
87062010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8707
8708 * fileread.cc (Input_file::find_file): Initialize *found_name
8709 and *namep when using the fallback search for case 4.
8710
6a9da32a
CC
87112010-10-11 Cary Coutant <ccoutant@google.com>
8712
8713 * options.h (class General_options): Redefine -z lazy as an alias for
8714 the negation of -z now.
8715
ac897c20
ILT
87162010-10-11 Ian Lance Taylor <iant@google.com>
8717
8718 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8719 binding.
8720
ea5cae92
NC
87212010-10-06 Nick Clifton <nickc@redhat.com>
8722
8723 * script-sections.cc(class Memory_region): Remove
8724 current_lma_offset_ field. Rename current_vma_offset_ to
8725 current_offset_. Add last_section_ field.
8726 (Memory_region::get_current_vma_address): Rename to
8727 get_current_address.
8728 (Memory_region::get_current_lma_address): Delete.
8729 (Memory_region::increment_vma_offset): Rename to
8730 increment_offset.
8731 (Memory_region::increment_lma_offset): Delete.
8732 (Memory_region::attributes_compatible): New method. Returns
8733 true if the provided section is compatible with the region.
8734 (Memory_region::get_last_section): New method. Returns the last
8735 section to use the region.
8736 (Memory_region::set_last_section): New method. Stores the last
8737 section to use the region.
8738 (Script_sections::block_in_region): New method. Returns true if
8739 a block of memory is contained within a region.
8740 (Script_sections::find_memory_region): New method. Locates a
8741 memory region to be used to set a VMA or LMA address.
8742 (Output_section_definition::set_section_addresses): Add code to
8743 check for addresses set by memory regions.
8744 (Output_segment::set_section_addresses): Remove memory region
8745 walking code.
8746 (Script_sections::create_segment): Add a warning if a header
8747 segment is created outside of any region.
8748 * script-sections.h (class Script_sections): Add prototypes for
8749 find_memory_region and block_in_region methods.
8750 * testsuite/memory_test.s: Use .long instead of .word.
8751 * testsuite/memory_test.t: Add some more output sections.
8752 * testsuite/memory_test.sh: Update expected output.
8753
a9bfd952
DK
87542010-10-02 Doug Kwan <dougkwan@google.com>
8755
8756 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8757 defintion to symtab.h
8758 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8759 declaration to defintion.
8760
bacff3ab
NC
87612010-10-01 Nick Clifton <nickc@redhat.com>
8762
8763 * expression.cc (eval): Replace dummy argument with NULL.
8764 (eval_maybe_dot): Check for a NULL result section pointer.
8765 (Symbol_expression::value): Likewise.
8766 (Dot_expression::value): Likewise.
8767 (BINARY_EXPRESSION): Likewise.
8768 (Max_expression::value): Likewise.
8769 (Min_expression::value): Likewise.
8770 (Absolute_expression::value): Likewise.
8771 (Addr_expression::value_from_output_section): Likewise.
8772 (Loaddddr_expression::value_from_output_section): Likewise.
8773 (Segment_start_expression::value): Likewise.
8774 * script-sections.cc
8775 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8776 argument with NULL.
8777 (Sections_elememt_dot_assignment::set_section_addresses):
8778 Likewise.
8779 (Output_data_expression::do_write_to_buffer): Likewise.
8780 (Output_section_definition::finalize_symbols): Likewise.
8781 (Output_section_definition::set_section_addresses): Likewise.
8782
f81bc8b5
DK
87832010-09-30 Doug Kwan <dougkwan@google.com>
8784
8785 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8786
c95e9f27
ST
87872010-09-28 Sriraman Tallam <tmsriram@google.com>
8788
8789 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8790 function.
c95e9f27
ST
8791 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8792 virtual function.
8793 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8794 virtual function.
8795 * icf.cc (get_section_contents): Inline merge sections only when
8796 target allows it.
8797
3cac54d2
RW
87982010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8799
8800 * configure: Regenerate.
8801
2904037a
ILT
88022010-09-17 Ian Lance Taylor <iant@google.com>
8803
8804 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8805 * testsuite/Makefile.am (memory_test.o): New target.
8806 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8807 memory_test.t.
8808 * testsuite/Makefile.in: Rebuild.
2904037a 8809
bca7fb63
DK
88102010-09-17 Doug Kwan <dougkwan@google.com>
8811
8812 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8813 defintion if relocation uses GOT entries of the symbol.
8814 * testsuite/icf_safe_test.sh: Fix test.
8815 * testsuite/icf_safe_so_test.sh: Fix test.
8816
4ef28648
CC
88172010-09-16 Cary Coutant <ccoutant@google.com>
8818
8819 * script_sections.cc (class Memory_region): Remove "NULL" from
8820 vector initializations.
8821
793990de
CC
88222010-09-15 Cary Coutant <ccoutant@google.com>
8823
8824 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8825 Resolve forwarding symbols.
8826
81e015e2
DK
88272010-09-15 Doug Kwan <dougkwan@google.com>
8828
8829 * gold/testsuite/script_test_3.t: Add ARM special sections.
8830 * gold/testsuite/script_test_4.t: Same.
8831 * gold/testsuite/script_test_5.t: Same.
8832 * gold/testsuite/script_test_6.t: Same.
8833 * gold/testsuite/script_test_7.t: Same.
8834 * gold/testsuite/script_test_7.t: Same.
8835 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8836
36171d64
CC
88372010-09-14 Cary Coutant <ccoutant@google.com>
8838
8839 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8840 (Target_x86_64::Relocate::relocate_tls): Replace check for
8841 saw_tls_block_reloc_ with test for executable section.
8842
d89051bd
CC
88432010-09-12 Cary Coutant <ccoutant@google.com>
8844
8845 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8846 position-independent executables to shared libraries need dynamic
8847 relocations.
8848 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8849 position-independent executables.
8850 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8851 * testsuite/Makefile.in: Regenerate.
8852
fca41f0f
NC
88532010-09-10 Nick Clifton <nickc@redhat.com>
8854
8855 PR gold/11997
8856 * testsuite/memory_test.t: Discard any sections that are not
8857 needed.
8858
6695e4b3
L
88592010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8860
8861 PR gold/11996
8862 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8863 "This::" to work around a bug in gcc 4.2.
8864
8865 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8866
0f72bf6f
RÁE
88672010-09-09 Rafael Espindola <espindola@google.com>
8868
8869 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8870 sections with different PF_X flags in the same segment.
8871 (Layout::find_first_load_seg): Search all segments to find the first
8872 one.
8873 * options.h (rosegment): New.
8874
88752010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8876
05a79166 8877 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8878
aa98ff75
DK
88792010-09-08 Doug Kwan <dougkwan@google.com>
8880
8881 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8882 (Arm_relobj::do_relocate_sections): Add new parameter for output
8883 file to match the parent.
8884 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8885 of local symbols instead of input values. Update code to track
8886 changes in gold::relocate_section.
8887 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8888 (Sized_relobj::compute_final_local_value_internal): New methods.
8889 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8890 body into private version of Sized_relobj::compute_final_local_value.
8891 Call the inline method.
8892 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8893 merged symbol value if there is one.
8894 (Symbol_value::has_output_value): New method defintiion.
8895 (Sized_relobj::Compute_final_local_value_status): New enum type.
8896 (Sized_relobj::compute_final_local_value): New methods.
8897 (Sized_relobj::compute_final_local_value_internal): New methods.
8898 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8899 and arm_cortex_a8.sh.
8900 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8901 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8902 New tests.
8903 * Makefile.in: Regenerate.
8904 * testsuite/arm_bl_out_of_range.s: Update test.
8905 * testsuite/thumb_bl_out_of_range.s: Ditto.
8906 * testsuite/thumb_blx_out_of_range.s: Ditto.
8907 * testsuite/arm_branch_out_of_range.sh: New file.
8908 * testsuite/arm_cortex_a8.sh: Ditto.
8909 * testsuite/arm_cortex_a8_b.s: Ditto.
8910 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8911 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8912 * testsuite/arm_cortex_a8_bl.s: Ditto.
8913 * testsuite/arm_cortex_a8_blx.s: Ditto.
8914 * testsuite/arm_cortex_a8_local.s: Ditto.
8915 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8916 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8917
05a79166
L
89182010-09-08 Rafael Espindola <espindola@google.com>
8919
8920 * Makefile.am (memory_test.stdout): Run readelf with -W.
8921 * Makefile.in: Regenerate.
8922 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8923 64 bit output.
8924
33dbc701
RÁE
89252010-09-08 Rafael Espindola <espindola@google.com>
8926
8927 * script-sections.cc (Script_sections::add_memory_region): Convert
8928 field precision to int.
8929 * script.cc (script_set_section_region, script_set_section_region):
8930 Convert field precision to int.
8931
731ca54a
RÁE
89322010-09-08 Rafael Espindola <espindola@google.com>
8933
8934 * arm.cc (do_finalize_sections): Create the __exidx_start and
8935 __exdix_end symbols even when the section is missing.
8936
7f8cd844
NC
89372010-09-08 Nick Clifton <nickc@redhat.com>
8938
8939 * README: Remove claim that MEMORY is not supported.
8940 * expression.cc (script_exp_function_origin)
8941 (script_exp_function_length): Move from here to ...
8942 * script.cc: ... here.
8943 (script_set_section_region, script_add_memory)
8944 (script_parse_memory_attr, script_include_directive): New
8945 functions.
8946 * script-sections.cc
8947 (class Memory_region): New class.
8948 (class Output_section_definition): Add set_memory_region,
8949 set_section_vma, set_section_lma and get_section_name methods.
8950 (class Script_Sections): Add add_memory_region,
8951 find_memory_region, find_memory_region_origin,
8952 find_memory_region_length and set_memory_region methods.
8953 Have set_section_addresses method walk the list of set memory
8954 regions.
8955 Extend the print methos to display memory regions.
8956 * script-sections.h: Add prototypes for new methods.
8957 Add enum for MEMORY region attributes.
8958 * yyscript.y: Add support for parsing MEMORY regions.
8959 * script-c.h: Add prototypes for new functions.
8960 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8961 * testsuite/Makefile.in: Regenerate.
8962 * testsuite/memory_test.sh: New script.
8963 * testsuite/memory_test.s: New assembler source file.
8964 * testsuite/memory_test.t: New linker script.
8965
a4649286
DK
89662010-08-27 Doug Kwan <dougkwan@google.com>
8967
8968 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8969 reference override an existing dynamic weak reference.
8970 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8971 * testsuite/Makefile.in: Regenerate.
8972 * testsuite/dyn_weak_ref.sh: New file.
8973 * testsuite/dyn_weak_ref_1.c: Ditto.
8974 * testsuite/dyn_weak_ref_2.c: Ditto.
8975
b56648ad
ILT
89762010-08-27 Ian Lance Taylor <iant@google.com>
8977
8978 * incremental.h (class Incremental_input_entry): Add virtual
8979 destructor.
8980
809313cb
ILT
89812010-08-27 Ian Lance Taylor <iant@google.com>
8982
8983 * testsuite/start_lib_test_3.c: Mark t3 as used.
8984
11e32464
NC
89852010-08-27 Nick Clifton <nickc@redhat.com>
8986
8987 * options.cc (version_script): Fix small typo in previous
8988 whitespace tidyup.
8989
ca09d69a
NC
89902010-08-25 Nick Clifton <nickc@redhat.com>
8991
8992 * archive.cc: Formatting fixes: Remove whitespace between
8993 typename and following asterisk. Remove whitespace between
8994 function name and opening parenthesis.
8995 * archive.h: Likewise.
8996 * arm.cc: Likewise.
8997 * attributes.cc: Likewise.
8998 * attributes.h: Likewise.
8999 * common.cc: Likewise.
9000 * copy-relocs.cc: Likewise.
9001 * dirsearch.h: Likewise.
9002 * dynobj.cc: Likewise.
9003 * ehframe.cc: Likewise.
9004 * ehframe.h: Likewise.
9005 * expression.cc: Likewise.
9006 * fileread.cc: Likewise.
9007 * fileread.h: Likewise.
9008 * gc.h: Likewise.
9009 * gold-threads.cc: Likewise.
9010 * gold.cc: Likewise.
9011 * i386.cc: Likewise.
9012 * icf.h: Likewise.
9013 * incremental-dump.cc: Likewise.
9014 * incremental.cc: Likewise.
9015 * layout.cc: Likewise.
9016 * layout.h: Likewise.
9017 * main.cc: Likewise.
9018 * merge.cc: Likewise.
9019 * merge.h: Likewise.
9020 * object.cc: Likewise.
9021 * object.h: Likewise.
9022 * options.cc: Likewise.
9023 * options.h: Likewise.
9024 * output.cc: Likewise.
9025 * output.h: Likewise.
9026 * plugin.cc: Likewise.
9027 * plugin.h: Likewise.
9028 * powerpc.cc: Likewise.
9029 * reloc.cc: Likewise.
9030 * script-c.h: Likewise.
9031 * script-sections.cc: Likewise.
9032 * script.cc: Likewise.
9033 * stringpool.cc: Likewise.
9034 * symtab.cc: Likewise.
9035 * symtab.h: Likewise.
9036 * target.cc: Likewise.
9037 * timer.cc: Likewise.
9038 * timer.h: Likewise.
9039 * version.cc: Likewise.
9040 * x86_64.cc: Likewise.
9041
b8fa8750
NC
90422010-08-24 Nick Clifton <nickc@redhat.com>
9043
9044 PR 11899
9045 * layout.cc (segment_precedes): Sort segments by their physical
9046 addresses, if they have been set.
9047
9919d93b
CC
90482010-08-23 Cary Coutant <ccoutant@google.com>
9049
9050 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9051 symbols data.
9052 (Lib_group::include_member): Unlock object after deleting its
9053 symbols data.
9054 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9055 the bug fixed here.
9056
97b4be1c
CC
90572010-08-19 Neil Vachharajani <nvachhar@google.com>
9058 Cary Coutant <ccoutant@google.com>
9059
9060 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9061 constructor, and set_blocker.
9062 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9063 readsyms_blocker_.
9064 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9065 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9066 * testsuite/Makefile.am (start_lib_test): New test case.
9067 * testsuite/Makefile.in: Regenerate.
9068 * testsuite/start_lib_test_main.c: New file.
9069 * testsuite/start_lib_test_1.c: New file.
9070 * testsuite/start_lib_test_2.c: New file.
9071 * testsuite/start_lib_test_3.c: New file.
9072
dd0b1884
ILT
90732010-08-19 Ian Lance Taylor <iant@google.com>
9074
9075 * Makefile.in: Rebuild with automake 1.11.1.
9076 * aclocal.m4: Likewise.
9077 * testsuite/Makefile.in: Likewise.
9078
7223e9ca
ILT
90792010-08-19 Ian Lance Taylor <iant@google.com>
9080
9081 PR 10893
9082 * i386.cc (class Output_data_plt_i386): Update declarations.
9083 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9084 local_ifuncs_ fields.
9085 (Target_i386::do_plt_section_for_global): New function.
9086 (Target_i386::do_plt_section_for_local): New function.
9087 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9088 parameter; change all callers. Initialize global_ifuncs_ and
9089 local_ifuncs_. If doing a static link define __rel_iplt_start and
9090 __rel_iplt_end.
9091 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9092 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9093 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9094 symbols.
9095 (Target_i386::make_plt_section): New function, broken out of
9096 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9097 (Target_i386::make_plt_entry): Call make_plt_section.
9098 (Target_i386::make_local_ifunc_plt_entry): New function.
9099 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9100 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9101 R_386_IRELATIVE to switch.
9102 (Target_i386::Scan::global): Likewise.
9103 (Target_i386::Relocate::relocate): Likewise.
9104 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9105 switch.
9106 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9107 (Target_x86_64::do_plt_section_for_global): New function.
9108 (Target_x86_64::do_plt_section_for_local): New function.
9109 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9110 parameter; change all callers. If doing a static link define
9111 __rela_iplt_start and __rela_iplt_end.
9112 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9113 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9114 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9115 to point to .plt.
9116 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9117 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9118 switch.
9119 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9120 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9121 R_X86_64_IRELATIVE to switch.
9122 (Target_x86_64::Scan::global): Likewise.
9123 (Target_x86_64::Relocate::relocate): Likewise.
9124 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9125 switch.
9126 * target.h (class Target): Add plt_section_for_global and
9127 plt_section_for_local functions. Add do_plt_section_for_global
9128 and do_plt_section_for_local virtual functions.
9129 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9130 clarifying comments.
9131 (Symbol::use_plt_offset): Handle IFUNC symbol.
9132 * object.cc (Sized_relobj::Sized_relobj): Initialize
9133 local_plt_offsets_.
9134 (Sized_relobj::local_has_plt_offset): New function.
9135 (Sized_relobj::local_plt_offset): New function.
9136 (Sized_relobj::set_local_plt_offset): New function.
9137 (Sized_relobj::do_count): Handle IFUNC symbol.
9138 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9139 a bit away from input_shndx_ field. Add set_is_func_symbol and
9140 is_ifunc_symbol functions.
9141 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9142 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9143 local_plt_offsets_ field.
9144 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9145 * output.h (class Output_section_data): Add non-const
9146 output_section function.
9147 (class Output_data_got): Update declarations.
9148 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9149 Add use_plt_offset parameter to global and local constructors.
9150 Change all callers. Change local_sym_index_ field to 31 bits.
9151 Change GSYM_CODE and CONSTANT_CODE accordingly.
9152 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9153 doing a static link don't set sh_link field.
9154 (Output_data_got::Got_entry::write): Use PLT offset if
9155 appropriate.
9156 (Output_data_got::add_global_plt): New function.
9157 (Output_data_got::add_local_plt): New function.
9158 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9159 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9160 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9161 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9162 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9163 IFUNC conditional.
9164 * testsuite/ifunc-sel.h: New file.
9165 * testsuite/ifuncmain1.c: New file.
9166 * testsuite/ifuncmain1vis.c: New file.
9167 * testsuite/ifuncmod1.c: New file.
9168 * testsuite/ifuncdep2.c: New file.
9169 * testsuite/ifuncmain2.c: New file.
9170 * testsuite/ifuncmain3.c: New file.
9171 * testsuite/ifuncmod3.c: New file.
9172 * testsuite/ifuncmain4.c: New file.
9173 * testsuite/ifuncmain5.c: New file.
9174 * testsuite/ifuncmod5.c: New file.
9175 * testsuite/ifuncmain6pie.c: New file.
9176 * testsuite/ifuncmod6.c: New file.
9177 * testsuite/ifuncmain7.c: New file.
9178 * configure, testsuite/Makefile.in: Rebuild.
9179
56f75c03
ILT
91802010-08-18 Ian Lance Taylor <iant@google.com>
9181
9182 * incremental.cc
9183 (Output_section_incremental_inputs::write_input_files): Add cast
9184 to avoid signed/unsigned comparison warning.
9185 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9186
55455f89
CC
91872010-08-12 Cary Coutant <ccoutant@google.com>
9188
9189 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9190
e2054bcb
ILT
91912010-08-13 Ian Lance Taylor <iant@google.com>
9192
9193 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9194
74f67560
DK
91952010-08-12 Cary Coutant <ccoutant@google.com>
9196 Doug Kwan <dougkwan@google.com>
9197
9198 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9199 defintion overrides non-weak undef, remember that the original undef
9200 is not weak.
9201 * symtab.cc (Symbol_table::sized_write_global): For undef without
9202 an original weak binding, set binding to global in output.
9203 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9204 * testsuite/Makefile.in: Regenerate.
9205 * testsuite/strong_ref_weak_def.sh: New file.
9206 * testsuite/strong_ref_weak_def_1.c: Ditto.
9207 * testsuite/strong_ref_weak_def_2.c: Ditto.
9208
d1238d12
CC
92092010-08-12 Cary Coutant <ccoutant@google.com>
9210
9211 * testsuite/incremental_test.sh: Rewrite.
9212 * testsuite/incremental_test_1.c: Rewrite.
9213 * testsuite/incremental_test_2.c: Rewrite.
9214
0e70b911
CC
92152010-08-12 Cary Coutant <ccoutant@google.com>
9216
9217 * arm.cc (Target_arm::got_size): Add const.
9218 (Target_arm::got_entry_count): New function.
9219 (Target_arm::plt_entry_count): New function.
9220 (Target_arm::first_plt_entry_offset): New function.
9221 (Target_arm::plt_entry_size): New function.
9222 (Output_data_plt_arm::entry_count): New function.
9223 (Output_data_plt_arm::first_plt_entry_offset): New function.
9224 (Output_data_plt_arm::get_plt_entry_size): New function.
9225 * i386.cc (Target_i386::got_size): Add const.
9226 (Target_i386::got_entry_count): New function.
9227 (Target_i386::plt_entry_count): New function.
9228 (Target_i386::first_plt_entry_offset): New function.
9229 (Target_i386::plt_entry_size): New function.
9230 (Output_data_plt_i386::entry_count): New function.
9231 (Output_data_plt_i386::first_plt_entry_offset): New function.
9232 (Output_data_plt_i386::get_plt_entry_size): New function.
9233 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9234 find_incremental_inputs_sections. Dump incremental_got_plt section.
9235 * incremental.cc: Include target.h.
9236 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9237 parameter. Adjust all callers. Find incremental_got_plt section.
9238 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9239 section.
9240 (Output_section_incremental_inputs::set_final_data_size): Calculate
9241 size of incremental_got_plt section.
9242 (Output_section_incremental_inputs::do_write): Write the
9243 incremental_got_plt section.
9244 (Got_plt_view_info): New struct.
9245 (Local_got_offset_visitor): New class.
9246 (Global_got_offset_visitor): New class.
9247 (Global_symbol_visitor_got_plt): New class.
9248 (Output_section_incremental_inputs::write_got_plt): New function.
9249 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9250 Add parameter. Adjust all callers.
9251 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9252 (Incremental_inputs::got_plt_section): New function.
9253 (Incremental_inputs::got_plt_section_): New data member.
9254 (Incremental_got_plt_reader): New class.
9255 * layout.cc (Layout::create_incremental_info_sections): Add the
9256 incremental_got_plt section.
9257 * object.h (Got_offset_list::get_list): New function.
9258 (Got offset_list::for_all_got_offsets): New function.
9259 (Sized_relobj::local_got_offset_list): New function.
9260 * powerpc.cc (Target_powerpc::got_size): Add const.
9261 (Target_powerpc::got_entry_count): New function.
9262 (Target_powerpc::plt_entry_count): New function.
9263 (Target_powerpc::first_plt_entry_offset): New function.
9264 (Target_powerpc::plt_entry_size): New function.
9265 (Output_data_plt_powerpc::entry_count): New function.
9266 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9267 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9268 * sparc.cc (Target_sparc::got_size): Add const.
9269 (Target_sparc::got_entry_count): New function.
9270 (Target_sparc::plt_entry_count): New function.
9271 (Target_sparc::first_plt_entry_offset): New function.
9272 (Target_sparc::plt_entry_size): New function.
9273 (Output_data_plt_sparc::entry_count): New function.
9274 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9275 (Output_data_plt_sparc::get_plt_entry_size): New function.
9276 * symtab.h (Symbol::got_offset_list): New function.
9277 (Symbol_table::for_all_symbols): New function.
9278 * target.h (Sized_target::got_entry_count): New function.
9279 (Sized_target::plt_entry_count): New function.
9280 (Sized_target::plt_entry_size): New function.
9281 * x86_64.cc (Target_x86_64::got_size): Add const.
9282 (Target_x86_64::got_entry_count): New function.
9283 (Target_x86_64::plt_entry_count): New function.
9284 (Target_x86_64::first_plt_entry_offset): New function.
9285 (Target_x86_64::plt_entry_size): New function.
9286 (Output_data_plt_x86_64::entry_count): New function.
9287 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9288 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9289
09ec0418
CC
92902010-08-12 Cary Coutant <ccoutant@google.com>
9291
9292 * archive.cc: Include incremental.h.
9293 (Archive::Archive): Initialize incremental_info_.
9294 (Archive::include_member): Record archive members in incremental info.
9295 (Add_archive_symbols::run): Record begin and end of an archive in
9296 incremental info.
9297 (Lib_group::include_member): Record objects in incremental info.
9298 * archive.h (Incremental_archive_entry): Forward declaration.
9299 (Archive::set_incremental_info): New member function.
9300 (Archive::incremental_info): New member function.
9301 (Archive::Unused_symbol_iterator): New class.
9302 (Archive::unused_symbols_begin): New member function.
9303 (Archive::unused_symbols_end): New member function.
9304 (Archive::incremental_info_): New data member.
9305 * incremental-dump.cc (find_input_containing_global): New function.
9306 (dump_incremental_inputs): Dump new incremental info sections.
9307 * incremental.cc: Include symtab.h.
9308 (Output_section_incremental_inputs): New class.
9309 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9310 new incremental info sections.
9311 (Sized_incremental_binary::do_check_inputs): Likewise.
9312 (Incremental_inputs::report_archive): Remove.
9313 (Incremental_inputs::report_archive_begin): New function.
9314 (Incremental_inputs::report_archive_end): New function.
9315 (Incremental_inputs::report_object): New function.
9316 (Incremental_inputs::finalize_inputs): Remove.
9317 (Incremental_inputs::report_input_section): New function.
9318 (Incremental_inputs::report_script): Rewrite.
9319 (Incremental_inputs::finalize): Do nothing but finalize string table.
9320 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9321 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9322 (Incremental_inputs::create_data_sections): New function.
9323 (Incremental_inputs::relocs_entsize): New function.
9324 (Output_section_incremental_inputs::set_final_data_size): New function.
9325 (Output_section_incremental_inputs::do_write): New function.
9326 (Output_section_incremental_inputs::write_header): New function.
9327 (Output_section_incremental_inputs::write_input_files): New function.
9328 (Output_section_incremental_inputs::write_info_blocks): New function.
9329 (Output_section_incremental_inputs::write_symtab): New function.
9330 * incremental.h (Incremental_script_entry): Forward declaration.
9331 (Incremental_object_entry): Forward declaration.
9332 (Incremental_archive_entry): Forward declaration.
9333 (Incremental_inputs): Forward declaration.
9334 (Incremental_inputs_header_data): Remove.
9335 (Incremental_inputs_header): Remove.
9336 (Incremental_inputs_header_write): Remove.
9337 (Incremental_inputs_entry_data): Remove.
9338 (Incremental_inputs_entry): Remove.
9339 (Incremental_inputs_entry_write): Remove.
9340 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9341 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9342 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9343 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9344 Likewise.
9345 (Incremental_input_entry): New class.
9346 (Incremental_script_entry): New class.
9347 (Incremental_object_entry): New class.
9348 (Incremental_archive_entry): New class.
9349 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9350 (Incremental_inputs::report_inputs): Remove.
9351 (Incremental_inputs::report_archive): Remove.
9352 (Incremental_inputs::report_archive_begin): New function.
9353 (Incremental_inputs::report_archive_end): New function.
9354 (Incremental_inputs::report_object): Change prototype.
9355 (Incremental_inputs::report_input_section): New function.
9356 (Incremental_inputs::report_script): Change prototype.
9357 (Incremental_inputs::get_reloc_count): New function.
9358 (Incremental_inputs::set_reloc_count): New function.
9359 (Incremental_inputs::create_data_sections): New function.
9360 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9361 (Incremental_inputs::inputs_section): New function.
9362 (Incremental_inputs::symtab_section): New function.
9363 (Incremental_inputs::relocs_section): New function.
9364 (Incremental_inputs::get_stringpool): Add const.
9365 (Incremental_inputs::command_line): Add const.
9366 (Incremental_inputs::inputs): Remove.
9367 (Incremental_inputs::command_line_key): New function.
9368 (Incremental_inputs::input_file_count): New function.
9369 (Incremental_inputs::input_files): New function.
9370 (Incremental_inputs::relocs_entsize): New function.
9371 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9372 (Incremental_inputs::finalize_inputs): Remove.
9373 (Incremental_inputs::Input_info): Remove.
9374 (Incremental_inputs::lock_): Remove.
9375 (Incremental_inputs::inputs_): Change type.
9376 (Incremental_inputs::inputs_map_): Remove.
9377 (Incremental_inputs::current_object_entry_): New data member.
9378 (Incremental_inputs::inputs_section_): New data member.
9379 (Incremental_inputs::symtab_section_): New data member.
9380 (Incremental_inputs::relocs_section_): New data member.
9381 (Incremental_inputs::reloc_count_): New data member.
9382 (Incremental_inputs_reader): New class.
9383 (Incremental_symtab_reader): New class.
9384 (Incremental_relocs_reader): New class.
9385 * layout.cc (Layout::finalize): Move finalization of incremental info
9386 and creation of incremental info sections to follow finalization of
9387 symbol table. Set offsets for postprocessing sections.
9388 (Layout::create_incremental_info_sections): Call
9389 Incremental_inputs::create_data_sections. Add incremental symtab
9390 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9391 sections to layout after input sections.
9392 * layout.h (struct Timespec): Forward declaration.
9393 (Layout::incremental_inputs): Add const.
9394 (Layout::create_incremental_info_sections): Add parameter.
9395 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9396 * object.cc: Include incremental.h.
9397 (Relobj::finalize_incremental_relocs): New function.
9398 (Sized_relobj::do_layout): Record input sections in incremental info.
9399 * object.h (Object::output_section): New function.
9400 (Object::output_section_offset): Moved from Relobj.
9401 (Object::get_incremental_reloc_base): New function.
9402 (Object::get_incremental_reloc_count): New function.
9403 (Object::do_output_section): New function.
9404 (Object::do_output_section_offset): Moved from Relobj.
9405 (Object::do_get_incremental_reloc_base): New function.
9406 (Object::do_get_incremental_reloc_count): New function.
9407 (Object::Object): Initialize new data members.
9408 (Relobj::output_section): Renamed do_output_section and moved to
9409 protected.
9410 (Relobj::output_section_offset): Moved to Object.
9411 (Relobj::do_get_incremental_reloc_base): New function.
9412 (Relobj::do_get_incremental_reloc_count): New function.
9413 (Relobj::allocate_incremental_reloc_counts): New function.
9414 (Relobj::count_incremental_reloc): New function.
9415 (Relobj::finalize_incremental_relocs): New function.
9416 (Relobj::next_incremental_reloc_index): New function.
9417 (Relobj::reloc_counts_): New data member.
9418 (Relobj::reloc_bases_): New data member.
9419 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9420 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9421 (Sized_relobj::incremental_relocs_scan): New function.
9422 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9423 (Sized_relobj::incremental_relocs_write): New function.
9424 (Sized_relobj::incremental_relocs_write_reltype): New function.
9425 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9426 incremental link.
9427 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9428 archives and object files elsewhere.
9429 (Add_symbols::run): Report object files here.
9430 (Finish_group::run): Report end of archive at end of group.
9431 * reloc.cc: Include layout.h, incremental.h.
9432 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9433 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9434 (Sized_relobj::incremental_relocs_scan): New function.
9435 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9436 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9437 (Sized_relobj::incremental_relocs_write): New function.
9438 (Sized_relobj::incremental_relocs_write_reltype): New function.
9439 * script.cc (read_input_script): Rewrite test for incremental link.
9440 Change call to Incremental_inputs::report_script.
9441 * symtab.h (Symbol_table::first_global_index): New function.
9442 (Symbol_table::output_count): New function.
9443
ce0d1972
DK
94442010-08-12 Doug Kwan <dougkwan@google.com>
9445
9446 * arm.cc (Target_arm::merge_object_attributes): Check command line
9447 options --no-wchar-size-warning and --no-enum-size-warning.
9448 * options.h (General_options): Add ld-compatible options
9449 --no-enum-size-warning and --no-wchar-size-warning.
9450
6e5710ce
ILT
94512010-08-04 Ian Lance Taylor <iant@google.com>
9452
9453 * x86_64.cc (Target_x86_64::Scan::local): Use
9454 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9455 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9456 (Target_x86_64::Scan::global): Likewise.
9457 (Target_x86_64::Relocate::relocate): Likewise.
9458 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9459 Likewise.
9460
fef830db
CC
94612010-08-03 Cary Coutant <ccoutant@google.com>
9462
9463 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9464 to reserve space in merged_strings vector. Keep total input size
9465 for stats.
9466 (Output_merge_string::do_print_merge_stats): Print total input size.
9467 * merge.h (Output_merge_string): Add input_size_ field.
9468 * stringpool.cc (Stringpool_template::string_length): Move
9469 implementations out of Stringpool_template class and place in
9470 stringpool.h.
9471 * stringpool.h (string_length): Move out of Stringpool_template.
9472
1e3811b0
ILT
94732010-08-03 Ian Lance Taylor <iant@google.com>
9474
9475 PR 11712
9476 * layout.cc (relaxation_loop_body): If address of load segment is
9477 set, adjust address to include headers if possible.
9478
7af0c620
ILT
94792010-08-03 Ian Lance Taylor <iant@google.com>
9480
9481 * version.cc (version_string): Bump to 1.10.
9482
22f0da72
ILT
94832010-08-03 Ian Lance Taylor <iant@google.com>
9484
9485 PR 11805
9486 * layout.h (enum Output_section_order): Define.
9487 (class Layout): Update declarations.
9488 * layout.cc (Layout::get_output_section): Add order parameter.
9489 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9490 is_first_non_relro parameters. Change all callers.
9491 (Layout::choose_output_section): Likewise.
9492 (Layout::add_output_section_data): Likewise.
9493 (Layout::make_output_section): Likewise. Set order.
9494 (Layout::default_section_order): New function.
9495 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9496 * output.cc (Output_section::Output_section): Initialize order_.
9497 Don't initialize deleted fields.
9498 (Output_segment::Output_segment): Don't initialize deleted
9499 fields.
9500 (Output_segment::add_output_section_to_load): New function
9501 replacing add_output_section. Change all callers to call this or
9502 add_output_section_to_nonload.
9503 (Output_segment::add_output_section_to_nonload): New function.
9504 (Output_segment::remove_output_section): Rewrite.
9505 (Output_segment::add_initial_output_data): Likewise.
9506 (Output_segment::has_any_data_sections): Likewise.
9507 (Output_segment::is_first_section_relro): Likewise.
9508 (Output_segment::maximum_alignment): Likewise.
9509 (Output_segment::has_dynamic_reloc): New function replacing
9510 dynamic_reloc_count. Change all callers.
9511 (Output_segment::has_dynamic_reloc_list): New function replacing
9512 dynamic_reloc_count_list. Change all callers.
9513 (Output_segment::set_section_addresses): Rewrite.
9514 (Output_segment::set_offset): Rewrite.
9515 (Output_segment::find_first_and_last_list): Remove.
9516 (Output_segment::set_tls_offsets): Rewrite.
9517 (Output_segment::first_section_load_address): Likewise.
9518 (Output_segment::output_section_count): Likewise.
9519 (Output_segment::section_with_lowest_load_address): Likewise.
9520 (Output_segment::write_section_headers): Likewise.
9521 (Output_segment::print_sections_to_map): Likewise.
9522 * output.h (class Output_data): Remove dynamic_reloc_count_
9523 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9524 (Output_data::add_dynamic_reloc): Rewrite.
9525 (Output_data::has_dynamic_reloc): New function.
9526 (Output_data::dynamic_reloc_count): Remove.
9527 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9528 is_last_relro_, is_first_non_relro_, is_interp_,
9529 is_dynamic_linker_section_ fields. Add order and set_order
9530 functions. Remove is_relro_local, set_is_relro_local,
9531 is_last_relro, set_is_last_relro, is_first_non_relro,
9532 set_is_first_non_relro functions, is_interp, set_is_interp,
9533 is_dynamic_linker_section, and set_is_dynamic_linker_section
9534 functions.
9535 (class Output_segment): Change Output_data_list from std::list to
9536 std:;vector. Add output_lists_ field. Remove output_data_ and
9537 output_bss_ fields. Update declarations.
9538
3ff2ccb0
ILT
95392010-08-02 Ian Lance Taylor <iant@google.com>
9540
9541 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9542 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9543 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9544
88a4108b
ILT
95452010-08-02 Ian Lance Taylor <iant@google.com>
9546
9547 PR 11855
9548 * script.cc (Script_options::Script_options): Initialize
9549 symbol_definitions_ and symbol_references_.
9550 (Script_options::add_symbol_assignment): Update
9551 symbol_definitions_ and symbol_references_.
9552 (Script_options::add_symbol_reference): New function.
9553 (script_symbol): New function.
9554 * script.h (class Script_options): Add symbol_definitions_ and
9555 symbol_references_ fields.
9556 (Script_options::referenced_const_iterator): New type.
9557 (Script_options::referenced_begin): New function.
9558 (Script_options::referenced_end): New function.
9559 (Script_options::is_referenced): New function.
9560 (Script_options::any_unreferenced): New function.
9561 * script-c.h (script_symbol): Declare.
9562 * yyscript.y (exp): Call script_symbol.
9563 * symtab.cc: Include "script.h".
9564 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9565 Change all callers. Check symbols referenced by scripts.
9566 (Symbol_table::add_undefined_symbols_from_command_line): Add
9567 layout parameter. Change all callers.
9568 (Symbol_table::do_add_undefined_symbols_from_command_line):
9569 Likewise. Break out loop body. Check symbols referenced by
9570 scripts.
9571 (Symbol_table::add_undefined_symbol_from_command_line): New
9572 function broken out of
9573 do_add_undefined_symbols_from_command_line.
9574 * symtab.h (class Symbol_table): Update declarations.
9575 * archive.cc: Include "layout.h".
9576 (Archive::should_include_member): Add layout parameter. Change
9577 all callers. Check for symbol mentioned in expression.
9578 * archive.h (class Archive): Update declaration.
9579 * object.cc (Sized_relobj::do_should_include_member): Add layout
9580 parameter.
9581 * object.h (Object::should_include_member): Add layout parameter.
9582 Change all callers.
9583 (Object::do_should_include_member): Add layout parameter.
9584 (class Sized_relobj): Update declaration.
9585 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9586 parameter.
9587 * dynobj.h (class Sized_dynobj): Update declaration.
9588 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9589 layout parameter.
9590 * plugin.h (class Sized_pluginobj): Update declaration.
9591
5f1ab67a
ILT
95922010-08-02 Ian Lance Taylor <iant@google.com>
9593
9594 PR 11866
9595 * output.cc (Output_segment::set_offset): Search for the first and
9596 last sections rather than assuming that the list is in order.
9597 (Output_segment::find_first_and_last_list): New function.
9598 * output.h (class Output_segment): Update declarations.
9599 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9600 (relro_strip_test_SOURCES): New variable.
9601 (relro_strip_test_DEPENDENCIES): New variable.
9602 (relro_strip_test_LDFLAGS): New variable.
9603 (relro_strip_test_LDADD): New variable.
9604 (relro_strip_test.so): New target.
9605
a8df5856
ILT
96062010-08-02 Ian Lance Taylor <iant@google.com>
9607
9608 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9609 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9610 (Target_i386::got_tlsdesc_section): New function.
9611 (Target_i386::got_section): Create space for GOT entries for
9612 TLSDESC relocations.
9613 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9614 R_386_TLS_GOTDESC.
9615 (Target_i386::Scan::global): Likewise.
9616 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9617 using TLSDESC GOT.
9618 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9619 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9620 (Target_x86_64::got_tlsdesc_section): New function.
9621 (Target_x86_64::got_section): Create space for GOT entries for
9622 TLSDESC relocations.
9623 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9624 R_386_TLS_GOTDESC.
9625 (Target_x86_64::Scan::global): Likewise.
9626 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9627 using TLSDESC GOT.
9628
0c10a0a6
ILT
96292010-08-02 Ian Lance Taylor <iant@google.com>
9630
9631 * testsuite/final_layout.sh: Use dc to convert from hex to
9632 decimal.
9633
41cbeecc
ST
96342010-07-29 Sriraman Tallam <tmsriram@google.com>
9635
9636 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9637 paramter to the call to gold::gc_process_relocs.
9638 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9639 paramter to the call to gold::gc_process_relocs.
9640 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9641 parameter to the call to gold::gc_process_relocs.
9642 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9643 template parameter to the call to gold::gc_process_relocs.
9644 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9645 paramter to the call to gold::gc_process_relocs.
9646 * gc.h (get_embedded_addend_size): New function.
9647 (gc_process_relocs): Save the size of the reloc for use by ICF.
9648 * icf.cc (get_section_contents): Get the addend from the text section
9649 for SHT_REL relocation sections.
9650 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9651 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9652 * int_encoding.h (read_from_pointer): New overloaded function.
9653 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9654 * testsuite/icf_sht_rel_addend_test.sh: New file.
9655 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9656 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9657
6ea55b82
RW
96582010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9659
9660 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9661 * Makefile.in: Regenerate.
9662 * testsuite/Makefile.in: Regenerate.
9663
9691462b
ILT
96642010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9665
9666 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9667 * gold/testsuite/debug_msg.cc: Likewise.
9668 * gold/testsuite/odr_violation1.cc
9669 * gold/testsuite/odr_violation2.cc
9670
76897331
CC
96712010-07-21 Cary Coutant <ccoutant@google.com>
9672
9673 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9674 string, and length fields.
9675 (Output_merge_string::Merged_strings_list): New type.
9676 (Output_merge_string::Merged_strings_lists): New typedef.
9677 (Output_merge_string): Replace merged_strings_ with
9678 merged_strings_lists_.
9679 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9680 Merged_strings_list per input object and section. Don't store pointer
9681 to the string. Don't store length with each merged string entry.
9682 (Output_merge_string::finalize_merged_data): Loop over list of merged
9683 strings lists. Recompute length of each merged string.
9684
78384e8f
CC
96852010-07-15 Cary Coutant <ccoutant@google.com>
9686
9687 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9688 here.
9689
783659f9
ILT
96902010-07-14 Ian Lance Taylor <iant@google.com>
9691
9692 * descriptors.cc (Descriptors::open): Report correct name in error
9693 message.
9694
131687b4
DK
96952010-07-13 Doug Kwan <dougkwan@google.com>
9696
9697 * arm.cc (Arm_input_section::Arm_input_section): For a
9698 SHT_ARM_EXIDX section, always keeps the input sections.
9699 (Arm_input_section::set_exidx_section_link): New method.
9700 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9701 has_errors_ to false.
9702 (Arm_exidx_input_section::has_errors,
9703 Arm_exidx_input_section::set_has_errors): New methods.
9704 (Arm_exidx_input_section::has_errors_): New data member.
9705 (Arm_relobj::get_exidx_shndx_list): New method.
9706 (Arm_output_section::append_text_sections_to_list): Do not skip
9707 section without SHF_EXECINSTR.
9708 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9709 errors.
2e702c99 9710 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9711 section header. Make error messages more verbose. Check for
9712 a non-executable section linked to an EXIDX section.
9713 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9714 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9715 check that there is no deferred EXIDX section if we exit early.
9716 Instead of not making an EXIDX section in case of an error, make one
9717 and set the has_errors flag of it.
9718 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9719 in a relocatable link.
9720 (Target_arm::do_relax): Look for the EXIDX output section instead of
9721 assuming that it is called .ARM.exidx.
2e702c99 9722 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9723 section list. Do not check for SHF_EXECINSTR section flags but
9724 skip any input section with errors.
9725 * output.cc (Output_section::Output_section): Initialize
9726 always_keeps_input_sections_ to false.
9727 (Output_section::add_input_section): Check for
9728 always_keeps_input_sections_.
9729 * output.h (Output_section::always_keeps_input_sections,
9730 Output_section::set_always_keeps_input_sections): New methods.
9731 (Output_section::always_keeps_input_sections): New data member.
9732
69517287
RÁE
97332010-07-13 Rafael Espindola <espindola@google.com>
9734
9735 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9736 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9737
82742395
ILT
97382010-07-13 Philip Herron <herron.philip@googlemail.com>
9739 Ian Lance Taylor <iant@google.com>
9740
9741 * output.h (Output_section_lookup_maps::add_merge_section):
9742 Correct check of whether value was inserted.
9743 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9744 (Output_section_lookup_maps::add_relaxed_input_section):
9745 Likewise.
9746 * arm.cc (Target_arm::got_section): Remove used local os.
9747 * i386.cc (Target_i386::got_section): Likewise.
9748 * x86_64.cc (Target_x86_64::got_section): Likewise.
9749 * sparc.cc (Target_sparc::got_section): Likewise.
9750 (Target_sparc::relocate): Remove unused local have_got_offset.
9751 * powerpc.cc (Target_powerpc::relocate): Likewise.
9752
f2d707b5
ILT
97532010-07-13 Ian Lance Taylor <iant@google.com>
9754
241531d6
ILT
9755 * compressed_output.cc (zlib_decompress): Fix signature in
9756 !HAVE_ZLIB_H case.
9757
f2d707b5
ILT
9758 * archive.cc (Archive::include_member): Unlock an external member
9759 of a thin archive. Don't bother to delete an object we know is
9760 NULL.
9761
a2e47362
CC
97622010-07-12 Cary Coutant <ccoutant@google.com>
9763
9764 * compressed_output.cc (zlib_decompress): New function.
9765 (get_uncompressed_size): New function.
9766 (decompress_input_section): New function.
9767 * compressed_output.h (get_uncompressed_size): New function.
9768 (decompress_input_section): New function.
9769 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9770 Handle compressed debug sections.
9771 * layout.cc (is_compressed_debug_section): New function.
9772 (Layout::output_section_name): Map compressed section names to
9773 canonical names.
9774 * layout.h (is_compressed_debug_section): New function.
9775 (is_debug_info_section): Recognize compressed debug sections.
9776 * merge.cc: Include compressed_output.h.
9777 (Output_merge_data::do_add_input_section): Handle compressed
9778 debug sections.
9779 (Output_merge_string::do_add_input_section): Handle compressed
9780 debug sections.
9781 * object.cc: Include compressed_output.h.
9782 (Sized_relobj::Sized_relobj): Initialize new data members.
9783 (build_compressed_section_map): New function.
9784 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9785 * object.h (Object::section_is_compressed): New method.
9786 (Object::do_section_is_compressed): New method.
9787 (Sized_relobj::Compressed_section_map): New type.
9788 (Sized_relobj::do_section_is_compressed): New method.
9789 (Sized_relobj::compressed_sections_): New data member.
9790 * output.cc (Output_section::add_input_section): Handle compressed
9791 debug sections.
9792 * reloc.cc: Include compressed_output.h.
9793 (Sized_relobj::write_sections): Handle compressed debug sections.
9794
ce279a62
CC
97952010-07-08 Cary Coutant <ccoutant@google.com>
9796
9797 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9798 weak when resolving to a dynamic def.
9799 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9800 for weak undef/dynamic def cases. Adjust callers.
9801 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9802 undef_binding_weak_.
9803 (Symbol_table::sized_write_globals): Adjust symbol binding.
9804 (Symbol_table::sized_write_symbol): Add binding parameter.
9805 * symtab.h (Symbol::set_undef_binding): New method.
9806 (Symbol::is_undef_binding_weak): New method.
9807 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9808 (Symbol_table::should_override): Add new parameter.
9809 (Symbol_table::sized_write_symbol): Add new parameter.
9810
9811 * testsuite/weak_undef_file1.cc: Add new test case.
9812 * testsuite/weak_undef_file2.cc: Fix header comment.
9813 * testsuite/weak_undef_test.cc: Add new test case.
9814
b2286c10
DK
98152010-06-29 Doug Kwan <dougkwan@google.com>
9816
9817 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9818 Initialize USE_SYMBOL_.
9819 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9820 definition.
9821 (Arm_reloc_property::uses_symbol_): New data member declaration.
9822 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9823 uses symbol value and symbol is undefined but not weakly undefined.
9824
4802450a
RÁE
98252010-06-28 Rafael Espindola <espindola@google.com>
9826
9827 * plugin.cc (Plugin::load): Use dlerror.
9828
e5ca47ba
ILT
98292010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9830
9831 * symtab.cc (detect_odr_violations): When reporting an ODR
9832 violation, report an object where the symbol is defined.
9833
8a75a161
DK
98342010-06-25 Doug Kwan <dougkwan@google.com>
9835
9836 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9837 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9838 definition.
9839 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9840 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9841 target hook to detect function points.
9842 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9843 * icf.h (Icf::check_section_for_function_pointers): Change type of
9844 parameter SECTION_NAME to const reference to std::string. Use
9845 target hook to determine if section may have unsafe pointers.
9846 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9847 method definition.
9848
42218b9f
RÁE
98492010-06-21 Rafael Espindola <espindola@google.com>
9850
9851 * fileread.cc (Input_file::find_fie): New
9852 (Input_file::open): Use Input_file::find_fie.
9853 * fileread.h (Input_file::find_fie): New
9854 * plugin.cc (set_extra_library_path): New.
9855 (Plugin::load): Add set_extra_library_path to the transfer vector.
9856 (Plugin_manager::set_extra_library_path): New.
9857 (Plugin_manager::add_input_file): Use the extra search path if set.
9858 (set_extra_library_path(): New.
9859 * plugin.h (Plugin_manager): Add set_extra_library_path and
9860 extra_search_path_.
9861
a0506cca
CC
98622010-06-19 Cary Coutant <ccoutant@google.com>
9863
9864 * layout.cc (gdb_sections): Add .debug_types.
9865 (lines_only_debug_sections): Likewise.
9866
6508b958
RÁE
98672010-06-18 Rafael Espindola <espindola@google.com>
9868
9869 * plugin.cc (add_input_file,add_input_library)
9870 (Plugin_manager::add_input_file): Make filename arguments const.
9871 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9872 const.
9873
3e235302
DK
98742010-06-16 Doug Kwan <dougkwan@google.com>
9875
9876 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9877 .ARM.attributes section if we have not merged any input
9878 attributes sections.
9879
106e8a6c
DK
98802010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9881
9882 * arm.cc: Allow combining objects with no EABI version
9883 information.
9884
91ff43fe
RÁE
98852010-06-15 Rafael Espindola <espindola@google.com>
9886
9887 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9888
68ed838c
ILT
98892010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9890
9891 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9892 (struct iovec): Correct !HAVE_READV definition.
9893
f3a2388f
CC
98942010-06-10 Cary Coutant <ccoutant@google.com>
9895
9896 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9897 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9898 reloc sections.
9899 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9900
9901 PR 11683
9902 * symtab.h (Symbol::is_placeholder): New member function.
9903 * target-reloc.h (relocate_section): Check for placeholder symbols.
9904
9905 * testsuite/Makefile.am (plugin_test_8): New test.
9906 (plugin_test_9): New test.
9907 * testsuite/Makefile.in: Regenerate.
9908
e1df38aa
NC
99092010-06-09 Nick Clifton <nickc@redhat.com>
9910
9911 * yyscript.y (input_list_element): Allow strings prefixed with
9912 the '-' character. Treat these as libraries.
9913 * script.cc (script_add_library): New function. Adds a library
9914 specified by "-l<name>" found in an input script.
9915 * script-c.h: Add prototype for script_add_library.
9916
25bbe950
DK
99172010-06-07 Doug Kwan <dougkwan@google.com>
9918
9919 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9920 Restrict stub-group size to be within long conditional branch
9921 range when working around cortex-A8 erratum.
9922
0f32ea4c
ILT
99232010-06-07 Damien Diederen <dd@crosstwine.com>
9924
9925 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9926 #ifdef typo.
9927
8fe2a369
ST
99282010-06-03 Sriraman Tallam <tmsriram@google.com>
9929
9930 PR gold/11658
9931 * output.cc
9932 (Output_section::Input_section_sort_entry::compare_section_ordering):
9933 Change to return non-zero correctly.
9934 (Output_section::Input_section_sort_section_order_index_compare
9935 ::operator()): Change to fix ambiguity in comparisons.
9936
6e9ba2ca
ST
99372010-06-01 Sriraman Tallam <tmsriram@google.com>
9938
9939 * gold.h (is_wildcard_string): New function.
9940 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9941 (Layout::layout_eh_frame): Ditto.
9942 (Layout::find_section_order_index): New method.
9943 (Layout::read_layout_from_file): New method.
9944 * layout.h (Layout::find_section_order_index): New method.
9945 (Layout::read_layout_from_file): New method.
9946 (Layout::input_section_position_): New private member.
9947 (Layout::input_section_glob_): New private member.
9948 * main.cc (main): Call read_layout_from_file here.
9949 * options.h (--section-ordering-file): New option.
9950 * output.cc (Output_section::input_section_order_specified_): New
9951 member.
9952 (Output_section::Output_section): Initialize new member.
9953 (Output_section::add_input_section): Add new parameter.
9954 Keep input sections when --section-ordering-file is used.
9955 (Output_section::set_final_data_size): Sort input sections when
9956 section ordering file is specified.
9957 (Output_section::Input_section_sort_entry): Add new parameter.
9958 Check sorting type.
9959 (Output_section::Input_section_sort_entry::compare_section_ordering):
9960 New method.
9961 (Output_section::Input_section_sort_compare::operator()): Change to
9962 consider section_order_index.
9963 (Output_section::Input_section_sort_init_fini_compare::operator()):
9964 Change to consider section_order_index.
9965 (Output_section::Input_section_sort_section_order_index_compare
9966 ::operator()): New method.
9967 (Output_section::sort_attached_input_sections): Change to sort
9968 according to section order when specified.
e1df38aa
NC
9969 (Output_section::add_input_section<32, true>): Add new parameter.
9970 (Output_section::add_input_section<64, true>): Add new parameter.
9971 (Output_section::add_input_section<32, false>): Add new parameter.
9972 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9973 * output.h (Output_section::add_input_section): Add new parameter.
9974 (Output_section::input_section_order_specified): New
9975 method.
9976 (Output_section::set_input_section_order_specified): New method.
9977 (Input_section::Input_section): Initialize section_order_index_.
9978 (Input_section::section_order_index): New method.
9979 (Input_section::set_section_order_index): New method.
9980 (Input_section::section_order_index_): New member.
9981 (Input_section::Input_section_sort_section_order_index_compare): New
9982 struct.
9983 (Output_section::input_section_order_specified_): New member.
9984 * script-sections.cc (is_wildcard_string): Delete and move modified
9985 method to gold.h.
9986 (Output_section_element_input::Output_section_element_input): Modify
9987 call to is_wildcard_string.
9988 (Output_section_element_input::Input_section_pattern
9989 ::Input_section_pattern): Ditto.
9990 (Output_section_element_input::Output_section_element_input): Ditto.
9991 * testsuite/Makefile.am (final_layout): New test case.
9992 * testsuite/Makefile.in: Regenerate.
9993 * testsuite/final_layout.cc: New file.
9994 * testsuite/final_layout.sh: New file.
9995
3537c84b
RÁE
99962010-06-01 Rafael Espindola <espindola@google.com>
9997
9998 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9999
105b6afd
RÁE
100002010-06-01 Rafael Espindola <espindola@google.com>
10001
10002 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10003 visibility of symbols.
10004
29e11421
DK
100052010-05-27 Doug Kwan <dougkwan@google.com>
10006
10007 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10008 from start of output section instead of address for a local symbol
10009 in a merged or relaxed section when doing a relocatable link.
10010
5e0f337e
RÁE
100112010-05-26 Rafael Espindola <espindola@google.com>
10012
703d02da 10013 PR 11604
5e0f337e
RÁE
10014 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10015 adding sections the garbage collector removed.
10016 * gold/testsuite/Makefile.am: Add test.
10017 * gold/testsuite/Makefile.in: Regenerate.
10018 * gold/testsuite/plugin_test_7.sh: New.
10019 * gold/testsuite/plugin_test_7_1.c: New.
10020 * gold/testsuite/plugin_test_7_2.c: New.
10021
f4187277
RÁE
100222010-05-26 Rafael Espindola <espindola@google.com>
10023
10024 * script-sections.cc (Output_section_definition::set_section_addresses):
10025 Check for --section-start.
10026
5c388529
DK
100272010-05-26 Doug Kwan <dougkwan@google.com>
10028
10029 * arm.cc (Arm_scan_relocatable_relocs): New class.
10030 (Target_arm::relocate_special_relocatable): New method.
10031 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10032 (Arm_relocate_functions::thumb_branch_common): Same.
10033 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10034 instead of Default_scan_relocatable_relocs.
10035 * target-reloc.h (relocate_for_relocatable): Let target handle
10036 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10037 * target.h (Sized_target::relocate_special_relocatable): New method.
10038
bca1c3ae
ILT
100392010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10040
10041 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10042
0439c796
DK
100432010-05-23 Doug Kwan <dougkwan@google.com>
10044
10045 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10046 instead of a cast.
10047 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10048 with a direct branch, not a conditional branch, to a stub.
10049 * merge.cc (Output_merge_base::record_input_section): New method
10050 defintion.
10051 (Output_merge_data::do_add_input_section): Record input section if
10052 keeps-input-sections flag is set.
10053 (Output_merge_string::do_add_input_section): Ditto.
10054 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10055 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10056 INPUT_SECTIONS_.
10057 (Output_merge_base::keeps_input_sections,
10058 Output_merge_base::set_keeps_input_sections,
10059 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10060 method definitions.
10061 (Output_merge_base::Input_sections): New type declaration.
10062 (Output_merge_base::input_sections_begin,
10063 Output_merge_base::input_sections_end,
10064 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10065 (Output_merge_base::bool keeps_input_sections_,
10066 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10067 Output_merge_base::input_sections_): New data members.
10068 (Output_merge_data::do_set_keeps_input_sections): New method
10069 defintion.
10070 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10071 * output.cc (Output_section::Input_section::relobj): Move method
10072 defintion from class declaration to here and handle merge sections.
10073 (Output_section::Input_section::shndx): Ditto.
10074 (Output_section::Output_section): Remove initializations of removed
10075 data members and initialize new data member LOOKUP_MAPS_.
10076 (Output_section::add_input_section): Set keeps-input-sections flag
10077 for a newly created merge output section as appropriate. Adjust code
10078 to use Output_section_lookup_maps class.
10079 (Output_section::add_relaxed_input_section): Adjst code for lookup
10080 maps code refactoring.
2e702c99 10081 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10082 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10083 class. If adding input section to a newly created merge output
10084 section fails, remove the new merge section.
10085 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10086 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10087 (Output_section::find_merge_section): Ditto.
0439c796 10088 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10089 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10090 Output_section_lookup_maps class.
10091 (Output_section::get_input_sections): Export merge sections. Adjust
10092 code to use Output_section_lookup_maps class.
10093 (Output_section:::add_script_input_section): Adjust code to use
10094 Output_section_lookup_maps class. Update lookup maps for merge
10095 sections also.
10096 (Output_section::discard_states): Use Output_section_lookup_maps.
10097 (Output_section::restore_states): Same.
10098 * output.h (Merge_section_properties): Move class defintion out of
10099 Output_section.
10100 (Output_section_lookup_maps): New class.
10101 (Output_section::Input_section::is_merge_section): New method
10102 defintion.
10103 (Output_section::Input_section::relobj): Move defintion out of class
10104 defintion. Declare method only.
10105 (Output_section::Input_section::shndx): Ditto.
10106 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10107 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10108 (Output_section::Merge_section_by_properties_map,
10109 Output_section::Output_section_data_by_input_section_map,
10110 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10111 Remove types.
2e702c99 10112 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10113 KEEPS_INPUT_SECTIONS.
10114 (Output_section::build_lookup_maps): New method declaration.
10115 (Output_section::merge_section_map_,
10116 Output_section::merge_section_by_properties_map_,
10117 Output_section::relaxed_input_section_map_,
10118 Output_section::is_relaxed_input_section_map_valid_): Remove data
10119 members.
10120 (Output_section::lookup_maps_): New data member.
10121
76295588
L
101222010-05-21 Doug Kwan <dougkwan@google.com>
10123
10124 PR gold/11619
10125 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10126 avoid a compilation error.
10127
d103a984
RÁE
101282010-05-19 Rafael Espindola <espindola@google.com>
10129
10130 * script-sections.cc (Output_section_definition::allocate_to_segment):
10131 Update the phdrs_list even when the output section is NULL.
10132 * testsuite/Makefile.am: Add test.
10133 * testsuite/Makefile.in: Regenerate.
10134 * testsuite/script_test_9.cc: New.
10135 * testsuite/script_test_9.sh: New.
10136 * testsuite/script_test_9.t: New.
10137
6625d24e
DK
101382010-05-19 Doug Kwan <dougkwan@google.com>
10139
10140 * arm.cc (Arm_input_section::original_size): New method.
10141 (Arm_input_section::do_addralign): Add a cast.
10142 (Arm_input_section::do_output_offset): Remove static cast.
10143 (Arm_input_section::original_addralign,
10144 Arm_input_section::original_size_): Change type to uint32_t.
10145 (Arm_input_section::init): Add safe casts for section alignment
10146 and size.
10147 (Arm_input_section::set_final_data_size): Do not set address and
10148 offset of stub table.
10149 (Arm_output_section::fix_exidx_coverage): Change use of of
10150 Output_section::Simple_input_section to that of
10151 Output_section::Input_section.
10152 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10153 except for the first pass.
10154 * output.cc (Output_section::get_input_sections): Change type of
10155 input_sections to std::list<Input_section>.
10156 (Output_section::add_script_input_section): Rename from
10157 Output_section::add_simple_input_section. Change type of SIS
10158 parameter from Simple_input_section to Input_section.
10159 * output.h (Output_section::Simple_input_section): Remove class.
10160 (Output_section::Input_section): Change class visibility to public.
10161 (Output_section::Input_section::addralign): Use stored alignments
10162 for special input sections if set.
10163 (Output_section::Input_section::set_addralign): New method.
10164 (Output_section::get_input_sections): Change parameter type from
10165 list of Simple_input_section to list of Input_section.
10166 (Output_section::add_script_input_section): Rename from
10167 Output_section::add_simple_input_section. Change first parameter's
10168 type from Simple_input_section to Input_section and remove the
10169 second and third parameters.
10170 * script-sections.cc (Input_section::Input_section_list): Change
10171 type to list of Output_section::Input_section/
10172 (Input_section_info::Input_section_info): Change parameter type of
10173 INPUT_SECTION to Output_section::Input_section.
10174 (Input_section_info::input_section): Change return type.
10175 (Input_section_info::input_section_): Change type to
10176 Output_section::Input_section.
10177 (Output_section_element_input::set_section_addresses): Adjust code
10178 to use Output_section::Input_section instead of
10179 Output_section::Simple_input_section. Adjust code for renaming
10180 of Output_section::add_simple_input_section.
10181 (Orphan_output_section::set_section_addresses): Ditto.
10182
e1e82ea4
RW
101832010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10184
10185 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10186 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10187
91e75c8a
RÁE
101882010-05-18 Rafael Espindola <espindola@google.com>
10189
10190 * options.cc (General_options::finalize): Handle -nostdlib.
10191 * options.h (nostdlib): New option.
10192 * script.cc (script_add_search_dir): Handle -nostdlib.
10193
da59ad79
DK
101942010-05-12 Doug Kwan <dougkwan@google.com>
10195
10196 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10197 attributes section only if there no attributes section after merging.
10198 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10199 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10200 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10201 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10202 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10203 and arm_attr_merge_7.stdout.
10204 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10205 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10206 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10207 arm_attr_merge_7b.o): New rules.
10208 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10209 arm_attr_merge_7
10210 * testsuite/Makefile.in: Regenerate.
10211 * testsuite/arm_attr_merge.sh: New file.
10212 * testsuite/arm_attr_merge_[67][ab].s: Same.
10213
3e01a7fd
NC
102142010-05-05 Nick Clifton <nickc@redhat.com>
10215
10216 * po/es.po: Updated Spanish translation.
10217
7ad2014a
L
102182010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10219
10220 * Makefile.am (install-exec-local): Properly install gold as
10221 default cross linker.
10222 * Makefile.in: Regenerated.
10223
4fda8867
NC
102242010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10225 Nick Clifton <nickc@redhat.com>
10226
10227 * configure.ac (install_as_default): Define and set to false
10228 unless --enable-gold or --enable-gold=both/gold has been
10229 specified.
10230 * configure: Regenerate.
10231
10232 * Makefile.am (install-exec-local): Install the executable as
10233 'ld.gold'. If install_as_default is true then also install it as
10234 'ld'.
10235 * Makefile.in: Regenerated.
10236
bd288ea2
ILT
102372010-04-24 Ian Lance Taylor <iant@google.com>
10238
10239 * layout.cc (Layout::layout_reloc): In relocatable link don't
10240 combine reloc sections for grouped sections.
10241
ef38fd8a
ST
102422010-04-23 Sriraman Tallam <tmsriram@google.com>
10243
10244 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10245 sections that are not ordinary to icf.
10246 * icf.cc (get_section_contents): Handle relocation pointing to section
10247 with no object or shndx information.
10248 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10249 * testsuite/Makefile.in: Regenerate.
10250 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10251 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10252
f6973bdc
ILT
102532010-04-22 Ian Lance Taylor <iant@google.com>
10254
10255 * expression.cc (Expression::Expression_eval_info): Add
10256 result_alignment_pointer field.
10257 (Expression::eval_with_dot): Add result_alignment_pointer
10258 parameter. Change all callers.
10259 (Expression::eval_maybe_dot): Likewise.
10260 (class Binary_expression): Add alignment_pointer parameter to
10261 left_value and right_value. Change all callers.
10262 (BINARY_EXPRESSION): Set result alignment.
10263 (class Trinary_expression): Add alignment_pointer parameter to
10264 arg2_value and arg3_value. Change all callers.
10265 (Trinary_cond::value): Set result alignment.
10266 (Max_expression::value, Min_expression::value): Likewise.
10267 (Align_expression::value): Likewise.
10268 * script-sections.cc (class Sections_element): Add dot_alignment
10269 parameter to set_section_addresses virtual function. Update
10270 instantiations.
10271 (class Output_section_element): Likewise.
10272 (Script_sections::create_segments): Add dot_alignment parameter.
10273 Change all callers.
10274 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10275 (Script_sections::set_phdrs_clause_addresses): Likewise.
10276 * script-sections.h: Update declarations.
10277 * script.h: Update declarations.
10278 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10279 min_p_align.
10280 * testsuite/script_test_3.t: Set large alignment.
10281 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10282 segment has expected alignment.
10283
9c9c98a5
NC
102842010-04-22 Nick Clifton <nickc@redhat.com>
10285
10286 * po/gold.pot: Updated by the Translation project.
10287 * po/vi.po: Updated Vietnamese translation.
10288
2253bfba
L
102892010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10290
10291 * testsuite/Makefile.am (check_PROGRAMS): Add
10292 icf_virtual_function_folding_test.
10293 * testsuite/Makefile.in: Regenerated.
10294
85fdf906
AH
102952010-04-15 Andrew Haley <aph@redhat.com>
10296
10297 * options.h (merge_exidx_entries): New option.
10298 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10299 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10300 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10301 (Target_arm::merge_exidx_entries): New function.
10302 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10303 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10304 to Arm_exidx_fixup constructor.
10305 Add new arg, merge_exidx_entries.
10306 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10307 Arm_output_section::fix_exidx_coverage.
10308
ce97fa81
ST
103092010-04-18 Sriraman Tallam <tmsriram@google.com>
10310
10311 * icf.cc (get_section_contents): Check for preemptible functions.
10312 Ignore addend when appropriate.
10313 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10314 section folded.
10315 (add_from_relobj): Check for section folded.
10316 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10317 * symtab.h (should_add_dynsym_entry): Add new parameter.
10318 * target-reloc.h (scan_relocs): Check for section folded.
10319 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10320 Check reloc types for function pointers in shared objects.
10321 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10322 case.
10323 (icf_preemptible_functions_test): New test case.
10324 (icf_string_merge_test): New test case.
10325 * testsuite.Makefile.in: Regenerate.
10326 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10327 bar_glob. Refactor code.
10328 * testsuite/icf_preemptible_functions_test.cc: New file.
10329 * testsuite/icf_preemptible_functions_test.sh: New file.
10330 * testsuite/icf_string_merge_test.cc: New file.
10331 * testsuite/icf_string_merge_test.sh: New file.
10332 * testsuite/icf_virtual_function_folding_test.cc: New file.
10333 * testsuite/icf_virtual_function_folding_test.sh: New file.
10334
04ceb17c
DK
103352010-04-14 Doug Kwan <dougkwan@google.com>
10336
10337 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10338 for local symbol recounting if we remove a section due to ICF.
10339 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10340 there are no regular objects in input.
10341
153e7da4
DK
103422010-04-13 Doug Kwan <dougkwan@google.com>
10343
10344 * arm.cc (Arm_input_section::set_final_data_size): Compute
10345 accurate final data size instead of using current data size.
10346
4dbd9faf
DK
103472010-04-09 Doug Kwan <dougkwan@google.com>
10348
10349 * layout.cc (Layout::choose_output_section): Handle script section
10350 types.
10351 (Layout::make_output_section_for_script): Add section type parameter.
10352 Handle script section types.
10353 * layout.h (Layout::make_output_section_for_script): Add section
10354 type parameter.
10355 * output.cc (Output_section::Output_section): Initialize data member
10356 is_noload_.
10357 (Output_section::do_reset_address_and_file_offset): Do not set address
10358 to 0 if section is a NOLOAD section.
10359 * output.h (Output_section::is_noload): New method.
10360 (Output_section::set_is_noload): Ditto.
10361 (Output_section::is_noload_): New data member.
10362 * script-c.h (Script_section_type): New enum type.
10363 (struct Parser_output_section_header): Add new file section_type.
10364 * script-sections.cc (Sections_element::output_section_name): Add
10365 parameter for returning script section type.
10366 (Output_section_definition::output_section_name): Ditto.
10367 (Output_section_definition::section_type)P; New method.
10368 (Output_section_definiton::script_section_type_name): Ditto.
10369 (Output_section_definition::script_section_type_): New data member.
10370 (Output_section_definition::Output_section_definition): Initialize
10371 data member Output_section_definition::script_section_type_.
10372 (Output_section_definition::create_sections): Pass script section type
10373 to Layout::make_output_section_for_script.
10374 (Output_section_definition::output_section_name): Return script
10375 section type to caller.
10376 (Output_section_definition::set_section_address): Do not advance
10377 dot value and load address if section type is NOLOAD. Set address
10378 of NOLOAD sections regardless of section flags.
10379 (Output_section_definition::print): Print section type if it is
10380 not SCRIPT_SECTION_TYPE_NONE.
10381 (Output_section_definition::section_type): New method.
10382 (Output_section_definition::script_section_type_name): Ditto.
10383 (Script_sections::output_section_name): Add new parameter
10384 PSECTION_TYPE for returning script section type. Pass it to
10385 section elements. Handle discard sections.
10386 (Sort_output_sections::operator()): Handle NOLOAD sections.
10387 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10388 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10389 returning script section type.
10390 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10391 INFO and NOLOAD.
10392 * yyscript.y (union): Add new field SECTION_TYPE.
10393 (COPY, DSECT, INFO, NOLOAD): New tokens.
10394 (opt_address_and_section_type): Change type to output_section_header.
10395 (section_type): New non-terminal
10396 (section_header): Handle section type.
2253bfba 10397 (opt_address_and_section_type): Return section type value.
4dbd9faf 10398
721ea635
L
103992010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10400
10401 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10402 * testsuite/plugin_common_test_2.c (foo): Likewise.
10403
6bf924b0
DK
104042010-04-08 Doug Kwan <dougkwan@google.com>
10405
10406 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10407 Output_merge_data.
10408 * output.cc (Output_section::add_merge_input_section): Simplify
10409 code and return status of Output_merge_base::add_input_section.
e1df38aa 10410 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10411 returns true.
10412
24af6f92
DK
104132010-04-07 Doug Kwan <dougkwan@google.com>
10414
10415 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10416 if section is marked as containing instructions but has no mapping
10417 symbols.
10418 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10419 correct section index.
10420 (Arm_relobj::find_linked_text_section): Ditto.
10421
00698fc5
CC
104222010-04-07 Cary Coutant <ccoutant@google.com>
10423
10424 * archive.cc (include_member): Destroy Read_symbols_data object before
10425 releasing file.
10426 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10427 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10428 (Read_symbols_data::~Read_symbols_data) New destructor.
10429 (Section_relocs::Section_relocs) New constructor.
10430 (Section_relocs::~Section_relocs) New destructor.
10431 (Read_relocs_data::Read_relocs_data) New constructor.
10432 (Read_relocs_data::~Read_relocs_data) New destructor.
10433 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10434 pointers to NULL after deleting.
10435
7296d933
DK
104362010-04-07 Doug Kwan <dougkwan@google.com>
10437
10438 * arm.cc: Replace "endianity" with "endianness" in comments.
10439 (Arm_exidx_cantunwind): Ditto.
10440 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10441 (Arm_relobj::merge_flags_and_attributes): New method.
10442 (Arm_relobj::merge_flags_and_attributes_): New data member.
10443 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10444 (Arm_relobj::scan_sections_for_stubs): Ditto.
10445 (Arm_relobj::do_read_symbols): Check to see if we really want to
10446 merge processor-specific flags and attributes. Exit early if
10447 an object is empty except for section names and the undefined symbol.
10448 (Target_arm::do_finalize_sections): Move check for ELF format to
10449 Arm_relobj::do_read_symbols. Merge processor specific flags and
10450 attributes from a regular object only when we have determined that
10451 it is aapropriate. Do not create an .ARM.attributes section in
10452 output if there is no regular input object.
10453 (Target_arm::merge_processor_specific_flags): Check
10454 --warn-mismatch before printing any error.
10455 (Target_arm::merge_object_attributes): Ditto.
10456 * gold.cc (queue_middle_tasks): Handle the case in which there is
10457 no regular object in input.
10458 * options.cc (General_options::parse_EB): New method.
10459 (General_options::parse_EL): Same.
10460 (General_options::General_options): Initialize endianness_.
10461 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10462 New options.
10463 (General_options::Endianness): New enum.
10464 (General_options::endianness): New method.
10465 (General_options::endianness_): New data member.
10466 * parameters.cc (Parameters::set_options): Check target endianness.
10467 (Parameters::set_target_once): Ditto.
10468 (Parameters::check_target_endianness): New method.
10469 (parameters_force_valid_target): If either -EL or -EB is specified,
10470 use it to define endianness of default target.
10471 * parameters.h (Parameters::check_target_endianness): New method
10472 declaration.
10473 * target.h (class Target): Change "endianity" to "endianness"
10474 in comments.
10475
efc8d4f2
RW
104762010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10477
10478 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10479 * configure: Regenerate.
10480 * Makefile.in: Regenerate.
10481 * testsuite/Makefile.in: Regenerate.
10482
be234d88
CC
104832010-04-06 Cary Coutant <ccoutant@google.com>
10484
10485 gcc PR lto/42757
10486 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10487 prevailing definitions of common symbols.
10488 * testsuite/plugin_test_6.sh: New test case.
10489 * testsuite/plugin_common_test_1.c: New test case.
10490 * testsuite/plugin_common_test_2.c: New test case.
10491 * testsuite/Makefile.am (plugin_test_6): New test case.
10492 * testsuite/Makefile.in: Regenerate.
10493
bd32c6bd
NC
104942010-04-06 Nick Clifton <nickc@redhat.com>
10495
10496 * po/vi.po: New Vietnamese translation.
10497
323c532f
DK
104982010-03-30 Doug Kwan <dougkwan@google.com>
10499
10500 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10501
4fcd97eb
DK
105022010-03-25 Doug Kwan <dougkwan@google.com>
10503
10504 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10505 to avoid a conversion warning on a 32-bit host.
10506
4ebf39db
ILT
105072010-03-24 Ian Lance Taylor <iant@google.com>
10508
10509 * testsuite/script_test_3.t: Add a TLS segment.
10510 * testsuite/Makefile.am (check_PROGRAMS): Add
10511 tls_phdrs_script_test.
10512 (tls_phdrs_script_test_SOURCES): Define.
10513 (tls_phdrs_script_test_DEPENDENCIES): Define.
10514 (tls_phdrs_script_test_LDFLAGS): Define.
10515 (tls_phdrs_script_test_LDADD): Define.
10516 * testsuite/Makefile.in: Rebuild.
10517
4a599bdd
CC
105182010-03-23 Cary Coutant <ccoutant@google.com>
10519
10520 * fileread.cc (find_or_make_view): Fix comment.
10521
6c93b22c
ILT
105222010-03-23 Ian Lance Taylor <iant@google.com>
10523
10524 * script-sections.cc (class Orphan_section_placement): Define
10525 PLACE_TLS and PLACE_TLS_BSS.
10526 (Orphan_section_placement::Orphan_section_placement): Initialize
10527 new places.
10528 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10529 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10530 (tls_script_test_SOURCES): Define.
10531 (tls_script_test_DEPENDENCIES): Define.
10532 (tls_script_test_LDFLAGS): Define.
10533 (tls_script_test_LDADD): Define.
10534 * testsuite/Makefile.in: Rebuild.
10535
a2c7281b
DK
105362010-03-22 Doug Kwan <dougkwan@google.com>
10537
10538 * arm.cc (Arm_relocate_functions::abs8,
10539 Arm_relocate_functions::abs16): Use correct check for overflow
10540 specified in the ARM ELF specs.
10541 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10542 target of a BLX instruction specially.
10543 (Reloc_stub::stub_type_for_reloc): Ditto.
10544 (Relocate::relocate): Use symbolic names instead of numeric relocation
10545 codes to report error.
10546 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10547 workaround.
10548 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10549 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10550 thumb2_blx_out_of_range.stdout
10551 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10552 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10553 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10554 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10555 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10556 thumb2_blx_in_range, thumb2_blx_in_range.o,
10557 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10558 thumb2_blx_out_of_range.o): New rules.
2e702c99 10559 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10560 thumb2_blx_in_range and thumb2_blx_out_of_range.
10561 * testsuite/Makefile.in: Regenerate.
10562 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10563 * testsuite/thumb_blx_in_range.s: New file.
10564 * testsuite/thumb_blx_out_of_range.s: New file.
10565
b0193076
RÁE
105662010-03-22 Rafael Espindola <espindola@google.com>
10567
10568 * archive.cc (Should_include): Move to archive.h.
10569 (should_include_member): Make it a member of Archive.
10570 (Lib_group): New.
10571 (Add_lib_group_symbols): New.
10572 * archive.h: Include options.h.
10573 (Archive_member): Moved from Archive.
10574 (Should_include): Moved from archive.cc.
10575 (Lib_group): New.
10576 (Add_lib_group_symbols): New.
10577 * dynobj.cc (do_should_include_member): New.
10578 * dynobj.h (do_should_include_member): New.
10579 * gold.cc (queue_initial_tasks): Update call to queue.
10580 * main.cc (main): Print lib group stats.
10581 * object.cc (do_should_include_member): New.
10582 * object.h: Include archive.h.
10583 (Object::should_include_member): New.
10584 (Object::do_should_include_member): New.
10585 (Sized_relobj::do_should_include_member): New.
10586 * options.cc (General_options::parse_start_lib): New.
10587 (General_options::parse_end_lib): New.
10588 (Input_arguments::add_file): Handle lib groups.
10589 (Input_arguments::start_group): Check we are not in a lib.
10590 (Input_arguments::start_lib): New.
10591 (Input_arguments::end_lib): New.
10592 * options.h (General_options): Add start_lib and end_lib.
10593 (Input_argument::lib_): New.
10594 (Input_argument::lib): New.
10595 (Input_argument::is_lib): New.
10596 (Input_file_lib): New.
10597 (Input_arguments::in_lib_): New.
10598 (Input_arguments::in_lib): New.
10599 (Input_arguments::start_lib): New.
10600 (Input_arguments::end_lib_): New.
10601 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10602 in unused members as preempted.
10603 (Sized_pluginobj::do_should_include_member): New.
10604 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10605 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10606 return the blocker.
10607 (Read_symbols::do_whole_lib_group): New.
10608 (Read_symbols::do_lib_group): New.
10609 (Read_symbols::do_read_symbols): Handle lib groups.
10610 (Read_symbols::get_name): Handle lib groups.
10611 * readsyms.h (Read_symbols): Add an archive member pointer.
10612 (Read_symbols::do_whole_lib_group): New.
10613 (Read_symbols::do_lib_group): New.
10614 (Read_symbols::member_): New.
10615 * script.cc (read_input_script): Update call to queue_soon.
10616
d099120c
DK
106172010-03-19 Doug Kwan <dougkwan@google.com>
10618
10619 * arm.cc (Stub_table::Stub_table): Initialize new data members
10620 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10621 (Stub_table::add_reloc_stub): Assign stub offset and update
10622 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10623 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10624 New data members.
2e702c99 10625 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10626 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10627 instead of going over all reloc stubs.
2e702c99 10628 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10629 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10630 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10631 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10632 Stringpool_template::offset_.
10633 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10634 Stringpool_template::offset_ to zero.
10635
1aa37384
DK
106362010-03-15 Doug Kwan <dougkwan@google.com>
10637
10638 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10639 offset_.
10640 (Stringpool_template::new_key_offset): New method.
10641 (Stringpool_template::add_string): Assign offsets when adding new
10642 strings.
10643 (Stringpool_template::set_string_offsets): Do not set string offsets
10644 when not optimizing.
10645 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10646 member size_.
2e702c99
RM
10647 (Chunked_vector::clear): Clear size_.
10648 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10649 (Chunked_vector::size): Return size_.
10650 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10651 (Chunked_vector::size_): New data member.
1aa37384
DK
10652 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10653 (Stringpool_template::new_key_offset): New method declaration.
10654 (Stringpool_template::offset_): New data member.
10655
b672b057
RÁE
106562010-03-15 Rafael Espindola <espindola@google.com>
10657
10658 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10659 Add_symbols' constructor.
10660 * readsyms.h (Add_symbols): Remove the input_group member.
10661
b6848d3c
ILT
106622010-03-10 Ian Lance Taylor <iant@google.com>
10663
10664 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10665 target to ask whether a reference to a symbol requires a stack
10666 split.
10667 * target.h (Target::is_call_to_non_split): New function.
10668 (Target::do_is_call_to_non_split): Declare virtual function.
10669 * target.cc: Include "symtab.h".
10670 (Target::do_is_call_to_non_split): New function.
10671 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10672
a2a5469e
CC
106732010-03-10 Cary Coutant <ccoutant@google.com>
10674
10675 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10676 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10677 (File_read::open[2]): Add whole_file_view_ to list of views.
10678 (File_read::make_view): Remove test of whole_file_view_.
10679 (File_read::find_or_make_view): Create whole_file_view_ if
10680 necessary.
10681 (File_read::clear_views): Replace bool parameter with enum;
10682 adjust all callers. Don't delete views with permanent data;
10683 do delete cached views and views from archives if
10684 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10685 if clearing the corresponding view.
10686 * fileread.h (File_read::Clear_views_mode): New enum.
10687 (File_read::View::is_permanent_view): New method.
10688 (File_read::clear_views): Replace bool parameter
10689 with enum; adjust all callers.
10690 * options.h (General_options): Change keep_files_mapped option;
10691 add map_whole_files.
10692 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10693 releasing the file.
10694 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10695 the file.
10696
8861f32b
DM
106972010-03-10 David S. Miller <davem@davemloft.net>
10698
10699 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10700
d62d0f5f
ST
107012010-03-09 Sriraman Tallam <tmsriram@google.com>
10702
10703 * icf.cc (get_section_contents): Add '@' marker after processing the
10704 merge reloc.
10705
9177756d
DK
107062010-03-08 Doug Kwan <dougkwan@google.com>
10707
10708 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10709 due to a conversion warning.
10710 (Arm_relobj::update_output_local_symbol_count): Check for local
10711 symbol with unset output index.
10712
9e9e071b
ILT
107132010-03-05 Ian Lance Taylor <iant@google.com>
10714
10715 * options.h (class General_options): Add --spare-dynamic-tags.
10716 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10717 --spare-dynamic-tags.
10718
a81ee015
ILT
107192010-03-05 Ian Lance Taylor <iant@google.com>
10720
10721 * incremental.cc: Include "libiberty.h".
10722
44ec90b9
RO
107232010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10724
10725 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10726 function, is_info_ member.
10727 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10728 (Versions::Versions): Update caller.
10729 (Versions::define_base_version): Likewise.
10730 (Versions::add_def): Likewise.
10731
0897ed3b
ST
107322010-03-03 Sriraman Tallam <tmsriram@google.com>
10733
10734 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10735 (Scan::possible_function_pointer_reloc): New function.
10736 (Scan::local_reloc_may_be_function_pointer): Change to call
10737 possible_function_pointer_reloc.
10738 (Scan::global_reloc_may_be_function_pointer): Ditto.
10739 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10740 relocations in ".data.rel.ro._ZTV" section.
10741 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10742 * testsuite/icf_safe_so_test.cc: Ditto.
10743 * testsuite/icf_safe_test.cc: Ditto.
10744 * testsuite/icf_safe_test.sh: Ditto.
10745
d3bbad62
ILT
107462010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10747 Ian Lance Taylor <iant@google.com>
10748
10749 * target-reloc.h (relocate_section): Check the symbol table index
10750 for -1U before setting the local symbol index.
10751 (scan_relocatable_relocs): If copying the relocation, record that
10752 the local symbol is required.
10753 * object.h (Symbol_value::is_output_symtab_index_set): New
10754 function.
10755 (Symbol_value::may_be_discarded_from_output_symtab): New
10756 function.
10757 (Symbol_value::has_output_symtab_entry): New function.
10758 (Symbol_value::needs_output_symtab_entry): Remove.
10759 (Symbol_value::output_symtab_index): Make sure the symbol index is
10760 set.
10761 (Symbol_value::set_output_symtab_index): Make sure the symbol
10762 index is not set. Make sure the new index is valid.
10763 (Symbol_value::set_must_have_output_symtab_entry): New function.
10764 (Symbol_value::has_output_dynsym_entry): New function.
10765 (Symbol_value::set_output_dynsym_index): Make sure the new index
10766 is valid.
10767 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10768 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10769 local symbol if permitted.
10770 (Sized_relobj::do_finalize_local_symbols): Call
10771 is_output_symtab_index_set rather than needs_output_symtab_entry.
10772 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10773 rather than needs_output_symtab_entry. Call
10774 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10775 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10776 is_output_symtab_index_set rather than needs_output_symtab_entry.
10777 * testsuite/discard_locals_relocatable_test.c: New file.
10778 * testsuite/discard_locals_test.sh: Test -r.
10779 * testsuite/Makefile.am (check_DATA): Add
10780 discard_locals_relocatable_test1.syms,
10781 discard_local_relocatable_test2.syms.
10782 (MOSTLYCLEANFILES): Likewise. Also add
10783 discard_locals_relocatable_test1.lout and
10784 discard_locals_relocatable_test2.out.
10785 (discard_locals_relocatable_test1.syms): New target.
10786 (discard_locals_relocatable_test.o): New target.
10787 (discard_locals_relocatable_test1.out): New target.
10788 (discard_locals_relocatable_test2.syms): New target.
10789 (discard_locals_relocatable_test2.out): New target.
10790 (various): Add missing ../ld-new dependencies.
10791 * testsuite/Makefile.in: Rebuild.
10792
7e8ccf26
NC
107932010-03-03 Nick Clifton <nickc@redhat.com>
10794
10795 * po/fi.po: New Finnish translation.
10796
2a0ff005
DK
107972010-03-01 Doug Kwan <dougkwan@google.com>
10798
10799 * layout.cc (Layout::Layout): Force section types of .init_array*,
10800 .preinit_array* and .fini_array* sections.
10801 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10802 Fix check of return value of std::string::find.().
10803 (Output_section::Input_section_sort_compare::operator()): Remove
10804 comment about .init_array.
10805 (Output_section::Input_section_sort_init_fini_compare::operator()):
10806 New method.
10807 (Output_section::sort_attached_input_sections): Handle .init_array
10808 and .fini_array specially.
10809 * output.h (Output_section::Inut_section_sort_compare): Update
10810 comment.
10811 (Output_section::Input_section_sort_init_fini_compare): New struct.
10812
c3e4ae29
DK
108132010-02-26 Doug Kwan <dougkwan@google.com>
10814
10815 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10816 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10817 * testsuite/debug_msg.sh: Avoid matching source line number for
10818 use of global variable undef_int.
10819
2fd9ae7a
DK
108202010-02-26 Doug Kwan <dougkwan@google.com>
10821
10822 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10823 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10824 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10825 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10826 * options.cc (General_options::General_options): Initialize member
10827 fix_v4bx_.
10828 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10829 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10830 and rm_no_fix_v4bx.stdout
10831 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10832 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10833 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10834 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10835 and arm_no_fix_v4bx.
10836 * Makefile.in: Regenerate.
10837 * testsuite/arm_fix_v4bx.s: New file.
10838 * testsuite/arm_fix_v4bx.sh: Ditto.
10839
67ec7d0b
DK
108402010-02-24 Doug Kwan <dougkwan@google.com>
10841
10842 * arm.cc (Target_arm::got_section): Make the .got section the first
10843 non RELRO section in the data segment.
10844 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10845 suffixes of section names.
10846
10165461
DK
108472010-02-24 Doug Kwan <dougkwan@google.com>
10848
10849 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10850 flags and attributes merging if an input file is a binary file.
10851 * fileread.cc (Input_file::open): Record format of original file.
10852 * fileread.h (Input_file::Format): New enum type.
2e702c99 10853 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10854 (Input_file::format): New method definition.
10855 (Input_file::format_):: New data member.
10856
4a54abbb
DK
108572010-02-24 Doug Kwan <dougkwan@google.com>
10858
10859 * arm.cc (Arm_output_data_got): New class.
10860 (ARM_TCB_SIZE): New constant
10861 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10862 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10863 If user uses a script with a SECTIONS clause, issue only a warning
10864 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10865 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10866 garbage collection.
10867 (Target_arm::got_mode_index_entry): Handle static linking.
10868 (Target_arm::Scan::local): Ditto.
10869 (Target_arm::Scan::global): Ditto.
10870 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10871 all incorrectly implemented relocations.
e1df38aa 10872 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10873 Arm_output_section::fix_exidx_coverage.
10874 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10875 from ".ARM.exidx." and ".ARM.extab.".
10876
ca419a6f
ILT
108772010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10878
10879 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10880 section if it does not already exist.
10881 * attributes.cc (Attributes_section_data::Attributes_section_data):
10882 Don't crash if size is zero.
10883
135b9c78
ILT
108842010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10885 Ian Lance Taylor <iant@google.com>
10886
10887 * gold.cc (queue_middle_tasks): If no input files were opened,
10888 exit.
10889 * workqueue.h (Task_function::Task_function): Assert that there is
10890 a blocker.
10891
bb0bfe4f
DK
108922010-02-22 Doug Kwan <dougkwan@google.com>
10893
10894 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10895 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10896 types to avoid warnings due to different uint64_t implementations
10897 on different hosts.
10898
2a2b6d42
DK
108992010-02-21 Doug Kwan <dougkwan@google.com>
10900
10901 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10902 handling of the maximum backward branch offset.
2e702c99 10903 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10904 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10905 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10906 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10907 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10908 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10909 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10910 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10911 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10912 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10913 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10914 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10915 thumb2_bl_out_of_range.o): New rules.
10916 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10917 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10918 thumb2_bl_out_of_range
10919 * testsuite/Makefile.in: Regenerate.
10920 * testsuite/arm_bl_in_range.s: New file.
10921 * testsuite/arm_bl_out_of_range.s: Ditto.
10922 * testsuite/arm_branch_in_range.sh: Ditto.
10923 * testsuite/arm_branch_range.t: Ditto.
10924 * testsuite/thumb2_branch_range.t: Ditto.
10925 * testsuite/thumb_bl_in_range.s: Ditto.
10926 * testsuite/thumb_bl_out_of_range.s: Ditto.
10927 * testsuite/thumb_branch_range.t: Ditto.
10928
b487ad64
ST
109292010-02-20 Sriraman Tallam <tmsriram@google.com>
10930
10931 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10932 Add reloc offset information.
10933 * icf.cc (get_section_contents): Change iterators to point to the new
10934 vectors. Add reloc offset information to the contents.
10935 * icf.h (Icf::Sections_reachable_info): New typedef.
10936 (Icf::Sections_reachable_list): New typedef.
10937 (Icf::Offset_info): New typedef.
10938 (Icf::Reloc_info): New struct typedef.
10939 (Icf::Reloc_info_list): New typedef.
10940 (Icf::symbol_reloc_list): Delete method.
10941 (Icf::addend_reloc_list): Delete method.
10942 (Icf::section_reloc_list): Delete method.
10943 (Icf::reloc_info_list): New method.
10944 (Icf::reloc_info_list_): New member.
10945
f96accdf
DK
109462010-02-19 Doug Kwan <dougkwan@google.com>
10947
10948 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10949 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10950 * arm.cc (Arm_relocation_functions): New forward declaration.
10951 (Target_arm::Target_arm): Initialize new data members
10952 got_mod_index_offset_ and tls_base_symbol_defined_.
10953 (Target_arm::Relocate::relocate_tls): New method.
10954 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10955 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10956 New methods.
2e702c99 10957 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10958 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10959 (Target_arm::got_mod_index_offset_,
10960 Target_arm::tls_base_symbol_defined_): New data members.
10961 (Target_arm::Scan::local, Target::Scan::global,
10962 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10963 relocations.
10964
c8761b9a
DK
109652010-02-18 Doug Kwan <dougkwan@google.com>
10966
10967 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10968 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10969 text section as a parameter becuase some broken tools may not set
10970 the link in section header.
10971 (Target_arm::has_got_section): New method.
10972 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10973 without any mapping symbol as data only. Remove warning.
10974 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10975 link in its section header, try to discover the link by inspecting the
10976 REL31 relocation at the beginning of the section.
10977 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10978 in error message.
10979 (Target_arm::Scan::global): Treat any reference to the symbol
10980 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10981
21bb3914
ST
109822010-02-12 Sriraman Tallam <tmsriram@google.com>
10983
10984 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10985 (Scan::global_reloc_may_be_function_pointer): New function.
10986 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10987 (Scan::global_reloc_may_be_function_pointer): New function.
10988 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10989 (Scan::global_reloc_may_be_function_pointer): New function.
10990 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10991 (Scan::global_reloc_may_be_function_pointer): New function.
10992 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10993 (Scan::global_reloc_may_be_function_pointer): New function.
10994 (Scan::possible_function_pointer_reloc): New function.
10995 (Target_x86_64::can_check_for_function_pointers): New function.
10996 * gc.h (gc_process_relocs): Scan relocation types to determine if
10997 function pointers were taken for targets that support it.
10998 * icf.cc (Icf::find_identical_sections): Include functions for
10999 folding in safe ICF whose pointer is not taken.
11000 * icf.h (Secn_fptr_taken_set): New typedef.
11001 (fptr_section_id_): New member.
11002 (section_has_function_pointers): New function.
11003 (set_section_has_function_pointers): New function.
11004 (check_section_for_function_pointers): New function.
11005 * options.h: Fix comment for safe ICF option.
11006 * target.h (can_check_for_function_pointers): New function.
11007 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11008 Modify icf_safe_test for X86-64.
11009 * testsuite/Makefile.in: Regenerate.
11010 * testsuite/icf_safe_so_test.cc: New file.
11011 * testsuite/icf_safe_so_test.sh: New file.
11012 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11013 (main): Change to take pointer to function kept_func_3.
11014 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11015 folding is done correctly for X86-64.
11016
0da6fa6c
DM
110172010-02-12 David S. Miller <davem@davemloft.net>
11018
11019 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11020 is_symbolless parameter.
11021 (Output_reloc<SHT_REL>::is_symbolless): New.
11022 (Output_reloc<SHT_REL>::is_symbolless_): New.
11023 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11024 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11025 (Output_reloc<SHT_RELA>::is_symbolless): New.
11026 (Output_data_reloc::add_global): Handle is_symbolless.
11027 (Output_data_reloc::add_global_relative): Likewise.
11028 (Output_data_reloc::add_local): Likewise.
11029 (Output_data_reloc::add_local_relative): Likewise.
11030 (Output_data_reloc::add_symbolless_global_addend): New.
11031 (Output_data_reloc::add_symbolless_local_addend): New.
11032 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11033 is_symbolless.
11034 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11035 instead of ->is_relative_
11036 (Output_reloc::write): Likewise.
11037 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11038 (Output_reloc::write_rel): Simplify.
11039
11040 * sparc.cc (Target_sparc::Scan::local): Use
11041 ->add_symbolless_local_addend as needed.
11042 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11043 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11044 based upon relocation offset.
11045
e4782e83
DK
110462010-02-11 Doug Kwan <dougkwan@google.com>
11047
11048 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11049 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11050 beginning of function.
11051 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11052 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11053 parameter is_32bit in calls to should_apply_static_reloc.
11054 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11055 (check_DATA): Add arm_abs_global.stdout.
11056 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11057 arm_abs_global.stdout): New rules.
11058 (MOSTLLYCLEANFILES): Add arm_abs_global
11059 * Makefile.in: Regenerate.
11060 * testsuite/arm_abs_global.s: New file.
11061 * testsuite/arm_abs_global.sh: Ditto.
11062 * testsuite/arm_abs_lib.s: Ditto.
11063
93ceb764
ILT
110642010-02-11 Ian Lance Taylor <iant@google.com>
11065
11066 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11067 Read_relocs task.
11068 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11069 Allocate_commons_task first.
11070 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11071 task, rather than symtab_lock_.
11072 (Gc_process_relocs::~Gc_process_relocs): New function.
11073 (Gc_process_relocs::is_runnable): Check this_blocker_.
11074 (Gc_process_relocs::locks): Use next_blocker_ rather than
11075 blocker_.
11076 (Scan_relocs::~Scan_relocs): New function.
11077 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11078 symtab_lock_.
11079 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11080 next_blocker_.
11081 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11082 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11083 constructor accordingly.
11084 (class Gc_process_relocs): Likewise.
11085 (class Scan_relocs): Likewise.
11086 * common.h (class Allocate_commons_task): Remove symtab_lock_
11087 field, and corresponding constructor parameter.
11088 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11089 symtab_lock_.
11090 (Allocate_commons_task::locks): Likewise.
11091
114dfbe1
ILT
110922010-02-11 Ian Lance Taylor <iant@google.com>
11093
11094 * gold-threads.h (class Once): Define.
11095 (class Initialize_lock): Rewrite as child of Once.
11096 * gold-threads.cc (class Once_initialize): Define.
11097 (once_pointer_control): New static variable.
11098 (once_pointer, once_arg): New static variables.
11099 (c_run_once): New static function.
11100 (Once::Once, Once::run_once, Once::internal_run): New functions.
11101 (class Initialize_lock_once): Remove.
11102 (initialize_lock_control): Remove.
11103 (initialize_lock_pointer): Remove.
11104 (initialize_lock_once): Remove.
11105 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11106 (Initialize_lock::initialize): Rewrite.
11107 (Initialize_lock::do_run_once): New function.
11108 * archive.cc (Archive::interpret_header): Only clear name if it is
11109 not already empty.
11110 * fileread.cc: Include "gold-threads.h"
11111 (file_counts_lock): New static variable.
11112 (file_counts_initialize_lock): Likewise.
11113 (File_read::release): Only increment counts when using --stats.
11114 Use a lock around the increment.
11115 * parameters.cc (class Set_parameters_target_once): Define.
11116 (set_parameters_target_once): New static variable.
11117 (Parameters::Parameters): Move here from parameters.h.
11118 (Parameters::set_target): Rewrite.
11119 (Parameters::set_target_once): New function.
11120 (Parameters::clear_target): Move here and rewrite.
11121 * parameters.h (class Parameters): Update declarations. Add
11122 set_parameters_target_once_ field.
11123 (Parameters::Parameters): Move to parameters.cc.
11124 (Parameters::clear_target): Likewise.
11125 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11126 task.
11127 (Start_group::~Start_group): New function.
11128 (Start_group::is_runnable): New function.
11129 (Start_group::locks, Start_group::run): New functions.
11130 (Finish_group::run): Change saw_undefined to size_t.
11131 * readsyms.h (class Start_group): Define.
11132 (class Finish_group): Change saw_undefined_ field to size_t.
11133 (Finish_group::Finish_group): Remove saw_undefined and
11134 this_blocker parameters. Change all callers.
11135 (Finish_group::set_saw_undefined): New function.
11136 (Finish_group::set_blocker): New function.
11137 * symtab.h (class Symbol_table): Change saw_undefined to return
11138 size_t. Change saw_undefined_ field to size_t.
11139 * target-select.cc (Set_target_once::do_run_once): New function.
11140 (Target_selector::Target_selector): Initialize set_target_once_
11141 field. Don't initialize lock_ and initialize_lock_ fields.
11142 (Target_selector::instantiate_target): Rewrite.
11143 (Target_selector::set_target): New function.
11144 * target-select.h (class Set_target_once): Define.
11145 (class Target_selector): Update declarations. Make
11146 Set_target_once a friend. Remove lock_ and initialize_lock_
11147 fields. Add set_target_once_ field.
11148
fa17a3f4
ILT
111492010-02-10 Ian Lance Taylor <iant@google.com>
11150
11151 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11152 queueing any tasks.
11153 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11154 (queue_middle_tasks): Add all blockers before queueing any tasks.
11155 (queue_final_tasks): Likewise.
11156 * token.h (Task_token::add_blockers): New function.
11157 * object.h (Input_objects::number_of_relobjs): New function.
11158
c7177d31
ILT
111592010-02-10 Ian Lance Taylor <iant@google.com>
11160
5de0e392
ILT
11161 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11162 shared, not if not position independent.
11163 * x86_64.cc (Relocate::relocate_tls): Likewise.
11164 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11165 (tls_pie_pic_test): New target.
11166 * testsuite/Makefile.in: Rebuild.
11167
c7177d31
ILT
11168 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11169 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11170 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11171 * testsuite/Makefile.in: Rebuild.
11172
684b268a
DM
111732010-02-09 David S. Miller <davem@davemloft.net>
11174
11175 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11176 R_SPARC_RELATIVE using ->add_local_relative().
11177 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11178
612a8d3d
DM
11179 * output.h (Output_data_dynamic::add_section_size): New method
11180 that takes two Output_data objects.
11181 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11182 entry param. Handle it in initializers.
11183 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11184 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11185 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11186 arg.
11187 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11188 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11189 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11190 for dynrel_includes_plt.
11191 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11192 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11193 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11194 before .rela.plt
11195 (Target_sparc::do_finalize_sections): Update to pass true for
11196 dynrel_includes_plt.
11197 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11198 output before .rela.plt
11199 (Target_powerpc::do_finalize_sections): Update to pass true for
11200 dynrel_includes_plt when 32-bit.
11201
cb1be87e
DK
112022010-02-08 Doug Kwan <dougkwan@google.com>
11203
11204 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11205 method.
11206 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11207 Arm_relobj::scan_section_for_cortex_a8_stubs,
11208 Arm_relobj::do_relocation_section): Instead of calling
11209 Output_section::output_address, use faster
11210 Arm_relobj::simple_input_section_output_address.
11211
705b5121
DM
112122010-02-08 David S. Miller <davem@davemloft.net>
11213
11214 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11215 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11216 relocation helper function.
11217
024c4466
DM
11218 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11219 just like R_SPARC_GOT{10,13,22}.
11220 (Target_sparc::Scan::local): Likewise.
11221 (Target_sparc::Relocate:relocate): Likewise.
11222
9109c078
ILT
112232010-02-06 Ian Lance Taylor <iant@google.com>
11224
11225 * configure.ac: Rewrite targetobjs duplicate removal code to use
11226 only shell constructs.
11227 * configure: Rebuild.
11228
cf846138
DK
112292010-02-05 Doug Kwan <dougkwan@google.com>
11230
11231 PR 11247
11232 * arm.cc (Arm_relobj::section_is_scannable): New method.
11233 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11234 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11235
6cfaf60b
DK
112362010-02-04 Doug Kwan <dougkwan@google.com>
11237
11238 PR 11247
11239 * arm-reloc-property.cc (cstdio): Include.
11240 * configure.ac (targetobjs): Remove duplicates.
11241 * configure: Regenerate.
11242 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11243 big and little endian version for a given address size.
11244
5c57f1be
DK
112452010-02-03 Doug Kwan <dougkwan@google.com>
11246
11247 * arm-reloc-property.cc
11248 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11249 definition.
11250 * arm-reloc-property.h
11251 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11252 New method definition.
11253 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11254 declaration.
11255 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11256 overflow to N.
11257 (GOT_PREL): Change implemented to Y.
11258 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11259 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11260 (Arm_relocate_functions::movw_abs_nc): Remove method.
11261 (Arm_relocate_functions::movt_abs): Ditto.
11262 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11263 (Arm_relocate_functions::thm_movt_abs): Ditto.
11264 (Arm_relocate_functions::movw_rel_nc): Ditto.
11265 (Arm_relocate_functions::movw_rel): Ditto.
11266 (Arm_relocate_functions::movt_rel): Ditto.
11267 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11268 (Arm_relocate_functions:thm_movw_rel): Ditto.
11269 (Arm_relocate_functions:thm_movt_rel): Ditto.
11270 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11271 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11272 New method definitions.
11273 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11274 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11275 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11276 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11277 (Target_arm::Relocate::relocate): Check for non-static or
11278 unimplemented relocation code and exit early. Change calls to
11279 Target_arm::reloc_uses_thumb_bit and
11280 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11281 instead. Refactor code to handle similar relocations to increase
11282 code sharing. Remove check for unsupported relocation code in switch
11283 statement.
11284 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11285 relocation property table to find out size. Change error message to
11286 print out the name of a relocation code instead of the numeric value.
11287 (Target_arm::scan_reloc_for_stub): Use relocation property table
11288 instead of calling Target_arm::reloc_uses_thumb_bit().
11289
218c5831
DK
112902010-02-02 Doug Kwan <dougkwan@google.com>
11291
11292 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11293 types of relaxed input section.
11294
0d31c79d
DK
112952010-02-02 Doug Kwan <dougkwan@google.com>
11296
11297 * Makefile.am (HFILES): Add arm-reloc-property.h.
11298 (DEFFILES): New.
2e702c99
RM
11299 (TARGETSOURCES): Add arm-reloc-property.cc
11300 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11301 (libgold_a_SOURCES): $(DEFFILES)
11302 * Makefile.in: Regenerate.
11303 * arm-reloc-property.cc: New file.
11304 * arm-reloc-property.h: New file.
11305 * arm-reloc.def: New file.
11306 * arm.cc: Update comments.
11307 (arm-reloc-property.h): New included header.
11308 (arm_reloc_property_table): New global variable.
11309 (Target_arm::do_select_as_default_target): New method definition.
11310 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11311 arm-reloc-property to targ_extra_obj.
11312 * parameters.cc (set_parameters_target): Call
11313 Target::select_as_default_target().
11314 * target.h (Target::select_as_default_target): New method definition.
11315 (Target::do_select_as_default_target): Same.
11316
546c7457
DK
113172010-02-01 Doug Kwan <dougkwan@google.com>
11318
11319 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11320 first_output_text_section_.
11321 (Arm_exidx_fixup::first_output_text_section): New method definition.
11322 (Arm_exidx_fixup::first_output_text_section_): New data member.
11323 (Arm_exidx_fixup::process_exidx_section): Record the first text
11324 output section seen.
11325 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11326 and entsize in output section header.
11327
11b861d5
DK
113282010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11329
11330 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11331 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11332 (Arm_relocate_functions::thm_alu11): New Method.
11333 (Arm_relocate_functions::thm_pc8): New Method.
11334 (Arm_relocate_functions::thm_pc12): New Method.
11335 (Target_arm::Scan::local): Handle the relocations.
11336 (Target_arm::Scan::global): Likewise.
11337 (Target_arm::Relocate::relocate): Likewise.
11338 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11339
c9a2c125
DK
113402010-01-29 Doug Kwan <dougkwan@google.com>
11341
11342 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11343 of relocation types as ld.
11344
1521477a
DK
113452010-01-29 Doug Kwan <dougkwan@google.com>
11346
11347 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11348 to public.
11349 (Arm_relocate_functions::thumb_branch_common): Ditto.
11350 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11351 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11352 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11353 Arm_relocate_functions::jump24): Remove.
11354 (Target_arm::Relocate::relocate): Adjust code to call
11355 Arm_relocation_functions::arm_branch_common and
11356 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11357 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11358
e7eca48c
DK
113592010-01-29 Doug Kwan <dougkwan@google.com>
11360
11361 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11362 output_local_symbol_count_needs_update_.
11363 (Arm_relobj::output_local_symbol_count_needs_update,
11364 Arm_relobj::set_output_local_symbol_count_needs_update,
11365 Arm_relobj::update_output_local_symbol_count): New methods.
11366 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11367 member.
11368 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11369 of pointed function as in a R_ARM_PREL31 relocation.
11370 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11371 for output local symbol count updating.
11372 (Target_arm::do_relax): Update output local symbol counts in objects
11373 if necessary.
11374 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11375
02961d7e
ILT
113762010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11377
11378 * arm.cc: Added support for the ARM relocations:
11379 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11380 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11381 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11382 movw_prel_nc).
11383 (Arm_relocate_functions::movw_rel): New method.
11384 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11385 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11386 thm_movw_prel_nc).
11387 (Arm_relocate_functions::thm_movw_rel): New method.
11388 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11389 thm_movt_prel).
11390 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11391 relocations.
11392 (Target_arm::Scan::global): Likewise.
11393 (Target_arm::Relocate::relocate): Likewise.
11394 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11395 Likewise.
11396
b10d2873
ILT
113972010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11398
11399 * arm.cc: Added support for ARM group relocations.
11400 (Target_arm::reloc_needs_sym_origin): New method.
11401 (Arm_relocate_functions::calc_grp_kn): New method.
11402 (Arm_relocate_functions::calc_grp_residual): New method.
11403 (Arm_relocate_functions::calc_grp_gn): New method.
11404 (Arm_relocate_functions::arm_grp_alu): New Method.
11405 (Arm_relocate_functions::arm_grp_ldr): New Method.
11406 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11407 (Arm_relocate_functions::arm_grp_ldc): New Method.
11408 (Target_arm::Scan::local): Handle the ARM group relocations.
11409 (Target_arm::Scan::global): Likewise.
11410 (Target_arm::Relocate::relocate): Likewise.
11411 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11412 Likewise.
11413
2b328d4e
DK
114142010-01-26 Doug Kwan <dougkwan@google.com>
11415
11416 * arm.cc (set): Include.
11417 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11418 pointer type.
2e702c99 11419 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11420 (Arm_output_section::append_text_sections_to_list): New method.
11421 (Arm_output_section::fix_exidx_coverage): Ditto.
11422 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11423 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11424 Relobj::set_section_offset() instead of
11425 Sized_relobj::invalidate_section_offset().
2e702c99 11426 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11427 parameter for section headers. Ignore relocation sections for
11428 unallocated sections and EXIDX sections.
11429 (Target_arm::fix_exidx_coverage): New method.
11430 (Target_arm::output_section_address_less_than): New type.
11431 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11432 linked text section instead of the EXIDX section.
11433 (Arm_output_section::create_stub_group): Add an assertion to check
11434 that this is not an EXIDX output section.
11435 (Arm_output_section::append_text_sections_to_list): New method.
11436 (Arm_output_section::fix_exidx_coverage): Ditto.
11437 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11438 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11439 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11440 first pass.
11441 (Target_arm::fix_exidx_coverage): New method.
11442 * object.h (Relobj::set_output_section): New method.
11443 (Sized_relobj::invalidate_section_offset): Remove method.
11444 (Sized_relobj::do_invalidate_section_offset): Remove method.
11445 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11446
c7f3c371
DK
114472010-01-25 Doug Kwan <dougkwan@google.com>
11448
11449 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11450 Fix warning due to signed and unsigned comparison on a 32-bit host.
11451
8923b24c
DK
114522010-01-22 Doug Kwan <dougkwan@google.com>
11453
11454 * arm.cc (Target_arm::do_relax): Record an output section for section
11455 offset adjustment it contains any stub table that has changed.
11456 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11457 offsets in an output section if necessary.
11458 * output.cc (Output_section::Output_section): Initialize
11459 section_offsets_need_adjustments_.
11460 (Output_section::add_input_section_for_script): Renamed to
11461 Output_section::add_simple_input_section.
11462 (Output_section::save_states): Add a comment.
11463 (Output_section::discard_states): New method defintion.
11464 (Output_section::adjust_section_offsets): Same.
11465 * output.h (Output_section::add_input_section_for_script): Renamed to
11466 Output_section::add_simple_input_section.
11467 (Output_section::discard_states): New method declaration.
11468 (Output_section::adjust_section_offsets): Same.
11469 (Output_section::section_offsets_need_adjustment,
11470 Output_section::set_section_offsets_need_adjustment): New method
11471 definitions.
11472 (Output_section::section_offsets_need_adjustment_): New data member.
11473 * script-sections.cc
11474 (Output_section_element_input::set_section_address): Adjust code for
11475 renaming of Output_section::add_input_section_for_script.
11476 (Orphan_output_section::set_section_address): Same.
11477
9b2fd367
DK
114782010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11479
11480 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11481 Fix_v4bx enum values .
11482 * gold/options.h (General_options): New option definitions.
11483 (General_options::fix_v4bx): New method.
11484 (General_options::Fix_v4bx): New enum.
11485 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11486 (General_options::parse_fix_v4bx_interworking): New method.
11487
80d0d023
DK
114882010-01-22 Doug Kwan <dougkwan@google.com>
11489
11490 * arm.cc (Arm_exidx_fixup): New class.
11491
af2cdeae
DK
114922010-01-21 Doug Kwan <dougkwan@google.com>
11493
11494 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11495 classes.
11496 (Arm_exidx_section_offset_map): New type.
11497
993d07c1
DK
114982010-01-21 Doug Kwan <dougkwan@google.com>
11499
11500 * arm.cc (Arm_exidx_input_section): New class.
11501 (Arm_relobj::exidx_input_section_by_link,
11502 Arm_relobj::exidx_input_section_by_shndx,
11503 Arm_relobj::make_exidx_input_section): New methods.
11504 (read_arm_attributes_section): Remove.
11505 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11506 information about them.
11507 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11508 to here.
11509
5ac169d4
DK
115102010-01-20 Doug Kwan <dougkwan@google.com>
11511
11512 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11513 Input_section_specifier to Section_id.
11514 (Target_arm::new_arm_input_section: Adjust code for change of key
11515 type.
11516 (Target_arm::find_arm_input_section): Ditto.
11517 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11518 (Section_id): Remove.
11519 (Garbage_collection::Section_id_hash): Remove.
11520 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11521 (Section_id): Remove.
11522 (Icf::Section_id_hash): Remove.
11523 * object.h (Section_id, Const_section_id, Section_id_hash,
11524 Const_section_id_hash): New type definitions.
11525 * output.cc (Output_section::add_relaxed_input_section): Change to
11526 use Const_section_id instead of Input_section_specifier as key type.
11527 (Output_section::add_merge_input_section): Ditto.
11528 (Output_section::build_relaxation_map): Change to use Section_id
11529 instead of Input_section_specifier as key type.
2e702c99 11530 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11531 Ditto.
11532 (Output_section::convert_input_sections_to_relaxed_sections): Change
11533 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11534 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11535 (Output_section::find_relaxed_input_section): Ditto.
11536 * output.h (Input_section_specifier): Remove class.
11537 (Output_section::Output_section_data_by_input_section_map): Change
11538 key type to Const_section_id.
11539 (Output_section::Output_relaxed_input_section_by_input_section_map):
11540 Ditto.
11541 (Output_section::Relaxation_map): Change key type to Section_id.
11542
a2162063
ILT
115432010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11544
11545 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11546 (class Arm_v4bx_stub): New class.
11547 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11548 (Stub_factory::make_arm_v4bx_stub): New method.
11549 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11550 (Stub_table::empty): Handle v4bx stubs.
11551 (Stub_table::add_arm_v4bx_stub): New method.
11552 (Stub_table::find_arm_v4bx_stub): New method.
11553 (Arm_relocate_functions::v4bx): New method.
11554 (Target_arm::fix_v4bx): New method.
11555 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11556 (Stub_table::relocate_stubs): Likewise.
11557 (Stub_table::do_write): Likewise.
11558 (Stub_table::update_data_size_and_addralign): Likewise.
11559 (Stub_table::finalize_stubs): Likewise.
11560 (Target_arm::Scan::local): Likewise.
11561 (Target_arm::Scan::global): Likewise.
11562 (Target_arm::do_finalize_sections): Likewise.
11563 (Target_arm::Relocate::relocate): Likewise.
11564 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11565 Likewise.
11566 (Target_arm::scan_reloc_for_stub): Likewise.
11567 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11568
5696ab0b
ILT
115692010-01-19 Ian Lance Taylor <iant@google.com>
11570
11571 * output.cc (Output_section_headers::do_sized_write): Write large
11572 segment count to sh_info field.
11573 (Output_file_header::do_sized_write): For large segment count,
11574 write PN_XNUM to e_phnum field.
11575
800d0f56
ILT
115762010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11577
11578 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11579 (Arm_relocate_functions::thm_jump8): New function.
11580 (Arm_relocate_functions::thm_jump11): New function.
11581 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11582 R_ARM_THM_JUMP11.
11583 (Target_arm::Scan::global): Likewise.
11584 (Target_arm::Relocate::relocate): Likewise.
11585 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11586 Likewise.
11587
41263c05
DK
115882010-01-14 Doug Kwan <dougkwan@google.com>
11589
11590 * arm.cc (map, utility): Include headers.
11591 (Target_arm::apply_cortex_a8_workaround): New method.
11592 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11593 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11594 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11595 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11596 the --[no-]fix-cortex-a8 command line options.
11597 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11598 (Target_arm::relocate_stub): Use addend in instruction template.
11599 * options.h (DEFINE_bool): Set the user-set flag.
11600 (General_options): Add --[no-]-fix-cortex options.
11601 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11602 : Update fast look-up map after conversion.
41263c05 11603
459e9b03
ST
116042010-01-14 Sriraman Tallam <tmsriram@google.com>
11605
11606 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11607 in the first pass of do_layout.
11608
b521dfe4
DK
116092010-01-13 Doug Kwan <dougkwan@google.com>
11610
11611 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11612 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11613 apparent compiler problem of not folding static constant integral
11614 data members of elfcpp::Elf_sizes<32>.
11615
44272192
DK
116162010-01-13 Doug Kwan <dougkwan@google.com>
11617
11618 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11619 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11620 Arm_relobj::scan_section_for_cortex_a8_erratum,
11621 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11622 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11623 sections to scan for relocation stubs into a new method
11624 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11625 relocation and Cortex-A8 stub scanning.
11626 (Target_arm::do_relax): Force stubs to be after stubbed sections
11627 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11628 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11629 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11630
44b71ece
ILT
116312010-01-12 Ian Lance Taylor <iant@google.com>
11632
11633 * target-reloc.h (visibility_error): New inline function.
11634 (relocate_section): Call visibility_error.
11635 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11636 (MOSTLYCLEANFILES): Likewise.
11637 (protected_4_pic.o, protected_3.err): New targets.
11638 * testsuite/protected_4.cc: New file.
11639
a120bc7f
DK
116402010-01-12 Doug Kwan <dougkwan@google.com>
11641
11642 * arm.cc (Cortex_a8_reloc): New class.
11643 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11644 and cortex_a8_relocs_info_.
11645 (Target_arm::fix_cortex_a8): New method definition.
11646 (Target_arm::Cortex_a8_relocs_info): New type.
11647 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11648 New data member declarations.
11649 (Target_arm::scan_reloc_for_stub): Record information about
11650 relocations for THUMB branches that might be exempted from the
11651 Cortex-A8 workaround.
11652 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11653 at the beginning of a relaxation pass.
11654
20138696
DK
116552010-01-12 Doug Kwan <dougkwan@google.com>
11656
11657 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11658 (Arm_relobj::Mapping_symbol_position,
11659 Arm_reloj::Mapping_symbol_position_less,
11660 Arm_relobj::Mapping_symbols_info): New types.
11661 (Target_arm::is_mapping_symbol_name): New method definition.
11662 (Arm_relobj::do_count_local_symbols): Save information about mapping
11663 symbols.
11664
089d69dc
DK
116652010-01-11 Doug Kwan <dougkwan@google.com>
11666
11667 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11668 Arm_relocate_functions::thumb32_branch_upper,
11669 Arm_relocate_functions::thumb32_branch_lower,
11670 Arm_relocate_functions::thumb32_cond_branch_offset,
11671 Arm_relocate_functions::thumb32_cond_branch_upper,
11672 Arm_relocate_functions::thumb32_cond_branch_lower,
11673 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11674 branch offset encoding.
11675 (Arm_relocate_functions::thumb_branch_common): Use new branch
11676 offset encoding methods to avoid code duplication.
11677 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11678 (Stub_addend_reader::operator()): Use new branch encoding method
11679 to avoid code duplication.
11680
99e5bff2
DK
116812010-01-11 Doug Kwan <dougkwan@google.com>
11682
11683 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11684 (Target_arm::do_finalize_sections): Define special EXIDX section
11685 symbols only if referenced.
11686 * gc.h (Garbage_collection::add_reference): New method.
11687 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11688 code duplication.
11689
98e090bd
ILT
116902010-01-11 Ian Lance Taylor <iant@google.com>
11691
d0a91bd8
ILT
11692 * script.cc (Version_script_info::build_expression_list_lookup):
11693 Change complaing about duplicate wildcard match from error to
11694 warning.
11695
98e090bd
ILT
11696 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11697 of 2009-12-30.
11698 (Version_script_info::Version_script_info): Initialize globs_,
11699 default_version_, default_is_global_, and exact_. Don't
11700 initialize globals_ or locals_.
11701 (Version_script_info::build_lookup_tables): Build local symbols
11702 first.
11703 (Version_script_info::unquote): New function.
11704 (Version_script_info::add_exact_match): New function.
11705 (Version_script_info::build_expression_list_lookup): Remove lookup
11706 parameter. Add is_global parameter. Change all callers. Handle
11707 wildcard pattern specially. Unquote pattern. Call
11708 add_exact_match.
11709 (Version_script_info::get_name_to_match): New function.
11710 (Version_script_info::get_symbol_version): New function.
11711 (Version_script_info::get_symbol_version_helper): Remove.
11712 (Version_script_info::check_unmatched_names): Call unquote.
11713 * script.h (class Version_script_info): Change get_symbol_version
11714 to be non-inline and add is_global parameter; change all callers.
11715 Rewrite symbol_is_local. Update declarations. Define struct
11716 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11717 Remove globals_ and locals_ members. Add exact_, globs_,
11718 default_version_, is_global_.
11719 (Version_script_info::Glob): Remove pattern, add expression and
11720 is_global. Update constructor. Change all callers.
11721 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11722 default version.
11723 (Versions::symbol_section_contents): If a symbol is undefined, or
11724 defined in a dynamic object, set the version index to
11725 VER_NDX_LOCAL.
11726 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11727 symbol_is_local.
11728 (Symbol_table::add_from_pluginobj): Likewise.
11729 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11730
d56962d3
DK
117312010-01-11 Doug Kwan <dougkwan@google.com>
11732
11733 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11734 (incremental_dump_LDADD): Add linking option for libintl.
11735 * Makefile.in: Regenerate.
11736
94e6ee91
L
117372010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11738
11739 PR gold/11144
11740 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11741 instead of -Ds.
11742 * testsuite/Makefile.in: Regenerated.
11743
e96c574b
DK
117442010-01-10 Doug Kwan <dougkwan@google.com>
11745
11746 * options.h (DEFINE_var): Use parentheses around argument varname__
11747 in macro body to avoid any unintended subsequent substitutions.
11748
7198066b
ILT
117492010-01-10 Ian Lance Taylor <iant@google.com>
11750
ba4d53bf
ILT
11751 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11752 candidates before doing symbol resolution.
11753
7198066b
ILT
11754 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11755 ODR candidates if only one is weak.
11756
a2beed37
ILT
117572010-01-08 Ian Lance Taylor <iant@google.com>
11758
11759 * script.cc (Version_script_info::build_expression_list_lookup):
11760 Don't warn about ambiguous version, just record the ambiguity.
11761 (Version_script_info::get_symbol_version_helper): Give error if
11762 version is ambiguous.
11763
2fb7225c
DK
117642010-01-08 Doug Kwan <dougkwan@google.com>
11765
11766 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11767 prev_data_size_ and prev_addralign_. Remove initializer for
11768 deleted data member has_been_changed_.
11769 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11770 to determine if the table is empty.
11771 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11772 Remove.
11773 (Stub_table::add_reloc_stub): Define method in class definition
11774 instead of just declaring it there.
11775 (Stub_table::add_cortex_a8_stub): New method definition.
11776 (Stub_table::update_data_size_and_addralign): Ditto.
11777 (Stub_table::finalize_stubs): Ditto.
11778 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11779 (Stub_table::do_addralign_): Return address alignment in the
11780 (Stub_table::do_reset_address_and_file_offset): Define method in
11781 class definition instead of declaring it there. Set current data
11782 size to be the data size of the previous pass.
11783 (Stub_table::set_final_data_size): Use current data size as the
11784 final data size.
11785 (Stub_table::relocate_stub): Change parameter type of stub from
11786 Reloc_stub pointer to Stub pointer.
11787 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11788 (Stub_table::Cortex_a8_stub_list): New typedef.
11789 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11790 Stub_table::prev_addralign_): New data member.
11791 (Arm_relobj::Arm_relobj): Initialize data member
11792 section_has_cortex_a8_workaround_.
11793 (Arm_relobj::section_has_cortex_a8_workaround,
11794 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11795 definitions.
11796 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11797 declarations.
11798 (Target_arm::relocate_stub): Change parameter type of stub from
11799 Reloc_stub pointer to Stub pointer.
11800 (Insn_template::size, Insn_template::alignment): Handle
11801 THUMB16_SPECIAL_TYPE.
11802 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11803 Stub_table::update_data_size_and_addralign,
11804 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11805 definitions.
11806 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11807 (Stub_table::do_write): Ditto.
11808 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11809
880cd20d
ILT
118102010-01-08 Ian Lance Taylor <iant@google.com>
11811
11812 PR 11108
11813 * symtab.h (class Symbol): Remove fields is_target_special_ and
11814 has_plt_offset_. Add field is_defined_in_discarded_section_.
11815 (Symbol::is_defined_in_discarded_section): New function.
11816 (Symbol::set_is_defined_in_discarded_section): New function.
11817 (Symbol::has_plt_offset): Rewrite.
11818 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11819 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11820 Don't initialize is_target_special_ or has_plt_offset_.
11821 Initialize is_defined_in_discarded_section_.
11822 (Symbol_table::add_from_relobj): If appropriate, set
11823 is_defined_in_discarded_section.
11824 * resolve.cc (Symbol::override_base_with_special): Don't test
11825 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11826 * target-reloc.h (relocate_section): Do special handling for
11827 symbols defined in discarded sections for global symbols as well
11828 as local symbols.
11829
2703e3eb
ILT
118302010-01-08 Ian Lance Taylor <iant@google.com>
11831
11832 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11833 the SHT_SYMTAB case.
11834
339d40a3
ILT
118352010-01-08 Ian Lance Taylor <iant@google.com>
11836
11837 * object.cc (Sized_relobj::do_layout): Don't get confused if
11838 layout_eh_frame returns NULL.
11839
abecea76
ILT
118402010-01-08 Ian Lance Taylor <iant@google.com>
11841
11842 PR 11084
11843 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11844 dynamic symbol table, use the normal symbol table.
11845 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11846 symbol table.
11847
6b7dd3f3
ILT
118482010-01-08 Ian Lance Taylor <iant@google.com>
11849
11850 PR 11072
11851 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11852 sections.
11853
36c50e63
L
118542010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11855
11856 * version.cc (print_version): Change to "Copyright 2010".
11857
e291e7b9
ILT
118582010-01-08 Ian Lance Taylor <iant@google.com>
11859
11860 PR 10287
11861 PR 11063
11862 * i386.cc (class Target_i386): Change return type of plt_section
11863 to be non-const.
11864 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11865 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11866 tls_desc_rel_ field.
11867 (Output_data_plt_i386::rel_tls_desc): New function.
11868 (Target_i386::rel_tls_desc_section): New function.
11869 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11870 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11871 R_386_TLS_DESC reloc in rel_tls_desc_section.
11872 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11873 Define struct Tlsdesc_info.
11874 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11875 (Target_x86_64::do_reloc_symbol_index): New function.
11876 (Target_x86_64::add_tlsdesc_info): New function.
11877 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11878 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11879 tlsdesc_rel_ field.
11880 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11881 all callers.
11882 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11883 (Target_x86_64::rela_tlsdesc_section): New function.
11884 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11885 handling.
11886 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11887 (Target_x86_64::do_reloc_addend): New function.
11888 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11889 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11890 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11891 (Output_reloc::type): New function.
11892 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11893 (Output_reloc::is_target_specific): New function.
11894 (Output_reloc::target_arg): New function.
11895 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11896 absolute relocs and target specific relocs.
11897 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11898 add_target_specific.
11899 (class Output_data_reloc) [SHT_RELA]: Likewise.
11900 * output.cc (Output_reloc::Output_reloc): Add four new versions
11901 for absolute relocs and target specific relocs.
11902 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11903 (Output_reloc::get_symbol_index): Likewise.
11904 (Output_reloc::local_section_offset): Check that local_sym_index_
11905 is not TARGET_CODE or 0.
11906 (Output_reloc::symbol_value): Likewise.
11907 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11908 reloc.
11909 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11910 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11911 functions.
11912 * layout.cc (add_target_dynamic_tags): Use output section for
11913 DT_PLTRELSZ and DT_JMPREL.
11914
3a44184e
ILT
119152010-01-07 Ian Lance Taylor <iant@google.com>
11916
11917 PR 11061
11918 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11919 function.
11920 (class Output_data_reloc_generic): Define.
11921 (class Output_data_reloc_base): Change base class to
11922 Output_data_reloc_generic. Change add() method to call
11923 bump_relative_reloc_count for a relative reloc. Remove
11924 sort_relocs_ field.
11925 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11926 to sort_relocs().
11927 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11928 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11929 appropriate.
11930 * layout.h (class Layout): Update declaration.
11931
ea715a34
ILT
119322010-01-07 Ian Lance Taylor <iant@google.com>
11933
11934 * output.h (class Output_data): Add const version of
11935 output_section and do_output_section.
11936 (class Output_section_data): Add const version of
11937 do_output_section.
11938 (class Output_section): Likewise.
11939 * layout.cc (Layout::add_target_dynamic_tags): New function.
11940 * layout.h (class Layout): Update declarations.
11941 * arm.cc (Target_arm::do_finalize_sections): Use
11942 add_target_dynamic_tags.
11943 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11944 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11945 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11946 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11947
659948a4
ILT
119482010-01-07 Ian Lance Taylor <iant@google.com>
11949
11950 PR 11042
11951 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11952 object as needed.
11953
9d3b86f6
ILT
119542010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11955 Ian Lance Taylor <iant@google.com>
11956
11957 PR 11019
11958 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11959 Xindex::read_symtab_xindex.
11960
bb0d3eb0
DK
119612010-01-07 Doug Kwan <dougkwan@google.com>
11962
11963 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11964 (Insn_template::thumb16_bcond_insn): New method declaration.
11965 (Insn_template): Fix spelling.
11966 (Stub::thumb16_special): New method declaration.
11967 (Stub::do_write): Define virtual method which was previously pure
11968 virtual.
11969 (Stub::do_thumb16_special): New method declaration.
11970 (Stub::do_fixed_endian_write): New template member.
11971 (Reloc_stub::do_write): Remove.
11972 (Reloc_stub::do_fixed_endian_write): Remove.
11973 (Cortex_a8_stub): New class definition.
11974 (Stub_factory::make_cortex_a8_stub): New method definition.
11975 (Stub_factory::Stub_factory): Add missing static storage class
11976 qualifier for elf32_arm_stub_a8_veneer_blx.
11977
ffeef7df
ILT
119782010-01-07 Ian Lance Taylor <iant@google.com>
11979
dc3f80fe
ILT
11980 PR 10980
11981 * options.h (class General_options): Add --warn-unresolved-symbols
11982 and --error-unresolved-symbols.
11983 * errors.cc (Errors::undefined_symbol): Implement
11984 --warn-unresolved-symbols.
11985
ffeef7df
ILT
11986 * options.h (class General_options): Add -z text and -z textoff.
11987 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11988
f1ec9ded
ST
119892010-01-06 Sriraman Tallam <tmsriram@google.com>
11990
11991 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11992 (Garbage_collection::cident_sections): New function.
11993 (Garbage_collection::add_cident_section): New function.
11994 (Garbage_collection::cident_sections_): New member.
11995 (gc_process_relocs): Add references to sections whose names are C
11996 identifiers.
11997 * gold.h (cident_section_start_prefix): New constant.
11998 (cident_section_stop_prefix): New constant.
11999 (is_cident): New function.
12000 * layout.cc (Layout::define_section_symbols): Replace string constants
12001 with the newly defined constants.
12002 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12003 C identifiers.
12004 * testsuite/Makefile.am: Add gc_orphan_section_test.
12005 * testsuite/Makefile.in: Regenerate.
12006 * testsuite/gc_orphan_section_test.cc: New file.
12007 * testsuite/gc_orphan_section_test.sh: New file.
12008
6eda8c29
ILT
120092010-01-06 Ian Lance Taylor <iant@google.com>
12010
b9674e17
ILT
12011 PR 10980
12012 * options.h (class General_options): Add --warn-shared-textrel.
12013 * layout.cc (Layout::finish_dynamic_section): Implement
12014 --warn-shared-textrel.
12015
6eda8c29
ILT
12016 PR 10980
12017 * options.h (class General_options): Add --warn-multiple-gp.
12018
32dcd44e
ILT
120192010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12020
12021 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12022 $(THREADSLIB) and $(LIBDL).
12023 * Makefile.in: Rebuild.
12024
a192ba05
ILT
120252010-01-06 Ian Lance Taylor <iant@google.com>
12026
12027 PR 10980
12028 * options.cc (General_options::parse_section_start): New function.
12029 (General_options::section_start): New function.
12030 (General_options::General_options): Initialize all members.
12031 * options.h: Include <map>
12032 (class General_options): Add --section-start. Add section_starts_
12033 member.
12034 * layout.cc (Layout::attach_allocated_section_to_segment): If
12035 --section-start was used, set the address of the segment. Remove
12036 local sort_sections.
12037 (Layout::relaxation_loop_body): If the address of the load segment
12038 has been set by --section-start, don't use it.
12039 * output.h (Output_segment::update_flags_for_output_section): New
12040 function.
12041 * output.cc (Output_segment::add_output_section): Call
12042 update_flags_for_output_section.
12043
dde3f402
ILT
120442010-01-05 Ian Lance Taylor <iant@google.com>
12045
62dfdd4d
ILT
12046 PR 10980
12047 * options.h (class General_options): Add --undefined-version.
12048 * script.cc (struct Version_expression): Add was_matched_by_symbol
12049 field.
12050 (Version_script_info::matched_symbol): New function.
12051 (Version_script_info::get_symbol_version_helper): Call
12052 matched_symbol.
12053 (Version_script_info::check_unmatched_names): New function.
12054 * script.h (class Version_script_info): Update declarations.
12055 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12056
9c4ae156
ILT
12057 * options.h (class General_options): Use DEFINE_bool_alias for
12058 allow_multiple_definition.
12059 * resolve.cc (Symbol_table::should_override): Don't test
12060 allow_multiple_definition.
12061
dde3f402
ILT
12062 PR 10980
12063 * options.h (class General_options): Add --cref.
12064 * main.cc (main): Print cref table if --cref. Don't close mapfile
12065 until after printing cref table.
12066 * cref.cc: Include "symtab.h".
12067 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12068 (Cref_table_compare::operator()): New function.
12069 (Cref_inputs::gather_cref): New function.
12070 (filecol): New static const.
12071 (Cref_inputs::print_cref): New function.
12072 (Cref::print_cref): New function.
12073 * cref.h: Include <cstdio>.
12074 (class Cref): Update declarations.
12075 * mapfile.h (Mapfile::file): New function.
12076 * object.h (class Object): Define Symbols. Declare virtual
12077 do_get_global_symbols.
12078 (Object::get_global_symbols): New function.
12079 * object.cc (Input_objects::add_object): Pass object to cref_ if
12080 --cref.
12081 (Input_objects::archive_start): Likewise.
12082 (Input_objects::archive_stop): Likewise.
12083 (Input_objects::print_cref): New function.
12084 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12085 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12086 --cref.
12087 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12088 function.
12089 * plugin.h (class Sized_pluginobj): Update declarations.
12090
8781f709
ILT
120912010-01-05 Ian Lance Taylor <iant@google.com>
12092
12093 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12094 to is_default_version. Rename insdef to insdefault.
12095 (Symbol_table::add_from_relobj): Rename def to is_default_version
12096 and local to is_forced_local.
12097 (Symbol_table::add_from_pluginobj): Likewise.
12098 (Symbol_table::add_from_dynobj): Likewise.
12099 (Symbol_table::define_special_symbol): Rename insdef to
12100 insdefault.
12101
fe35d28d
ILT
121022010-01-04 Ian Lance Taylor <iant@google.com>
12103
30bc8c46
ILT
12104 PR 10980
12105 * options.h (class General_options): Add
12106 --allow-multiple-definition and -z muldefs.
12107 * resolve.cc (Symbol_table::should_override): Don't warn about a
12108 multiple symbol definition if --allow-multiple-definition or -z
12109 muldefs.
12110
7eaea549
ILT
12111 PR 10980
12112 * options.h (class General_options): Add --add-needed and
12113 --copy-dt-needed-entries. Tweak --as-needed help entry.
12114 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12115 error if --copy-dt-needed-entries aka --add-needed is used and
12116 would cause a change in behaviour.
12117
fe35d28d
ILT
12118 PR 10980
12119 * options.h (class General_options): Add -G as a short version of
12120 --shared. Add no-op options -assert, -g, and -i.
12121
55a2bb35
ST
121222010-01-04 Sriraman Tallam <tmsriram@google.com>
12123
12124 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12125 check for .text or .gnu.linkonce.t sections.
12126 * icf.cc (Icf::find_identical_sections): Ditto.
12127 Change the detection for mangled function name within the section
12128 name.
12129 * icf.h (is_section_foldable_candidate): New function.
12130
719328e1
ILT
121312009-12-30 Ian Lance Taylor <iant@google.com>
12132
12133 PR 10980
12134 * options.h (class General_options): Permit two dashes with
12135 --retain-symbols-file.
12136
d7bb5745
ILT
121372009-12-30 Ian Lance Taylor <iant@google.com>
12138
403a15dd
ILT
12139 PR 10979
12140 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12141 don't put the file header and segment headers in the text
12142 segment.
12143
eda294df
ILT
12144 PR 10979
12145 * common.cc (Sort_commons::operator()): Stabilize sort when both
12146 entries are NULL.
12147 (Symbol_table::do_allocate_commons_list): When allocating common
12148 symbols, skip a symbol which is no longer common.
12149 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12150 an object before checking its type.
12151 * testsuite/common_test_2.c: New file.
12152 * testsuite/common_test_3.c: New file.
12153 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12154 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12155 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12156 (common_test_2_pic.o, common_test_2.so): New targets.
12157 (common_test_3_pic.o, common_test_3.so): New targets.
12158 * testsuite/Makefile.in: Rebuild.
12159
d7bb5745
ILT
12160 PR 10979
12161 * script.cc (read_input_script): If we see a new SECTIONS clause,
12162 and we have added an input section, give an error.
12163 * layout.h (class Layout): Add have_added_input_section function.
12164 Add have_added_input_section_ field.
12165 * layout.cc (Layout::Layout): Initialize
12166 have_added_input_section_.
12167 (Layout::layout): Set have_added_input_section_.
12168 (Layout::layout_eh_frame): Likewise.
12169
fc59c572
ILT
121702009-12-30 Ian Lance Taylor <iant@google.com>
12171
12172 PR 10931
12173 * options.h (class General_options): Add --sort-common option.
12174 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12175 * common.cc (Sort_common): Add sort_order parameter to
12176 constructor. Add sort_order_ field.
12177 (Sort_commons::operator): Check sort_order_.
12178 (Symbol_table::allocate_commons): Determine the sort order.
12179 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12180 Change all callers.
12181 (Symbol_table::do_allocate_commons_list): Likewise.
12182
1c74fab0
ILT
121832009-12-30 Ian Lance Taylor <iant@google.com>
12184
12185 PR 10916
12186 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12187 symbols from this object, don't change the visibility of an
12188 undefined symbol.
12189 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12190
6affe781
ILT
121912009-12-30 Ian Lance Taylor <iant@google.com>
12192
12193 PR 10861
12194 * script.h (class Version_script_info): Define Language enum.
12195 Update declarations. Define Glob, Exact, and Lookup types. Add
12196 new fields globals_, locals_, and is_finalized_.
12197 * script.cc: Various formatting fixes.
12198 (class Parser_closure): Change language_stack_ from a vector of
12199 std::string to one of Version_script_info::Language. Adjust all
12200 uses accordingly.
12201 (class Lazy_demangler): Remove.
12202 (struct Version_expression): Change language from std::string to
12203 Version_script_info::Language.
12204 (Version_script_info::Version_script_info): New function.
12205 (Version_script_info::~Version_script_info): Don't call clear.
12206 (Version_script_info::finalize): New function.
12207 (Version_script_info::build_lookup_tables): New function.
12208 (Version_script_info::build_expression_list_lookup): New
12209 function.
12210 (Version_script_info::get_symbol_version_helper): Rewrite to use
12211 lookup tables.
12212 (Version_script_info::print_expression_list): Adjust to use
12213 Version_script_info::Language.
12214 (script_push_lex_into_version_mode): Check that the version script
12215 has not been finalized.
12216 (version_script_push_lang): Change language string to
12217 Version_script_info::Language.
12218 * options.cc (Command_line::version_script): New function.
12219 * options.h (class General_options): Add finalize_dynamic_list
12220 function. Change version_script from declaration to definition.
12221 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12222 * testsuite/version_script.map: Remove duplicate def of foo.
12223 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12224 version_script.map.
12225 * testsuite/Makefile.in: Rebuild.
12226
818bf354
ILT
122272009-12-30 Ian Lance Taylor <iant@google.com>
12228
12229 PR 10843
12230 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12231 if the input symbol index is 0, make the output symbol index 0.
12232
ebcc8304
ILT
122332009-12-30 Ian Lance Taylor <iant@google.com>
12234
12235 PR 10670
12236 * options.h (class General_options): Add -x/--discard-all.
12237 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12238 --discard-all. If the local symbol needs a dynamic entry, check
12239 that before handling --discard-locals.
12240
176fe33f
ILT
122412009-12-30 Ian Lance Taylor <iant@google.com>
12242
bb321bb1
ILT
12243 PR 10450
12244 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12245 flags to PF_R.
12246 (Output_segment::add_output_section): Don't change the flags if
12247 the type is PT_TLS.
12248
176fe33f
ILT
12249 PR 10450
12250 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12251 GNU hash table if they need a dynamic value. Otherwise, don't add
12252 them if they are defined in a dynamic object or are forced local.
12253
e8cd95c7
ILT
122542009-12-29 Ian Lance Taylor <iant@google.com>
12255
1b81fb71
ILT
12256 PR 10450
12257 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12258 .gnu.hash table for a 32-bit target.
12259
8d6d383d
ILT
12260 PR 10450
12261 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12262 regular and a dynamic object only needs a dynamic symbol table
12263 entry if it is externally visible.
12264
e785ec03
ILT
12265 PR 10450
12266 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12267 constructor. Add global_offset_table_ field.
12268 (Target_i386::got_section): Set global_offset_table_.
12269 (Target_i386::do_finalize_sections): Set global_offset_table_
12270 size.
12271 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12272 in constructor. Add global_offset_table_ field.
12273 (Target_x86_64::got_section): Set global_offset_table_.
12274 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12275 size.
12276
1a2dff53
ILT
12277 * layout.cc (Layout::Layout): Initialize increase_relro_.
12278 (Layout::get_output_section): Add is_relro, is_last_relro, and
12279 is_first_non_relro parameters. Change all callers.
12280 (Layout::choose_output_section): Likewise.
12281 (Layout::add_output_section_data): Likewise.
12282 (Layout::make_output_section): Likewise.
12283 (Layout::set_segment_offsets): Clear increase_relro when using a
12284 linker script.
12285 * layout.h (class Layout): Add increase_relro method. Add
12286 increase_relro_ field. Update declarations.
12287 * output.cc (Output_section::Output_section): Initialize
12288 is_last_relro_ and is_first_non_relro_.
12289 (Output_segment::add_output_section): Group relro sections is
12290 do_sort is true. Handle is_last_relro and is_first_non_relro.
12291 (Output_segment::maximum_alignment): Remove relro handling.
12292 (Output_segment::set_section_addresses): Add increase_relro
12293 parameter. Change all callers. Add initial alignment to align
12294 relro sections on separate page. Remove old relro handling.
12295 (Output_segment::set_section_list_addresses): Remove in_relro
12296 parameter. Change all callers.
12297 (Output_segment::set_offset): Add increase parameter. Change all
12298 callers. Remove old relro handling.
12299 * output.h (class Output_section): Add new methods: is_last_relro,
12300 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12301 Add is_last_relro_ and is_first_non_relro_ fields.
12302 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12303 Create separate .got.plt section. Call increase_relro.
12304 * x86_64.cc (Target_x86_64::got_section): Likewise.
12305 * testsuite/relro_script_test.t: Add .got.plt.
12306
f0ba79e2
ILT
12307 PR 10450
12308 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12309 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12310 (Layout::finalize): Call set_dynamic_symbol_size.
12311 (Layout::set_dynamic_symbol_size): New function.
12312 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12313 set_dynamic_symbol_size.
12314
e8cd95c7
ILT
12315 PR 10450
12316 * output.h (class Output_section): Add is_entsize_zero_ field.
12317 * output.cc (Output_section::Output_section): Initialize
12318 is_entsize_zero_.
12319 (Output_section::set_entsize): If two different entsizes are
12320 requested, force it to zero.
12321 (Output_section::add_input_section): Set flags for .debug_str
12322 before updating section flags. Set entsize.
12323 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12324 and SHF_STRING if all input sections have those flags.
12325
3e1b9a8a
RÁE
123262009-12-29 Rafael Espindola <espindola@google.com>
12327
12328 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12329 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12330 reporting.
3e1b9a8a 12331
3dcad376
ST
123322009-12-29 Sriraman Tallam <tmsriram@google.com>
12333
12334 * options.cc (General_options::parse_version): Allow -v to exit
12335 without an error if there is nothing to link.
12336
084e2665
ILT
123372009-12-29 Ian Lance Taylor <iant@google.com>
12338
12339 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12340 using a version of gcc before 4.1.
12341 * configure: Rebuild.
12342
250acde3
CD
123432009-12-28 Chris Demetriou <cgd@google.com>
12344
12345 * attributes.cc (Output_attributes_section_data::do_write): Use
12346 std::vector::front rather than std::vector::data.
12347
99fff23b
ILT
123482009-12-28 Ian Lance Taylor <iant@google.com>
12349
12350 * symtab.h (class Symbol_table): Add enum Defined.
12351 * resolve.cc (Symbol_table::should_override): Add defined
12352 parameter. Change all callers. Test whether object is NULL
12353 before calling a method on it.
12354 (Symbol_table::report_resolve_problem): Add defined parameter.
12355 Change all callers.
12356 (Symbol_table::should_override_with_special): Likewise.
12357 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12358 parameter. Change all callers.
12359 (Symbol_table::do_define_in_output_data): Likewise.
12360 (Symbol_table::define_in_output_segment): Likewise.
12361 (Symbol_table::do_define_in_output_segment): Likewise.
12362 (Symbol_table::define_as_constant): Likewise.
12363 (Symbol_table::do_define_as_constant): Likewise.
12364 * script.h (class Symbol_assignment): Add is_defsym parameter to
12365 constructor; change all callers.
12366 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12367 parameter. Change all callers. Add is_defsym_ field.
12368 (class Parser_closure): Add parsing_defsym parameter to
12369 constructor; change all callers. Add parsing_defsym accessor
12370 function. Add parsing_defsym_ field.
12371
556bd683
ILT
123722009-12-28 Ian Lance Taylor <iant@google.com>
12373
12374 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12375 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12376
1782c879
ILT
123772009-12-23 Ian Lance Taylor <iant@google.com>
12378
12379 * i386.cc (Target_i386::do_calls_non_split): Recognize
12380 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12381 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12382 -fsplit-stack prologue when using %r11.
1782c879 12383
329ca2b1
ST
123842009-12-21 Sriraman Tallam <tmsriram@google.com>
12385
12386 * options.cc (General_options::parse_version): Make -v continue and do
12387 the link like GNU ld does.
12388
d675ff46
RÁE
123892009-12-17 Rafael Avila de Espindola <espindola@google.com>
12390
12391 * Makefile.am (CCFILES): Add timer.cc.
12392 (HFILES): Add timer.h.
12393 * configure.ac: Check for sysconf and times.
12394 * main.cc: include timer.h.
12395 (main): Use Timer instead of get_run_time.
12396 * timer.cc: New.
12397 * timer.h: New.
12398 * workqueue.cc: include timer.h.
12399 (Workqueue::find_and_run_task):
12400 Report user, sys and wall time.
12401 * Makefile.in: Regenerate.
12402 * config.in: Regenerate.
12403 * configure: Regenerate.
12404
d6344fb5
DK
124052009-12-16 Doug Kwan <dougkwan@google.com>
12406
12407 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12408 sections.
12409 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12410 relaxed input sections.
12411 * output.cc (Output_section::find_relaxed_input_section): Change
12412 return type to Output_relaxed_input_section pointer. Adjust code
12413 for new type of relaxed_input_section_map_.
12414 * output.h (Output_section::find_relaxed_input_section): Change
12415 return type to Output_relaxed_input_section pointer.
12416 (Output_section::Output_relaxed_input_section_by_input_section_map):
12417 New type.
12418 (Output_section::relaxed_input_section_map_): Change type to
12419 Output_section::Output_relaxed_input_section_by_input_section_map.
12420 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12421 input section.
12422
0e0d5469
ILT
124232009-12-15 Ian Lance Taylor <iant@google.com>
12424
12425 * layout.cc (Layout::create_shstrtab): Only write out after input
12426 sections if we are compressing debug sections.
12427
0649a889
ILT
124282009-12-15 Ian Lance Taylor <iant@google.com>
12429
12430 * archive.cc (Archive::add_symbols): Only look up a symbol without
12431 a version if there is, in fact, a version.
12432
2ea97941
ILT
124332009-12-14 Ian Lance Taylor <iant@google.com>
12434
12435 Revert -Wshadow changes, all changes from:
12436 2009-12-11 Doug Kwan <dougkwan@google.com>
12437 2009-12-11 Nick Clifton <nickc@redhat.com>
12438 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12439
b0eec2cc
DK
124402009-12-11 Doug Kwan <dougkwan@google.com>
12441
12442 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12443 due to -Wshadow.
12444 * attributes.cc (Object_attribute::size): Ditto.
12445 (Attributes_section_data::size): Ditto.
12446 (Attributes_section_data::Attributes_section_data): Ditto.
12447 (Output_attributes_section_data::do_write): Ditto.
12448 * attributes.h (Object_attribute::set_type): Ditto.
12449 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12450
91d6fa6a
NC
124512009-12-11 Nick Clifton <nickc@redhat.com>
12452
12453 * archive.cc: Fix shadowed variable warnings.
12454 * arm.cc: Likewise.
12455 * compressed_output.cc: Likewise.
12456 * compressed_output.h: Likewise.
12457 * configure: Likewise.
12458 * dwarf_reader.cc: Likewise.
12459 * dynobj.cc: Likewise.
12460 * dynobj.h: Likewise.
12461 * ehframe.cc: Likewise.
12462 * ehframe.h: Likewise.
12463 * errors.cc: Likewise.
12464 * expression.cc: Likewise.
12465 * fileread.cc: Likewise.
12466 * fileread.h: Likewise.
12467 * freebsd.h: Likewise.
12468 * i386.cc: Likewise.
12469 * icf.cc: Likewise.
12470 * incremental.h: Likewise.
12471 * layout.cc: Likewise.
12472 * layout.h: Likewise.
12473 * mapfile.cc: Likewise.
12474 * merge.cc: Likewise.
12475 * merge.h: Likewise.
12476 * object.cc: Likewise.
12477 * object.h: Likewise.
12478 * options.h: Likewise.
12479 * output.cc: Likewise.
12480 * output.h: Likewise.
12481 * parameters.cc: Likewise.
12482 * plugin.cc: Likewise.
12483 * powerpc.cc: Likewise.
12484 * reduced_debug_output.cc: Likewise.
12485 * reduced_debug_output.h: Likewise.
12486 * reloc.cc: Likewise.
12487 * reloc.h: Likewise.
12488 * resolve.cc: Likewise.
12489 * script-sections.cc: Likewise.
12490 * script.cc: Likewise.
12491 * script.h: Likewise.
12492 * sparc.cc: Likewise.
12493 * symtab.cc: Likewise.
12494 * symtab.h: Likewise.
12495 * target-select.cc: Likewise.
12496 * target-select.h: Likewise.
12497 * token.h: Likewise.
12498 * workqueue.cc: Likewise.
12499 * workqueue.h: Likewise.
12500 * x86_64.cc: Likewise.
12501
a0351a69
DK
125022009-12-10 Doug Kwan <dougkwan@google.com>
12503
12504 * arm.cc (attributes.h): New include.
12505 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12506 (Arm_relobj::~Arm_relobj): Delete object pointed by
12507 attributes_section_data_.
12508 (Arm_relobj::attributes_section_data): New method definition.
12509 (Arm_relobj::attributes_section_data_): New data member declaration.
12510 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12511 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12512 attributes_section_data_.
12513 (Arm_dynobj::attributes_section_data): New method definition.
12514 (Arm_dynobj::attributes_section_data_): New data member declaration.
12515 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12516 initialization value of may_use_blx_ to false.
2e702c99 12517 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12518 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12519 object attributes to compute results instead of hard-coding.
12520 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12521 Target_arm::get_secondary_compatible_arch,
12522 Target_arm::set_secondary_compatible_arch
12523 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12524 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12525 New method declarations.
12526 (Target_arm::get_aeabi_object_attribute): New method definition.
12527 (Target_arm::attributes_section_data_): New data member declaration.
12528 (read_arm_attributes_section): New template definition.
12529 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12530 (Arm_dynobj::do_read_symbols): Ditto.
12531 (Target_arm::do_finalize_sections): Merge attributes sections from
12532 input. Check for BLX use after attributes section merging.
12533 Fix __exidx_start and __exidx_end visibility. Create an
12534 .ARM.attributes section if necessary.
12535 (Target_arm::get_secondary_compatible_arch,
12536 Target_arm::set_secondary_compatible_arch,
12537 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12538 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12539 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12540 New method definitions.
12541
b59befec
ILT
125422009-12-09 Ian Lance Taylor <iant@google.com>
12543
12544 * plugin.cc (Plugin::load): Don't cast from void* to a function
12545 pointer.
12546
1276bc89
ILT
125472009-12-09 Ian Lance Taylor <iant@google.com>
12548
12549 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12550 information fields.
12551
2f2de248
L
125522009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12553
12554 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12555 Replace two_file_shared_1.so with two_file_shared_2.so.
12556 * testsuite/Makefile.in: Regenerated.
12557
4f787271
DK
125582009-12-08 Doug Kwan <dougkwan@google.com>
12559
12560 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12561 (HFILES): Add attributes.h and int_encoding.h.
12562 * Makefile.in: Regenerate.
12563 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12564 function definitions to int_encoding.cc
12565 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12566 prototypes to int_encoding.h
12567 * reduced_debug_output.cc (int_encoding.h): New include.
12568 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12569 function definitions to int_encoding.cc
12570 (insert_into_vector, read_from_pointer): Move template definitions to
12571 int_encoding.h
12572 * attributes.cc: New file.
12573 * attributes.h: New file.
12574 * int_encoding.cc: New file.
12575 * int_encoding.h: New file.
12576
20b52f1a
RÁE
125772009-12-07 Rafael Avila de Espindola <espindola@google.com>
12578
12579 PR gold/11055
12580 * incremental-dump.cc (dump_incremental_inputs): New.
12581 (main): Use dump_incremental_inputs.
12582
53d7974c
L
125832009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12584
12585 PR gold/10893
12586 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12587 checking elfcpp::STT_FUNC.
12588 (Target_i386::Relocate::relocate): Likewise.
12589 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12590
12591 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12592 symbols from shared libraries into normal FUNC symbols.
12593
12594 * symtab.h (Symbol): Add is_func and use it.
12595
05a352e6
DK
125962009-12-05 Doug Kwan <dougkwan@google.com>
12597
12598 * arm.cc (Target_arm::arm_info): Initialize new fields
12599 attributes_section and attributes_vendor.
12600 * i386.cc (Target_i386::i386_info): Same.
12601 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12602 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12603 fields attributes_section and attributes_vendor.
53d7974c 12604 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12605 * target.h (Target::attributes_section, Target::attributes_vendor,
12606 Target::is_attributes_section, Target::attribute_arg_type,
12607 Target::attributes_order): New method definitions.
12608 (Target::Target_info::attributes_section,
12609 Target::Target_info::attributes_vendor): New fields.
12610 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12611 virtual method definitions.
12612 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12613 attributes_section and attributes_vendor.
12614 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12615
f4e5969c
DK
126162009-12-05 Doug Kwan <dougkwan@google.com>
12617
12618 * arm.cc: Update comments about interworking and stub generation.
12619 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12620 considered as non-PIC.
12621 (Arm_relocate_functions::base_abs): Fix formatting.
12622 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12623 of function to use GOT entry address instead of offset.
12624 (Target_arm::Scan::global): Issue an error if a symbol would need a
12625 PLT does not get one because it is untyped. Remove code to create
12626 dynamic symbols for relative branches.
12627 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12628 takes unsigned integer instead of boolean.
12629
1abce4a6
L
126302009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12631
12632 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12633 (two_file_test_LDADD): Likewise.
12634 (common_test_1_LDADD): Likewise.
12635 (exception_test_LDADD) Likewise.
12636 (weak_test_LDADD): Likewise.
12637 (many_sections_test_LDADD): Likewise.
12638 (initpri1_LDADD): Likewise.
12639 (script_test_1_LDADD): Likewise.
12640 (script_test_2_LDADD): Likewise.
12641 (justsyms_LDADD): Likewise.
12642 (binary_test_LDADD): Likewise.
12643 (large_LDADD): Likewise.
12644 * testsuite/Makefile.in: Regenerated.
12645
adcf2816 126462009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12647
adcf2816
L
12648 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12649 (Symbol_table::override_with_special): Likewise.
12650 (Symbol_table::add_from_object): Likewise.
12651
28e67f5d
RÁE
126522009-12-04 Rafael Avila de Espindola <espindola@google.com>
12653
12654 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12655 Don't set the data_offset twice.
12656
ae10a101
RÁE
126572009-12-04 Rafael Avila de Espindola <espindola@google.com>
12658
12659 * testsuite/Makefile.in: Regenerate.
12660
f59f41f3
DK
126612009-12-03 Doug Kwan <dougkwan@google.com>
12662
12663 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12664 (Target_arm::do_finalize_sections): Add parameter for symbol table
12665 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12666 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12667 parameter for symbol table pointer.
12668 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12669 an additional parameter for a pointer to symbol table.
12670 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12671 parameter for a symbol table pointer.
12672 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12673 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12674 Ditto.
12675 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12676 parameter for a symbol table pointer.
12677
ca55d848
RÁE
126782009-12-03 Rafael Avila de Espindola <espindola@google.com>
12679
12680 * incremental.cc (Incremental_inputs_header)
12681 (Incremental_inputs_header_write, Incremental_inputs_entry)
12682 (Incremental_inputs_entry_write): Move ...
12683 * incremental.h (Incremental_inputs_header)
12684 (Incremental_inputs_header_write, Incremental_inputs_entry)
12685 (Incremental_inputs_entry_write): here.
12686
3aec4f9c
RÁE
126872009-12-02 Rafael Avila de Espindola <espindola@google.com>
12688
12689 * incremental.cc (make_sized_incremental_binary): Set the target.
12690 Error if it is incompatible.
12691 * output.h (Output_file): Add filename method.
12692
9c0ae74d
RÁE
126932009-12-02 Rafael Avila de Espindola <espindola@google.com>
12694
12695 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12696 from the get_* methods.
12697
a45500ae
RÁE
126982009-12-02 Rafael Avila de Espindola <espindola@google.com>
12699
12700 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12701 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12702 Write 0 for the data_offset of scripts.
12703
325e6408
RÁE
127042009-12-02 Rafael Avila de Espindola <espindola@google.com>
12705
12706 * testsuite/Makefile.am: Add the incremental_test.sh test.
12707 * testsuite/incremental_test.sh: New.
12708 * testsuite/incremental_test_1.c: New.
12709 * testsuite/incremental_test_2.c: New.
12710
954c3e2e
RÁE
127112009-12-01 Rafael Avila de Espindola <espindola@google.com>
12712
703d02da 12713 * incremental-dump.cc (main): Fix typos.
954c3e2e 12714
f8086623
RÁE
127152009-11-27 Rafael Avila de Espindola <espindola@google.com>
12716
12717 PR gold/11025
12718 * incremental-dump.cc (main): Use llu to print 64 bit values.
12719
3b0dd6ac
L
127202009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12721 H.J. Lu <hongjiu.lu@intel.com>
12722
12723 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12724 $(LIBDL).
12725 (incremental_dump_LDADD): Likewise.
12726 * Makefile.in: Regenerated.
12727
a6d1ef57 127282009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12729
a6d1ef57
DK
12730 Revert:
12731
12732 2009-11-25 Doug Kwan <dougkwan@google.com>
12733
12734 * arm.cc (Target_arm::Target_arm): Move method definition
12735 outside of class definition. Add code to handle
12736 --target1-rel, --target1-abs and --target2= options.
12737 (Target_arm::get_reloc_reloc_type): Change method to be
12738 non-static and const.
12739 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12740 New data member declaration.
12741 (Target_arm::Scan::local, Target_arm::Scan::global,
12742 Target_arm::Relocate::relocate,
12743 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12744 Adjust call to Target_arm::get_real_reloc_type.
12745 (Target_arm::get_real_reloc_type): Use command line options
12746 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12747 * options.h (--target1-rel, --target1-abs, --target2): New
12748 ARM-only options.
12749
50aeb7d4
DK
127502009-11-25 Doug Kwan <dougkwan@google.com>
12751
12752 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12753 class definition. Add code to handle --target1-rel, --target1-abs
12754 and --target2= options.
12755 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12756 and const.
12757 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12758 member declaration.
12759 (Target_arm::Scan::local, Target_arm::Scan::global,
12760 Target_arm::Relocate::relocate,
12761 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12762 call to Target_arm::get_real_reloc_type.
12763 (Target_arm::get_real_reloc_type): Use command line options to
12764 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12765 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12766 options.
12767
51938283
DK
127682009-11-25 Doug Kwan <dougkwan@google.com>
12769
12770 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12771 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12772 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12773 formatting.
12774 (Arm_relocate_functions::thm_call): Replace body with a call to
12775 Arm_relocate_functions::thumb_branch_common.
12776 (Arm_relocate_functions::thm_jump24,
12777 Arm_relocate_functions::thm_xpc22): New method definitions.
12778 (Arm_relocate_functions::thumb_branch_common): New method definition.
12779 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12780 operator.
12781 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12782 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12783
e2b8f3c4
RÁE
127842009-11-24 Rafael Avila de Espindola <espindola@google.com>
12785
12786 * Makefile.am: Build incremental-dump
12787 * Makefile.in: Regenerate.
12788 * incremental-dump.cc: New.
12789 * incremental.cc (Incremental_inputs_header_data,
12790 Incremental_inputs_entry_data): Move to incremental.h
12791 * incremental.h: (Incremental_inputs_header_data,
12792 Incremental_inputs_entry_data): Move from incremental.cc
12793
bcba9aec
RÁE
127942009-11-24 Rafael Avila de Espindola <espindola@google.com>
12795
12796 * incremental.cc (Incremental_inputs_header,
12797 Incremental_inputs_header_write, Incremental_inputs_entry,
12798 Incremental_inputs_entry_write): Add a typedef with the data type.
12799
7c3afe08
RÁE
128002009-11-24 Rafael Avila de Espindola <espindola@google.com>
12801
12802 * incremental.cc (Incremental_inputs_header,
12803 Incremental_inputs_header_write, Incremental_inputs_entry,
12804 Incremental_inputs_entry_write): Update comment about which
12805 type has the filed descriptions.
12806
d204b6e9
DK
128072009-11-15 Doug Kwan <dougkwan@google.com>
12808
12809 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12810 (Arm_relocate_functions::arm_branch_common): Change method defintion
12811 in class definition to a method declaration and update list of formal
12812 parameters.
12813 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12814 Arm_relocation_functions::jump24): Adjust call to
12815 Arm_relocate_functions::arm_branch_common. Update list of formal
12816 parameters.
12817 (Arm_relocate_functions::xpc25): New method definition.
12818 (Arm_relocate_functions::arm_branch_common): Move method defintion
12819 out from class definition. Use stubs for mode-switching and extending
12820 branch ranges.
12821 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12822 specially. Change code to enable use of stubs in ARM branches.
12823
43d12afe
DK
128242009-11-10 Doug Kwan <dougkwan@google.com>
12825
12826 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12827 in method declaration.
12828 (Target_arm::relocate_stub): New method declaration.
12829 (Target_arm::default_target): Change to return a pointer instead of
12830 a const reference.
12831 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12832 Target_arm::default_target.
12833 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12834 method definition.
12835 (Target_arm::relocate_section): Adjust view.
12836 (Target_arm::relocate_stub): New method definition.
12837
ac33a407
DK
128382009-11-10 Doug Kwan <dougkwan@google.com>
12839
12840 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12841 a format warning.
12842 * incremental.cc (open_incremental_binary): Initialized local
12843 variables to avoid warnings.
12844 * object.cc (make_elf_object): Ditto.
12845 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12846 a format warning.
e1df38aa 12847
88ee28e9
L
12848009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12849
12850 PR gold/10930
12851 * testsuite/plugin_test.c: Include "config.h".
12852
2daedcd6
DK
128532009-11-09 Doug Kwan <dougkwan@google.com>
12854
12855 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12856 (arm_symbol_value): Remove.
12857 (Arm_relocate_functions::arm_branch_common,
12858 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12859 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12860 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12861 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12862 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12863 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12864 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12865 Arm_relocate_functions::thm_mobw_abs_nc,
12866 Arm_relocate_functions::thm_mov_abs,
12867 Arm_relocate_functions::movw_prel_nc,
12868 Arm_relocate_functions::thm_movt_abs,
12869 Arm_relocate_functions::movt_prel,
12870 Arm_relocate_functions::thm_movw_prel_nc,
12871 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12872 (Target_arm::Relocate::relocate): Only decompose address into two
12873 parts if relocation type uses the thumb-bit and pass the actual
12874 bit instead of a flag indicating that the thumb-bit is used. Adjust
12875 calls to methods in Arm_relocate_functions for this change.
12876
1276bc89 128772009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12878
12879 PR 10925
12880 * reloc.cc: Instantiate
12881 Sized_relobj::initialize_input_to_output_maps and
12882 Sized_relobj:free_input_to_output_maps.
12883
e53ad1b5
ILT
128842009-11-06 Ian Lance Taylor <iant@google.com>
12885
12886 PR 10876
12887 * defstd.cc (in_segment): Set only_if_ref true for "end".
12888
eb44217c
DK
128892009-11-06 Doug Kwan <dougkwan@google.com>
12890
12891 * arm.cc (class Reloc_stub): Correct a comment.
12892 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12893 (Target_arm::scan_section_for_stubs): New method declaration.
12894 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12895 Change methods from private to protected.
12896 (Target_arm::do_may_relax): New method definition.
12897 (Target_arm::do_relax, Target_arm::group_sections,
12898 Target_arm::scan_reloc_for_stub,
12899 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12900 (Target_arm::arm_input_section_map_): New data member declaration.
12901 (Target_arm::scan_reloc_for_stub,
12902 Target_arm::scan_reloc_section_for_stubs,
12903 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12904 Target_arm::do_relax): New method definitions.
12905
5d329b7d
ILT
129062009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12907
12908 * configure.ac: Check for (struct stat)::st_mtim
12909 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12910 * config.in: Regenerate.
12911 * configure: Regenerate.
12912
96a0d71b
ILT
129132009-11-05 Ian Lance Taylor <iant@google.com>
12914
12915 PR 10910
12916 * output.cc (Output_segment::add_output_section): Add missing
12917 return statement.
12918
594c8e5e
ILT
129192009-11-04 Ian Lance Taylor <iant@google.com>
12920
12921 PR 10880
12922 * object.h (class Object): Add is_needed and set_is_needed
12923 methods. Add is_needed_ field. Make bool fields into bitfields.
12924 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12925 defined in a dynamic object and referenced by a regular object,
12926 set is_needed for the dynamic object.
12927 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12928 if the file is marked with as_needed and it is not needed.
12929
22b127cc
ILT
129302009-11-04 Ian Lance Taylor <iant@google.com>
12931
12932 PR 10887
12933 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12934 tags if data is discarded by linker script.
12935 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12936 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12937 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12938 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12939
f5c870d2
ILT
129402009-11-04 Ian Lance Taylor <iant@google.com>
12941
12942 * layout.cc (Layout::get_output_section): Add is_interp and
12943 is_dynamic_linker_section parameters. Change all callers.
12944 (Layout::choose_output_section): Likewise.
12945 (Layout::make_output_section): Likewise.
12946 (Layout::add_output_section_data): Add is_dynamic_linker_section
12947 parameter. Change all callers.
12948 * layout.h (class Layout): Update declarations.
12949 * output.h (class Output_section): Add is_interp, set_is_interp,
12950 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12951 Add is_interp_, is_dynamic_linker_section_ fields. Change
12952 generate_code_fills_at_write_ to a bitfield.
12953 * output.cc (Output_section::Output_sections): Initialize new
12954 fields.
12955 (Output_segment::add_output_section): Add do_sort parameter.
12956 Change all callers.
12957
1ae4d23b
ILT
129582009-11-03 Ian Lance Taylor <iant@google.com>
12959
12960 PR 10860
12961 * options.h (class General_options): Add --warn-common.
12962 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12963 merging two common symbols.
12964 (Symbol_table::should_override): Handle --warn-common when merging
12965 a common symbol with a defined symbol. Use report_resolve_problem
12966 for multiple definitions.
12967 (Symbol_table::report_resolve_problem): New function.
12968 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12969
55da9579
DK
129702009-11-03 Doug Kwan <dougkwan@google.com>
12971
12972 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12973 stub_factory_.
12974 (Target_arm::stub_factory): New method definition.
12975 (Target_arm::new_arm_input_section,
12976 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12977 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12978 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12979 New type definitions.
12980 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12981 member declarations.
12982 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12983 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12984 New method definitions.
12985
37a9ac43
ILT
129862009-11-03 Ian Lance Taylor <iant@google.com>
12987
12988 * options.h (class General_options): Add --warn_constructors.
12989
b3d6a3d4
ILT
129902009-11-03 Ian Lance Taylor <iant@google.com>
12991
12992 PR 10893
12993 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12994 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12995
934b01dd
ILT
129962009-11-03 Ian Lance Taylor <iant@google.com>
12997
12998 PR 10895
12999 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13000 --msgid-bugs-address.
13001 (install-pdf): New target.
13002 (install-data_yes): Look up one directory to find mkinstalldirs.
13003
03c1939b
L
130042009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13005
13006 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13007 tree.
13008
ebd95253
DK
130092009-10-30 Doug Kwan <dougkwan@google.com>
13010
13011 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13012
e9bbb538
DK
130132009-10-30 Doug Kwan <dougkwan@google.com>
13014
13015 * arm.cc (Stub_addend_reader): New struct template definition
13016 and partial specializations.
13017 (Stub_addend_reader::operator()): New method definition for a
13018 partially specialized template.
13019
d5b40221
DK
130202009-10-30 Doug Kwan <dougkwan@google.com>
13021
13022 * arm.cc (Arm_relobj::processor_specific_flags): New method
13023 definition.
13024 (Arm_relobj::do_read_symbols): New method declaration.
13025 (Arm_relobj::processor_specific_flags_): New data member declaration.
13026 (Arm_dynobj): New class definition.
13027 (Target_arm::do_finalize_sections): Add input_objects parameter.
13028 (Target_arm::do_adjust_elf_header): New method declaration.
13029 (Target_arm::are_eabi_versions_compatible,
13030 (Target_arm::merge_processor_specific_flags): New method declaration.
13031 (Target_arm::do_make_elf_object): New overloaded method definitions
13032 and declaration.
13033 (Arm_relobj::do_read_symbols): New method definition.
13034 (Arm_dynobj::do_read_symbols): Ditto.
13035 (Target_arm::do_finalize_sections): Add input_objects parameters.
13036 Merge processor-specific flags from all input objects.
13037 (Target_arm::are_eabi_versions_compatible,
13038 Target_arm::merge_processor_specific_flags,
13039 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13040 New method definitions.
13041 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13042 Input_objects pointer type parameter.
13043 * layout.cc (Layout::finalize): Pass input objects to target's.
13044 finalize_sections function.
13045 * output.cc (Output_file_header::do_sized_write): Set ELF file
13046 header's processor-specific flags.
13047 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13048 Input_objects pointer type parameter.
13049 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13050 * target.h (Input_objects): New forward class declaration.
13051 (Target::processor_specific_flags,
13052 Target::are_processor_specific_flags_sect): New method definitions.
13053 (Target::finalize_sections): Add input_objects parameter.
13054 (Target::Target): Initialize processor_specific_flags_ and
13055 are_processor_specific_flags_set_.
13056 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13057 parameter.
13058 (Target::set_processor_specific_flags): New method definition.
13059 (Target::processor_specific_flags_,
13060 Target::are_processor_specific_flags_set_): New data member
13061 declarations.
13062 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13063 Input_objects pointer type parameter.
13064
ebabffbd
DK
130652009-10-30 Doug Kwan <dougkwan@google.com>
13066
13067 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13068
ad0f2072
ILT
130692009-10-28 Ian Lance Taylor <iant@google.com>
13070
13071 * object.h (class Relobj): Drop options parameter from
13072 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13073 do_scan_relocs, do_relocate. Change all callers.
13074 (class Sized_relobj): Drop options parameters from
13075 do_gc_process_relocs, do_scan_relocs, do_relocate,
13076 do_relocate_sections, relocate_sections, emit_relocs_scan,
13077 emit_relocs_scan_reltype. Change all callers.
13078 (struct Relocate_info): Remove options field and all references to
13079 it.
13080 * reloc.h (class Read_relocs): Remove options constructor
13081 parameter and options_ field. Change all callers.
13082 (class Gc_process_relocs, class Scan_relocs): Likewise.
13083 (class Relocate_task): Likewise.
13084 * target-reloc.h (scan_relocs): Remove options parameter. Change
13085 all callers.
13086 (scan_relocatable_relocs): Likewise.
13087 * target.h (class Sized_target): Remove options parameter from
13088 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13089 all callers.
13090 * gc.h (gc_process_relocs): Remove options parameter. Change all
13091 callers.
13092 * arm.cc: Update functions to remove options parameters.
13093 * i386.cc: Likewise.
13094 * powerpc.cc: Likewise.
13095 * sparc.cc: Likewise.
13096 * x86_64.cc: Likewise.
13097 * testsuite/testfile.cc: Likewise.
13098
8ffa3667
DK
130992009-10-28 Doug Kwan <dougkwan@google.com>
13100
13101 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13102 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13103 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13104 New method definitions.
13105
40f36857
CC
131062009-10-28 Cary Coutant <ccoutant@google.com>
13107
13108 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13109 (Plugin::cleanup_done_): New member.
13110 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13111 (Plugin_manager::cleanup_done_): Remove.
13112 (Plugin_manager::add_input_file): Edit error message.
13113 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13114 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13115
2c849493
ILT
131162009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13117
13118 * fileread.cc: (File_read::View::~View): Use the new
13119 data_ownership_ filed.
13120 (File_read::~File_read): Dispose the new whole_file_view_.
13121 (File_read::open): Mmap the whole file if needed.
13122 (File_read::open): Use whole_file_view_ instead of contents_.
13123 (File_read::find_view): Use whole_file_view_ if applicable.
13124 (File_read::do_read): Use whole_file_view_ instead of contents_.
13125 (File_read::make_view): Use whole_file_view_ instead of contents_,
13126 update File_read::View::View call.
13127 (File_read::find_or_make_view): Update File_read::View::View
13128 call.
13129 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13130 remove contents_
13131 (File_read::View::Data_ownership): New enum.
13132 (File_read::View::View): Replace bool mapped_ with Data_ownership
13133 argument.
13134 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13135 (File_read::View::data_ownership_): New field.
13136 (File_read::contents_): Remove (replaced by whole_file_view_).
13137 (File_read::whole_file_view_): New field.
13138 * options.h (class General_options): Add --keep-files-mapped.
13139
24998053
CC
131402009-10-27 Cary Coutant <ccoutant@google.com>
13141
13142 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13143 * testsuite/Makefile.am (plugin_test_5): New test case.
13144 * testsuite/Makefile.in: Regenerate.
13145
72adc4fa
DK
131462009-10-25 Doug Kwan <dougkwan@google.com>
13147
13148 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13149 from private to protected to allow access by child class.
13150 (Sized_relobj::do_relocate_sections): New method declaration.
13151 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13152 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13153 Sized_relobj::relocate_sections. Instantiate template explicitly
13154 for different target sizes and endianity.
13155
07f508a2
DK
131562009-10-24 Doug Kwan <dougkwan@google.com>
13157
13158 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13159 (Arm_input_section::as_arm_input_section): New method.
13160 (Arm_output_section): New class definition.
13161 (Arm_output_section::create_stub_group,
13162 Arm_output_section::group_sections): New method definitions.
13163
10ad9fe5
DK
131642009-10-22 Doug Kwan <dougkwan@google.com>
13165
13166 * arm.cc (Arm_input_section): New class definition.
13167 (Arm_input_section::init, Arm_input_section:do_write,
13168 Arm_input_section::set_final_data_size,
13169 Arm_input_section::do_reset_address_and_file_offset): New method
13170 definitions.
13171
56ee5e00
DK
131722009-10-21 Doug Kwan <dougkwan@google.com>
13173
13174 * arm.cc (Stub_table, Arm_input_section): New forward class
13175 declarations.
13176 (Stub_table): New class defintion.
13177 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13178 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13179 New method definition.
13180
b569affa
DK
131812009-10-21 Doug Kwan <dougkwan@google.com>
13182
13183 * arm.cc: Update copyright comments.
13184 (Target_arm): New forward class template declaration.
13185 (Arm_address): New type.
13186 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13187 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13188 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13189 constants.
13190 (Insn_template): Same.
13191 (DEF_STUBS): New macro.
13192 (Stub_type): New enum type.
13193 (Stub_template): New class definition.
13194 (Stub): Same.
13195 (Reloc_stub): Same.
13196 (Stub_factory): Same.
13197 (Target_arm::Target_arm): Initialize may_use_blx_ and
13198 should_force_pic_veneer_.
13199 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13200 Target_arm::should_force_pic_veneer,
13201 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13202 Target_arm::using_thumb_only, Target_arm:;default_target): New
13203 method defintions.
13204 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13205 New data member declarations.
13206 (Insn_template::size, Insn_template::alignment): New method defintions.
13207 (Stub_template::Stub_template): New method definition.
13208 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13209 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13210 (Stub_factory::Stub_factory): New method definition.
13211 * gold.h (string_hash): New template.
13212 * output.h (Input_section_specifier::hash_value): Use
13213 gold::string_hash.
13214 (Input_section_specifier::string_hash): Remove.
13215 * stringpool.cc (Stringpool_template::string_hash): Use
13216 gold::string_hash.
13217
6c172549
DK
132182009-10-20 Doug Kwan <dougkwan@google.com>
13219
13220 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13221 symbols of relaxed input sections.
13222 * output.h (Output_section::find_relaxed_input_section): Make
13223 method public.
13224
c5617f2f
DK
132252009-10-16 Doug Kwan <dougkwan@google.com>
13226
13227 * dynobj.cc (Versions::Versions): Initialize version_script_.
13228 Only insert base version symbol definition for a shared object
13229 if version script defines any version versions.
13230 (Versions::define_base_version): New method definition.
13231 (Versions::add_def): Check that base version is not needed.
13232 (Versions::add_need): Define base version lazily.
13233 * dynobj.h (Versions::define_base_version): New method declaration.
13234 (Versions::needs_base_version_): New data member declaration.
13235 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13236 (check_DATA): Add no_version_test.stdout.
13237 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13238 New make rules.
13239 * testsuite/Makefile.in: Regenerate.
13240 * testsuite/no_version_test.c: New file.
13241 * testsuite/no_version_test.sh: Ditto.
13242
3c12dcdb
DK
132432009-10-16 Doug Kwan <dougkwan@google.com>
13244
13245 * expression.cc (class Segment_start_expression): New class definition.
13246 (Segment_start_expression::value): New method definition.
13247 (script_exp_function_segment_start): Return a new
13248 Segment_start_expression.
13249 * gold/script-c.h (script_saw_segment_start_expression): New function
13250 prototype.
13251 * script-sections.cc (Script_sections::Script_sections): Initialize
13252 SAW_SEGMENT_START_EXPRESSION_ to false.
13253 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13254 and -Tbbs options to specify section addresses if given in
13255 command line and no SEGMENT_START expression is seen in a script.
13256 * script-sections.h (Script_sections::saw_segment_start_expression,
13257 Script_sections::set_saw_segment_start_expression): New method
13258 definition.
13259 (Script_sections::saw_segment_start_expression_): New data member
13260 declaration.
13261 * script.cc (script_saw_segment_start_expression): New function.
13262 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13263 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13264 script_test_7.sh and script_test_8.sh.
13265 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13266 script_test_8.stdout.
13267 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13268 (script_test_6, script_test_6.stdout, script_test_7,
13269 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13270 * Makefile.in: Regenerate.
13271 * testsuite/script_test_6.sh: New file.
13272 * testsuite/script_test_6.t: Same.
13273 * testsuite/script_test_7.sh: Same.
13274 * testsuite/script_test_7.t: Same.
13275 * testsuite/script_test_8.sh: Same.
13276
64b1ae37
DK
132772009-10-16 Doug Kwan <dougkwan@google.com>
13278
13279 * output.cc (Output_segment::set_section_list_address): Cast
13280 expressions to unsigned long long type to avoid format warnings.
13281
661be1e2
ILT
132822009-10-15 Ian Lance Taylor <iant@google.com>
13283
12edd763 13284 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13285 dot assignment to script_sections_.
12edd763
ILT
13286 * script-sections.cc (Script_sections::add_dot_assignment):
13287 Initialize if necessary.
13288
68b6574b
ILT
13289 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13290 program headers with no load segment if there is a linker script.
13291
661be1e2
ILT
13292 * layout.cc (Layout::set_segment_offsets): Align the file offset
13293 to the segment aligment for -N or -n with no load segment.
13294 * output.cc (Output_segment::add_output_section): Don't crash if
13295 the first section is a TLS section.
13296 (Output_segment::set_section_list_addresses): Print an error
13297 message if the address moves backward in a linker script.
13298 * script-sections.cc
13299 (Output_section_element_input::set_section_addresses): Don't
13300 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13301 (Orphan_output_section::set_section_addresses): Likewise.
13302
f15f61a7
DK
133032009-10-15 Doug Kwan <dougkwan@google.com>
13304
13305 * layout.cc (Layout::finish_dynamic_section): Generate tags
13306 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13307 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13308 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13309
82bb573a
ILT
133102009-10-14 Ian Lance Taylor <iant@google.com>
13311
13312 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13313 fields.
13314 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13315 data_shdr fields of relinfo.
13316 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13317 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13318 R_386_TLS_LDO_32, adjust based on section flags.
13319 (Target_i386::Relocate::fix_up_ldo): Remove.
13320
374ad285
ILT
133212009-10-13 Ian Lance Taylor <iant@google.com>
13322
13323 Add support for -pie.
13324 * options.h (class General_options): Add -pie and
13325 --pic-executable.
13326 (General_options::output_is_position_independent): Test -pie.
13327 (General_options::output_is_executable): Return true if not shared
13328 and not relocatable.
13329 (General_options::output_is_pie): Remove.
13330 * options.cc (General_options::finalize): Reject incompatible uses
13331 of -pie.
13332 * gold.cc (queue_middle_tasks): A -pie link is not static.
13333 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13334 * symtab.cc (Symbol::final_value_is_known): Return false if
13335 output_is_position_independent.
13336 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13337 output_is_position_independent.
13338 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13339 output_is_position_independent.
13340 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13341 output_is_position_independent.
13342 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13343 two_file_pie_test.
13344 (basic_pie_test.o, basic_pie_test): New targets.
13345 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13346 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13347 (two_file_pie_test): New target.
13348 * testsuite/Makefile.in: Rebuild.
13349 * README: Remove note saying that -pie is not supported.
13350
c6585162
ILT
133512009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13352
13353 * options.h (class General_options): Add -init and -fini.
13354 * layout.cc (Layout::finish_dynamic_section): Emit
13355 given init and fini functions.
13356
032ce4e9
ST
133572009-10-13 Sriraman Tallam <tmsriram@google.com>
13358
13359 * gc.h (gc_process_relocs): Check if icf is enabled using new
13360 function.
13361 * gold.cc (queue_initial_tasks): Likewise.
13362 (queue_middle_tasks): Likewise.
13363 * object.cc (do_layout): Likewise.
13364 * symtab.cc (is_section_folded): Likewise.
13365 * main.cc (main): Likewise.
13366 * reloc.cc (Read_relocs::run): Likewise.
13367 (Sized_relobj::do_scan_relocs): Likewise.
13368 * icf.cc (is_function_ctor_or_dtor): New function.
13369 (Icf::find_identical_sections): Check if function is ctor or dtor when
13370 safe icf is chosen.
13371 * options.h (General_options::icf): Change option to be an enum.
13372 (Icf_status): New enum.
13373 (icf_enabled): New method.
13374 (icf_safe_folding): New method.
13375 (set_icf_status): New method.
13376 (icf_status_): New variable.
13377 * (options.cc) (General_options::finalize): Set icf_status_.
13378 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13379 icf_test and icf_keep_unique_test to use the --icf enum flag.
13380 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13381 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13382
f345227a
ST
133832009-10-12 Sriraman Tallam <tmsriram@google.com>
13384
13385 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13386 includes to gc.h and icf.h.
13387 * arm.cc: Include gc.h.
13388 * gold.cc: Likewise.
13389 * i386.cc: Likewise.
13390 * powerpc.cc: Likewise.
13391 * sparc.cc: Likewise.
13392 * x86_64.cc: Likewise.
13393 * gc.h: Include icf.h.
13394
1c7814ed
ILT
133952009-10-11 Ian Lance Taylor <iant@google.com>
13396
13397 * plugin.cc: Include "gold.h" before other header files.
13398
ae3b5189
CD
133992009-10-10 Chris Demetriou <cgd@google.com>
13400
13401 * options.h (Input_file_argument::Input_file_type): New enum.
13402 (Input_file_argument::is_lib_): Replace with...
13403 (Input_file_argument::type_): New member.
13404 (Input_file_argument::Input_file_argument): Take Input_file_type
13405 'type' rather than boolean 'is_lib' as second argument.
13406 (Input_file_argument::is_lib): Use type_.
13407 (Input_file_argument::is_searched_file): New function.
13408 (Input_file_argument::may_need_search): Handle is_searched_file.
13409 * options.cc (General_options::parse_library): Support -l:filename.
13410 (General_options::parse_just_symbols): Update for Input_file_argument
13411 changes.
13412 (Command_line::process): Likewise.
13413 * archive.cc (Archive::get_file_and_offset): Likewise.
13414 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13415 * script.cc (read_script_file, script_add_file): Likewise.
13416 * fileread.cc (Input_file::Input_file): Likewise.
13417 (Input_file::will_search_for): Handle is_searched_file.
13418 (Input_file::open): Likewise.
13419 * readsyms.cc (Read_symbols::get_name): Likewise.
13420 * testsuite/Makefile.am (searched_file_test): New test.
13421 * testsuite/Makefile.in: Regenerate.
13422 * testsuite/searched_file_test.cc: New file.
13423 * testsuite/searched_file_test_lib.cc: New file.
13424
f3048a1d
ILT
134252009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13426 Ian Lance Taylor <iant@google.com>
13427
13428 * descriptor.cc: Include <cstdio> and "binary-io.h".
13429 (Descriptors::open): Open the files in binary mode always.
13430 * script.cc (Lex::get_token): Treat \r as whitespace.
13431
d4780e57
ILT
134322009-10-09 Ian Lance Taylor <iant@google.com>
13433
13434 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13435
d9a893b8
ILT
134362009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13437 Ian Lance Taylor <iant@google.com>
13438
13439 * configure.ac: Check for readv function also.
13440 * fileread.cc (readv): Define if not HAVE_READV.
13441 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13442 does not exist.
13443 * config.in: Regenerate.
13444 * configure: Regenerate.
13445
c0a62865
DK
134462009-10-09 Doug Kwan <dougkwan@google.com>
13447
13448 * layout.cc (Layout::make_output_section): Call target hook to make
13449 ordinary output section.
13450 (Layout::finalize): Adjust parameter list of call the
13451 Target::may_relax().
13452 * layout.h (class Layout::section_list): New method.
13453 * merge.h (Output_merge_base::entsize): Change visibility to public.
13454 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13455 New methods.
13456 (Output_merge_string::do_is_string): New method.
13457 * object.cc (Sized_relobj::do_setup): renamed from
13458 Sized_relobj::set_up.
13459 * object.h (Sized_relobj::adjust_shndx,
13460 Sized_relobj::initializ_input_to_output_maps,
13461 Sized_relobj::free_input_to_output_maps): Change visibilities to
13462 protected.
13463 (Sized_relobj::setup): Virtualize.
13464 (Sized_relobj::do_setup): New method declaration.
13465 (Sized_relobj::invalidate_section_offset,
13466 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13467 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13468 * options.cc (parse_int): New function.
13469 * options.h (parse_int): New declaration.
13470 (DEFINE_int): New macro.
13471 (stub_group_size): New option.
13472 * output.cc (Output_section::Output_section): Initialize memebers
13473 merge_section_map_, merge_section_by_properties_map_,
13474 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13475 (Output_section::add_input_section): Handled deferred code-fill
13476 generation and remove an old comment.
13477 (Output_section::add_relaxed_input_section): New method definition.
13478 (Output_section::add_merge_input_section): Use merge section by
13479 properties map to speed to search. Update merge section maps
13480 as appropriate.
13481 (Output_section::build_relaxation_map): New method definition.
13482 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13483 Same.
13484 (Output_section::relax_input_section): Renamed to
13485 Output_section::convert_input_sections_to_relaxed_sections and change
13486 interface to take a vector of pointers to relaxed sections.
13487 (Output_section::find_merge_section,
13488 Output_section::find_relaxed_input_section): New method definitions.
13489 (Output_section::is_input_address_mapped,
13490 Output_section::output_offset, Output_section::output_address):
13491 Use output section data maps to speed up searching.
13492 (Output_section::find_starting_output_address): Add comments.
13493 (Output_section::do_write,
13494 Output_section::write_to_postprocessing_buffer): Do code-fill
13495 generation as appropriate.
13496 (Output_section::get_input_sections): Invalidate relaxed input section
13497 map.
13498 (Output_section::restore_states): Adjust type of checkpoint .
13499 Invalidate relaxed input section map.
13500 * output.h (Output_merge_base): New class declaration.
13501 (Input_section_specifier): New class defintion.
13502 (class Output_relaxed_input_section) Change base class to
13503 Output_section_data_build.
13504 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13505 base class initializer.
13506 (Output_section::add_relaxed_input_section): New method declaration.
13507 (Output_section::Input_section): Change visibility to protected.
2e702c99 13508 (Output_section::Input_section::relobj,
c0a62865
DK
13509 Output_section::Input_section::shndx): Handle relaxed input sections.
13510 Output_section::input_sections) Change visibility to protected. Also
13511 define overload to return a non-const pointer.
13512 (Output_section::Merge_section_properties): New class defintion.
13513 (Output_section::Merge_section_by_properties_map,
13514 Output_section::Output_section_data_by_input_section_map,
13515 Output_section::Relaxation_map): New types.
13516 (Output_section::relax_input_section): Rename method to
13517 Output_section::convert_input_sections_to_relaxed_sections and change
13518 interface to take a vector of relaxed section pointers.
13519 (Output_section::find_merge_section,
13520 Output_section::find_relaxed_input_section,
13521 Output_section::build_relaxation_map,
13522 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13523 New method declarations.
13524 (Output_section::merge_section_map_
13525 Output_section::merge_section_by_properties_map_,
13526 Output_section::relaxed_input_section_map_,
13527 Output_section::is_relaxed_input_section_map_valid_,
13528 Output_section::generate_code_fills_at_write_): New data members.
13529 * script-sections.cc
13530 (Output_section_element_input::set_section_addresses): Call
13531 current_data_size and addralign methods of relaxed input sections.
13532 (Orphan_output_section::set_section_addresses): Call current_data_size
13533 and addralign methods of relaxed input sections.
13534 * symtab.cc (Symbol_table::compute_final_value): Extract template
13535 from the body of Symbol_table::sized_finalize_symbol.
13536 (Symbol_table::sized_finalized_symbol): Call
13537 Symbol_table::compute_final_value.
13538 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13539 (Symbol_table::compute_final_value): New templated method declaration.
13540 * target.cc (Target::do_make_output_section): New method defintion.
13541 * target.h (Target::make_output_section): New method declaration.
13542 (Target::relax): Add more parameters for input objects, symbol table
13543 and layout. Adjust call to do_relax.
13544 (Target::do_make_output_section): New method declaration.
13545 (Target::do_relax): Add parameters for input objects, symbol table
13546 and layout.
13547
d446d6c4
ILT
135482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13549
13550 * pread.c: Include stdio.h.
13551
bc06c745
ILT
135522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13553
13554 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13555 defined.
13556
75aea3d0
ILT
135572009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13558
13559 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13560 Change read_shndx type to unsigned int.
13561 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13562 int.
13563 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13564 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13565 Change read_shndx type to unsigned int.
13566 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13567 int.
13568 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13569 * layout.cc (Layout::create_symtab_sections): Cast the result of
13570 local_symcount * symsize to off_t in the gold_assert.
13571
be8fcb75
ILT
135722009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13573
13574 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13575 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13576 R_ARM_BASE_ABS.
13577 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13578 (Arm_relocate_functions::thm_abs5): New function.
13579 (Arm_relocate_functions::abs12): New function.
13580 (Arm_relocate_functions::abs16): New function.
13581 (Arm_relocate_functions::base_abs): New function.
13582 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13583 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13584 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13585 R_ARM_BASE_ABS.
13586 (Scan::global): Likewise.
13587 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13588 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13589 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13590 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13591 R_ARM_BASE_ABS.
13592
c2a122b6
ILT
135932009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13594
13595 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13596 (Arm_relocate_functions::movt_prel): New function.
13597 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13598 (Arm_relocate_functions::thm_movt_prel): New function.
13599 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13600 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13601 (Scan::global, Relocate::relocate): Likewise.
13602 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13603
c4aa1e2d
ILT
136042009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13605
13606 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13607 Incremental_checker.
13608 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13609 unsigned int.
13610 (class Incremental_inputs_header): New class.
13611 (Incremental_inputs_header_writer): Edit comment.
13612 (Incremental_inputs_entry): New class.
13613 (Incremental_inputs_entry_writer): Edit comment.
13614 (Sized_incremental_binary::do_find_incremental_inputs_section):
13615 Add *strtab_shndx parameter, fill it.
13616 (Sized_incremental_binary::do_check_inputs): New method.
13617 (Incremental_checker::can_incrementally_link_output_file): Use
13618 Sized_incremental_binary::check_inputs.
13619 (Incremental_inputs::report_command_line): Save command line in
13620 command_line_.
13621 * incremental.h:
13622 (Incremental_binary::find_incremental_inputs_section): New
13623 method.
13624 (Incremental_binary::do_find_incremental_inputs_section): Add
13625 strtab_shndx parameter.
13626 (Incremental_binary::do_check_inputs): New pure virtual method.
13627 (Sized_incremental_binary::do_check_inputs): Declare.
13628 (Incremental_checker::Incremental_checker): Add incremental_inputs
13629 parameter, use it to initialize incremental_inputs_.
13630 (Incremental_checker::incremental_inputs_): New field.
13631 (Incremental_checker::command_line): New method.
13632 (Incremental_checker::inputs): New method.
13633 (Incremental_checker::command_line_): New field.
13634
c549a694
ILT
136352009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13636
13637 * incremental.cc: Include <cstdarg> and "target-select.h".
13638 (vexplain_no_incremental): New function.
13639 (explain_no_incremental): New function.
13640 (Incremental_binary::error): New method.
13641 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13642 method.
13643 (make_sized_incremental_binary): New function.
13644 (open_incremental_binary): New function.
13645 (can_incrementally_link_file): Add checks if output is ELF and has
13646 inputs section.
13647 * incremental.h: Include "elfcpp_file.h" and "output.h".
13648 (Incremental_binary): New class.
13649 (Sized_incremental_binary): New class.
13650 (open_incremental_binary): Declare.
13651 * object.cc (is_elf_object): Use
13652 elfcpp::Elf_recognizer::is_elf_file.
13653 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13654 * output.h (Output_file::filesize): New method.
13655
fd3c5f0b
ILT
136562009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13657
13658 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13659 New function.
13660 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13661 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13662 function.
13663 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13664 function.
13665 (Arm_relocate_functions::movw_abs_nc): New function.
13666 (Arm_relocate_functions::movt_abs): New function.
13667 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13668 (Arm_relocate_functions::thm_movt_abs): New function.
13669 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13670 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13671 (Scan::global): Likewise.
13672 (Relocate::relocate): Likewise.
13673 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13674
7f5309a5
ILT
136752009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13676
13677 * arm.cc (Arm_relocate_functions::got_prel) New function.
13678 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13679 (Relocate::relocate): Likewise.
13680 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13681
364c7fa5
ILT
136822009-10-06 Ian Lance Taylor <iant@google.com>
13683
13684 * options.h (class General_options): Define
13685 split_stack_adjust_size parameter.
13686 * object.h (class Object): Add uses_split_stack_ and
13687 has_no_split_stack_ fields. Add uses_split_stack and
13688 has_no_split_stack accessor functions. Declare
13689 handle_split_stack_section.
13690 (class Reloc_symbol_changes): Define.
13691 (class Sized_relobj): Define Function_offsets. Declare
13692 split_stack_adjust, split_stack_adjust_reltype, and
13693 find_functions.
13694 * object.cc (Object::handle_split_stack_section): New function.
13695 (Sized_relobj::do_layout): Call handle_split_stack_section.
13696 * dynobj.cc (Sized_dynobj::do_layout): Call
13697 handle_split_stack_section.
13698 * reloc.cc (Sized_relobj::relocate_sections): Call
13699 split_stack_adjust for executable sections in split_stack
13700 objects. Pass reloc_map to relocate_section.
13701 (Sized_relobj::split_stack_adjust): New function.
13702 (Sized_relobj::split_stack_adjust_reltype): New function.
13703 (Sized_relobj::find_functions): New function.
13704 * target-reloc.h: Include "object.h".
13705 (relocate_section): Add reloc_symbol_changes parameter. Change
13706 all callers.
13707 * target.h (class Target): Add calls_non_split method. Declare
13708 do_calls_non_split virtual method. Declare match_view and
13709 set_view_to_nop.
13710 * target.cc: Include "elfcpp.h".
13711 (Target::do_calls_non_split): New function.
13712 (Target::match_view): New function.
13713 (Target::set_view_to_nop): New function.
13714 * gold.cc (queue_middle_tasks): Give an error if mixing
13715 split-stack and non-split-stack objects with -r.
13716 * i386.cc (Target_i386::relocate_section): Add
13717 reloc_symbol_changes parameter.
13718 (Target_i386::do_calls_non_split): New function.
13719 * x86_64.cc (Target_x86_64::relocate_section): Add
13720 reloc_symbol_changes parameter.
13721 (Target_x86_64::do_calls_non_split): New function.
13722 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13723 parameter.
13724 * powerpc.cc (Target_powerpc::relocate_section): Add
13725 reloc_symbol_changes parameter.
13726 * sparc.cc (Target_sparc::relocate_section): Add
13727 reloc_symbol_changes parameter.
13728 * configure.ac: Call AM_CONDITIONAL for the default target.
13729 * configure: Rebuild.
13730 * testsuite/Makefile.am (TEST_AS): New variable.
13731 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13732 (check_DATA): Add split_i386 and split_x86_64 files.
13733 (SPLIT_DEFSYMS): Define.
13734 (split_i386_[1234n].o): New targets.
13735 (split_i386_[124]): New targets.
13736 (split_i386_[1234r].stdout): New targets.
13737 (split_x86_64_[1234n].o): New targets.
13738 (split_x86_64_[124]): New targets.
13739 (split_x86_64_[1234r].stdout): New targets.
13740 (MOSTLYCLEANFILES): Add new executables.
13741 * testsuite/split_i386.sh: New file.
13742 * testsuite/split_x86_64.sh: New file.
13743 * testsuite/split_i386_1.s: New file.
13744 * testsuite/split_i386_2.s: New file.
13745 * testsuite/split_i386_3.s: New file.
13746 * testsuite/split_i386_4.s: New file.
13747 * testsuite/split_i386_n.s: New file.
13748 * testsuite/split_x86_64_1.s: New file.
13749 * testsuite/split_x86_64_2.s: New file.
13750 * testsuite/split_x86_64_3.s: New file.
13751 * testsuite/split_x86_64_4.s: New file.
13752 * testsuite/split_x86_64_n.s: New file.
13753 * testsuite/testfile.cc (Target_test): Update relocation_section
13754 function.
13755 * testsuite/Makefile.in: Rebuild.
13756
e8a9fcda
ILT
137572009-10-06 Ian Lance Taylor <iant@google.com>
13758
13759 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13760 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13761 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13762 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13763 the address on ldo_addrs_.
13764 (Target_i386::Relocate::fix_up_ldo): New function.
13765
e99daf92
ILT
137662009-10-06 Rafael Espindola <espindola@google.com>
13767
13768 * plugin.cc (add_input_library): New.
13769 (Plugin::load): Add add_input_library to tv.
13770 (Plugin_manager::add_input_file): Add the is_lib argument.
13771 (add_input_file): Update call to Plugin_manager::add_input_file.
13772 (add_input_library): New.
13773 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13774
966d4097
DK
137752009-09-30 Doug Kwan <dougkwan@google.com>
13776
13777 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13778 symbol and call Symbol::may_need_copy_reloc to determine if
13779 a copy reloc is needed.
13780 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13781 nocopyreloc is given in command line.
13782 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13783 given in command line.
13784 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13785 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13786 of the removed Target_i386::may_need_copy_reloc.
13787 * options.h (copyreloc): New option with default value false.
13788 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13789 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13790 instead of the removed Target_powerpc::may_need_copy_reloc.
13791 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13792 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13793 instead of the removed Target_sparc::may_need_copy_reloc.
13794 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13795 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13796 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13797 instead of the removed Target_x86_64::may_need_copy_reloc.
13798
029ba973
ILT
137992009-09-30 Ian Lance Taylor <iant@google.com>
13800
13801 * object.h (class Object): Remove target_ field, and target,
13802 sized_target, and set_target methods.
13803 (Object::sized_target): Remove.
13804 (class Sized_relobj): Update declarations. Remove sized_target.
13805 * object.cc (Sized_relobj::setup): Remove target parameter.
13806 Change all callers.
13807 (Input_objects::add_object): Don't do anything with the target.
13808 (make_elf_sized_object): Add punconfigured parameter. Change all
13809 callers. Set or test parameter target.
13810 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13811 Change all callers.
13812 * parameters.cc (Parameters::set_target): Change parameter type to
13813 be non-const.
13814 (Parameters::default_target): Remove.
13815 (set_parameters_target): Change parameter type to be non-const.
13816 (parameters_force_valid_target): New function.
13817 (parameters_clear_target): New function.
13818 * parameters.h (class Parameters): Update declarations. Remove
13819 default_target method. Add sized_target and clear_target
13820 methods. Change target_ to be non-const.
13821 (set_parameters_target): Update declaration.
13822 (parameters_force_valid_target): Declare.
13823 (parameters_clear_target): Declare.
13824 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13825 as NULL if we aren't searching.
13826 (Add_symbols::run): Don't check for compatible target.
13827 * fileread.cc (Input_file::open_binary): Call
13828 parameters_force_valid_target.
13829 * gold.cc (queue_middle_tasks): Likewise.
13830 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13831 set_target on object.
13832 * dynobj.h (class Sized_dynobj): Update declarations.
13833 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13834 make_elf_object returns NULL.
13835 (Archive::include_member): Don't check whether object target is
13836 compatible.
13837 * output.cc (Output_section::add_input_section): Get target from
13838 parameters.
13839 (Output_section::relax_input_section): Likewise.
13840 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13841 parameters.
13842 (Sized_relobj::do_scan_relocs): Likewise.
13843 (Sized_relobj::relocate_sections): Likewise.
13844 * resolve.cc (Symbol_table::resolve): Likewise.
13845 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13846 parameter. Change all callers.
13847 (Symbol_table::add_from_object): Get target from parameters.
13848 (Symbol_table::add_from_relobj): Don't check object target.
13849 (Symbol_table::add_from_dynobj): Likewise.
13850 (Symbol_table::define_special_symbol): Get target from
13851 parameters.
13852 * symtab.h (class Symbol_table): Update declaration.
13853 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13854 parameter. Change all callers. Clear parameter target.
13855 (Binary_test): Test target here.
13856 * testsuite/object_unittest.cc (gold_testsuite): Remove
13857 target_test_pointer parameter. Change all callers.
13858 (Object_test): Test target here.
13859
a6a22b83
ILT
138602009-09-26 Ian Lance Taylor <iant@google.com>
13861
13862 * testsuite/initpri1.c: Don't try to use constructor priorities if
13863 compiling with gcc before 4.3.
13864
6a8f49fe
ILT
138652009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13866
13867 * testsuite/retain_symbols_file_test.sh (check_present): Change
13868 output file name to retain_symbols_file_test.stdout.
13869 (check_absent): Likewise.
13870
8c604651
CS
138712009-09-18 Craig Silverstein <csilvers@google.com>
13872
13873 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13874 * options.cc: Include <cerrno> and <fstream>.
13875 (General_options::finalize): Parse -retain-symbols-file tag.
13876 * options.h: New flag.
13877 (General_options): New method should_retain_symbol, new
13878 variable symbols_to_retain.
13879 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13880 should_retain_symbol map.
13881 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13882 * testsuite/Makefile.in: Regenerate.
13883 * testsuite/retain_symbols_file_test.sh: New file.
13884
ca58b19f
NC
138852009-09-18 Nick Clifton <nickc@redhat.com>
13886
13887 * po/es.po: Updated Spanish translation.
13888
20e6d0d6
DK
138892009-09-17 Doug Kwan <dougkwan@google.com>
13890
13891 * debug.h (DEBUG_RELAXATION): New constant.
13892 (DEBUG_ALL): Add DEBUG_RELAXATION.
13893 (debug_string_to_enum): Add relaxation debug option.
13894 * layout.cc
13895 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13896 Layout::Relaxation_debug_check::read_sections,
13897 Layout::Relaxation_debug_check::read_sections): New method definitions.
13898 (Layout::Layout): Initialize data members
13899 record_output_section_data_from_scrips_,
13900 script_output_section_data_list_ and relaxation_debug_check_.
13901 (Layout::save_segments, Layout::restore_segments,
13902 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13903 Layout::relaxation_loop_body): New method definitions.
13904 (Layout::finalize): Support relaxation. Move section layout code to
13905 Layout::relaxation_loop_body.
13906 (Layout::set_asection_address_from_script): Move code for orphan
13907 section placement out.
13908 (Layout::place_orphan_sections_in_script): New method definition.
13909 * layout.h (Output_segment_headers, Output_file_header):
13910 New forward class declarations.
13911 (Layout::~Layout): Define.
13912 (Layout::new_output_section_data_from_script): New method definition.
13913 (Layout::place_orphan_sections_in_script): New method declaration.
13914 (Layout::Segment_states): New type declaration.
13915 (Layout::save_segments, Layout::restore_segments,
13916 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13917 Layout::relaxation_loop_body): New method declarations.
13918 (Layout::Output_section_data_list): New type declaration.
13919 (Layout::Relaxation_debug_check): New class definition.
13920 (Layout::record_output_section_data_from_script_,
13921 Layout::script_output_section_data_list_, Layout::segment_states_,
13922 Layout::relaxation_debug_check_): New data members.
13923 * output.cc: (Output_section_headers::do_size): New method definition.
13924 (Output_section_headers::Output_section_headers): Move size
13925 computation to Output_section_headers::do_size.
13926 (Output_segment_headers::do_size): New method definition.
e1df38aa 13927 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13928 Output_file_header::do_size and call it.
13929 (Output_file_header::do_size): New method definition.
13930 (Output_data_group::Output_data_group): Adjust call to
13931 Output_section_data.
13932 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13933 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13934 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13935 RELAXED_INPUT_SECTION_CODE.
13936 (Output_section::Output_section): Initialize data member checkpoint_.
13937 (Output_section::~Output_section): Delete checkpoint object pointed
13938 by checkpoint_.
13939 (Output_section::add_input_section): Always add an Input_section if
13940 relaxing.
13941 (Output_section::add_merge_input_section): Add assert.
13942 (Output_section::relax_input_section): New method definition.
13943 (Output_section::set_final_data_size): Set load address to zero for
13944 an unallocated section.
13945 (Output_section::do_address_and_file_offset_have_reset_values):
13946 New method definition.
13947 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13948 Handle relaxed input section.
13949 (Output_section::sort_attached_input_sections): Checkpoint input
13950 section list lazily.
13951 (Output_section::get_input_sections): Change type of input_sections to
13952 list of Simple_input_section pointers. Checkpoint input section list
13953 lazily. Also handle relaxed input sections.
13954 (Output_section::add_input_section_for_script): Take a reference to
13955 a Simple_input_section object instead of Relobj pointer and section
13956 index as parameter. Handle relaxed input sections.
13957 (Output_section::save_states, Output_section::restore_states): New
13958 method definitions.
13959 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13960 (Output_data::is_data_size_fixed): New method definition.
13961 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13962 if it is fixed.
13963 (Output_data::address_and_file_offset_have_reset_values): New method
13964 definition.
13965 (Output_data::do_address_and_file_offset_have_reset_values): New method
13966 definition.
13967 (Output_data::set_data_size): Check that data size is not fixed.
13968 (Output_data::fix_data_size): New method definition.
13969 (Output_data::is_data_size_fixed_): New data member.
13970 (Output_section_headers::set_final_data_size): New method definition.
13971 (Output_section_headers::do_size): New method declaration.
13972 (Output_segment_headers::set_final_data_size): New method definition.
13973 (Output_segment_headers::do_size): New method declaration.
13974 (Output_file_header::set_final_data_size)::New method definition.
13975 (Output_file_header::do_size)::New method declaration.
13976 (Output_section_data::Output_section_data): Add new parameter
13977 is_data_size_fixed and use it to fix data size.
13978 (Output_data_const::Output_data_const): Adjust call to base class
13979 constructor and fix data size.
13980 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13981 base class constructor and fix data size.
13982 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13983 base class constructor and fix data size.
13984 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13985 class constructor and fix data size.
13986 (Output_data_group::set_final_data_size): New method definition.
13987 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13988 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13989 class constructor and fix data size.
13990 (Output_relaxed_input_section): New class definition.
13991 (Output_section::Simple_input_section): New class definition.
13992 (Output_section::get_input_sections): Adjust parameter list.
13993 (Output_section::add_input_section_for_script): Same.
13994 (Output_section::save_states, Output_section::restore_states,
13995 Output_section::do_address_and_file_offset_have_reset_values,
13996 (Output_section::Input_section::Input_section): Handle
13997 RELAXED_INPUT_SECTION_CODE. Add new overload for
13998 Output_relaxed_input_section.
13999 (Output_section::Input_section::is_input_section,
14000 Output_section::Input_section::set_output_section): Handle relaxed
14001 input section.
14002 (Output_section::Input_section::is_relaxed_input_section,
14003 Output_section::Input_section::output_section_data,
14004 Output_section::Input_section::relaxed_input_section): New method
14005 definitions.
14006 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14007 value.
14008 (Output_section::Input_section::u1_): Update comments.
14009 (Output_section::Input_section::u2_): Add new union member poris.
14010 (Output_section::Checkpoint_output_section): New classs definition.
14011 (Output_section::relax_input_section): New method declaration.
14012 (Output_section::checkpoint_): New data member.
14013 (Output_segment): Update comments.
14014 (Output_segment::Output_segment): Un-privatize copy constructor.
14015 (Output_segment::operator=): Un-privatize.
14016 * script-sections.cc (Output_section_element::Input_section_list):
14017 Change element type to Output_section::Simple_input_section.
14018 (Output_section_element_dot_assignment::set_section_addresses):
14019 Register output section data for relaxation clean up.
14020 (Output_data_exression::Output_data_expression): Adjust call to base
14021 constructor to fix data size.
14022 (Output_section_element_data::set_section_addresses): Register
14023 Output_data_expression object for relaxation clean up.
14024 (struct Input_section_info): Replace Relobj pointer and section index
14025 pair with Output_section::Simple_input_section and Convert struct to a
14026 class.
14027 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14028 Input_section_info data member to use accessors.
20e6d0d6
DK
14029 (Output_section_element_input::set_section_addresses): Use layout
14030 parameter. Adjust code to use Output_section::Simple_input_section
14031 and Input_secction_info classes. Register filler for relaxation
14032 clean up.
14033 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14034 and section index pair with Output_section::Simple_input_section
14035 class. Adjust code accordingly.
14036 (Phdrs_element::release_segment): New method definition.
14037 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14038 segment list.
14039 (Script_sections::release_segments): New method definition.
14040 * gold/script-sections.h (Script_sections::release_segments): New
14041 method declaration.
14042 * gold/target.h (Target::may_relax, Target::relax,
14043 Target::do_may_relax, Target::do_relax): New method definitions.
14044
5e445df6
ILT
140452009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14046
14047 * arm.cc (has_signed_unsigned_overflow): New function.
14048 (Arm_relocate_functions::abs8): New function.
14049 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14050 (Target_arm::Scan::global): Likewise.
14051 (Target_arm::relocate::relocate): Likewise.
14052 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14053 Likewise.
14054
8c604651 140552009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14056
14057 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14058 * testsuite/Makefile.in: Regenerate.
14059
1e9cc1c2
NC
140602009-09-11 Nick Clifton <nickc@redhat.com>
14061
14062 * po/gold.pot: Updated by the Translation project.
14063
6a89f575
CC
140642009-09-08 Cary Coutant <ccoutant@google.com>
14065
14066 * output.cc (Output_file::open): Add execute permission to empty file.
14067 * testsuite/Makefile.am (permission_test): New test.
14068 * testsuite/Makefile.in: Regenerate.
14069
fdcac5af
ILT
140702009-09-02 Ian Lance Taylor <iant@google.com>
14071
14072 * output.cc (Output_file::resize): Call map_no_anonymous rather
14073 than map.
14074
44453f85
ILT
140752009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14076
14077 * gold.cc: Include "incremental.h".
14078 (queue_initial_tasks): Call Incremental_checker methods.
14079 * incremental.cc: Include "output.h".
14080 (Incremental_checker::can_incrementally_link_output_file): New
14081 method.
14082 * incremental.h (Incremental_checker): New class.
14083
14084 * output.cc (Output_file::open_for_modification): New method.
14085 (Output_file::map_anonymous): Changed return type to bool. Record
14086 map in base_ field.
14087 (Output_file::map_no_anonymous): New method, broken out of map.
14088 (Output_file::map): Use map_no_anonymous and map_anonymous.
14089 * output.h (class Output_file): Update declarations.
14090
293c1386
CC
140912009-08-24 Cary Coutant <ccoutant@google.com>
14092
14093 * options.h (Command_line::Pre_options): New class.
14094 (Command_line::pre_options): New member.
14095 * options.cc (gold::options::ready_to_register): New variable.
14096 (One_option::register_option): Do nothing if not registering options.
14097 Assert if same short option registered twice.
14098 (General_options::General_options): Turn off option registration when
14099 done constructing.
14100 (Command_line::Pre_options::Pre_options): New constructor.
14101
f773f3d2
CC
141022009-08-24 Cary Coutant <ccoutant@google.com>
14103
06a73cfe
CC
14104 * options.h (General_options::no_keep_memory): Remove incorrect
14105 short option.
f773f3d2 14106
a15af8e2
RW
141072009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14108
14109 * Makefile.am (am__skiplex, am__skipyacc): New.
14110 * Makefile.in: Regenerate.
14111
c462b41b
RW
141122009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14113
14ec8efd
RW
14114 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14115 (INCLUDES): ... this.
14116 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14117 (AM_CPPFLAGS): Renamed from ...
14118 (INCLUDE): ... this.
14119 * Makefile.in, testsuite/Makefile.in: Regenerate.
14120
81ecdfbb
RW
14121 * Makefile.in: Regenerate.
14122 * aclocal.m4: Likewise.
14123 * config.in: Likewise.
14124 * configure: Likewise.
14125 * testsuite/Makefile.in: Likewise.
14126
c462b41b
RW
14127 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14128 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14129 * Makefile.in: Regenerate.
14130 * testsuite/Makefile.in: Regenerate.
14131
2da73f13
CC
141322009-08-19 Cary Coutant <ccoutant@google.com>
14133
14134 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14135 symbols in shared libraries overridden by hidden or internal symbols
14136 in the main program.
14137
2db70501
CD
141382009-08-19 Chris Demetriou <cgd@google.com>
14139
14140 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14141 checking source file names in error messages.
14142
f733487b
DK
141432009-08-18 Doug Kwan <dougkwan@google.com>
14144
14145 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14146 an elcpp::Ehdr as parameter. Adjust call to set_target.
14147 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14148 an elfcpp::Ehdr as parameter.
14149 * object.cc (Object::set_target): Remove the version that looks up
14150 a target and sets it.
14151 (Sized_relobj::setup): Take a Target object instead of
14152 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14153 (make_elf_sized_object): Find target and ask target to
14154 make an ELF object.
14155 * object.h: (Object::set_target): Remove the version that looks up
14156 a target and sets it.
14157 (Sized_relobj::setup): Take a Target object instead of
14158 an elfcpp:Ehdr as parameter.
14159 * target.cc: Include dynobj.h.
14160 (Target::do_make_elf_object_implementation): New.
2e702c99 14161 (Target::do_make_elf_object): New.
f733487b
DK
14162 * target.h (Target::make_elf_object): New template declaration.
14163 (Target::do_make_elf_object): New method declarations.
14164 (Target::do_make_elf_object_implementation): New template declaration.
14165
cc70f101
ILT
141662009-08-14 Ian Lance Taylor <iant@google.com>
14167
14168 * gold.h (FUNCTION_NAME): Define.
14169 (gold_unreachable): Use FUNCTION_NAME.
14170
ef5e0cb1
ST
141712009-08-12 Sriraman Tallam <tmsriram@google.com>
14172
14173 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14174 symbol in the --keep-unique list is not found.
14175
48c187ce
ST
141762009-08-12 Sriraman Tallam <tmsriram@google.com>
14177
14178 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14179 been maked as --keep-unique.
14180 (Icf::unfold_section): New function.
14181 * icf.h (Icf::unfold_section): New function.
14182 * options.h (General_options::keep_unique): New option.
14183 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14184 * testsuite/Makefile.in: Regenerate.
14185 * testsuite/icf_keep_unique_test.sh: New file.
14186 * testsuite/icf_keep_unique_test.cc: New file.
14187
645afe0c
CC
141882009-08-12 Cary Coutant <ccoutant@google.com>
14189
14190 PR 10471
14191 * resolve.cc (Symbol_table::resolve): Check for references from
14192 dynamic objects to hidden and internal symbols.
14193 * testsuite/Makefile.am (hidden_test.sh): New test.
14194 * testsuite/Makefile.in: Regenerate.
14195 * testsuite/hidden_test.sh: New script.
14196 * testsuite/hidden_test_1.c: New test source.
14197 * testsuite/hidden_test_main.c: New test source.
14198
11af873f
DK
141992009-08-11 Doug Kwan <dougkwan@google.com>
14200
14201 * arm.cc: Update comments.
14202 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14203 segment to locate the .ARM.exidx section if present.
14204
b9f7d72d
DK
142052009-08-09 Doug Kwan <dougkwan@google.com>
14206
14207 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14208 patch.
14209
ddd3c53c
ST
142102009-08-07 Sriraman Tallam <tmsriram@google.com>
14211 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14212 compiler warnings.
14213
27721062
ST
142142009-08-06 Sriraman Tallam <tmsriram@google.com>
14215
14216 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14217 valid tls_segment only for non-debug-section relocations.
14218 * testsuite/Makefile.am: Add gc_tls_test.
14219 * testsuite/Makefile.in: Regenerate.
14220 * testsuite/gc_tls_test.cc: New file.
14221 * testsuite/gc_tls_test.sh: New file.
14222
ef15dade 142232009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14224
ef15dade
ST
14225 * icf.cc: New file.
14226 * icf.h: New file.
14227 * Makefile.am (CCFILES): Add icf.cc.
14228 (HFILES): Add icf.h
14229 * Makefile.in: Regenerate.
14230 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14231 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14232 section, symbol and addend information for the relocs.
14233 * gold.cc (queue_middle_tasks): Call identical code folding.
14234 * gold.h: Add defines for multimap.
14235 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14236 to the call of finalize_local_symbols.
14237 * main.cc (main): Create object of class Icf.
14238 * object.cc (Sized_relobj::do_layout): Allow this function to be
14239 called twice during icf.
14240 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14241 to sections marked as identical by icf.
14242 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14243 when available.
14244 (Sized_relobj::do_section_entsize): New function.
14245 * object.h (Object::section_entsize): New function.
14246 (Object::do_section_entsize): New pure virtual function.
14247 (Relobj::finalize_local_symbols): Add new parameter.
14248 (Relobj::do_section_entsize): New function.
14249 * options.h (General_options::icf): New option.
14250 (General_options::icf_iterations): New option.
14251 (General_options::print_icf_sections): New option.
14252 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14253 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14254 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14255 icf.
14256 * symtab.cc (Symbol_table::is_section_folded): New function.
14257 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14258 to sections marked as identical by icf.
14259 * symtab.h (Symbol_table::set_icf): New function.
14260 (Symbol_table::icf): New function.
14261 (Symbol_table::is_section_folded): New function.
14262 (Symbol_table::icf_): New data member.
14263 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14264 * testsuite/Makefile.am: Add commands to build icf_test.
14265 * testsuite/Makefile.in: Regenerate.
14266 * testsuite/icf_test.sh: New file.
14267 * testsuite/icf_test.cc: New file.
14268
c3b65ac4
CD
142692009-07-24 Chris Demetriou <cgd@google.com>
14270
14271 * layout.cc (is_compressible_debug_section): Fix incorrect
14272 comment about compressed section names.
14273
1caf2c51
ILT
142742009-07-20 Ian Lance Taylor <ian@airs.com>
14275
14276 PR 10419
14277 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14278
1ef4d87f
ILT
142792009-07-16 Ian Lance Taylor <iant@google.com>
14280
14281 PR 10400
14282 * layout.h: #include <map>.
14283 (class Kept_section): Change from struct to class. Add accessors
14284 and setters. Add section size to Comdat_group mapping. Change
14285 Comdat_group to std::map. Add is_comdat_ field. Add
14286 linkonce_size field in union.
14287 (class Layout): Update declaration of find_or_add_kept_section.
14288 Don't declare find_kept_object.
14289 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14290 parameter. Add object, shndx, is_comdat, and is_group_name
14291 parameters. Change all callers. Adjust for new Kept_section.
14292 (Layout::find_kept_object): Remove.
14293 * object.cc (Sized_relobj::include_section_group): Update use of
14294 Kept_section. Rename secnum to shndx. Only record
14295 Kept_comdat_section if sections are the same size.
14296 (Sized_relobj::include_linkonce_section): Update use of
14297 Kept_section. Only record Kept_comdat_section if sections are the
14298 same size. Set size of linkonce section.
14299 (Sized_relobj::map_to_kept_section): Update call to
14300 get_kept_comdat_section.
14301 * object.h (class Sized_relobj): Rename fields in
14302 Kept_comdat_section to drop trailing underscores; change object
14303 field to Relobj*. Change Kept_comdat_section_table to store
14304 struct rather than pointer.
14305 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14306 Add kept_object and kept_shndx parameters. Change all callers.
14307 (Sized_relobj::get_kept_comdat_section): Change return type to
14308 bool. Add kept_object and kept_shndx parameters. Change all
14309 callers.
14310 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14311 Layout::find_or_add_kept_section.
14312
37c3b7b0
ILT
143132009-07-09 Ian Lance Taylor <iant@google.com>
14314
14315 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14316 Reserve space in the hash table.
14317
98fa85cb
ILT
143182009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14319
14320 * fileread.cc (File_read::get_mtime): New method.
14321 * fileread.h (Timespec): New structure.
14322 (File_read::get_mtime): New method.
14323 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14324 Renamed from timestamp_nsec.
14325 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14326 Elf_Xword.
e1df38aa 14327 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14328 timestamp_nsec.
e1df38aa 14329 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14330 (Incremental_inputs::report_obejct): Save mtime; style fix.
14331 (Incremental_inputs::report_script): Save mtime; style fix.
14332 (Incremental_inputs::finalize_inputs): Style fix.
14333 (Incremental_inputs::finalize): Style fix.
14334 (Incremental_inputs::create_input_section_data): Store inputs
14335 mtime.
14336 * incremental.h (Incremental_inputs::report_script): Add mtime
14337 argument.
14338 (Incremental_inputs::Input_info::Input_info): Intialize only one
14339 union member.
14340 (Incremental_inputs::Input_info::archive): Move to nameless
14341 union.
14342 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14343 (Incremental_inputs::Input_info::script): Move to nameless union.
14344 (Incremental_inputs::mtime): New field.
14345 * script.cc (read_input_script): Pass file mtime to
14346 Incremental_input.
14347 * script.h (Script_info::inputs): Style fix.
14348
c9d70757
ILT
143492009-07-01 Ian Lance Taylor <ian@airs.com>
14350
14351 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14352 instead of 32.
14353
9c547ec3
ILT
143542009-06-24 Ian Lance Taylor <iant@google.com>
14355
14356 PR 10156
14357 * layout.cc (Layout::choose_output_section): If we find an
14358 existing section, update the flags.
14359 (Layout::create_notes): New function, broken out of
14360 Layout::finalize.
14361 (Layout::finalize): Don't create note sections.
14362 (Layout::create_note): Don't crash if linker script discards
14363 section.
14364 (Layout::create_gold_note): Likewise.
14365 (Layout::create_build_id): Likewise. Don't set
14366 after_input_sections on the section.
14367 (Layout::create_executable_stack_info): Remove target parameter.
14368 Change caller.
14369 * layout.h (class Layout): Declare create_notes. Update
14370 declaration of create_executable_stack_info.
14371 * gold.cc (queue_middle_tasks): Call create_notes.
14372 * output.cc (Output_section::update_flags_for_input_section): Move
14373 here from output.h. If SHF_ALLOC flag is newly set, mark address
14374 invalid.
14375 * output.h (Output_data::mark_address_invalid): New function.
14376 (class Output_section): Only declare, not define,
14377 update_flags_for_input_section. Remove set_flags.
14378
55458500
ILT
143792009-06-24 Ian Lance Taylor <iant@google.com>
14380
14381 * script-sections.cc (Output_section_definition::
14382 set_section_addresses): Rename shadowing local load_address to
14383 laddr.
14384
1307d6cd
ILT
143852009-06-24 Ian Lance Taylor <iant@google.com>
14386
14387 PR 10244
14388 * reloc.cc (relocate_sections): Skip empty relocation sections.
14389
ec3f783e
ILT
143902009-06-23 Ian Lance Taylor <iant@google.com>
14391
14392 PR 10156
14393 * layout.cc (Layout::create_note): Use choose_output_section
14394 rather than make_output_section.
14395
459c9f1c
ILT
143962009-06-23 Ian Lance Taylor <iant@google.com>
14397
14398 PR 10237
14399 * options.cc (General_options::parse_V): Set printed_version_.
14400 (General_options::General_options): Initialize printed_version_.
14401 * options.h (class General_options): Add printed_version_ field.
14402 * gold.cc (queue_initial_tasks): If there are no input files,
14403 don't give a fatal error if we printed the version information.
14404 (queue_middle_tasks): If using -r with a shared object, give a
14405 fatal error rather than an ordinary error.
14406
1518dc8f
ILT
144072009-06-23 Ian Lance Taylor <iant@google.com>
14408
14409 PR 10219
14410 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14411 (Layout::make_output_section): Set have_stabstr_section_ if we see
14412 a .stab*str section.
14413 (Layout::finalize): Call link_stabs_sections.
14414 (Layout::link_stabs_sections): New file.
14415 * layout.h (class Layout): Add have_stabstr_section_ field.
14416 Declare link_stabs_sections.
14417
3d857b98
DK
144182009-06-23 Doug Kwan <dougkwan@google.com>
14419
14420 * Makefile.am (libgold_a_LIBADD): New.
14421 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14422 * Makefile.in: Regenerate.
3d857b98
DK
14423 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14424 * configure: Regenerate.
14425 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14426 * fileread.cc: Include sys/state.h
14427 * gold.h: Declare memmem and strndup if found missing.
14428 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14429
0639a6f6
ILT
144302009-06-23 Ian Lance Taylor <iant@google.com>
14431
14432 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14433 * configure: Rebuild.
14434
8d63875c
ILT
144352009-06-23 Ian Lance Taylor <iant@google.com>
14436
14437 PR 10147
14438 * object.cc (Object::section_contents): Don't try to get a view if
14439 the section has length zero.
14440 (Object::handle_gnu_warning_section): If the section is empty, use
14441 the name of the section as the warning.
14442
f7c8a183
ILT
144432009-06-23 Ian Lance Taylor <iant@google.com>
14444
14445 PR 10133
14446 * stringpool.h (class Stringpool_template): Add optimize_ field.
14447 (Stringpool_template::set_optimize): New function.
14448 * stringpool.cc (Stringpool_template::Stringpool_template):
14449 Initialize optimize_ field.
14450 (Stringpool_template::set_string_offsets): Test local optimize
14451 fild rather than parameter.
14452 * layout.cc (Layout::Layout): Call set_optimize on the section
14453 name stringpool.
14454
e6a307ba
ILT
144552009-06-22 Ian Lance Taylor <iant@google.com>
14456
14457 PR 10030
14458 * yyscript.y: Parse TARGET.
14459 * script.cc (script_set_target): New function.
14460 * script-c.h (script_set_target): Declare.
14461 * options.cc (General_options::string_to_object_format): Rename
14462 from string_to_object_format in anonymous namespace. Change
14463 callers.
14464 * options.h (class General_options): Declare
14465 string_to_object_format.
14466
3ee173de
ILT
144672009-06-22 Ian Lance Taylor <iant@google.com>
14468
14469 * script-sections.cc (Script_sections::create_segments): Don't put
14470 program headers in a PT_LOAD segment if -n or -N.
14471
144722009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14473
14474 PR 10141
14475 * options.h (class General_options): Add -z lazy and -z now. Sort
14476 -z options into alphabetical order.
14477 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14478
cd6739a1 144792009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14480
14481 * layout.cc (Layout::make_output_section): Call
14482 Target::new_output_section.
14483 (Layout::attach_allocated_section_to_segment): Put large section
14484 sections in a separate load segment with the large segment flag
14485 set.
14486 (Layout::segment_precedes): Sort large data segments after other
14487 load segments.
14488 (align_file_offset): New static function.
14489 (Layout::set_segment_offsets): Use align_file_offset.
14490 * output.h (class Output_section): Add is_small_section_ and
14491 is_large_section_ fields.
14492 (Output_section::is_small_section): New function.
14493 (Output_section::set_is_small_section): New function.
14494 (Output_section::is_large_section): New function.
14495 (Output_section::set_is_large_section): New function.
14496 (Output_section::is_large_data_section): New function.
14497 (class Output_segment): Add is_large_data_segment_ field.
14498 (Output_segment::is_large_data_segment): New function.
14499 (Output_segment::set_is_large_data_segment): New function.
14500 * output.cc (Output_section::Output_section): Initialize new
14501 fields.
14502 (Output_segment::Output_segment): Likewise.
14503 (Output_segment::add_output_section): Add assertion that large
14504 data sections always go in large data segments. Force small data
14505 sections to the end of the list of data sections. Force small BSS
14506 sections to the start of the list of BSS sections. For large BSS
14507 sections to the end of the list of BSS sections.
14508 * symtab.h (class Symbol): Declare is_common_shndx.
14509 (Symbol::is_defined): Check Symbol::is_common_shndx.
14510 (Symbol::is_common): Likewise.
14511 (class Symbol_table): Define enum Commons_section_type. Update
14512 declarations. Add small_commons_ and large_commons_ fields.
14513 * symtab.cc (Symbol::is_common_shndx): New function.
14514 (Symbol_table::Symbol_table): Initialize new fields.
14515 (Symbol_table::add_from_object): Put small and large common
14516 symbols in the right list.
14517 (Symbol_table::sized_finalized_symbol): Check
14518 Symbol::is_common_shndx.
14519 (Symbol_table::sized_write_globals): Likewise.
14520 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14521 common symbol lists. Don't call do_allocate_commons_list if the
14522 list is empty.
14523 (Symbol_table::do_allocate_commons_list): Remove is_tls
14524 parameter. Add comons_section_type parameter. Change all
14525 callers. Handle small and large common symbols.
14526 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14527 Symbol::is_common_shndx.
14528 * resolve.cc (symbol_to_bits): Likewise.
14529 * target.h (Target::small_common_shndx): New function.
14530 (Target::small_common_section_flags): New function.
14531 (Target::large_common_shndx): New function.
14532 (Target::large_common_section_flags): New function.
14533 (Target::new_output_section): New function.
14534 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14535 small_common_section_flags, and large_common_section_flags
14536 fields.
14537 (Target::do_new_output_section): New virtual function.
14538 * arm.cc (Target_arm::arm_info): Initialize new fields.
14539 * i386.cc (Target_i386::i386_info): Likewise.
14540 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14541 Likewise.
14542 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14543 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14544 (Target_x86_64::do_new_output_section): New function.
14545 * configure.ac: Define conditional MCMODEL_MEDIUM.
14546 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14547 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14548 (large_LDFLAGS): Define.
14549 * testsuite/large.c: New file.
14550 * testsuite/testfile.cc (Target_test::test_target_info):
14551 Initialize new fields.
14552 * configure, testsuite/Makefile.in: Rebuild.
14553
bb04269c
DK
145542009-06-05 Doug Kwan <dougkwan@google.com>
14555
14556 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14557 * Makefile.in: Regenerate.
bb04269c
DK
14558 * i386.cc (class Target_i386): Define new virtual method to
14559 override do_is_local_label_name in parent.
14560 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14561 local symbols if --discard-locals or -X is given.
14562 * options.h (class General_options): Declare new options
14563 '--discard-locals' and '-X' for discarding locals.
14564 * target.h (class Target): Define new methods is_local_label_name.
14565 Declare new virtual method do_is_local_label_name.
14566 * target.cc: New file.
14567 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14568 (check_SCRIPTS): Add discard_locals_test.sh.
14569 (check_DATA): Add discard_local_tests.syms.
14570 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14571 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14572 * testsuite/Makefile.in: Regenerate.
14573 * testsuite/discard_locals_test.c: New file.
14574 * testsuite/discard_locals_test.sh: Same.
14575
805bb01c
DK
145762009-06-05 Doug Kwan <dougkwan@google.com>
14577
14578 * object.cc (Sized_relobj::Sized_relobj): Initialize
14579 discarded_eh_frame_shndx_ to -1U.
14580 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14581 section.
14582 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14583 a discarded .eh_frame section.
14584 (Sized_relobj::do_finalize_local_symbols): Ditto.
14585 * object.h (class Sized_relobj): Declare new member
14586 discarded_eh_frame_shndx_.
14587 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14588 (local_labels_test.o, local_labels_test): New rules.
14589 * testsuite/Makefile.in: Regenerate.
14590
1dcd334d
DK
145912009-06-04 Doug Kwan <dougkwan@google.com>
14592
14593 * layout.cc (Layout::section_name_mapping): Add mapping for
14594 special ARM sections.
14595
96d49306
DK
145962009-06-03 Doug Kwan <dougkwan@google.com>
14597
14598 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14599 (utils::has_overflow): Same.
14600
dff16297
ILT
146012009-06-03 Ian Lance Taylor <iant@google.com>
14602
14603 * layout.cc (Layout::section_name_mapping): New array, replacing
14604 Layout::linkonce_mapping.
14605 (Layout::section_name_mapping_count): New variable, replacing
14606 Layout::linkonce_mapping_count.
14607 (Layout::linkonce_output_name): Remove.
14608 (Layout::output_section_name): Rewrite.
14609 * layout.h (class Layout): Rename Linkonce_mapping to
14610 Section_name_mapping, linkonce_mapping to section_name_mapping,
14611 linkonce_mapping_count to section_name_mapping_count. Don't
14612 declare linkonce_output_name.
14613
c121c671
DK
146142009-06-03 Doug Kwan <dougkwan@google.com>
14615
14616 * gold/arm.cc (namespace utils): New.
14617 (Target_arm::reloc_is_non_pic): Define new method.
14618 (class Arm_relocate_functions): New.
14619 (Target_arm::Relocate::relocate): Handle relocation types used by
14620 Android.
14621
07800fab
ILT
146222009-06-03 Ian Lance Taylor <iant@google.com>
14623
14624 * arm.cc (Target_arm::scan::global): Use || instead of |.
14625
c121c671
DK
146262009-06-02 Doug Kwan <dougkwan@google.com>
14627
14628 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14629 issued_non_pic_error_.
14630 (class Target_arm::Scan): Declare new method check_non_pic.
14631 Define new method symbol_needs_plt_entry.
14632 Declare new data member issued_non_pic_error_.
14633 (class Target_arm::Relocate): Declare new method
14634 should_apply_static_reloc.
14635 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14636 (Target_arm::Scan::check_non_pic): Define new method.
14637 (Target_arm::Scan::local): Handle a small subset of reloc types used
14638 by Android.
14639 (Target_arm::Scan::local): Same.
14640 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14641
b19b0c6d
ILT
146422009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14643
14644 * incremental.cc (Incremental_inputs::report_command_line): Filter
14645 out --incremental-* options.
14646
94cdfcff
DK
146472009-05-29 Doug Kwan <dougkwan@google.com>
14648
14649 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14650 template class.
14651 (class Target_arm): Update comment.
14652 (Target_arm::Target_arm): Initialize new data members GOT_,
14653 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14654 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14655 and Target_arm::rel_dyn_section.
14656 Declare new_enum Target_arm::Got_type.
14657 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14658 and DYNBSS_.
14659 Update commments for member do_dynsym_value.
14660 (Target_arm::got_size, Target_arm::plt_section,
14661 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14662 new methods inside class defintion.
14663 (Target_arm::got_section): Define new method.
14664 (Target_arm::rel_dyn_section): Same.
14665 (Output_data_plt_arm): New template class.
14666 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14667 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14668 (Output_data_plt_arm::add_entry): Same.
14669 (Output_data_plt_arm::first_plt_entry): Define new
14670 static data member for PLT instruction template.
14671 (Output_data_plt_arm::plt_entry): Same.
14672 (Output_data_plt_arm::do_write): Define new method.
14673 (Target_arm::make_plt_entry): Same.
14674 (Target_arm::do_finalize_sections): Same.
14675 (Target_arm::do_dynsym_value): Same.
14676
4a657b0d
DK
146772009-05-28 Doug Kwan <dougkwan@google.com>
14678
14679 * Makefile.am (TARGETSOURCES): Add arm.cc.
14680 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14681 * Makefile.in: Regenerate.
14682 * arm.cc: New file.
14683 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14684
e7ae8c36
DK
146852009-05-26 Doug Kwan <dougkwan@google.com>
14686
14687 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14688 (General_options::check_excluded_libs): Strip off directories in
14689 archive name before matching like GNU ld does.
14690 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14691 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14692 (exclude_libs_test_LDFLAGS): Add linker option
14693 -Wl,--exclude-libs,libexclude_libs_test_3
14694 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14695 an explicit archive without using -l.
14696 (alt/libexclude_libs_test_3.a): New make rule.
14697 * testsuite/Makefile.in: Regenerate.
14698 * testsuite/exclude_libs_test.c : Declare lib3_default().
14699 (main): Call it.
14700 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14701 * exclude_libs_test_3.c: New file.
14702
f12e7348
NC
147032009-05-26 Nick Clifton <nickc@redhat.com>
14704
14705 * po/id.po: New Indonesian translation.
14706 * po/gold.pot: Updated template file.
14707
4daadc0d
ST
147082009-05-22 Sriraman Tallam <tmsriram@google.com>
14709
e1df38aa 14710 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14711 gc_comdat_test files. Add -Wl,--gc-sections to build
14712 gc_comdat_test.
14713 * testsuite/Makefile.in: Regenerate.
14714 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14715
531813ad
ST
147162009-05-21 Sriraman Tallam <tmsriram@google.com>
14717
14718 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14719 kept comdat section was garbage collected.
14720 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14721 * testsuite/Makefile.in: Regenerate.
14722 * testsuite/gc_comdat_test.sh: New file.
14723 * testsuite/gc_comdat_test_1.cc: New file.
14724 * testsuite/gc_comdat_test_2.cc: New file.
14725
65514900
CC
147262009-05-19 Doug Kwan <dougkwan@google.com>
14727
14728 * archive.cc (Archive::Archive): Move constructor from archive.h
14729 to here. Initialize no_export_.
14730 (Archive::get_elf_object_for_member): Set no_export flag of object.
14731 * archive.h (Archive::Archive): Move constructor body to
14732 archive.cc.
14733 (Archive::no_export): New method.
14734 (Archive::no_export_): New field.
14735 * object.h (Object::Object): Initialize no_export_ to false.
14736 (Object::no_export, Object::set_no_export): New methods.
14737 (Object::no_export_): New field.
14738 * options.cc (General_options::parse_exclude_libs): New method.
14739 (General_options::check_excluded_libs) Same.
14740 * options.h (exclude_libs): New option.
14741 (General_options::check_excluded_libs): New method declaration.
14742 (General_options::excluded_libs_): New field.
14743 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14744 default or protected visibility if an object has no-export flag set.
14745 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14746 (check_SCRIPTS): Add exclude_libs_test.sh.
14747 (check_DATA): Add exclude_libs_test.syms.
14748 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14749 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14750 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14751 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14752 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14753 libexclude_libs_test_2.a): New rules.
14754 * testsuite/Makefile.in: Regenerate.
14755 * testsuite/exclude_libs_test.c: New file.
14756 * testsuite/exclude_libs_test.sh: Ditto.
14757 * testsuite/exclude_libs_test_1.c: Ditto.
14758 * testsuite/exclude_libs_test_2.c: Ditto.
14759
1b77ea50
ILT
147602009-05-15 Ian Lance Taylor <iant@google.com>
14761
14762 * configure.ac: Check for declarations for cases where libiberty.h
14763 checks HAVE_DECL_xxx.
14764 * configure, config.in: Rebuild.
14765
072fe7ce
ILT
147662009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14767
14768 * gold.h (Incremental_argument_list): Remove (invalid) forward
14769 declaration.
14770 * incremental.cc (Incremental_inputs::report_achive): New method.
14771 (Incremental_inputs::report_object): New method.
14772 (Incremental_inputs::report_script): New method.
14773 (Incremental_inputs::finalize_inputs): New method.
14774 (Incremental_inputs::finalize): Call finalize_inputs().
14775 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14776 Create inputs entries.
14777 * incremental.h (Incremental_input_type): New enum.
14778 (Incremental_inputs::Incremental_input): Initialize new fields.
14779 (Incremental_inputs::report_inputs): New method.
14780 (Incremental_inputs::report_achive): New method.
14781 (Incremental_inputs::report_object): New method.
14782 (Incremental_inputs::report_script): New method.
14783 (Incremental_inputs::finalize_inputs): New method.
14784 (Incremental_inputs::Input_info): New struct.
14785 (Incremental_inputs::Input_info_map): New typedef.
14786 (Incremental_inputs::lock_): New field.
14787 (Incremental_inputs::Inputs_): New field.
14788 (Incremental_inputs::Inputs_map): New field.
14789 * main.cc (main): Call Incremental_input::report_inputs.
14790 * options.h (Input_argument_list): Typedef moved from
14791 Input_arguments.
14792 (Input_file_group::Files): Remove, use ::Input_argument_list.
14793 (Input_file_group::Input_argument_list): Remove, use
14794 ::Input_argument_list.
14795 * plugin.cc (Plugin_manager::add_input_file): Add error in
14796 incremental build.
14797 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14798 functions.
14799 * script.cc (read_input_script): Call
14800 Incremental_input::report_script.
14801 * script.h (Script_info): New class.
14802
b0481b0b
ILT
148032009-04-27 Ian Lance Taylor <iant@google.com>
14804
14805 * x86_64.cc (do_adjust_output_section): Set entsize to
14806 plt_entry_size.
14807
b22a5a41 148082009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14809
14810 * output.cc (Output_file::close): After short writes, continue
14811 writing from the correct offset in the buffer being written.
14812
40fde488
CD
148132009-04-23 Chris Demetriou <cgd@google.com>
14814
14815 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14816 * configure: Regenerate.
14817 * config.in: Regenerate.
14818 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14819 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14820
3ce2c28e
ILT
148212009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14822
14823 * incremental.cc (Incremental_inputs_header_data): Renamed from
14824 Incremental_input_header_data.
14825 (Incremental_inputs_header_data::data_size): New field.
14826 (Incremental_inputs_header_data::put_input_file_count): Renamed
14827 from input_file_count.
14828 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14829 from command_line_offset.
14830 (Incremental_inputs_header_data::put_reserved): Renamed from
14831 put_reserved.
14832 (Incremental_inputs_entry_data): Renamed from
14833 Incremental_input_entry_data.
14834 (Incremental_inputs_entry_data::data_size): New field.
14835 (Incremental_inputs::report_command_line): New method.
14836 (Incremental_inputs::finalize): New method.
14837 (Incremental_inputs::create_incremental_inputs_data): New method.
14838 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14839 * incremental.h: New file.
14840 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14841 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14842 incremental builds.
703d02da 14843 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14844 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14845 (Layout::create_incremental_info_sections): New method.
14846 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14847 * main.cc (main): Notify Incremental_input of the command line.
14848
e55bde5e
ILT
148492009-04-01 Ian Lance Taylor <iant@google.com>
14850 Mikolaj Zalewski <mikolajz@google.com>
14851
14852 * gold.h (reserve_unordered_map): Define, three versions, one for
14853 each version of Unordered_map.
14854 * layout.cc (Layout::Layout): Remove options parameter. Add
14855 number_of_input_files parameter. Don't initialize options_.
14856 Initialize number_of_input_files_ and resized_signatures_. Move
14857 sections_are_attached_.
14858 (Layout::layout_group): Reserve space for group_signatures_.
14859 (Layout::find_or_add_kept_section): Change name parameter to be a
14860 reference. Resize signatures_ map when it gets large enough.
14861 (Layout::layout_eh_frame): Use parameters->options() instead of
14862 this->options_.
14863 (Layout::make_output_section): Likewise.
14864 (Layout::attach_allocated_section_to_segment): Likewise.
14865 (Layout::finalize, Layout::create_executable_stack): Likewise.
14866 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14867 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14868 * layout.h (class Layout): Update declarations. Remove options_
14869 field. Add number_of_input_files_ and resized_signatures_
14870 fields. Move sections_are_attached_ field.
14871 * main.cc (main): Pass number of input files to Layout
14872 constructor. Don't pass options.
14873
154b857c
ILT
148742009-03-30 Ian Lance Taylor <iant@google.com>
14875
14876 * ffsll.c (ffsll): Correct implementation.
14877
2f35ab9b
ILT
148782009-03-27 Ian Lance Taylor <iant@google.com>
14879
fd03461a
ILT
14880 * ffsll.c: New file.
14881 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14882 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14883 * ftruncate.c (ftruncate): Declare before definition.
14884 * mremap.c (mremap): Likewise.
14885 * pread.c (pread): Likewise.
14886 * configure, Makefile.in, config.in: Rebuild.
14887
2f35ab9b
ILT
14888 * mremap.c: New file.
14889 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14890 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14891 (mremap): Declare if HAVE_MREMAP is not defined.
14892 * configure, Makefile.in, config.in: Rebuild.
14893
33aea2fd
CC
148942009-03-27 Cary Coutant <ccoutant@google.com>
14895
14896 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14897 position independent.
14898 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14899 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14900
6d479619
CC
149012009-03-24 Cary Coutant <ccoutant@google.com>
14902
14903 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14904 an executable.
14905 (needs_dynamic_reloc): Likewise.
14906
afc06bb8
ILT
149072009-03-24 Ian Lance Taylor <iant@google.com>
14908
14909 * yyscript.y (file_cmd): Recognize EXTERN.
14910 (extern_name_list, extern_name_list_body): New nonterminals.
14911 * script.cc (script_add_extern): Define.
14912 * script-c.h (script_add_extern): Declare.
14913
f6060a4d
ILT
149142009-03-24 Rafael Avila de Espindola <espindola@google.com>
14915
14916 * object.cc (is_elf_object): Define.
14917 * object.h (is_elf_object): Declare.
14918 * archive.cc (Archive::get_elf_object_for_member): Call
14919 is_elf_object.
33aea2fd 14920 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14921
26736d8e
ILT
149222009-03-24 Elliott Hughes <enh@google.com>
14923
14924 * output.cc (Output_file::map_anonymous): Define.
14925 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14926 try an anonymous one. Report the size if the mmap fails.
14927 * output.h (class Output_file): Declare map_anonymous.
14928
22fd9730
ILT
149292009-03-24 Ian Lance Taylor <iant@google.com>
14930
14931 * target-select.cc (instantiate_target): Don't acquire the lock if
14932 the instantiated_target_ field has already been set.
14933
cb010894
ILT
149342009-03-23 Ian Lance Taylor <iant@google.com>
14935
7f055c20
ILT
14936 * gold-threads.h (class Initialize_lock): Define.
14937 * gold-threads.cc (class Initialize_lock_once): Define.
14938 (initialize_lock_control): New static variable.
14939 (initialize_lock_pointer): New static variable.
14940 (initialize_lock_once): New static function.
14941 (Initialize_lock::Initialize_lock): Define.
14942 (Initialize_lock::initialize): Define.
14943 * target-select.h: Include "gold-threads.h".
14944 (class Target_selector): Add lock_ and initialize_lock_ fields.
14945 Don't define instantiate_target, just declare it.
14946 * target-select.cc (Target_selector::Target_selector): Initialize
14947 new fields.
14948 (Target_selector::instantiate_target): Define.
14949 * descriptors.h: Include "gold-threads.h".
14950 (class Descriptors): Add initialize_lock_ field.
14951 * descriptors.cc (Descriptors::Descriptors): Initialize new
14952 field.
14953 (Descriptors::open): Use initialize_lock_ field
14954 * errors.h (class Errors): Add initialize_lock_ field.
14955 * errors.cc (Errors::Errors): Initialize new field.
14956 (Errors::initialize_lock): Use initialize_lock_ field.
14957 * powerpc.cc (class Target_selector_powerpc): Remove
14958 instantiated_target_ field. In do_recognize call
14959 instantiate_target rather than do_instantiate_target. In
14960 do_instantiate_target just allocate a new target.
14961 * sparc.cc (class Target_selector_sparc): Likewise.
14962
36959681
ILT
14963 * freebsd.h: New file.
14964 * i386.cc: Include "freebsd.h".
14965 (Target_i386): Derive from Target_freebsd rather than
14966 Sized_target.
14967 (Target_selector_i386): Derive from Target_selector_freebsd rather
14968 than Target_selector.
14969 * x86_64.cc: Include "freebsd.h".
14970 (Target_x86_64): Derive from Target_freebsd rather than
14971 Sized_target.
14972 (Target_selector_x86_64): Derive from Target_selector_freebsd
14973 rather than Target_selector.
14974 * target.h (class Target): Add adjust_elf_header and
14975 do_adjust_elf_header.
14976 * output.cc (Output_file_header:: do_sized_write): Call target
14977 adjust_elf_header routine.
14978 * configure.tgt: Set targ_osabi.
14979 * configure.ac: Define GOLD_DEFAULT_OSABI.
14980 * parameters.cc (Parameters::default_target): Pass
14981 GOLD_DEFAULT_OSABI to select_target.
14982 * target-select.h (class Target_selector): Make instantiate_target
14983 protected rather than private.
14984 * Makefile.am (HFILES): Add freebsd.h.
14985 * configure, Makefile.in, config.in: Rebuild.
14986
cb010894
ILT
14987 * merge.cc (do_add_input_section): Correct pend value. Change
14988 message about last entry not being null terminated from error to
14989 warning.
14990
0e879927
ILT
149912009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14992
14993 * incremental.cc: New file.
14994 * Makefile.am (CCFILES): Add incremental.cc.
14995 * Makefile.in: Rebuild.
14996
41105937
PP
149972009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14998
14999 * layout.cc (Layout::output_section_name): Preserve names
15000 of '.note.' sections.
e1df38aa 15001
60439920
ILT
150022009-03-19 Ian Lance Taylor <iant@google.com>
15003
15004 * descriptors.cc (Descriptors::open): Check that the options are
15005 valid before using them.
15006
0d371ad3
ILT
150072009-03-18 Ian Lance Taylor <iant@google.com>
15008
15009 * script-sections.h: Include <list>.
15010 (class Script_sections): Change Sections_elements from std::vector
15011 to std::list. Typedef public Elements_iterator. Add
15012 orphan_section_placement_, data_segment_align_start_, and
15013 saw_data_segment_align_ fields. Remove data_segment_align_index_
15014 field.
15015 * script-sections.cc (class Orphan_section_placement): New class.
15016 (class Sections_element): Add virtual functions is_relro and
15017 orphan_section_init. Remove virtual function place_orphan_here.
15018 (class Output_section_definition): Add is_relro and
15019 orphan_section_init. Remove place_orphan_here.
15020 (class Orphan_output_section): Likewise.
15021 (Script_sections::Script_sections): Update for field changes.
15022 (Script_sections::data_segment_align): Set saw_data_segment_align_
15023 and data_segment_align_start_, not data_segment_align_index.
15024 (Script_sections::data_segment_relro_end): Check
15025 saw_data_segment_align_. Use data_segment_align_start_ rather
15026 than data_segment_align_index_.
15027 (Script_sections::place_orphan): Rewrite to use
15028 Orphan_section_placement.
15029
9201d894
ILT
150302009-03-17 Ian Lance Taylor <iant@google.com>
15031
9c5b8369
ILT
15032 * archive.cc (Archive::add_symbols): Check for a version attached
15033 to the symbol name in the archive map.
15034 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15035 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15036 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15037 (ver_test_11.a): New target.
15038 * testsuite/Makefile.in: Rebuild.
15039
9201d894
ILT
15040 * configure.ac: Check for chsize and posix_fallocate. Replace
15041 ftruncate.
15042 * ftruncate.c: New file, from gnulib.
15043 * output.cc (posix_fallocate): Define dummy version if not
15044 HAVE_POSIX_FALLOCATE.
15045 (Output_file::map): Call posix_fallocate rather than lseek and
15046 write.
15047 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15048 * configure, Makefile.in, config.in: Rebuild.
15049
ef4ab7a8 150502009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15051
ef4ab7a8
PP
15052 * layout.h (Layout::create_note): Add section_name parameter.
15053 * layout.cc (Layout::create_note): Likewise.
15054 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15055
8c500701
ILT
150562009-03-17 Ian Lance Taylor <iant@google.com>
15057
e85b18e1
ILT
15058 * descriptors.cc: Include "options.h".
15059 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15060 (Descriptors::open): Always use O_CLOEXEC when opening a new
15061 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15062 then set FD_CLOEXEC.
15063
9efe6174
ILT
15064 * sparc.cc (class Target_sparc): Add has_got_section.
15065 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15066 make sure we have a GOT section.
15067
15068 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15069 (Target_sparc::Scan::local): Likewise.
15070 (Target_sparc::Scan::global): Likewise.
15071 (Target_sparc::Relocate::relocate): Likewise.
15072 (Target_sparc::Relocate::relocate_tls): Likewise.
15073
8c500701
ILT
15074 * symtab.cc (Symbol_table::define_default_version): New function,
15075 broken out of add_from_object.
15076 (Symbol_table::add_from_object): Call define_default_version.
15077 (Symbol_table::define_special_symbol): Add resolve_oldsym
15078 parameter. Change all callers. If the version for a symbol comes
15079 from a version script, resolve it with the symbol with the same
15080 name with no version. Also add the symbol without a version if
15081 appropriate.
15082 (do_define_in_output_data): If resolving with oldsym, don't delete
15083 sym.
15084 (do_define_in_output_segment): Likewise.
15085 (do_define_as_constant): Likewise.
15086 * symtab.h (class Symbol_table): Update declarations.
15087
f1ed28fb
ILT
150882009-03-13 Ian Lance Taylor <iant@google.com>
15089
15f8229b
ILT
15090 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15091 (Read_symbols::requeue): New function.
15092 (Read_symbols::do_read_symbols): If make_elf_object fails because
15093 the target type is not configured, and the file was searched for,
15094 issue a warning and retry with the next directory.
15095 (Add_symbols::run): If the file has an incompatible format, and
15096 it was searched for, requeue the Read_symbols task. On error,
15097 release the object.
15098 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15099 dirindex parameter to constructor. Change all callers. Declare
15100 incompatible_warning and requeue.
15101 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15102 input_argument_ and input_group_ fields. Add them to
15103 constructor. Change all callers.
15104 (class Read_script): Add dirindex_ field. Add it to constructor.
15105 Change all callers.
15106 * archive.cc (Archive::setup): Remove input_objects parameter.
15107 Change all callers.
15108 (Archive::get_file_and_offset): Likewise.
15109 (Archive::read_all_symbols): Likewise.
15110 (Archive::read_symbols): Likewise.
15111 (Archive::get_elf_object_for_member): Remove input_objects
15112 parameter. Add punconfigured parameter. Change all callers.
15113 (Archive::add_symbols): Change return type to bool. Check return
15114 value of include_member.
15115 (Archive::include_all_members): Likewise.
15116 (Archive::include_member): Change return type to bool. Return
15117 false if first included object has incompatible target. Set
15118 included_member_ field.
15119 (Add_archive_symbols::run): If add_symbols returns false, requeue
15120 Read_symbols task.
15121 * archive.h (class Archive): Add included_member_ field.
15122 Initialize it in constructor. Add input_file and searched_for
15123 methods. Update declarations.
15124 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15125 input_argument_ fields. Add them to constructor. Change all
15126 callers.
15127 * script.cc: Include "target-select.h".
15128 (class Parser_closure): Add skip_on_incompatible_target_ and
15129 found_incompatible_target_ fields. Add
15130 skip_on_incompatible_target parameter to constructor. Change all
15131 callers. Add methods skip_on_incompatible_target,
15132 clear_skip_on_incompatible_target, found_incompatible_target, and
15133 set_found_incompatible_target.
15134 (read_input_script): Add dirindex parameter. Change all callers.
15135 If parser finds an incompatible target, requeue Read_symbols
15136 task.
15137 (script_set_symbol): Clear skip_on_incompatible_target in
15138 closure.
15139 (script_add_assertion, script_parse_option): Likewise.
15140 (script_start_sections, script_add_phdr): Likewise.
15141 (script_check_output_format): New function.
15142 * script.h (read_input_script): Update declaration.
15143 * script-c.h (script_check_output_format): Declare.
15144 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15145 (ignore_cmd): Remove OUTPUT_FORMAT.
15146 * fileread.cc (Input_file::Input_file): Add explicit this.
15147 (Input_file::will_search_for): New function.
15148 (Input_file::open): Add pindex parameter. Change all callers.
15149 * fileread.h (class Input_file): Add input_file_argument method.
15150 Declare will_search_for. Update declarations.
15151 * object.cc (make_elf_object): Add punconfigured parameter.
15152 Change all callers.
15153 * object.h (class Object): Make input_file public. Add
15154 searched_for method.
15155 (make_elf_object): Update declaration.
15156 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15157 restart search.
15158 * dirsearch.h (class Dirsearch): Update declaration.
15159 * options.h (class General_options): Add --warn-search-mismatch.
15160 * parameters.cc (Parameters::is_compatible_target): New function.
15161 * parameters.h (class Parameters): Declare is_compatible_target.
15162 * workqueue.cc (Workqueue::add_blocker): New function.
15163 * workqueue.h (class Workqueue): Declare add_blocker.
15164
f1ed28fb
ILT
15165 * fileread.cc (Input_file::open): Remove options parameter.
15166 Change all callers.
15167 (Input_file::open_binary): Likewise.
15168 * script.cc (read_input_script): Likewise.
15169 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15170 options parameter from constructor. Change all callers.
15171 (class Read_script): Likewise.
15172 * fileread.h (class Input_file): Update declarations.
15173 * script.h (read_input_script): Update declaration.
15174
34dd024a
NC
151752009-03-10 Nick Clifton <nickc@redhat.com>
15176
15177 * po/es.po: New Spanish translation.
15178
6d71b17c
CC
151792009-03-06 Cary Coutant <ccoutant@google.com>
15180
15181 * options.cc (parse_short_option): Keep dash_z from registering itself.
15182
031cdbed
ILT
151832009-03-03 Ian Lance Taylor <iant@google.com>
15184
15185 PR 9918
15186 * target-reloc.h (relocate_section): Pass output_section to
15187 relocate.
15188 * i386.cc (Target_i386::should_apply_static_reloc): Add
15189 output_section parameter. Change all callers.
15190 (Target_i386::Relocate::relocate): Add output_section parameter.
15191 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15192 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15193 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15194 * testsuite/two_file_shared.sh: New script.
15195 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15196 (check_DATA): Add two_file_shared.dbg.
15197 (two_file_shared.dbg): New target.
15198 * testsuite/Makefile.in: Rebuild.
15199
15d5fa16
ILT
152002009-03-01 Ian Lance Taylor <iant@google.com>
15201
15202 * configure.ac: Check for byteswap.h.
15203 * configure: Rebuild.
15204 * config.in: Rebuild.
15205
8a4c0b0d
ILT
152062009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15207
15208 * layout.cc (Layout::find_or_add_kept_section): New function.
15209 (Layout::add_comdat): Removed.
15210 * layout.h (struct Kept_section): Move out of class Layout.
15211 Remove trailing underscores from field names. Add group_sections
15212 field. Rename group_ field to is_group. Change all uses.
15213 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15214 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15215 comdat_groups_ field.
15216 (Sized_relobj::include_section_group): Use
15217 find_or_add_kept_section and Kept_section::group_sections.
15218 (Sized_relobj::include_linkonce_section): Likewise.
15219 * object.cc (class Sized_relobj): Don't define Comdat_group or
15220 Comdat_group_table. Remove find_comdat_group and
15221 add_comdat_group. Remove comdat_groups_ field.
15222 * plugin.cc (include_comdat_group): Use
15223 Layout::find_or_add_kept_section.
15224
b4ecf66b
ILT
152252009-02-28 Ian Lance Taylor <iant@google.com>
15226
14359ca0
ILT
15227 * README: --gc-sections and map files are now supported. Document
15228 some build requirements.
15229
b4ecf66b
ILT
15230 PR 6992
15231 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15232 relocatable link set the value of the section symbol to zero.
15233 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15234 relocatable link don't include the section address in the local
15235 symbol value.
15236
0602e05a
ILT
152372009-02-27 Ian Lance Taylor <iant@google.com>
15238
fd9d194f
ILT
15239 PR 6811
15240 * options.h (class Search_directory): Add is_system_directory.
15241 (class General_options): Declare is_in_system_directory.
15242 * options.cc (get_relative_sysroot): Make static.
15243 (get_default_sysroot): Make static.
15244 (General_optoins::is_in_system_directory): New function.
15245 * fileread.cc (Input_file::is_in_system_directory): New function.
15246 * fileread.h (class Input_file): Declare is_in_system_directory.
15247 * object.h (class Object): Add is_in_system_directory.
15248 (class Input_objects): Remove system_library_directory_ field.
15249 * object.cc (Input_objects::add_object): Don't set
15250 system_library_directory_.
15251 (input_objects::found_in_system_library_directory): Remove.
15252 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15253 parameter. Change all callers.
15254 (Symbol_table::sized_write_globals): Likewise.
15255 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15256 Call Object::is_in_system_directory.
15257 * symtab.h (class Symbol_table): Update declarations.
15258
61edd21f
ILT
15259 PR 5990
15260 * descriptors.h (Open_descriptor): Add is_on_stack field.
15261 * descriptors.cc (Descriptors::open): If the descriptor is on the
15262 top of the stack, remove it. Initialize is_on_stack field.
15263 (Descriptors::release): Only add pod to stack if it is not on the
15264 stack already.
15265 (Descriptors::close_some_descriptor): Clear stack_next and
15266 is_on_stack fields.
15267
e29e076a
ILT
15268 PR 7091
15269 * output.cc (Output_section::find_starting_output_address): Rename
15270 from starting_output_address; add PADDR parameter; change return
15271 type.
15272 * output.h (class Output_section): Declare
15273 find_starting_output_address instead of starting_output_address.
15274 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15275 section symbol for which we can't find a merge section.
15276
0602e05a
ILT
15277 PR 9836
15278 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15279 hidden or internal, force the symbol to be local.
15280 * resolve.cc (Symbol::override_visibility): Define.
15281 (Symbol::override_base): Use override_visibility.
15282 (Symbol_table::resolve): Likewise.
15283 (Symbol::override_base_with_special): Likewise.
15284 (Symbol_table::override_with_special): If the visibility is hidden
15285 or internal, force the symbol to be local.
15286 * symtab.h (class Symbol): Add set_visibility and
15287 override_visibility.
15288 * testsuite/ver_test_1.sh: New file.
15289 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15290 (check_DATA): Add ver_test_1.syms.
15291 (ver_test_1.syms): New target.
15292 * testsuite/Makefile.in: Rebuild.
15293
401a9a73
CC
152942009-02-25 Cary Coutant <ccoutant@google.com>
15295
15296 * layout.cc (Layout::choose_output_section): Don't rename sections
15297 when using a linker script that has a SECTIONS clause.
15298 * Makefile.in: Regenerate.
15299
15300 * testsuite/Makefile.am (script_test_5.sh): New test case.
15301 * testsuite/Makefile.in: Regenerate.
15302 * testsuite/script_test_5.cc: New file.
15303 * testsuite/script_test_5.sh: New file.
15304 * testsuite/script_test_5.t: New file.
15305
f488e4b0
CC
153062009-02-13 Rafael Avila de Espindola <espindola@google.com>
15307
15308 * archive.cc (Archive::include_member): Update calls to add_symbols.
15309 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15310 the Layout argument.
15311 * dynobj.h (do_add_symbols): Add the Layout argument.
15312 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15313 Layout argument.
15314 * object.h (Object::add_symbols): Add the Layout argument.
15315 (Object::do_add_symbols): Add the Layout argument.
15316 (Sized_relobj::do_add_symbols): Add the Layout argument.
15317 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15318 Unify the two versions.
15319 (Add_plugin_symbols): Remove.
15320 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15321 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15322 (Add_plugin_symbols): Remove.
15323 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15324 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15325 (Add_symbols::run): Make it work with Pulginobj.
15326
89dd1680
ILT
153272009-02-06 Ian Lance Taylor <iant@google.com>
15328
15329 * object.cc (Sized_relobj::do_layout): Make info message start
15330 with lower case letter.
15331
266d0a74
ILT
153322009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15333
602b464e
ILT
15334 * binary.cc: Fix file comment.
15335
266d0a74
ILT
15336 * options.h (enum Incremental_disposition): Define.
15337 (class General_options): Add new options: --incremental,
15338 --incremental_changed, --incremental_unchanged,
15339 --incremental_unknown. Add incremental_disposition_ and
15340 implicit_incremental_ fields.
15341 (General_options::incremental_disposition): New function.
15342 (class Position_dependent_options): Add incremental_disposition
15343 option.
15344 (Position_dependent_options::copy_from_options): Set incremental
15345 dispositions.
15346 * options.cc (General_options::parse_incremental_changed): New
15347 function.
2e702c99
RM
15348 (General_options::parse_incremental_unchanged): New function.
15349 (General_options::parse_incremental_unknown): New function.
15350 (General_options::General_options): Initialize new fields
266d0a74 15351 incremental_disposition_ and implicit_incremental_.
2e702c99 15352 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15353 without --incremental.
15354
f073bbf7
CD
153552009-02-06 Chris Demetriou <cgd@google.com>
15356
15357 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15358 pointer and to report location as the file name associated with
15359 the symbol.
15360 (gold_undefined_symbol_at_location): New function to replace the
15361 old gold_undefined_symbol functionality.
15362 * target-reloc.h (relocate_section): Update to use
15363 gold_undefined_symbol_at_location.
15364 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15365 Call gold_undefined_symbol function rather than gold_error.
15366 * errors.h (Errors::undefined_symbol): Take location as a
15367 string, rather than calculating it from a relocation.
15368 * errors.cc (Errors::fatal): Print "fatal error:" before the
15369 formatted message.
15370 (Errors::error, Errors::error_at_location): Print "error: "
15371 before the formatted message.
15372 (Errors::undefined_symbol): Take location as a string, rather
15373 than calculating it from a relocation.
15374 (gold_undefined_symbol_at_location): New function akin to
15375 old gold_undefined_symbol, calculates location from relocation.
15376 (gold_undefined_symbol): Change to take only a Symbol pointer
15377 and to report location as the file name associated with the symbol.
15378 * testsuite/debug_msg.sh: Update for changed error messages.
15379 * testsuite/undef_symbol.sh: Likewise.
15380
8e94a90c
ILT
153812009-02-04 Duncan Sands <baldrick@free.fr>
15382
15383 PR 9812
15384 * reduced_debug_output.h
15385 (Output_reduced_debug_abbrev_section::failed): Use format for
15386 gold_warning.
15387 (Output_reduced_debug_info_section::faild): Likewise.
15388
88a0e15b
ILT
153892009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15390
15391 * script.cc (Lazy_demangler): New class.
2e702c99 15392 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15393 symbol only once.
15394
5efc7cd2
CC
153952009-01-29 Cary Coutant <ccoutant@google.com>
15396
15397 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15398 to __tls_get_addr.
15399 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15400
e0ebcf42
ILT
154012009-01-28 Ian Lance Taylor <iant@google.com>
15402
5efc7cd2 15403 * version.cc (version_string): Bump to 1.9.
75fe7426 15404
e0ebcf42
ILT
15405 * gold.h: Include <cstring> and <stdint.h>.
15406 * version.cc: Include <cstdio>.
15407 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15408 warning.
15409 * reduced_debug_output.cc (insert_into_vector): Rename from
15410 Insert_into_vector; change all callers. Use Swap_unaligned to
15411 avoid aliasing issue; remove union since it is unnecessary.
15412
8e2813be 154132009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15414
15415 * Makefile.am (CCFILES): Add gc.cc.
15416 (HFILES): Add gc.h.
15417 * Makefile.in: Regenerate.
15418 * gold.cc (Gc_runner): New class.
15419 (queue_initial_tasks): Call garbage collection related tasks
15420 when corresponding options are invoked.
15421 (queue_middle_gc_tasks): New function.
15422 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15423 processed early before laying out sections during garbage collection.
15424 * gold.h (queue_middle_gc_tasks): New function.
15425 (is_prefix_of): Move from "layout.cc".
15426 * i386.cc (Target_i386::gc_process_relocs): New function.
15427 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15428 * main.cc (main): Create object of class "Garbage_collection".
15429 * object.cc (Relobj::copy_symbols_data): New function.
15430 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15431 (Sized_relobj::do_layout): Allow this function to be called twice
15432 during garbage collection and defer layout of section during the
6d03d481
ST
15433 first call.
15434 * object.h (Relobj::get_symbols_data): New function.
15435 (Relobj::is_section_name_included): New function.
15436 (Relobj::copy_symbols_data): New function.
15437 (Relobj::set_symbols_data): New function.
15438 (Relobj::get_relocs_data): New function.
15439 (Relobj::set_relocs_data): New function.
15440 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15441 (Relobj::gc_process_relocs): New function.
15442 (Relobj::do_gc_process_relocs): New pure virtual function.
15443 (Relobj::sd_): New data member.
15444 (Sized_relobj::is_output_section_offset_invalid): New function.
15445 (Sized_relobj::do_gc_process_relocs): New function.
15446 * options.h (General_options::gc_sections): Modify to not be a no-op.
15447 (General_options::print_gc_sections): New option.
15448 * plugin.cc (Plugin_finish::run): Remove function call to
15449 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15450 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15451 * reloc.cc (Read_relocs::run): Add task to process relocs and
15452 determine unreferenced sections when doing garbage collection.
15453 (Gc_process_relocs): New class.
15454 (Sized_relobj::do_gc_process_relocs): New function.
15455 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15456 sections that are garbage collected.
15457 * reloc.h (Gc_process_relocs): New class.
15458 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15459 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15460 symbols whose corresponding sections are garbage collected.
15461 (Symbol_table::Symbol_table): Add new parameter for the garbage
15462 collection object.
15463 (Symbol_table::gc_mark_undef_symbols): New function.
15464 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15465 (Symbol_table::gc_mark_dyn_syms): New function.
15466 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15467 as garbage.
15468 (Symbol_table::add_from_object): Likewise.
15469 (Symbol_table::add_from_relobj): When building shared objects, do not
15470 treat externally visible symbols as garbage.
15471 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15472 table information for static and relocatable links.
15473 * symtab.h (Symbol_table::set_gc): New function.
15474 (Symbol_table::gc): New function.
15475 (Symbol_table::gc_mark_undef_symbols): New function.
15476 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15477 (Symbol_table::gc_mark_dyn_syms): New function.
15478 (Symbol_table::gc_): New data member.
e1df38aa 15479 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15480 function.
15481 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15482 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15483
3b293544
CF
154842009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15485
15486 * options.h (General_options::gc_sections): Define as a no-op for now.
15487 (General_options::no_keep_memory): Ditto.
15488 (General_options::Bshareable): Define.
15489 * options.cc (General_options::finalize): Honor -Bshareable.
15490
83d22aa8
AS
154912009-01-20 Andreas Schwab <schwab@suse.de>
15492
15493 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15494 read the value in the contents, since we don't use it. Use the
15495 template endianness when writing.
15496 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15497
cd536b21
AS
154982009-01-19 Andreas Schwab <schwab@suse.de>
15499
15500 * configure.tgt (powerpc64-*): Fix targ_obj.
15501
99e9a495
ILT
155022009-01-15 Ian Lance Taylor <iant@google.com>
15503
15504 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15505 local symbols when stripping all symbols.
15506
bbbfea06
CC
155072009-01-14 Cary Coutant <ccoutant@google.com>
15508
99e9a495 15509 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15510
0f7c0701
CC
155112009-01-14 Cary Coutant <ccoutant@google.com>
15512
15513 * archive.cc (Archive::get_elf_object_for_member): Remove call
15514 to File_read::claim_for_plugin.
15515 * descriptors.cc (Descriptors::open): Remove reference to
15516 is_claimed.
15517 (Descriptors::claim_for_plugin): Remove.
15518 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15519 (Descriptors::is_claimed): Remove.
15520 (claim_descriptor_for_plugin): Remove.
15521 * fileread.cc (File_read::claim_for_plugin): Remove.
15522 * fileread.h (File_read::claim_for_plugin): Remove.
15523 (File_read::descriptor): Reopen descriptor if necessary.
15524 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15525 (Plugin_manager::all_symbols_read): Add task parameter. Change
15526 all callers.
15527 (Plugin_manager::get_input_file): New function.
15528 (Plugin_manager::release_input_file): New function.
15529 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15530 corresponding data member.
15531 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15532 and pass to base constructor. Change all callers.
15533 (get_input_file, release_input_file): New functions.
15534 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15535 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15536 (Plugin_manager::all_symbols_read): Add task parameter.
15537 (Plugin_manager::get_input_file): New function.
15538 (Plugin_manager::release_input_file): New function.
15539 (Plugin_manager::task_): New data member.
15540 (Pluginobj::Pluginobj): Add filesize parameter.
15541 (Pluginobj::filename): New function.
15542 (Pluginobj::descriptor): New function.
15543 (Pluginobj::filesize): New function.
15544 (Pluginobj::filesize_): New data member.
15545 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15546 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15547 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15548
15549 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15550 with archive libraries.
15551 * testsuite/Makefile.in: Regenerate.
15552 * testsuite/plugin_test.c (struct sym_info): New type.
15553 (get_input_file, release_input_file): New static variables.
15554 (onload): Capture new transfer vector entries.
15555 (claim_file_hook): Stop reading at end of file according to filesize.
15556 Factor out parsing of readelf output into separate function.
15557 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15558 APIs and get the source file name from the symbol table. Convert
15559 source file name to corresponding object file name. Print info
15560 message when adding new input files.
15561 (parse_readelf_line): New function.
15562 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15563 * testsuite/plugin_test_2.sh: Likewise.
15564 * testsuite/plugin_test_3.sh: Likewise.
15565 * testsuite/plugin_test_4.sh: New test case.
15566
62a6d109
ILT
155672009-01-07 Ian Lance Taylor <iant@google.com>
15568
15569 * version.cc (version_string): Bump to 1.8.
15570
483620e8
CC
155712008-12-23 Cary Coutant <ccoutant@google.com>
15572
15573 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15574 * plugin.cc (Plugin_manager::finish): Rename as
15575 layout_deferred_objects. Move cleanup to separate function.
15576 (Plugin_manager::cleanup): New function.
15577 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15578 separately.
15579 * plugin.h (Plugin_manager::finish): Rename as
15580 layout_deferred_objects.
15581 (Plugin_manager::cleanup): New function.
15582 (Plugin_manager::cleanup_done): New field.
15583
d66a9eb3
CC
155842008-12-23 Cary Coutant <ccoutant@google.com>
15585
15586 * plugin.cc (is_visible_from_outside): New function.
15587 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15588 so we don't return "IR only" status for exported symbols or -r links.
15589
15590 * testsuite/Makefile.am (plugin_test_3): New test case.
15591 * testsuite/Makefile.in: Regenerate.
15592 * testsuite/plugin_test_3.sh: New file.
15593
5995b570
CC
155942008-12-22 Cary Coutant <ccoutant@google.com>
15595
15596 * object.cc (Sized_relobj::layout_section): New function.
15597 (Sized_relobj::do_layout): Defer layout of input sections until after
15598 plugin has provided replacement files.
15599 (Sized_relobj::do_layout_deferred_sections): New function.
15600 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15601 (Relobj::layout_deferred_sections): New function.
15602 (Relobj::do_layout_deferred_sections): New function.
15603 (Sized_relobj::do_layout_deferred_sections): New function.
15604 (Sized_relobj::layout_section): New function.
15605 (Sized_relobj::Deferred_layout): New structure.
15606 (Sized_relobj::deferred_layout_): New field.
15607 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15608 Change all callers. Layout deferred sections.
15609 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15610 references.
15611 (Plugin_hook::run): Move code from do_plugin_hook inline.
15612 (Plugin_hook::do_plugin_hook): Remove.
15613 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15614 (Plugin_manager::finish): Renamed, was cleanup.
15615 (Plugin_manager::should_defer_layout): New function.
15616 (Plugin_manager::add_deferred_layout_object): New function.
15617 (Plugin_manager::Deferred_layout_list): New type.
15618 (Plugin_manager::deferred_layout_objects_): New field.
15619 (Plugin_hook::do_plugin_hook): Remove.
15620
ee769c88
ILT
156212008-12-17 Ian Lance Taylor <iant@google.com>
15622
15623 * options.h (class General_options): Add --no case for
15624 --export-dynamic.
15625
abc8dcba
CC
156262008-12-16 Cary Coutant <ccoutant@google.com>
15627
15628 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15629 vector.
15630 (Plugin_manager::claim_file): Create plugin object even if
15631 plugin did not call the add_symbols callback.
15632 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15633 asking for more symbols than were added.
15634 * testsuite/Makefile.am (plugin_test_1): Add test case with
15635 no global symbols.
15636 (empty.syms): New target.
15637 * testsuite/Makefile.in: Regenerate.
15638 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15639 message. Don't call add_symbols if no globals.
15640 (all_symbols_read_hook): Don't provide replacement for empty
15641 claimed file.
15642
b0074644
ILT
156432008-12-12 Ian Lance Taylor <iant@google.com>
15644
68943102
ILT
15645 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15646 r_type == 0 for a local symbol with r_sym == 0.
15647 (scan_relocatable_relocs): Pass r_sym to
15648 local_non_section_strategy.
15649 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15650 r_sym parameter.
15651
b0074644
ILT
15652 * configure.ac: Update test for TLS descriptors: they are
15653 supported as of glibc 2.9.
15654 * configure: Rebuild.
15655
c2508178
ILT
156562008-12-11 Ian Lance Taylor <iant@google.com>
15657
15658 PR 7091
15659 * target-reloc.h (Default_scan_relocatable_relocs): For each
15660 function, map r_type == 0 to RELOC_DISCARD.
15661
2756a258
CC
156622008-12-10 Cary Coutant <ccoutant@google.com>
15663
15664 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15665 object to override a kept COMDAT group from a plugin object.
15666
bb6f53d3
ILT
156672008-12-09 Ian Lance Taylor <iant@google.com>
15668
fbc558e1
ILT
15669 PR 7088
15670 * yyscript.y (file_cmd): Handle INPUT.
15671
bb6f53d3
ILT
15672 * testsuite/initpri1.c: Change all declarations to be full
15673 prototypes by adding void, to avoid compiler warnings.
15674
4674ecfc
CC
156752008-12-05 Rafael Avila de Espindola <espindola@google.com>
15676
15677 * options.cc (General_options::parse_plugin_opt): New.
15678 (General_options::add_plugin): The argument now is just the filename.
15679 (General_options::add_plugin_option): New.
15680 * options.h (plugin_opt): New.
15681 (add_plugin): Change argument name.
15682 (add_plugin_option): New.
15683 * plugin.cc (Plugin::load): Don't parse the plugin option.
15684 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15685 (Plugin::add_option): New.
15686 (Plugin::args_): Change type.
15687 (Plugin::filename_): New.
15688 (Plugin_manager::add_plugin_option): New.
15689 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15690 * testsuite/Makefile.in: Regenerate.
15691
fd06b4aa
CC
156922008-12-05 Cary Coutant <ccoutant@google.com>
15693
15694 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15695 Handle --strip-lto-sections option.
15696 * options.h (strip_lto_sections): New option.
15697
6c52134c
CC
156982008-12-01 Cary Coutant <ccoutant@google.com>
15699
15700 * plugin.cc (ld_plugin_message): Change format parameter to const.
15701 Fix mismatch between new[] and delete.
15702
a45248e0
CC
157032008-11-14 Cary Coutant <ccoutant@google.com>
15704
15705 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15706 instead of -1U.
15707
c82fbeee
CS
157082008-11-05 Craig Silverstein <csilvers@google.com>
15709
15710 * options.cc (General_options::parse_dynamic_list): New function.
15711 * options.h (General_options): New flags dynamic_list,
15712 dynamic_list_data, dynamic_list_cpp_new, and
15713 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15714 (General_options::in_dynamic_list): New function.
15715 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15716 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15717 (Lex::can_continue_name): Likewise.
15718 (yylex): Likewise.
15719 (read_script_file): New parameter script_options.
15720 (read_dynamic_list): New function.
15721 (Script_options::define_dynamic_list): New function.
15722 (dynamic_list_keyword_parsecodes): New variable.
15723 (dynamic_list_keywords): New variable.
15724 * script.h (Script_options::define_dynamic_list): New function
15725 prototype.
15726 (read_dynamic_list): New function prototype.
15727 * symtab.cc (strprefix): New macro.
15728 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15729 dynamic_list_data, dynamic_list_cpp_new, and
15730 dynamic_list_cpp_typeinfo.
15731 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15732 (dynamic_list_expr): New rule.
15733 (dynamic_list_nodes): Likewise.
15734 (dynamic_list_node): Likewise.
15735 * testsuite/Makefile.am (dynamic_list): New test.
15736 * testsuite/Makefile.in: Regenerated.
15737 * testsuite/dynamic_list.t: New file.
15738 * testsuite/dynamic_list.sh: New file.
15739
e0bb29a5
CS
157402008-11-05 Craig Silverstein <csilvers@google.com>
15741
15742 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15743 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15744 (t11_last): Likewise.
15745 * testsuite/ver_test_6.c (main): Likewise.
15746
4e1e25e0
CC
157472008-10-07 Cary Coutant <ccoutant@google.com>
15748
15749 * options.c (General_options::finalize): Add check for -static and
15750 -shared.
15751 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15752 is not empty.
15753
92f03fcb
CC
157542008-10-02 Cary Coutant <ccoutant@google.com>
15755
15756 * plugin.cc (make_sized_plugin_object): Fix conditional
15757 compilation to work when not all targets are enabled.
15758
fbd8a257
CC
157592008-09-29 Cary Coutant <ccoutant@google.com>
15760
15761 * archive.cc (Archive::get_file_and_offset): Use filename instead
15762 of name to get library path.
15763 (Archive::include_member): Unlock external member of a thin archive.
15764
15765 * testsuite/Makefile.am (TEST_AR): New variable.
15766 (thin_archive_test_1): New test.
15767 (thin_archive_test_2): New test.
81636b3f
CC
15768 * testsuite/Makefile.in: Regenerate.
15769 * testsuite/thin_archive_main.cc: New file.
15770 * testsuite/thin_archive_test_1.cc: New file.
15771 * testsuite/thin_archive_test_2.cc: New file.
15772 * testsuite/thin_archive_test_3.cc: New file.
15773 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15774
eff45813
CC
157752008-09-29 Cary Coutant <ccoutant@google.com>
15776
15777 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15778 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15779 instead of -1U.
15780 (Sized_relobj::do_finalize_local_symbols): Likewise.
15781 (Sized_relobj::map_to_kept_section): Likewise.
15782 * object.h (Sized_relobj::invalid_address): New constant.
15783 (Sized_relobj::do_output_section_offset): Check for invalid_address
15784 and return -1ULL.
15785 * output.cc (Output_reloc::local_section_offset): Use constant
15786 invalid_address instead of -1U.
15787 (Output_reloc::get_address): Likewise.
15788 (Output_section::output_address): Change -1U to -1ULL.
15789 * output.h (Output_reloc::invalid_address): New constant.
15790 * reloc.cc (Sized_relobj::write_sections): Use constant
15791 invalid_address instead of -1U.
15792 (Sized_relobj::relocate_sections): Likewise.
15793 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15794 values for merge sections.
15795 * target-reloc.h (relocate_for_relocatable): Use constant
15796 invalid_address instead of -1U.
15797
89fc3421
CC
157982008-09-19 Cary Coutant <ccoutant@google.com>
15799
15800 Add plugin functionality for link-time optimization (LTO).
15801 * configure.ac (plugins): Add --enable-plugins option.
15802 * configure: Regenerate.
15803 * config.in: Regenerate.
15804 * Makefile.am (LIBDL): New variable.
15805 (CCFILES): Add plugin.cc.
15806 (HFILES): Add plugin.h.
15807 (ldadd_var): Add LIBDL.
15808 * Makefile.in: Regenerate.
15809
15810 * archive.cc: Include "plugin.h".
15811 (Archive::setup): Don't preread archive symbols when using a plugin.
15812 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15813 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15814 files.
15815 (Archive::include_member): Add symbols from plugin objects.
15816 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15817 * descriptors.cc (Descriptors::open): Check for file descriptors
15818 abandoned by plugins.
15819 (Descriptors::claim_for_plugin): New function.
15820 * descriptors.h (Descriptors::claim_for_plugin): New function.
15821 (Open_descriptor::is_claimed): New field.
15822 (claim_descriptor_for_plugin): New function.
15823 * fileread.cc (File_read::claim_for_plugin): New function.
15824 * fileread.h (File_read::claim_for_plugin): New function.
15825 (File_read::descriptor): New function.
15826 * gold.cc: Include "plugin.h".
15827 (queue_initial_tasks): Add task to call plugin hooks for generating
15828 new object files.
15829 * main.cc: Include "plugin.h".
15830 (main): Load plugin libraries.
15831 * object.h (Pluginobj): Declare.
15832 (Object::pluginobj): New function.
15833 (Object::do_pluginobj): New function.
15834 (Object::set_target): New function.
15835 * options.cc: Include "plugin.h".
15836 (General_options::parse_plugin): New function.
15837 (General_options::General_options): Initialize plugins_ field.
15838 (General_options::add_plugin): New function.
15839 * options.h (Plugin_manager): Declare.
15840 (General_options): Add --plugin option.
15841 (General_options::has_plugins): New function.
15842 (General_options::plugins): New function.
15843 (General_options::add_plugin): New function.
15844 (General_options::plugins_): New field.
15845 * plugin.cc: New file.
15846 * plugin.h: New file.
15847 * readsyms.cc: Include "plugin.h".
15848 (Read_symbols::do_read_symbols): Check for archive before checking
15849 for ELF file. Call plugin hooks to claim files.
15850 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15851 from a real object file; force override when processing replacement
15852 files.
15853 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15854 (Symbol::init_base_object): Likewise.
15855 (Symbol::init_base_output_data): Likewise.
15856 (Symbol::init_base_output_segment): Likewise.
15857 (Symbol::init_base_constant): Likewise.
15858 (Symbol::init_base_undefined): Likewise.
15859 (Symbol::output_section): Assert that object is not a plugin.
15860 (Symbol_table::add_from_pluginobj): New function.
15861 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15862 undefined.
15863 (Symbol_table::sized_write_globals): Likewise.
15864 (Symbol_table::add_from_pluginobj): Instantiate template.
15865 * symtab.h (Sized_pluginobj): Declare.
15866 (Symbol::in_real_elf): New function.
15867 (Symbol::set_in_real_elf): New function.
15868 (Symbol::in_real_elf_): New field.
15869 (Symbol_table::add_from_pluginobj): New function.
15870
15871 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15872 (LIBDL): New variable.
15873 (LDADD): Add LIBDL.
15874 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15875 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15876 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15877 (MOSTLYCLEANFILES): Likewise.
15878 * testsuite/Makefile.in: Regenerate.
15879 * testsuite/plugin_test.c: New file.
15880 * testsuite/plugin_test_1.sh: New file.
15881 * testsuite/plugin_test_2.sh: New file.
15882
de31bda5
ILT
158832008-09-16 Ian Lance Taylor <iant@google.com>
15884
9c2d0ef9
ILT
15885 * target-reloc.h (relocate_section): Check whether a symbol is
15886 defined by the ABI before reporting an undefined symbol error.
15887 * target.h (Target::is_defined_by_abi): Make parameter const.
15888 (Target::do_is_defined_by_abi): Likewise.
15889 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15890 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15891 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15892 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15893 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15894 * testsuite/Makefile.in: Rebuild.
15895
de31bda5
ILT
15896 * fileread.cc (make_view): Add casts to avoid warning.
15897
9fa33bee
AO
158982008-09-16 Alexandre Oliva <aoliva@redhat.com>
15899
15900 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15901 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15902
183fd0e3
AO
159032008-09-16 Alexandre Oliva <aoliva@redhat.com>
15904
15905 * options.h (General_options::output_is_executable): New.
15906 (General_options::output_is_pie): New.
15907 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15908 for shared libraries.
15909 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15910
7be8330a
CD
159112008-09-11 Chris Demetriou <cgd@google.com>
15912
15913 * options.h (origin): New -z option.
15914 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15915 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15916 in DT_FLAGS_1.
15917
a9caad02
CC
159182008-09-05 Cary Coutant <ccoutant@google.com>
15919
15920 * fileread.cc (File_read::make_view): Add check for attempt to map
15921 beyond end of file.
15922
ae6dce4d
CC
159232008-09-05 Cary Coutant <ccoutant@google.com>
15924
15925 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15926 explicit instantiations.
15927
d7ab2a47
KVH
159282008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15929
15930 PR gold/6858
15931 * options.cc (General_options::finalize): Allow undefined symbols
15932 in shlibs if linking -shared.
15933
15934 PR gold/6859
15935 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15936 symbols as not needing a dynsym entry.
15937
1e52a9c1
CS
159382008-08-20 Craig Silverstein <csilvers@google.com>
15939
15940 * fileread.cc (File_read::open): Do not lock the file unless it
15941 was successfully opened.
15942
d85c80a3
CC
159432008-08-14 Cary Coutant <ccoutant@google.com>
15944
15945 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15946 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15947 * testsuite/tls_test.cc (struct int128): 128-bit struct
15948 for testing TLS relocs with non-zero addend.
15949 (v12): New TLS variable.
15950 (t12): New test.
15951 (t_last): Add check for v12.
15952 * testsuite/tls_test.h (t12): New function.
15953 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15954
2d924fd9
ILT
159552008-08-13 Ian Lance Taylor <iant@google.com>
15956
15957 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15958 set tls_segment_ or relro_segment_.
15959 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15960 when appropriate.
15961 * output.h (Output_section::clear_is_relro): New function.
15962 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15963 sections specially even when output_data_ is empty.
15964 (Output_segment::maximum_alignment): When first section is relro,
15965 only force alignment for PT_LOAD segments.
15966 * script.cc (script_data_segment_align): New function.
15967 (script_data_segment_relro_end): New function.
15968 * script-c.h (script_data_segment_align): Declare.
15969 (script_data_segment_relro_end): Declare.
15970 * script-sections.h (class Script_sections): Declare
15971 data_segment_align and data_segment_relro_end. Add fields
15972 segment_align_index_ and saw_relro_end_.
15973 * script-sections.cc (class Sections_element): Add set_is_relro
15974 virtual function. Add new bool* parameter to place_orphan_here.
15975 Add get_output_section virtual function.
15976 (class Output_section_definition): Add set_is_relro. Add new
15977 bool* parameter to place_orphan_here. Add get_output_section.
15978 Add is_relro_ field.
15979 (Output_section_definition::Output_section_definition): Initialize
15980 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15981 and is_relro_ fields.
15982 (Output_section_definition::place_orphan_here): Add is_relro
15983 parameter.
15984 (Output_section_definition::set_section_addresses): Set relro for
15985 output section.
15986 (Output_section_definition::alternate_constraint): Likewise.
15987 (class Orphan_output_section): Add new bool* parameter to
15988 place_orphan_here. Add get_output_section.
15989 (Orphan_output_section::place_orphan_here): Add is_relro
15990 parameter.
15991 (Script_sections::Script_sections): Initialize
15992 data_segment_align_index_ and saw_relro_end_.
15993 (Script_sections::data_segment_align): New function.
15994 (Script_sections::data_segment_relro_end): New function.
15995 (Script_sections::place_orphan): Set or clear is_relro.
15996 (Script_sections::set_section_addresses): Force alignment of first
15997 TLS section.
15998 * yyscript.y (exp): Call script_data_segment_align and
15999 script_data_segment_relro_end.
16000 * testsuite/relro_script_test.t: New file.
16001 * testsuite/relro_test.cc (using_script): Declare.
16002 (t1, t2): Test using_script.
16003 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16004 (relro_script_test_SOURCES): Define.
16005 (relro_script_test_DEPENDENCIES): Define.
16006 (relro_script_test_LDFLAGS): Define.
16007 (relro_script_test_LDADD): Define.
16008 (relro_script_test.so): New target.
16009 * testsuite/Makefile.in: Rebuild.
16010
f827c9a9
CC
160112008-08-06 Cary Coutant <ccoutant@google.com>
16012
16013 * archive.cc (Archive::total_archives, Archive::total_members)
16014 (Archive::total_members_loaded): New variables.
16015 (Archive::setup): Add parameter. Add option to preread
16016 archive symbols.
16017 (Archive::read_armap): Add counter.
16018 (Archive::get_file_and_offset): New function.
16019 (Archive::get_elf_object_for_member): New function.
16020 (Archive::read_all_symbols): New function.
16021 (Archive::read_symbols): New function.
16022 (Archive::add_symbols): Add counters.
16023 (Archive::include_all_members): Use armap to find members if it's
16024 already built.
16025 (Archive::include_member): Skip reading symbols if already read.
16026 Factored code into Archive::get_file_and_offset and
16027 Archive::get_elf_object_for_member. Changed call to
16028 Mapfile::report_include_archive_member.
16029 (Archive::print_stats): New function.
16030 * archive.h: Declare Object and Read_symbols_data classes.
16031 (Archive::Archive): Add initializers for new members.
16032 (Archive::setup): Add parameter.
16033 (Archive::print_stats): New function.
16034 (Archive::total_archives, Archive::total_members)
16035 (Archive::total_members_loaded): New variables.
16036 (Archive::get_file_and_offset): New function.
16037 (Archive::get_elf_object_for_member): New function.
16038 (Archive::read_all_symbols): New function.
16039 (Archive::read_symbols): New function.
16040 (Archive::Archive_member): New class.
16041 (Archive::members_): New member.
16042 (Archive::num_members_): New member.
16043 * main.cc: Include archive.h.
16044 (main): Call Archive::print_stats.
16045 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16046 archive parameter; member_name is now the fully-decorated name.
16047 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16048 * options.h: (General_options): Add --preread-archive-symbols option.
16049 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16050 Archive::setup.
16051
de4c45bd
ILT
160522008-08-04 Ian Lance Taylor <iant@google.com>
16053
16054 * symtab.h (Symbol::use_plt_offset): New function.
16055 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16056 * powerpc.cc (Relocate::relocate): Likewise.
16057 * sparc.cc (Relocate::relocate): Likewise.
16058 * x86_64.cc (Relocate::relocate): Likewise.
16059 * testsuite/weak_plt.sh: New test.
16060 * testsuite/weak_plt_main.cc: New test.
16061 * testsuite/weak_plt_shared.cc: New test.
16062 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16063 (check_PROGRAMS): Add weak_plt.
16064 (check_DATA): Add weak_plt_shared.so.
16065 (weak_plt_main_pic.o, weak_plt): New targets.
16066 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16067 * testsuite/Makefile.in: Rebuild.
16068
16069 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16070 gcctestdir/ld.
16071 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16072 * testsuite/Makefile.in: Rebuild.
16073
323ee3f4
AM
160742008-08-04 Alan Modra <amodra@bigpond.net.au>
16075
16076 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16077 * Makefile.in: Regenerate.
16078 * po/POTFILES.in: Regenerate.
16079
7c07ecec
ILT
160802008-07-29 Ian Lance Taylor <iant@google.com>
16081
16082 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16083 symbols before other symbols.
16084 * testsuite/script_test_2.cc (test_addr): Declare.
16085 (test_addr_alias): Declare.
16086 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16087 values.
7c07ecec
ILT
16088 * testsuite/script_test_2.t: Define test_addr_alias and
16089 test_addr.
16090
5778530e
ILT
160912008-07-24 Ian Lance Taylor <iant@google.com>
16092
2a00e4fb
ILT
16093 PR 5990
16094 * descriptors.cc: New file.
16095 * descriptors.h: New file.
16096 * gold-threads.h (class Hold_optional_lock): New class.
16097 * fileread.cc: Include "descriptors.h".
16098 (File_read::~File_read): Release descriptor rather than closing
16099 it.
16100 (File_read::open) [file]: Call open_descriptor rather than open.
16101 Set is_descriptor_opened_.
16102 (File_read::open) [memory]: Assert that descriptor is not open.
16103 (File_read::reopen_descriptor): New function.
16104 (File_read::release): Release descriptor.
16105 (File_read::do_read): Make non-const. Reopen descriptor.
16106 (File_read::read): Make non-const.
16107 (File_read::make_view): Reopen descriptor.
16108 (File_read::do_readv): Likewise.
16109 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16110 Update declarations.
16111 * layout.cc: Include "descriptors.h".
16112 (Layout::create_build_id): Use open_descriptor rather than open.
16113 * output.cc: Include "descriptors.h".
16114 (Output_file::open): Use open_descriptor rather than open.
16115 * archive.cc (Archive::const_iterator): Change Archive to be
16116 non-const.
16117 (Archive::begin, Archive::end): Make non-const.
16118 (Archive::count_members): Likewise.
16119 * archive.h (class Archive): Update declarations.
16120 * object.h (Object::read): Make non-const.
16121 * Makefile.am (CCFILES): Add descriptors.cc.
16122 (HFILES): Add descriptors.h.
16123 * Makefile.in: Rebuild.
16124
801647d1
ILT
16125 PR 6716
16126 * gold.h: Always include <clocale>. Add Solaris workarounds
16127 following code in binutils/sysdep.h.
16128
5edd166e
ILT
16129 PR 6048
16130 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16131 this->eh_frame_hdr_ is NULL before using it.
16132
c89ad728
ILT
16133 * dynobj.cc (Versions::Versions): Update comment.
16134
aa86f06b
ILT
16135 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16136 the base version name.
16137
5778530e
ILT
16138 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16139 array size plus one.
16140 (Stringpool_template::set_string_offsets): Subtract one from key
16141 before using it as an array index.
16142 (Stringpool_template::get_offset_with_length): Likewise.
16143 (Stringpool_template::write_to_buffer): Likewise.
16144 * stringpool.h (Stringpool_template::get_offset_from_key):
16145 Likewise.
16146
057ead22
ILT
161472008-07-23 Ian Lance Taylor <iant@google.com>
16148
7f649c59
ILT
16149 PR 6658
16150 * object.h (Merged_symbol_value::value): Do our best to handle a
16151 negative addend.
16152
057ead22
ILT
16153 PR 6647
16154 * script.cc (Version_script_info::get_versions): Don't add empty
16155 version tag to return value.
16156 (Version_script_info::get_symbol_version_helper): Change return
16157 type to bool. Add pversion parameter. Change all callers.
16158 (script_register_vers_node): Don't require a non-NULL tag.
16159 * script.h (class Version_script_info): Update declarations.
16160 (Version_script_info::get_symbol_version): Change return type to
16161 bool. Add version parameter. Change all callers.
16162 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16163 handling. Handle an empty version from a version script.
16164 (Symbol_table::define_special_symbol): Likewise.
16165 * testsuite/ver_test_10.script: New file.
16166 * testsuite/ver_test_10.sh: New file.
16167 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16168 (check_DATA): Add ver_test_10.syms.
16169 (ver_test_10.syms, ver_test_10.so): New target.
16170 * testsuite/Makefile.in: Rebuild.
16171
58e54ac2
CD
161722008-07-23 Simon Baldwin <simonb@google.com>
16173
16174 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16175 to zero for undefined symbols from dynamic libraries.
16176
95d14cd3
ILT
161772008-07-23 Ian Lance Taylor <iant@google.com>
16178
16179 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16180 Change all callers.
16181 * symtab.h (class Symbol_table): Update declaration.
16182 * testsuite/ver_test_9.cc: New file.
16183 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16184 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16185 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16186 (ver_test_9.so, ver_test_9.o): New targets.
16187 * testsuite/Makefile.in: Rebuild.
16188
92de84a6
ILT
161892008-07-22 Ian Lance Taylor <iant@google.com>
16190
34810851
ILT
16191 * options.h (class General_options): Define --check-sections.
16192 * layout.cc (Layout::set_segment_offsets): Handle
16193 --check-sections.
16194
af6156ef
ILT
16195 * options.h (class General_options): Define -n/--nmagic and
16196 -N/--omagic.
16197 * options.cc (General_options::finalize): For -n/--nmagic or
16198 -N/--omagic, set -static.
16199 * layout.cc (Layout::attach_allocated_section_to_segment): If
16200 -N/--omagic, don't put read-only and read-write sections in
16201 different segments.
16202 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16203 finding a read-only segment.
16204 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16205 don't set the minimum segment alignment to the common page size,
16206 and don't set the file offset to the address modulo the page size.
16207 * script-sections.cc (Script_sections::create_segments): If
16208 -n/--omagic, don't put read-only and read-write sections in
16209 different segments.
16210
92de84a6
ILT
16211 * cref.cc: New file.
16212 * cref.h: New file.
16213 * options.h (class General_options): Add --print-symbol-counts.
16214 * main.cc (main): Issue defined symbol report if requested.
16215 * archive.cc (Archive::interpret_header): Make into a const member
16216 function.
16217 (Archive::add_symbols): Call Input_objects::archive_start and
16218 archive_stop.
16219 (Archive::const_iterator): Define new class.
16220 (Archive::begin, Archive::end): New functions.
16221 (Archive::include_all_members): Rewrite to use iterator.
16222 (Archive::count_members): New function.
16223 * archive.h (class Archive): Update declarations.
16224 (Archive::filename): New function.
16225 * object.cc: Include "cref.h".
16226 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16227 (Sized_relobj::do_get_global_symbol_counts): New function.
16228 (Input_objects::add_object): Add object to cross-referencer.
16229 (Input_objects::archive_start): New function.
16230 (Input_objects::archive_stop): New function.
16231 (Input_objects::print_symbol_counts): New function.
16232 * object.h: Declare Cref and Archive.
16233 (Object::get_global_symbol_counts): New function.
16234 (Object::do_get_global_symbol_counts): New pure virtual function.
16235 (class Sized_relobj): Add defined_count_ field. Update
16236 declarations.
16237 (class Input_objects): Add cref_ field. Update constructor.
16238 Update declarations.
16239 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16240 defined_count_.
16241 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16242 symbol counts.
16243 (Sized_dynobj::do_get_global_symbol_counts): New function.
16244 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16245 defined_count_. Update declarations. Define Symbols typedef.
16246 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16247 parameter. Change all callers.
16248 (Symbol_table::add_from_dynobj): Add sympointers and defined
16249 parameters. Change all callers.
16250 * symtab.h (class Symbol_table): Update declarations.
16251 * Makefile.am (CCFILES): Add cref.cc.
16252 (HFILES): Add cref.h.
16253 * Makefile.in: Rebuild.
16254
3f7c5e1d
CD
162552008-07-22 Simon Baldwin <simonb@google.com>
16256
16257 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16258 to zero when writing undefined symbols.
16259
e0b64032
ILT
162602008-07-22 Ian Lance Taylor <iant@google.com>
16261
16262 * output.cc (Output_section::add_input_section): Don't try to
16263 merge empty merge sections.
16264
096b02cf
CS
162652008-07-21 Craig Silverstein <csilvers@google.com>
16266
16267 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16268 Include symbol version in error message.
cd536b21 16269
1d1f116d
CD
162702008-07-20 Chris Demetriou <cgd@google.com>
16271
cd536b21 16272 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16273 (RANDOM_SEED_CFLAGS): New substituted variable.
16274 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16275 * configure: Rebuild.
16276 * Makefile.in: Likewise.
16277 * testsuite/Makefile.in: Likewise.
16278
a18f591e
ILT
162792008-07-18 Ian Lance Taylor <iant@google.com>
16280
16281 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16282 where we see NAME/NULL and NAME/VERSION as separate symbols.
16283 * testsuite/ver_test_main.cc (main): Call t4.
16284 (t4, t4_2a): Define.
16285 * testsuite/ver_test_2.cc (t4_2): Define.
16286 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16287 * testsuite/ver_test_4.cc (t4_2a): Define.
16288 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16289 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16290
c6e3f6ed
ILT
162912008-07-17 Ian Lance Taylor <iant@google.com>
16292
16293 * dynobj.cc (Versions::add_def): If we give an error about a
16294 missing version, go ahead and create the version anyhow.
16295
ef9beddf
ILT
162962008-07-10 Ian Lance Taylor <iant@google.com>
16297
16298 Handle output sections with more than 0x7fffffff bytes.
16299 * object.h (class Relobj): Change map_to_output_ to
16300 output_sections_, and just keep a section pointer. Change all
16301 uses. Move comdat group support to Sized_relobj.
16302 (Relobj::is_section_specially_mapped): Remove.
16303 (Relobj::output_section): Remove poff parameter. Change all
16304 callers.
16305 (Relobj::output_section_offset): New function.
16306 (Relobj::set_section_offset): Rewrite.
16307 (Relobj::map_to_output): Remove.
16308 (Relobj::output_sections): New function.
16309 (Relobj::do_output_section_offset): New pure virtual function.
16310 (Relobj::do_set_section_offset): Likewise.
16311 (class Sized_relobj): Add section_offsets_ field. Add comdat
16312 group support from Relobj. Update declarations.
16313 (Sized_relobj::get_output_section_offset): New function.
16314 (Sized_relobj::do_output_section_offset): New function.
16315 (Sized_relobj::do_set_section_offset): New function.
16316 * object.cc (Relobj::output_section_address): Remove.
16317 (Sized_relobj::Sized_relobj): Initialize new fields.
16318 (Sized_relobj::include_section_group): Cast find_kept_object to
16319 Sized_relobj.
16320 (Sized_relobj::include_linkonce_section): Likewise.
16321 (Sized_relobj::do_layout): Use separate arrays for output section
16322 and output offset.
16323 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16324 output_sections.
16325 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16326 output_sections and section_offsets.
16327 (Sized_relobj::write_local_symbols): Likewise.
16328 (map_to_kept_section): Compute output address directly.
16329 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16330 output_sections and section_offsets.
16331 (Sized_relobj::write_sections): Likewise.
16332 (Sized_relobj::relocate_sections): Likewise.
16333 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16334 * output.h (class Output_reloc): Update declarations. Change
16335 u2_.relobj to Sized_relobj*.
16336 (class Output_data_reloc): Change add functions to use
16337 Sized_relobj*.
16338 * output.cc (Output_reloc::Output_reloc): Change relobj to
16339 Sized_relobj*.
16340 (Output_reloc::local_section_offset): Change return type to
16341 Elf_Addr. Use get_output_section_offset.
16342 (Output_reloc::get_address): Likewise.
16343 (Output_section::is_input_address_mapped): Don't call
16344 is_section_specially_mapped.
16345 (Output_section::output_offset): Likewise.
16346 (Output_section::output_address): Likewise.
16347 (Output_section::starting_output_address): Likewise.
16348 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16349 parameter to Sized_relobj*.
16350 (Copy_relocs::need_copy_reloc): Likewise.
16351 (Copy_relocs::save): Likewise.
16352 * copy-relocs.h (class Copy_relocs): Update declarations.
16353 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16354 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16355 * target-reloc.h (relocate_for_relocatable): Change
16356 offset_in_output_section type to Elf_Addr. Change code that uses
16357 it as well.
16358 * layout.cc (Layout::layout): Always set *off.
16359 * mapfile.cc (Mapfile::print_input_section): Use
16360 output_section_offset.
16361 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16362 Sized_relobj*.
16363 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16364 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16365 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16366
5cb66f97
ILT
163672008-07-03 Ian Lance Taylor <iant@google.com>
16368
16369 * layout.cc (Layout::include_section): Do not discard unrecognized
16370 SHT_STRTAB sections.
16371
afe47622
CS
163722008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16373
16374 * script.cc (Lex::can_continue_name): Make '?' allowable in
16375 version-script names.
16376 * testsuite/version_script.map: Change glob pattern to use '?'
16377
5adf9721
ILT
163782008-06-30 Manish Singh <yosh@gimp.org>
16379
16380 PR 6585
16381 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16382 Correct typo.
16383
e6fde208
ILT
163842008-06-30 Ian Lance Taylor <iant@google.com>
16385
16386 PR 6660
16387 PR 6682
16388 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16389 versions]: Don't try to read the value in the contents, since we
16390 don't use it. Use the template endianness when writing.
16391
3f2e6a2d
CC
163922008-06-25 Cary Coutant <ccoutant@google.com>
16393
16394 * fileread.cc (File_read::make_view): Assert on zero-length view.
16395 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16396 symbol table when there are no symbols to read.
16397
c43d3a48
CS
163982008-06-23 Craig Silverstein <csilvers@google.com>
16399
16400 * version.cc (version_string): Bump to 1.7
16401
5f494ea0
CS
164022008-06-18 Craig Silverstein <csilvers@google.com>
16403
16404 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16405 constant 0xFFFF to type Valtype.
16406 (Powerpc_relocate_functions::rel16_ha): Likewise.
16407
c42e122e
ILT
164082008-06-17 Ian Lance Taylor <iant@google.com>
16409
f34787f8
ILT
16410 * output.h (Output_section::Input_section): Initialize p2align_ to
16411 zero for Output_section_data constructors.
16412 (Output_section::Input_section::addralign): If not an input
16413 section, return the alignment of the Output_section_data.
16414 * testsuite/copy_test.cc: New file.
16415 * testsuite/copy_test_1.cc: New file.
16416 * testsuite/copy_test_2.cc: New file.
16417 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16418 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16419 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16420 (copy_test_1_pic.o, copy_test_1.so): New targets.
16421 (copy_test_2_pic.o, copy_test_2.so): New targets.
16422 * testsuite/Makefile.in: Rebuild.
16423
c42e122e
ILT
16424 * script-sections.cc (Script_sections::place_orphan): Initialize
16425 local variable exact.
16426
ce3ac18a
DE
164272008-06-13 David Edelsohn <edelsohn@gnu.org>
16428
16429 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16430
42cacb20
DE
164312008-06-12 David Edelsohn <edelsohn@gnu.org>
16432 David S. Miller <davem@davemloft.net>
16433
16434 * powerpc.cc: New file.
16435 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16436 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16437 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16438 * Makefile.in: Rebuild.
16439
7b308235
ILT
164402008-06-09 Ian Lance Taylor <iant@google.com>
16441
16442 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16443 <exception>.
16444 (throwing, orig_terminate): New static variables.
16445 (terminate_handler): New static function.
16446 (t2): Set terminate handler.
16447
f0b886e3
ILT
164482008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16449
16450 PR 6584
cd536b21 16451 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16452 alignment.
16453
3e90f135
CC
164542008-05-30 Cary Coutant <ccoutant@google.com>
16455
16456 * archive.cc (Archive::include_all_members) Correct to step
16457 over symbol table and extended name table in thin archives.
16458
e09ad04a
ILT
164592008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16460
16461 PR 6407
16462 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16463 calculation.
16464
62b01cb5
ILT
164652008-05-28 Caleb Howe <cshowe@google.com>
16466
16467 * reduced_debug_output.cc: New file.
16468 * reduced_debug_output.h: New file.
92de84a6 16469 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16470 * options.cc (General_options::finalize): Add strip_debug_non_line
16471 to the strip heirarchy.
16472 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16473 fields.
16474 * layout.cc: Include "reduced_debug_output.h".
16475 (Layout::Layout): Initialize new fields.
16476 (line_only_debug_sections): New static array.
16477 (is_lines_only_debug_sections): New static inline function.
16478 (Layout::include_section): Handle --strip-debug-non-line.
16479 (Layout::make_output_section): If --strip-debug-non-line, build
16480 new output sections for .debug_abbrev and .debug_info.
16481 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16482 gold. Warn about possible overflow.
16483 (read_signed_LEB_128): Likewise.
16484 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16485 (read_signed_LEB_128): Declare.
16486 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16487 (HFILES): Add reduced_debug_output.h.
16488 * Makefile.in: Rebuild.
16489
7d9e3d98
ILT
164902008-05-21 Ian Lance Taylor <iant@google.com>
16491
16492 * mapfile.cc: New file.
16493 * mapfile.h: New file.
16494 * options.h (class General_options): Add -M/--print-map and -Map.
16495 * options.cc (General_options::finalize): Make -M equivalent to
16496 -Map -.
16497 * main.cc: Include <cstdio> and "mapfile.h".
16498 (main): Open mapfile if requested.
16499 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16500 constructor. Change caller.
16501 (queue_initial_tasks): Add mapfile parameter. Change caller.
16502 (queue_middle_tasks): Likewise.
16503 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16504 declarations.
16505 * archive.cc: Include "mapfile.h".
16506 (Archive::add_symbols): Add mapfile parameter. Change all
16507 callers. Pass mapfile, symbol, and reason to include_member.
16508 (Archive::include_all_members): Add mapfile parameter. Change all
16509 callers.
16510 (Archive::include_member): Add mapfile, sym, and why parameters.
16511 Change all callers. Report inclusion to map file.
16512 * archive.h: Include "fileread.h".
16513 (class Archive): Update declarations.
16514 (Archive::file): New const method.
16515 (class Add_archive_symbols): Add mapfile_ field. Update
16516 constructor. Change all callers.
16517 * readsyms.h (class Read_symbols): Likewise.
16518 (class Finish_group): Likewise.
16519 (class Read_script): Likewise.
16520 * common.cc: Include "mapfile.h".
16521 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16522 all callers.
16523 (Symbol_table::do_allocate_commons): Likewise.
16524 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16525 symbol allocation to mapfile.
16526 * common.h (class Allocate_commons_task): Add mapfile_ field.
16527 Update constructor. Change all callers.
16528 * symtab.h (class Symbol_table): Update declarations.
16529 * layout.cc: Include "mapfile.h".
16530 (Layout_task_runner::run): Print information to mapfile.
16531 (Layout::create_gold_note): Change Output_data_fixed_space to
16532 Output_data_zero_fill.
16533 (Layout::create_build_id): Likewise.
16534 (Layout::print_to_mapfile): New function.
16535 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16536 constructor. Change caller.
16537 (class Layout): Declare print_to_mapfile.
16538 * output.cc (Output_section::Input_section::print_to_mapfile): New
16539 function.
16540 (Output_section::add_input_section): If producing a map, always
16541 add to input_sections_ list.
16542 (Output_section::do_print_to_mapfile): New function.
16543 (Output_segment::print_sections_to_mapfile): New function.
16544 (Output_segment::print_section_list_to_mapfile): New function.
16545 * output.h: Include "mapfile.h".
16546 (Output_data::print_to_mapfile): New function.
16547 (Output_data::do_print_to_mapfile): New virtual function.
16548 (Output_segment_headers::do_print_to_mapfile): New function.
16549 (Output_file_header::do_print_to_mapfile): New function.
16550 (Output_data_const::do_print_to_mapfile): New function.
16551 (class Output_data_const_buffer): Add map_name_ field. Update
16552 constructor. Change all callers. Add do_print_to_mapfile
16553 function.
16554 (class Output_data_fixed_space): Likewise.
16555 (class Output_data_space): Likewise.
16556 (class Output_data_zero_fill): New class.
16557 (Output_data_strtab::do_print_to_mapfile): New function.
16558 (Output_data_reloc_base::do_print_to_mapfile): New function.
16559 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16560 (Output_data_group::do_print_to_mapfile): New function.
16561 (Output_data_got::do_print_to_mapfile): New function.
16562 (Output_data_dynamic::do_print_to_mapfile): New function.
16563 (Output_symtab_xindex::do_print_to_mapfile): New function.
16564 (class Output_section): Declare do_print_to_mapflie. Declare
16565 print_to_mapfile in Input_section.
16566 (class Output_segment): Declare new functions.
16567 * object.h (Sized_relobj::symbol_count): New function.
16568 * script-sections.cc
16569 (Output_section_element_dot_assignment::set_section_addresses):
16570 Change Output_data_fixed_space to Output_data_zero_fill.
16571 (Output_data_expression::do_print_to_mapfile): New function.
16572 * script.cc (read_input_script): Add mapfile parameter. Change
16573 all callers.
16574 * script.h (read_input_script): Update declaration.
16575 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16576 (Eh_frame::do_print_to_mapfile): New function.
16577 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16578 (Output_merge_string::do_print_to_mapfile): New function.
16579 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16580 function.
16581 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16582 function.
16583 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16584 function.
16585 * Makefile.am (CCFILES): Add mapfile.cc.
16586 (HFILES): Add mapfile.h.
16587 * Makefile.in: Rebuild.
16588
9f1d377b
ILT
165892008-05-19 Ian Lance Taylor <iant@google.com>
16590
16591 * options.h (class General_options): Add -z relro.
16592 * layout.cc (Layout::Layout): Initialize relro_segment_.
16593 (Layout::add_output_section_data): Return the output section.
16594 (Layout::make_output_section): Rcognize relro sections and mark
16595 them appropriately.
16596 (Layout::attach_allocated_section_to_segment): Put relro sections
16597 in a PT_GNU_RELRO segment.
16598 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16599 section as relro.
16600 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16601 PT_TLS segments.
16602 (Layout::linkonce_mapping): Map d.rel.ro.local to
16603 .data.rel.ro.local.
16604 (Layout::output_section_name): Us .data.rel.ro.local for any
16605 section which begins with that.
16606 * layout.h (class Layout): Update add_output_section_data
16607 declaration. Add relro_segment_ field.
16608 * output.cc (Output_section::Output_section): Initialize is_relro_
16609 and is_relro_local_ fields.
16610 (Output_segment::add_output_section): Group relro sections.
16611 (Output_segment::is_first_section_relro): New function.
16612 (Output_segment::maximum_alignment): If there is a relro section,
16613 align the segment to the common page size.
16614 (Output_segment::set_section_addresses): Track whether we are
16615 looking at relro sections. If the last section is a relro
16616 section, align to the common page size.
16617 (Output_segment::set_section_list_addresses): Add in_relro
16618 parameter. Change all callers. Align to the page size when
16619 moving from relro to non-relro section.
16620 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16621 segment.
16622 * output.h (class Output_section): Add is_relro_ and
16623 is_relro_local_ fields.
16624 (Output_section::is_relro): New function.
16625 (Output_section::set_is_relro): New function.
16626 (Output_section::is_relro_local): New function.
16627 (Output_section::set_is_relro_local): New function.
16628 (class Output_segment): Update declarations.
16629 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16630 * sparc.cc (Target_sparc::got_section): Likewise.
16631 * x86_64.cc (Target_x86_64::got_section): Likewise.
16632 * testsuite/relro_test_main.cc: New file.
16633 * testsuite/relro_test.cc: New file.
16634 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16635 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16636 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16637 (relro_test.so, relro_test_pic.o): New targets.
16638 * testsuite/Makefile.in: Rebuild.
16639
a984ee1d
ILT
166402008-05-16 Ian Lance Taylor <iant@google.com>
16641
01676dcd
ILT
16642 * output.cc (Output_segment::add_output_section): Remove front
16643 parameter.
16644 * output.h (class Output_segment): Remove
16645 add_initial_output_section and overloaded add_output_section.
16646 Update declaration of remaining add_output_section.
16647 * layout.cc (Layout::create_interp): Call add_output_section
16648 rather than add_initial_output_section.
16649 (Layout::finish_dynamic_section): Likewise.
16650
497897f9
ILT
16651 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16652 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16653 know the dynamic type.
16654 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16655 field. Initialize it in constructor.
16656 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16657 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16658 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16659 reloc.
16660
a984ee1d
ILT
16661 * output.cc (Output_reloc::get_address): Change return type to
16662 Elf_Addr.
16663 * output.h (class Output_reloc): Update get_address declaration.
16664 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16665 for section addresses.
16666
55ba0940
ILT
166672008-05-09 Ian Lance Taylor <iant@google.com>
16668
16669 PR 6493
16670 * gold.cc (gold_nomem): Use return value of write.
16671
75517b77
ILT
166722008-05-08 Ian Lance Taylor <iant@google.com>
16673
16674 * symtab.c (Symbol::init_base_output_data): Add version
16675 parameter. Change all callers.
16676 (Symbol::init_base_output_segment): Likewise.
16677 (Symbol::init_base_constant): Likewise.
16678 (Symbol::init_base_undefined): Likewise.
16679 (Sized_symbol::init_output_data): Likewise.
16680 (Sized_symbol::init_output_segment): Likewise.
16681 (Sized_symbol::init_constant): Likewise.
16682 (Sized_symbol::init_undefined): Likewise.
16683 (Symbol_table::do_define_in_output_data): If the new symbol has a
16684 version, mark it as the default.
16685 (Symbol_table::do_define_in_output_segment): Likewise.
16686 (Symbol_table::do_define_as_constant): Likewise.
16687 * symtab.h (class Symbol): Update declarations.
16688 (class Sized_symbol): Likewise.
16689 * resolve.cc (Symbol::override_version): New function.
c42e122e 16690 (Symbol::override_base): Call override_version.
75517b77
ILT
16691 (Symbol::override_base_with_special): Likewise.
16692 * testsuite/ver_script_8.script: New file.
16693 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16694 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16695 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16696 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16697
f1f70eae
ILT
166982008-05-06 Ian Lance Taylor <iant@google.com>
16699
f3e9c5c5
ILT
16700 PR 6049
16701 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16702 functions.
16703 (class General_options): Remove existing --undefined, and add
16704 --no-undefined instead. Add new --undefined as synonym for -u.
16705 * archive.cc (Archive::add_symbols): Check whether symbol was
16706 named with -u.
16707 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16708 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16709 all uses. Add IS_UNDEFINED. Update declarations to split
16710 different versions of init_base. Declare init_base_undefined.
16711 (Symbol::is_defined): Handle IS_UNDEFINED.
16712 (Symbol::is_undefined): Likewise.
16713 (Symbol::is_weak_undefined): Call is_undefined.
16714 (Symbol::is_absolute): Handle IS_CONSTANT.
16715 (class Sized_symbol): Update declarations to split different
16716 versions of init. Declare init_undefined.
16717 (class Symbol_table): Declare new functions.
16718 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16719 Change all callers.
16720 (Symbol::init_base_output_data): Likewise.
16721 (Symbol::init_base_output_segment): Likewise.
16722 (Symbol::init_base_constant): Likewise.
16723 (Symbol::init_base_undefined): New function.
16724 (Sized_symbol::init_object): Rename from init. Change all
16725 callers.
16726 (Sized_symbol::init_output_data): Likewise.
16727 (Sized_symbol::init_output_segment): Likewise.
16728 (Sized_symbol::init_constant): Likewise.
16729 (Sized_symbol::init_undefined): New function.
16730 (Symbol_table::add_undefined_symbols_from_command_line): New
16731 function.
16732 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16733 function.
16734 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16735 (Symbol::output_section): Likewise.
16736 (Symbol::set_output_section): Likewise.
16737 (Symbol_table::sized_finalize_symbol): Likewise.
16738 (Symbol_table::sized_write_globals): Likewise.
16739 * resolve.cc (Symbol_table::should_override): Likewise.
16740 (Symbol::override_base_with_special): Likewise.
16741
8bdcdf2c
ILT
16742 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16743 symbol, change it to have default visibility.
16744 * testsuite/protected_1.cc: New file.
16745 * testsuite/protected_2.cc: New file.
16746 * testsuite/protected_3.cc: New file.
16747 * testsuite/protected_main_1.cc: New file.
16748 * testsuite/protected_main_2.cc: New file.
16749 * testsuite/protected_main_3.cc: New file.
16750 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16751 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16752 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16753 (protected_1.so): New target.
16754 (protected_1_pic.o, protected_2_pic.o): New targets.
16755 (protected_3_pic.o): New target.
16756 (check_PROGRAMS): Add protected_2.
16757 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16758 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16759 * testsuite/Makefile.in: Rebuild.
16760
2b706932
ILT
16761 * options.h (DEFINE_var): Add set_user_set_##varname__.
16762 (DEFINE_bool_alias): New macro.
16763 (class General_options): Define -Bstatic using DEFINE_bool_alias
16764 rather than DEFINE_special. Add --undefined as an alias for -z
16765 defs.
16766 * options.cc (General_options::parse_Bstatic): Remove.
16767
d82a5bcc
ILT
16768 * options.h (class General_options): Add --fatal-warnings.
16769 * main.cc (main): Implement --fatal-warnings.
16770 * errors.h (Errors::warning_count): New function.
16771
f1f70eae
ILT
16772 * options.h (class General_options): Add -Bsymbolic-functions.
16773 * symtab.h (Symbol::is_preemptible): Check for
16774 -Bsymbolic-functions.
16775
8825ac63
ILT
167762008-05-05 Ian Lance Taylor <iant@google.com>
16777
d98bc257
ILT
16778 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16779 as noVARNAME rather than no-VARNAME.
16780 (class General_options): Add option -z combreloc.
16781 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16782 get_address.
16783 (Output_reloc::sort_before) [SHT_REL]: New function.
16784 (Output_reloc::sort_before) [SHT_RELA]: New function.
16785 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16786 Sort_relocs_comparison.
16787 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16788 parameter. Change all callers.
16789 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16790 sort_relocs parameter. Change all callers.
16791 * output.cc (Output_reloc::get_address): New function, broken out
16792 of write_rel.
16793 (Output_reloc::write_rel): Call it.
16794 (Output_reloc::compare): New function.
16795 (Output_data_reloc_base::do_write): Optionally sort relocs.
16796
60b2b4e7
ILT
16797 * configure.ac: If targ_extra_obj is set, link it in.
16798 * configure.tgt: Initialize all variables.
16799 (x86_64*): Set targ_extra_obj and targ_extra_size.
16800 * configure: Rebuild.
16801
8825ac63
ILT
16802 * object.cc (Sized_relobj::include_section_group): Adjust section
16803 indexes read from group data. Build vector to pass to
16804 layout_group.
16805 * layout.cc (Layout::layout_group): Add flags and shndxes
16806 parameters. Remove contents parameter. Change caller. Update
16807 explicit instantiations.
16808 * layout.h (class Layout): Update layout_group declaration.
16809 * output.cc (Output_data_group::Output_data_group): Add flags and
16810 input_shndxes parameters. Remove contents parameter. Change
16811 caller.
16812 (Output_data_group::do_write): Change input_sections_ to
16813 input_shndxes_.
16814 * output.h (class Output_data_group): Update constructor
16815 declaration. Rename input_sections_ to input_shndxes_.
16816 * testsuite/many_sections_test.cc: Add template.
16817
e94cf127
CC
168182008-04-30 Cary Coutant <ccoutant@google.com>
16819
4418b2d5
CC
16820 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16821
e94cf127
CC
16822 * layout.cc (Layout::include_section): Refactored check for debug
16823 info section.
16824 (Layout::add_comdat): Add new parameters. Change type
16825 of signature parameter. Add object and shndx to signatures table.
16826 (Layout::find_kept_object): New function.
16827 * layout.h: Include <cstring>.
16828 (Layout::is_debug_info_section): New function.
16829 (Layout::add_comdat): Add new parameters.
16830 (Layout::find_kept_object): New function.
16831 (Layout::Kept_section): New struct.
16832 (Layout::Signatures): Change type of map range.
16833 * object.cc (Relobj::output_section_address): New function.
16834 (Sized_relobj::include_section_group): Add new parameters. Change
16835 calls to Layout::add_comdat. Change to build table of kept comdat
16836 groups and table mapping discarded sections to kept sections.
16837 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16838 (Sized_relobj::do_layout): Change calls to include_section_group and
16839 include_linkonce_section.
16840 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16841 value to zero when section is discarded.
16842 (Sized_relobj::map_to_kept_section): New function.
16843 * object.h (Relobj::output_section_address): New function.
16844 (Relobj::Comdat_group): New type.
16845 (Relobj::find_comdat_group): New function.
16846 (Relobj::Comdat_group_table): New type.
16847 (Relobj::Kept_comdat_section): New type.
16848 (Relobj::Kept_comdat_section_table): New type.
16849 (Relobj::add_comdat_group): New function.
16850 (Relobj::set_kept_comdat_section): New function.
16851 (Relobj::get_kept_comdat_section): New function.
16852 (Relobj::comdat_groups_): New field.
16853 (Relobj::kept_comdat_sections_): New field.
16854 (Symbol_value::input_value): Update comment.
16855 (Sized_relobj::map_to_kept_section) New function.
16856 (Sized_relobj::include_linkonce_section): Add new parameter.
16857 * target-reloc.h (Comdat_behavior): New type.
16858 (get_comdat_behavior): New function.
16859 (relocate_section): Add code to map a discarded section to the
16860 corresponding kept section when applying a relocation.
16861
e4e5049b
CS
168622008-04-30 Craig Silverstein <csilvers@google.com>
16863
16864 * dwarf_reader.cc (next_generation_count): New static var.
16865 (Addr2line_cache_entry): New struct.
16866 (addr2line_cache): New static var.
16867 (Dwarf_line_info::one_addr2line): Added caching.
16868 (Dwarf_line_info::clear_addr2line_cache): New function.
16869 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16870 cache-size parameter.
16871 (Dwarf_line_info::one_addr2line_cache): New function.
16872 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16873 new cache-size argument to one_addr2line(), and clear cache.
16874
d09e9154
CC
168752008-04-28 Cary Coutant <ccoutant@google.com>
16876
16877 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16878 R_386_PC8 relocations.
16879
7ef73768
ILT
168802008-04-23 Ian Lance Taylor <iant@google.com>
16881
55438702
ILT
16882 * object.cc (Sized_relobj::include_section_group): Check for
16883 invalid section group.
16884
c165fb93
ILT
16885 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16886 header size.
16887
7ef73768
ILT
16888 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16889 than read for file header.
16890 * archive.cc (Archive::include_member): Likewise.
16891
6194aaab
L
168922008-04-23 Paolo Bonzini <bonzini@gnu.org>
16893
16894 * aclocal.m4: Regenerate.
16895 * configure: Regenerate.
16896
d491d34e
ILT
168972008-04-19 Ian Lance Taylor <iant@google.com>
16898
5ea2bac6
ILT
16899 * version.cc (version_string): Bump to 1.6.
16900
7bc3e21a
ILT
16901 * testsuite/Makefile.am (many_sections_r_test): New target.
16902 (many_sections_r_test_SOURCES): Remove.
16903 (many_sections_r_test_DEPENDENCIES): Remove.
16904 (many_sections_r_test_LDFLAGS): Remove.
16905 (many_sections_r_test_LDADD): Remove.
16906
7fcd3aa9
ILT
16907 * object.cc (Sized_relobj::do_add_symbols): Always pass
16908 local_symbol_count_ to add_from_relobj.
16909
4c94d6ae
ILT
16910 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16911 every thousand variables.
16912 * testsuite/Makefile.in: Rebuild.
16913
d491d34e
ILT
16914 * object.cc (Xindex::initialize_symtab_xindex): New function.
16915 (Xindex::read_symtab_xindex): New function.
16916 (Xindex::sym_xindex_to_shndx): New function.
16917 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16918 available.
16919 (Sized_relobj::do_initialize_xindex): New function.
16920 (Sized_relobj::do_read_symbols): Adjust section links.
16921 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16922 parameter. Change all callers.
16923 (Sized_relobj::include_section_group): Adjust section links and
16924 symbol section indexes.
16925 (Sized_relobj::do_layout): Adjust section links.
16926 (Sized_relobj::do_count_local_symbols): Adjust section links and
16927 symbol section indexes.
16928 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16929 ordinary and special symbols.
16930 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16931 dynsym_xindex parameters. Change all callers. Adjust section
16932 links. Use SHN_XINDEX when needed.
16933 (Sized_relobj::get_symbol_location_info): Adjust section links.
16934 Don't get fooled by special symbols.
16935 * object.h (class Xindex): Define.
16936 (class Object): Add xindex_ parameter. Declare virtual functoin
16937 do_initialize_xindex.
16938 (Object::adjust_sym_shndx): New function.
16939 (Object::set_xindex): New protected function.
16940 (class Symbol_value): Add is_ordinary_shndx_ field.
16941 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16942 (Symbol_value::value): Assert ordinary section.
16943 (Symbol_value::initialize_input_to_output_map): Likewise.
16944 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16945 Change all callers.
16946 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16947 all callers.
16948 (class Sized_relobj): Update declarations.
16949 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16950 parameter. Change all callers.
16951 (Sized_relobj::adjust_shndx): New function.
16952 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16953 field.
16954 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16955 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16956 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16957 (Sized_dynobj::read_dynsym_section): Adjust section links.
16958 (Sized_dynobj::read_dynamic): Likewise.
16959 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16960 section links.
16961 (Sized_dynobj::do_initialize_xindex): New function.
16962 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16963 do_initialize_xindex.
16964 (Sized_dynobj::adjust_shndx): New function.
16965 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16966 dynsym_xindex_ fields.
16967 (Layout::finalize): Add a call to set_section_indexes before
16968 creating the symtab sections.
16969 (Layout::set_section_indexes): Don't do anything if the section
16970 already has a section index.
16971 (Layout::create_symtab_sections): Add shnum parameter. Change
16972 caller. Create .symtab_shndx section if needed.
16973 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16974 caller.
16975 (Layout::allocated_output_section_count): New function.
16976 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16977 needed.
16978 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16979 fields. Update declarations.
16980 (Layout::symtab_xindex): New function.
16981 (Layout::dynsym_xindex): New function.
16982 (class Write_symbols_task): Add layout_ field.
16983 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16984 Change caller.
16985 * output.cc (Output_section_headers::Output_section_headers): Add
16986 shstrtab_section parameter. Change all callers.
16987 (Output_section_headers::do_sized_write): Store overflow values
16988 for section count and section string table section index in
16989 section header zero.
16990 (Output_file_header::do_sized_write): Check for overflow of
16991 section count and section string table section index.
16992 (Output_symtab_xindex::do_write): New function.
16993 (Output_symtab_xindex::endian_do_write): New function.
16994 * output.h (class Output_section_headers): Add shstrtab_section_.
16995 Update declarations.
16996 (class Output_symtab_xindex): Define.
16997 (Output_section::has_out_shndx): New function.
16998 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16999 field.
17000 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17001 Change all callers.
17002 (Sized_symbol::init): Likewise.
17003 (Symbol::output_section): Check for ordinary symbol.
17004 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17005 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17006 callers.
17007 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17008 Change all callers. Simplify handling of symbols from sections
17009 not included in the link.
17010 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17011 distinction.
17012 (Weak_alias_sorter::operator()): Assert that symbols are
17013 ordinary.
17014 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17015 distinction.
17016 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17017 parameters. Change all callers.
17018 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17019 symbol distinction. Use SHN_XINDEX when needed.
17020 (Symbol_table::write_section_symbol): Add symtab_xindex
17021 parameter. Change all callers.
17022 (Symbol_table::sized_write_section_symbol): Likewise. Use
17023 SHN_XINDEX when needed.
17024 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17025 declarations.
17026 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17027 (Symbol::is_defined): Check is_ordinary.
17028 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17029 (Symbol::is_absolute, Symbol::is_common): Likewise.
17030 (class Sized_symbol): Update declarations.
17031 (class Symbol_table): Update declarations.
17032 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17033 parameters. Change all callers.
17034 (Sized_symbol::override): Likewise.
17035 (Symbol_table::override): Likewise.
17036 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17037 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17038 is_ordinary, and orig_st_shndx parameters. Change all callers.
17039 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17040 to be in an ordinary section.
17041 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17042 object and is_ordinary parameters. Change all callers.
17043 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17044 Change all callers. Don't add undefined or non-ordinary symbols
17045 to reloc_map_.
17046 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17047 Change all callers.
17048 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17049 declarations.
17050 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17051 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17052 (Sized_relobj::relocate_sections): Likewise.
17053 * target-reloc.h (scan_relocs): Adjust section symbol index.
17054 (scan_relocatable_relocs): Likewise.
17055 * i386.cc (Scan::local): Check for ordinary symbols.
17056 * sparc.cc (Scan::local): Likewise.
17057 * x86_64.cc (Scan::local): Likewise.
17058 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17059 to symbol_section_and_value.
17060 * testsuite/many_sections_test.cc: New file.
17061 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17062 (check_PROGRAMS): Add many_sections_test.
17063 (many_sections_test_SOURCES): Define.
17064 (many_sections_test_DEPENDENCIES): Define.
17065 (many_sections_test_LDFLAGS): Define.
17066 (BUILT_SOURCES): Add many_sections_define.h.
17067 (many_sections_define.h): New target.
17068 (BUILT_SOURCES): Add many_sections_check.h.
17069 (many_sections_check.h): New target.
17070 (check_PROGRAMS): Add many_sections_r_test.
17071 (many_sections_r_test_SOURCES): Define.
17072 (many_sections_r_test_DEPENDENCIES): Define.
17073 (many_sections_r_test_LDFLAGS): Define.
17074 (many_sections_r_test_LDADD): Define.
17075 (many_sections_r_test.o): New target.
17076 * testsuite/Makefile.in: Rebuild.
17077
c5818ff1
CC
170782008-04-17 Cary Coutant <ccoutant@google.com>
17079
17080 * errors.cc (Errors::info): New function.
17081 (gold_info): New function.
17082 * errors.h (Errors::info): New function.
17083 * gold.h (gold_info): New function.
17084 * object.cc (Input_objects::add_object): Print trace output.
17085 * options.cc (options::parse_set): New function.
17086 (General_options::parse_wrap): Deleted.
17087 (General_options::General_options): Deleted initializer.
17088 * options.h (options::String_set): New typedef.
17089 (options::parse_set): New function.
17090 (DEFINE_set): New macro.
17091 (General_options::wrap): Changed to use DEFINE_set. Changed
17092 callers of any_wrap_symbols and is_wrap_symbol.
17093 (General_options::trace, General_options::trace_symbol):
17094 New options.
17095 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17096 (General_options::wrap_symbols_): Deleted.
17097 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17098
b5be4a7c
DM
170992008-04-17 David S. Miller <davem@davemloft.net>
17100
17101 * options.cc (General_options::parse_V): New function.
17102 * options.h: Add entries for -V and -Qy.
17103
155a0dd7
ILT
171042008-04-17 Ian Lance Taylor <iant@google.com>
17105
17106 * common.cc (Symbol_table::allocate_commons): Remove options
17107 parameter. Change caller.
17108 (Symbol_table::do_allocate_commons): Remove options parameter.
17109 Change caller. Just call do_allocate_commons_list twice.
17110 (Symbol_table::do_allocate_commons_list): New function, broken out
17111 of do_allocate_commons.
17112 * common.h (class Allocate_commons_task): Remove options_ field.
17113 Update constructor.
17114 * symtab.cc (Symbol_table::Symbol_table): Initialize
17115 tls_commons_.
17116 (Symbol_table::add_from_object): Put TLS common symbols on
17117 tls_commons_ list.
17118 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17119 which are IN_OUTPUT_DATA.
17120 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17121 allocate_commons and do_allocate_commons declarations. Declare
17122 do_allocate_commons_list.
17123 * gold.cc (queue_middle_tasks): Update creation of
17124 Allocate_commons_task to not pass options.
17125 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17126 (TLS_TEST_C_FLAGS): New variable.
17127 (tls_test_c_pic.o): New target.
17128 (tls_test_shared.so): Link in tls_test_c_pic.o.
17129 (tls_test_c_pic_ie.o): New target.
17130 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17131 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17132 (tls_test_c.o): New target.
17133 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17134 (tls_pic_test_LDADD): Likewise.
17135 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17136 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17137 (tls_test_c_gnu2.o): New target.
17138 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17139 tls_test_c_gnu2.o.
17140 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17141 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17142 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17143 * testsuite/tls_test.cc: Include "config.h".
17144 (t_last): Call t11_last.
17145 * testsuite/tls_test.h (t11, t11_last): Declare.
17146 * testsuite/tls_test_c.c: New file.
17147 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17148 * configure.ac: Check for OpenMP support.
17149 * configure, config.in, Makefile.in: Rebuild.
17150 * testsuite/Makefile.in: Rebuild.
17151
edfbb029
CC
171522008-04-16 Cary Coutant <ccoutant@google.com>
17153
17154 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17155 (Target_i386::tls_base_symbol_defined_): New field.
17156 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17157 (Target_i386::Scan::global): Likewise.
17158 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17159 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17160 (Target_x86_64::tls_base_symbol_defined_): New field.
17161 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17162 (Target_x86_64::Scan::global): Likewise.
17163
f3c69fca
CC
171642008-04-16 Cary Coutant <ccoutant@google.com>
17165
17166 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17167 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17168 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17169 building shared libraries.
17170 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17171 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17172 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17173 * testsuite/Makefile.in: Rebuild.
17174 * testsuite/weak_undef.h: New file.
17175 * testsuite/weak_undef_file1.cc: Add extra test cases.
17176 * testsuite/weak_undef_file2.cc: Likewise.
17177 * testsuite/weak_undef_test.cc: Likewise.
17178
7c414435
DM
171792008-04-16 David S. Miller <davem@davemloft.net>
17180
32b769e1
DM
17181 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17182 Add issued_non_pic_error_ field. Declare check_non_pic.
17183 (Target_sparc::Scan::check_non_pic): New function.
17184 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17185 (Target_sparc::Scan::global): Likewise.
17186
11936fb1
DM
17187 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17188 * configure: Rebuild.
17189
7c414435
DM
17190 * options.h (DEFINE_enable): New macro.
17191 (new_dtags): New enable option.
17192 (initfirst, interpose, loadfltr, nodefaultlib,
17193 nodelete, nodlopen, nodump): New -z options.
17194 * layout.cc (Layout:finish_dynamic_section): If new
17195 dtags enabled, emit DT_RUNPATH. Also, emit a
17196 DT_FLAGS_1 containing any specified -z flags.
17197
85c7bf8b
ILT
171982008-04-16 Ian Lance Taylor <iant@google.com>
17199
12c0daef
ILT
17200 * copy-relocs.cc: New file.
17201 * copy-relocs.h: New file.
17202 * reloc.cc: Remove Copy_relocs code.
17203 * reloc.h: Likewise.
17204 * reloc-types.h (struct Reloc_types) [both versions]: Add
17205 get_reloc_addend_noerror.
17206 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17207 variants of add_global which take an addend which must be zero.
17208 * i386.cc: Include "copy-relocs.h".
17209 (class Target_i386): Change type of copy_relocs_ to variable,
17210 update initializer.
17211 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17212 Change all callers.
17213 (Target_i386::do_finalize_sections): Change handling of
17214 copy_relocs_.
17215 * sparc.cc: Include "copy-relocs.h".
17216 (class Target_sparc): Change type of copy_relocs_ to variable,
17217 update initializer.
17218 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17219 Change all callers.
17220 (Target_sparc::do_finalize_sections): Change handling of
17221 copy_relocs_.
17222 * x86_64.cc: Include "copy-relocs.h".
17223 (class Target_x86_64): Change type of copy_relocs_ to variable,
17224 update initializer.
17225 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17226 class. Change all callers.
17227 (Target_x86_64::do_finalize_sections): Change handling of
17228 copy_relocs_.
17229 * Makefile.am (CCFILES): Add copy-relocs.cc.
17230 (HFILES): Add copy-relocs.h.
17231
4f4995b6
ILT
17232 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17233
85c7bf8b
ILT
17234 * testsuite/script_test_4.sh: Permit leading zeroes.
17235
4f2a9edd
ILT
172362008-04-15 Ian Lance Taylor <iant@google.com>
17237
e6188289
ILT
17238 * script-sections.cc (Script_sections::create_segments): Use
17239 header_size_adjustment even when there is enough room for the
17240 headers.
17241 * testsuite/script_test_4.sh: New file.
17242 * testsuite/script_test_4.t: New file.
17243 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17244 (check_DATA): Add script_test_4.stdout.
17245 (MOSTLYCLEANFILES): Likewise.
17246 (script_test_4): New target.
17247 (script_test_4.stdout): New target.
17248 * testsuite/Makefile.in: Rebuild.
17249
4f2a9edd
ILT
17250 * sparc.cc: Add definitions for Output_data_plt_sparc class
17251 constants.
17252
f5314dd5
DM
172532008-04-14 David S. Miller <davem@davemloft.net>
17254
17255 * sparc.cc: New file.
17256 * Makefile.am (TARGETSOURCES): Add sparc.cc
17257 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17258 * configure.tgt: Document targ_extra_size and
17259 targ_extra_big_endian. Add entries for sparc-* and
17260 sparc64-*.
17261 * configure.ac: Handle targ_extra_size and
17262 targ_extra_big_endian.
17263 * Makefile.in: Rebuild.
17264 * configure: Likewise.
17265 * po/POTFILES.in: Likewise.
17266 * po/gold.pot: Likewise.
17267
154e0e9a
ILT
172682008-04-14 Ian Lance Taylor <iant@google.com>
17269
17270 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17271 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17272 in the name/type/flags to section mapping. Don't call
17273 allocate_output_section.
17274 (Layout::choose_output_section): Change parameter from adjust_name
17275 to is_input_section. Don't permit input sections after sections
17276 are attached to segments. Don't call allocate_output_section.
17277 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17278 not write_enable_output_section.
17279 (Layout::make_output_section): Don't push to
17280 unattached_section_list_ nor call attach_to_segment. Call
17281 attach_section_to_segment if sections are attached.
17282 (Layout::attach_sections_to_segments): New function.
17283 (Layout::attach_section_to_segment): New function.
17284 (Layout::attach_allocated_section_to_segment): Rename from
17285 attach_to_segment. Remove flags parameter.
17286 (Layout::allocate_output_section): Remove function.
17287 (Layout::write_enable_output_section): Remove function.
17288 * layout.h (class Layout): Update for above changes. Add new
17289 field sections_are_attached_.
17290 * output.h (Output_section::update_flags_for_input_section): New
17291 function.
17292 * output.cc (Output_section::add_input_section): Call
17293 update_flags_for_input_section.
17294 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17295
009a67a2
CC
172962008-04-11 Cary Coutant <ccoutant@google.com>
17297
17298 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17299 thought unnecessary.
17300 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17301
759b1a24
ILT
173022008-04-11 Ian Lance Taylor <iant@google.com>
17303
17304 * output.h (class Output_section_data): Remove inline definition
17305 of set_addralign.
17306 * output.cc (Output_section_data::set_addralign): New function.
17307
c2b45e22
CC
173082008-04-11 Cary Coutant <ccoutant@google.com>
17309
17310 Add support for TLS descriptors for i386 and x86_64.
17311 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17312 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17313 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17314 GOT_TYPE_TLS_DESC.
17315 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17316 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17317 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17318 relocations.
17319 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17320 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17321 Fix problem with initial-exec relocations.
17322 (Target_i386::Relocate::relocate_tls): Likewise.
17323 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17324 relaxation.
17325 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17326 support for section-plus-offset dynamic table entries.
17327 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17328 (Output_data_dynamic::Dynamic_entry): Add support for
17329 section-plus-offset dynamic table entries.
17330 (Output_data_dynamic::Classification): Likewise.
17331 (Output_data_dynamic::classification_): Renamed offset_.
17332 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17333 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17334 (Target_x86_64::make_plt_section): New function.
17335 (Target_x86_64::reserve_tlsdesc_entries): New function.
17336 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17337 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17338 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17339 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17340 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17341 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17342 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17343 add extra PLT entry for TLS descriptors.
17344 (Output_data_plt_x86_64::got_): New field.
17345 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17346 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17347 fields.
17348 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17349 descriptors.
17350 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17351 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17352 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17353 R_386_TLS_DESC_CALL relocations.
17354 (Target_x86_64::Scan::global): Likewise.
17355 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17356 for TLS descriptors.
17357 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17358 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17359 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17360 GD-to-IE relaxation.
17361 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17362 and TLS_DESCRIPTORS.
17363 * Makefile.in: Rebuild.
17364 * configure: Rebuild.
17365 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17366 (tls_test_shared2.so): New target.
17367 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17368 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17369 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17370 (tls_shared_gd_to_ie_test_LDADD): New variable.
17371 (tls_shared_gnu2_gd_to_ie_test): New target.
17372 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17373 New targets.
17374 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17375 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17376 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17377 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17378 (tls_shared_gnu2_test): New target.
17379 (tls_test_gnu2_shared.so): New target.
17380 (tls_shared_gnu2_test_SOURCES): New variable.
17381 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17382 (tls_shared_gnu2_test_LDFLAGS): New variable.
17383 (tls_shared_gnu2_test_LDADD): New variable.
17384 * testsuite/Makefile.in: Rebuild.
17385 * testsuite/Makefile.
17386
83bfb6b7
ILT
173872008-04-11 Ian Lance Taylor <iant@google.com>
17388
17389 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17390 justsyms.t.
17391 * testsuite/Makefile.in: Rebuild.
17392
17393 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17394 long.
17395 * testsuite/script_test_2.cc (main): Adjust test.
17396
706e1f5e
ILT
173972008-04-11 David S. Miller <davem@davemloft.net>
17398 Ian Lance Taylor <iant@google.com>
17399
17400 * options.h (General_options): Add entries for '-Y' and
17401 '-relax'.
17402 * options.cc (General_options:finalize): If -Y was used, add those
17403 entries to the library path instead of the default "/lib" and
17404 "/usr/lib".
17405
7c98e6bb
DM
174062008-04-11 David S. Miller <davem@davemloft.net>
17407
17408 * testsuite/justsyms.t: Start at 0x100.
17409 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17410 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17411 long.
17412 * testsuite/script_test_2.cc: Adjust string and section length
17413 checks.
7c98e6bb 17414
99a37bfd
ILT
174152008-04-09 Ian Lance Taylor <iant@google.com>
17416
2cefc357
ILT
17417 PR gold/5996
17418 * script-sections.cc (Sections_element::allocate_to_segment): Add
17419 orphan parameter.
17420 (Output_section_definition::allocate_to_segment): Likewise.
17421 (Orphan_output_section::allocate_to_segment): Likewise.
17422 (Script_sections::attach_sections_using_phdrs_clause): Don't
17423 propagate non-PT_LOAD segments to orphan sections.
17424 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17425 readelf rather than objdump.
17426 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17427 .interp section and PT_INTERP segment are the same size.
17428 * testsuite/Makefile.in: Rebuild.
17429
99a37bfd
ILT
17430 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17431 aliases for symbols defined in the same object.
17432 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17433 (weak_alias_test_SOURCES): New variable.
17434 (weak_alias_test_DEPENDENCIES): New variable.
17435 (weak_alias_test_LDFLAGS): New variable.
17436 (weak_alias_test_LDADD): New variable.
17437 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17438 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17439 (weak_alias_test_3.o): New target.
17440 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17441 * testsuite/weak_alias_test_main.cc: New file.
17442 * testsuite/weak_alias_test_1.cc: New file.
17443 * testsuite/weak_alias_test_2.cc: New file.
17444 * testsuite/weak_alias_test_3.cc: New file.
17445
780e49c5
ILT
174462008-04-08 Ian Lance Taylor <iant@google.com>
17447
cdb0b8f5
ILT
17448 * options.h (class General_options): Add --noinhibit-exec option.
17449 * main.cc (main): Check --noinhibit-exec.
17450
0864d551
ILT
17451 * options.h (class General_options): Define --wrap as a special
17452 option. Add wrap_symbols_ field.
17453 (General_options::any_wrap_symbols): New function.
17454 (General_options::is_wrap_symbol): New function.
17455 * options.cc (General_options::parse_wrap): New function.
17456 (General_options::General_options): Initialize wrap_symbols_.
17457 * symtab.cc (Symbol_table::wrap_symbol): New function.
17458 (Symbol_table::add_from_object): Handle --wrap.
17459 * symtab.h (class Symbol_table): Declare wrap_symbol.
17460 * target.h (Target::wrap_char): New function.
17461 (Target::Target_info): Add wrap_char field.
17462 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17463 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17464 * testsuite/testfile.cc (Target_test::test_target_info):
17465 Likewise.
17466
789aa6de
ILT
17467 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17468 there is one.
17469
2c38906f
ILT
17470 * layout.h (class Layout): Add added_eh_frame_data_ field.
17471 * layout.cc (Layout::Layout): Initialize new field.
17472 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17473 output section until we find a section we merged successfully.
17474 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17475 that the size be non-zero.
17476
780e49c5
ILT
17477 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17478 qualifier.
17479
7fcd0256
ILT
174802008-04-08 Craig Silverstein <csilvers@google.com>
17481
17482 * configure.ac: Export new conditional variable HAVE_ZLIB.
17483 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17484 on HAVE_ZLIB.
17485 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17486 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17487
6835af53
ILT
174882008-04-07 Ian Lance Taylor <iant@google.com>
17489
e24f324c
ILT
17490 * version.cc (version_string): Set to "1.5".
17491
a036edd8
ILT
17492 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17493 Add issued_non_pic_error_ field. Declare check_non_pic.
17494 (Target_x86_64::Scan::check_non_pic): New function.
17495 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17496 (Target_x86_64::Scan::global): Likewise.
17497
624f8810
ILT
17498 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17499 addend parameter. Change caller. Handle merge sections.
17500 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17501 Address to Addend. Don't add in the result of
17502 local_section_offset, pass down the addend and use the returned
17503 value.
17504 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17505 Update declarations of local_section_offset and symbol_value.
17506 * testsuite/two_file_test_1.cc (t18): New function.
17507 * testsuite/two_file_test_2.cc (f18): New function.
17508 * testsuite/two_file_test_main.cc (main): Call t18.
17509 * testsuite/two_file_test.h (t18, f18): Declare.
17510
6835af53
ILT
17511 * configure.ac: Don't test for objdump, c++filt, or readelf.
17512 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17513 conditionals.
17514 (TEST_READELF): New variable.
17515 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17516 (check_PROGRAMS): Add two_file_strip_test.
17517 (two_file_strip_test): New target.
17518 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17519 (two_file_same_shared_strip_test_SOURCES): New variable.
17520 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17521 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17522 (two_file_same_shared_strip_test_LDADD): New variable.
17523 (two_file_shared_strip.so): New target.
17524 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17525 (ver_test_5.syms, ver_test_7.syms): Likewise.
17526 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17527 (strip_test_3.stdout): Use TEST_OBJDUMP.
17528 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17529
86925eef
CC
175302008-04-04 Cary Coutant <ccoutant@google.com>
17531
17532 * symtab.h (Symbol::is_weak_undefined): New function.
17533 (Symbol::is_strong_undefined): New function.
17534 (Symbol::is_absolute): New function.
17535 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17536 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17537 absolute symbols.
17538 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17539 (weak_undef_test): New target.
17540 * testsuite/Makefile.in: Rebuild.
17541 * testsuite/weak_undef_file1.cc: New file.
17542 * testsuite/weak_undef_file2.cc: New file.
17543 * testsuite/weak_undef_test.cc: New file.
17544
126f3ece
ILT
175452008-04-03 Craig Silverstein <csilvers@google.com>
17546
17547 * compressed_output.h (class Output_compressed_section): Use
17548 unsigned buffer.
17549 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17550 add zlib header.
17551 (zlib_compressed_suffix): Removed.
17552 (Output_compressed_section::set_final_data_size): Use unsigned
17553 buffers.
17554 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17555 Fix linker invocation.
17556 (flagstest_o_specialfile_and_compress_debug_sections):
17557 Likewise.
17558 * testsuite/Makefile.in: Regenerated.
17559
deae2a14
DM
175602008-04-02 David S. Miller <davem@davemloft.net>
17561
17562 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17563 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17564
70752818
ILT
175652008-04-02 Craig Silverstein <csilvers@google.com>
17566
17567 * TODO: New file.
17568
39d0cb0e
ILT
175692008-04-02 Ian Lance Taylor <iant@google.com>
17570
17571 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17572 parameters. Update for new key type to views_. Change all
17573 callers.
17574 (File_read::read): Adjust for byteshift in returned view.
17575 (File_read::add_view): New function, broken out of
17576 find_and_make_view.
17577 (File_read::make_view): New function, broken out of
17578 find_and_make_view.
17579 (File_read::find_or_make_view): Add offset and aligned
17580 parameters. Rewrite accordingly. Change all callers.
17581 (File_read::get_view): Add offset and aligned parameters. Adjust
17582 for byteshift in return value.
17583 (File_read::get_lasting_view): Likewise.
17584 * fileread.h (class File_read): Update declarations.
17585 (class File_read::View): Add byteshift_ field. Add byteshift to
17586 constructor. Add byteshift method.
17587 * archive.h (Archive::clear_uncached_views): New function.
17588 (Archive::get_view): Add aligned parameter. Change all callers.
17589 * object.h (Object::get_view): Add aligned parameter. Change all
17590 callers.
17591 (Object::get_lasting_view): Likewise.
17592
17593 * fileread.cc (File_read::release): Don't call clear_views if
17594 there are multiple objects.
17595 * fileread.h (File_read::clear_uncached_views): New function.
17596 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17597 on the archive.
17598
a1207466
CC
175992008-03-31 Cary Coutant <ccoutant@google.com>
17600
17601 Add thin archive support.
17602 * archive.cc (Archive::armagt): New const.
17603 (Archive::setup): Remove task parameter and calls to unlock.
17604 (Archive::unlock_nested_archives): New function.
17605 (Archive::read_header): Add nested_off parameter. Change
17606 all callers.
17607 (Archive::interpret_header): Likewise.
17608 (Archive::include_all_members): Change to handle thin
17609 archives.
17610 (Archive::include_member): Likewise.
17611 * archive.h (Archive::Archive): Add new parameters and
17612 initializers.
17613 (Archive::armagt): New const.
17614 (Archive::setup): Remove task parameter.
17615 (Archive::unlock_nested_archives): New function.
17616 (Archive::read_header): Add nested_off parameter.
17617 (Archive::interpret_header): Likewise.
17618 (Archive::Nested_archive_table): New typedef.
17619 (Archive::is_thin_archive_): New field.
17620 (Archive::nested_archives_): New field.
17621 (Archive::options_): New field.
17622 (Archive::dirpath_): New field.
17623 (Archive::task_): New field.
17624 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17625 for thin archives. Pass additional parameters to
17626 Archive::Archive. Unlock the archive file after calling
17627 Archive::setup.
cd536b21 17628
479f6503
ILT
176292008-03-29 Ian Lance Taylor <iant@google.com>
17630
686c8caf
ILT
17631 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17632 version symbol to be local.
17633 * testsuite/ver_test_4.sh: New file.
17634 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17635 (check_DATA): Add ver_test_4.syms.
17636 (ver_test_4.syms): New target.
17637 * testsuite/Makefile.in: Rebuild.
17638
ab794b6b
ILT
17639 * output.cc
17640 (Output_section::Input_section_sort_entry::has_priority): New
17641 function.
17642 (Output_section::Input_section_sort_entry::match_file_name): New
17643 function.
17644 (Output_section::Input_section_sort_entry::match_section_name):
17645 Remove.
17646 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17647 Remove.
17648 (Output_section::Input_section_sort_entry::match_section_file):
17649 Remove.
17650 (Output_section::Input_section_sort_compare::operator()): Rewrite
17651 using new Input_section_sort_entry functions. Sort crtbegin and
17652 crtend first. Sort sections with no priority before sections with
17653 a priority.
17654 * testsuite/initpri1.c (d3): Check j != 4.
17655 (cd5): New constructor/destructor function.
17656 (main): Check j != 2.
17657
479f6503
ILT
17658 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17659 new symbol when resolving, don't call set_is_default.
17660 * testsuite/ver_test_7.cc: New file.
17661 * testsuite/ver_test_7.sh: New file.
17662 * testsuite/Makefile.am (ver_test_7.so): New target.
17663 (ver_test_7.o): New target.
17664 (check_SCRIPTS): Add ver_test_7.sh.
17665 (check_DATA): Add ver_test_7.syms.
17666 (ver_test_7.syms): New target.
17667
2fd32231
ILT
176682008-03-28 Ian Lance Taylor <iant@google.com>
17669
17670 * layout.cc (Layout::layout): If we see an input section with a
17671 name that needs sorting, set the must_sort flag for the output
17672 section.
17673 (Layout::make_output_section): If the name of the output section
17674 indicates that it might require sorting, set the may_sort flag.
17675 * output.h (Output_section::may_sort_attached_input_sections): New
17676 function.
17677 (Output_section::set_may_sort_attached_input_sections): New
17678 function.
17679 (Output_section::must_sort_attached_input_sections): New
17680 function.
17681 (Output_section::set_must_sort_attached_input_sections): New
17682 function.
17683 (class Output_section): Declare Input_section_sort_entry. Define
17684 Input_section_sort_compare. Declare
17685 sort_attached_input_sections. Add new fields:
17686 may_sort_attached_input_sections_,
17687 must_sort_attached_input_sections_,
17688 attached_input_sections_are_sorted_.
17689 * output.cc (Output_section::Output_section): Initialize new
17690 fields.
17691 (Output_section::add_input_section): Add an entry to
17692 input_sections_ if may_sort or must_sort are true.
17693 (Output_section::set_final_data_size): Call
17694 sort_attached_input_sections if necessary.
17695 (Output_section::Input_section_sort_entry): Define new class.
17696 (Output_section::Input_section_sort_compare::operator()): New
17697 function.
17698 (Output_section::sort_attached_input_sections): New function.
17699 * configure.ac: Check whether the compiler supports constructor
17700 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17701 * testsuite/initpri1.c: New file.
17702 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17703 CONSTRUCTOR_PRIORITY.
17704 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17705 (initpri1_LDFLAGS): New variable.
17706 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17707
18e6b24e
ILT
177082008-03-27 Ian Lance Taylor <iant@google.com>
17709
49bdd526
ILT
17710 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17711 * testsuite/common_test_1.c: New file.
17712 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17713 (common_test_1_SOURCES): New variable.
17714 (common_test_1_DEPENDENCIES): New variable.
17715 (common_test_1_LDFLAGS): New variable.
17716
18e6b24e
ILT
17717 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17718 and commons_ correctly when NAME/VERSION does not override
17719 NAME/NULL.
17720 * testsuite/ver_test_6.c: New file.
17721 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17722 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17723 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17724
04bf7072
ILT
177252008-03-26 Ian Lance Taylor <iant@google.com>
17726
5871526f
ILT
17727 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17728 of an undefined symbol from a version script.
17729 * testsuite/Makefile.am (ver_test_5.so): New target.
17730 (ver_test_5.o): New target.
17731 (check_SCRIPTS): Add ver_test_5.sh.
17732 (check_DATA): Add ver_test_5.syms.
17733 (ver_test_5.syms): New target.
17734 * testsuite/ver_test_5.cc: New file.
17735 * testsuite/ver_test_5.script: New file.
17736 * testsuite/ver_test_5.sh: New file.
17737 * Makefile.in, testsuite/Makefile.in: Rebuild.
17738
04bf7072
ILT
17739 PR gold/5986
17740 Fix problems building gold with gcc 4.3.0.
17741 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17742 (gold_error_at_location, gold_warning_at_location): Use it.
17743 * configure.ac: Check whether we can compile and use a template
17744 function with a printf attribute.
17745 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17746 when jumping over bytes.
17747 * object.cc: Instantiate Object::read_section_data.
17748 * debug.h: Include <cstring>
17749 * dwarf_reader.cc: Include <algorithm>
17750 * main.cc: Include <cstring>.
17751 * options.cc: Include <cstring>.
17752 * output.cc: Include <cstring>.
17753 * script.cc: Include <cstring>.
17754 * script.h: Include <string>.
17755 * symtab.cc: Include <cstring> and <algorithm>.
17756 * target-select.cc: Include <cstring>.
17757 * version.cc: Include <string>.
17758 * testsuite/testmain.cc: Include <cstdlib>.
17759 * configure, config.in: Rebuild.
17760
874c5b28
ILT
177612008-03-25 Ian Lance Taylor <iant@google.com>
17762
819d6c3a
ILT
17763 * options.cc: Include "../bfd/bfdver.h".
17764 (options::help): Print bug reporting address.
17765
f4b2c6f5
ILT
17766 * version.cc (print_version): Adjust output for current value of
17767 BFD_VERSION_STRING.
17768
17769 * NEWS: New file.
17770
e96caa79
ILT
17771 * options.cc (options::help): Print list of supported targets.
17772 * target-select.h: Include <vector>.
17773 (class Target_selector): Make machine_, size_, and is_big_endian_
17774 fields const. Add bfd_name_ and instantiated_target_ fields.
17775 (Target_selector::Target_selector): Add bfd_name parameter.
17776 (Target_selector::recognize): Make non-virtual, call
17777 do_recognize.
17778 (Target_selector::recognize_by_name): Make non-virtual, call
17779 do_recognize_by_name.
17780 (Target_selector::supported_names): New function.
17781 (Target_selector::bfd_name): New function.
17782 (Target_selector::do_instantiate_target): New pure virtual
17783 function.
17784 (Target_selector::do_recognize): New virtual function.
17785 (Target_selector::do_recognize_by_name): New virtual function.
17786 (Target_selector::instantiate_target): New private function.
17787 (supported_target_names): Declare.
17788 * target-select.cc (Target_selector::Target_selector): Update for
17789 new parameter and fields.
17790 (select_target_by_name): Check that the name matches before
17791 calling recognize_by_name.
17792 (supported_target_names): New function.
17793 * i386.cc (class Target_selector_i386): Update Target_selector
17794 constructor call. Remove recognize and recognize_by_name. Add
17795 do_instantiate_target.
17796 * x86_64.cc (class Target_selector_x86_64): Likewise.
17797 * testsuite/testfile.cc (class Target_selector_test): Update for
17798 changes to Target_selector.
17799
874c5b28
ILT
17800 * README: Rewrite, with some notes on unsupported features.
17801
0a65a3a7
CC
178022008-03-24 Cary Coutant <ccoutant@google.com>
17803
17804 * i386.cc (Target_i386::Got_type): New enum declaration.
17805 (Target_i386::Scan::local): Updated callers of Output_data_got
17806 member functions.
17807 (Target_i386::Scan::global): Likewise.
17808 (Target_i386::Relocate::relocate): Likewise.
17809 (Target_i386::Relocate::relocate_tls): Likewise.
17810 * object.h (Got_offset_list): New class.
17811 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17812 (Sized_relobj::local_got_offset): Likewise.
17813 (Sized_relobj::set_local_got_offset): Likewise.
17814 (Sized_relobj::local_has_tls_got_offset): Removed.
17815 (Sized_relobj::local_tls_got_offset): Removed.
17816 (Sized_relobj::set_local_tls_got_offset): Removed.
17817 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17818 * output.cc (Output_data_got::add_global): Added got_type parameter.
17819 (Output_data_got::add_global_with_rel): Likewise.
17820 (Output_data_got::add_global_with_rela): Likewise.
17821 (Output_data_got::add_global_pair_with_rel): New function.
17822 (Output_data_got::add_global_pair_with_rela): New function.
17823 (Output_data_got::add_local): Added got_type parameter.
17824 (Output_data_got::add_local_with_rel): Likewise.
17825 (Output_data_got::add_local_with_rela): Likewise.
17826 (Output_data_got::add_local_pair_with_rel): New function.
17827 (Output_data_got::add_local_pair_with_rela): New function.
17828 (Output_data_got::add_global_tls): Removed.
17829 (Output_data_got::add_global_tls_with_rel): Removed.
17830 (Output_data_got::add_global_tls_with_rela): Removed.
17831 (Output_data_got::add_local_tls): Removed.
17832 (Output_data_got::add_local_tls_with_rel): Removed.
17833 (Output_data_got::add_local_tls_with_rela): Removed.
17834 * output.h (Output_data_got::add_global): Added got_type parameter.
17835 (Output_data_got::add_global_with_rel): Likewise.
17836 (Output_data_got::add_global_with_rela): Likewise.
17837 (Output_data_got::add_global_pair_with_rel): New function.
17838 (Output_data_got::add_global_pair_with_rela): New function.
17839 (Output_data_got::add_local): Added got_type parameter.
17840 (Output_data_got::add_local_with_rel): Likewise.
17841 (Output_data_got::add_local_with_rela): Likewise.
17842 (Output_data_got::add_local_pair_with_rel): New function.
17843 (Output_data_got::add_local_pair_with_rela): New function.
17844 (Output_data_got::add_global_tls): Removed.
17845 (Output_data_got::add_global_tls_with_rel): Removed.
17846 (Output_data_got::add_global_tls_with_rela): Removed.
17847 (Output_data_got::add_local_tls): Removed.
17848 (Output_data_got::add_local_tls_with_rel): Removed.
17849 (Output_data_got::add_local_tls_with_rela): Removed.
17850 * resolve.cc (Symbol::override_base_with_special): Removed
17851 reference to has_got_offset_ field.
17852 * symtab.cc (Symbol::init_fields): Replaced initialization
17853 of got_offset_ with got_offsets_. Removed initialization
17854 of has_got_offset_
53fcba31 17855 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17856 (Symbol::got_offset): Likewise.
17857 (Symbol::set_got_offset): Likewise.
17858 (Symbol::has_tls_got_offset): Removed.
17859 (Symbol::tls_got_offset): Removed.
17860 (Symbol::set_tls_got_offset): Removed.
17861 (Symbol::got_offset_): Removed.
17862 (Symbol::tls_mod_got_offset_): Removed.
17863 (Symbol::tls_pair_got_offset_): Removed.
17864 (Symbol::got_offsets_): New field.
17865 (Symbol::has_got_offset): Removed.
17866 (Symbol::has_tls_mod_got_offset): Removed.
17867 (Symbol::has_tls_pair_got_offset): Removed.
17868 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17869 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17870 member functions.
17871 (Target_x86_64::Scan::global): Likewise.
17872 (Target_x86_64::Relocate::relocate): Likewise.
17873 (Target_x86_64::Relocate::relocate_tls): Likewise.
17874
bd52eafb
BE
178752008-03-25 Ben Elliston <bje@au.ibm.com>
17876
17877 * yyscript.y: Fix spelling error in comment.
17878
8b105e34
ILT
178792008-03-24 Ian Lance Taylor <iant@google.com>
17880
8ed814a9
ILT
17881 * options.h (class General_options): Define build_id option.
17882 * layout.h (class Layout): Declare write_build_id, create_note,
17883 create_build_id. Add build_id_note_ member.
17884 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17885 "libiberty.h", "md5.h", "sha1.h".
17886 (Layout::Layout): Initialize eh_frame_data_,
17887 eh_frame_hdr_section_, and build_id_note_.
17888 (Layout::finalize): Call create_build_id.
17889 (Layout::create_note): New function, broken out of
17890 Layout::create_gold_note.
17891 (Layout::create_gold_note): Call create_note.
17892 (Layout::create_build_id): New function.
17893 (Layout::write_build_id): New function.
17894 (Close_task_runner::run): Call write_build_id.
17895
8b105e34
ILT
17896 * x86_64.cc: Correct license to GPLv3.
17897
086a1841
ILT
178982008-03-23 Ian Lance Taylor <iant@google.com>
17899
17900 * options.cc: Include "demangle.h".
17901 (parse_optional_string): New function.
17902 (parse_long_option): Handle takes_optional_argument.
17903 (parse_short_option): Update dash_z initializer. Handle
17904 takes_optional_argument.
17905 (General_options::General_options): Initialize do_demangle_.
17906 (General_options::finalize): Set do_demangle_. Handle demangling
17907 style.
17908 * options.h (parse_optional_string): Declare.
17909 (struct One_option): Add optional_arg field. Update constructor.
17910 Update call constructor calls. Add takes_optional_argument
17911 function.
17912 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17913 (DEFINE_optional_string): Define.
17914 (General_options::demangle): Change from DEFINE_bool to
17915 DEFINE_optional_string.
17916 (General_options::no_demangle): New function.
17917 (General_options::do_demangle): New function.
17918 (General_options::set_do_demangle): New function.
17919 (General_options::execstack_status_): Move definition to end of
17920 class definition.
17921 (General_options::static_): Likewise.
17922 (General_options::do_demangle_): New field.
17923 * object.cc (big_endian>::get_symbol_location_info): Call
17924 Options::do_demangle, not Options::demangle.
17925 * symtab.cc (demangle): Likewise.
17926
cbb93e63
ILT
179272008-03-22 Ian Lance Taylor <iant@google.com>
17928
17929 * gold.h: Include <cstddef> and <sys/types.h>
17930 * options.h: Include <cstring>.
17931
ec531623
ILT
179322008-03-21 Ian Lance Taylor <iant@google.com>
17933
17934 * Added source code to GNU binutils.
752937aa 17935\f
b90efa5b 17936Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17937
17938Copying and distribution of this file, with or without modification,
17939are permitted in any medium without royalty provided the copyright
17940notice and this notice are preserved.
17941
17942Local Variables:
17943mode: change-log
17944left-margin: 8
17945fill-column: 74
17946version-control: never
17947End:
This page took 1.227865 seconds and 4 git commands to generate.