Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
549dba71
AM
12015-12-07 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
4 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
5 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
6
7ef8ae7c
VR
72015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
8
9 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
10 Local_got_entry_key for searching in local_got_offsets_.
11 * object.h (class Local_got_entry_key): New class.
12 (Relobj::local_has_got_offset): New overloaded method.
13 (Relobj::local_got_offset): Likewise.
14 (Relobj::set_local_got_offset): Likewise.
15 (Relobj::do_local_has_got_offset): Add addend argument.
16 (Relobj::do_local_got_offset): Likewise.
17 (Relobj::do_set_local_got_offset): Likewise.
18 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
19 Local_got_entry_key for searching through local_got_offsets_.
20 (Sized_relobj::do_local_got_offset): Likewise.
21 (Sized_relobj::do_set_local_got_offset): Likewise.
22 (Sized_relobj::Local_got_offsets): Change type of the key from
23 unsigned int to Local_got_entry_key, and add hash and equal_to.
24 * output.cc (Got_entry::write): Take addend into account for
25 calculating value of the local symbol for GOT.
26 (Output_data_got::add_local): New definition of overloaded method.
27 (Output_data_got::add_local_with_rel): Likewise.
28 (Output_data_got::add_local_pair_with_rel): Likewise.
29 * output.h (Output_data_got::add_local): New declaration of overloaded
30 method.
31
74b03b91
CC
322015-11-25 Cary Coutant <ccoutant@gmail.com>
33
34 PR gold/19291
35 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
36 subtract section address from symbol value.
37
751e4d66
AM
382015-11-25 Alan Modra <amodra@gmail.com>
39
40 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
41 to 256 byte boundary.
42
32d849b3
AM
432015-11-19 Alan Modra <amodra@gmail.com>
44
45 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
46 GOT16 and TOC16 relocs to RELATIVE_REF.
47
db1ff028
CC
482015-11-14 Cary Coutant <ccoutant@gmail.com>
49
50 PR gold/19244
51 PR gold/18548
52 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
53 local symbols only for predefined symbols.
54
a680de9a
PB
552015-11-11 Alan Modra <amodra@gmail.com>
56 Peter Bergner <bergner@vnet.ibm.com>
57
58 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
59 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
60 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
61 (Target_powerpc::Scan::global): Likewise.
62 (Target_powerpc::Relocate::relocate): Likewise.
63
cc203475
VR
642015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
65
66 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
67 sections.
68
859d7987
CC
692015-11-09 Cary Coutant <ccoutant@gmail.com>
70 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
71
72 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
73 with type, offset, addend.
74 (Copy_relocs::save): Likewise.
75 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
76 (Copy_relocs::save): Likewise.
77 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
78 and r_addend to Copy_relocs::copy_reloc.
79 * arm.cc (Target_arm::copy_reloc): Likewise.
80 * i386.cc (Target_i386::copy_reloc): Likewise.
81 * mips.cc (Target_mips::copy_reloc): Likewise.
82 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
83 * s390.cc (Target_s390::copy_reloc): Likewise.
84 * sparc.cc (Target_sparc::copy_reloc): Likewise.
85 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
86 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
87
96f9814d
CC
882015-11-05 Cary Coutant <ccoutant@gmail.com>
89
90 PR gold/19119
91 PR gold/19172
92 PR gold/19197
93 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
94 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
95 * options.h (General_options): Remove "obsolete" from -m.
96 * parameters.cc (set_parameters_target): Check if input target
97 is compatible with output emulation set by "-m emulation".
98
0eccf19f
CC
992015-11-05 Cary Coutant <ccoutant@gmail.com>
100
101 PR gold/19163
102 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
103 certain relocations if --no-apply-dynamic-relocs is set.
104 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
105
c1e7d6a8
AM
1062015-11-03 Alan Modra <amodra@gmail.com>
107
108 * po/POTFILES.in: Regenerate.
109
26f187cd
NC
1102015-10-30 Nick Clifton <nickc@redhat.com>
111
112 * po/zh_CN.po: New (simplified) Chinese translation.
113
41e83f2b
L
1142015-10-29 H.J. Lu <hongjiu.lu@intel.com>
115
116 PR gold/19184
117 * incremental.cc (Got_plt_view_info): Add got_entry_size.
118 (Local_got_offset_visitor::visit): Replace got_entry_size_
119 with info_.got_entry_size.
120 (Local_got_offset_visitor::got_entry_size_): Removed.
121 (Global_got_offset_visitor::visit): Replace got_entry_size_
122 with info_.got_entry_size.
123 (Global_got_offset_visitor::got_entry_size_): Removed.
124 (Output_section_incremental_inputs::write_got_plt): Initialize
125 view_info.got_entry_size.
126 * target.h (Sized_target::got_entry_size): New virtual function.
127 * x86_64.cc (Target_x86_64::got_entry_size): New function.
128
238830c6
MK
1292015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
130
131 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
132 * testsuite/script_test_12a.c: Likewise.
133 * testsuite/script_test_1a.cc: Likewise.
134 * testsuite/script_test_2.cc: Likewise.
135
bd890911
MK
1362015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
137
138 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
139
a817ff49
MK
1402015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
141
142 PR gold/18959
143 * stringpool.cc (Stringpool_template::new_key_offset): Align all
144 strings, even zero-length.
145 (Stringpool_template::set_string_offsets): Likewise.
146
e79a4bad
MK
1472015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
148
149 * s390.cc: New file.
150 * Makefile.am (TARGETSOURCES): Add s390.cc.
151 (ALL_TARGETOBJS): Add s390.o.
152 * Makefile.in: Regenerate.
153 * configure.ac: Add s390 support.
154 * configure: Regenerate.
155 * configure.tgt: Add s390-*-* and s390x-*-*.
156 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
157 support.
158
6f97897d
MK
1592015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
160
161 * archive.cc (Archive::sym64name): New const.
162 (Archive::setup): Add support for SYM64 armap.
163 (Archive::read_armap): Likewise.
164 (Archive::interpret_header): Likewise.
165 (Archive::const_iterator::read_next_header): Likewise.
166 * archive.h (Archive::sym64name): New const.
167 (Archive::read_armap): Add mapsize template parameter.
168
8d9743bd
MK
1692015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
170
171 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
172 target-specific entry size.
173 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
174 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
175 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
176 hash_entry_size.
177 * target.h (Target::hash_entry_size): New method.
178 (Target::Target_info::hash_entry_size): New data member.
179
180 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
181 * arm.cc (Target_arm::arm_info): Likewise.
182 (Target_arm_nacl::arm_nacl_info): Likewise.
183 * i386.cc (Target_i386::i386_info): Likewise.
184 (Target_i386_nacl::i386_nacl_info): Likewise.
185 (Target_iamcu::iamcu_info): Likewise.
186 * mips.cc (Target_mips::mips_info): Likewise.
187 (Target_mips_nacl::mips_nacl_info): Likewise.
188 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
189 * sparc.cc (Target_sparc::sparc_info): Likewise.
190 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
191 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
192 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
193 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
194
3043c1ab
L
1952015-10-28 H.J. Lu <hongjiu.lu@intel.com>
196
197 PR gold/19177
198 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
199 and R_386_GOT32X relocations without base register.
200
4d2f5d58
HS
2012015-10.27 Han Shen <shenhan@google.com>
202
203 PR gold/19042 - unsupported reloc 311/312.
204
205 * aarch64.cc (Target_aarch64::Scan::local): Add support for
206 reloc 311/312.
207
2891b491
L
2082015-10-22 H.J. Lu <hongjiu.lu@intel.com>
209
210 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
211 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
212 as R_X86_64_GOTPCREL.
213 (Target_x86_64<size>::Scan::local): Likewise.
214 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
215 Likewise.
216 (Target_x86_64<size>::Scan::global): Likewise.
217 (Target_x86_64<size>::Relocate::relocate): Likewise.
218 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
219 Likewise.
220
493d4b48
L
2212015-10-22 H.J. Lu <hongjiu.lu@intel.com>
222
223 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
224 R_386_GOT32X the same as R_386_GOT32.
225 (Target_i386::Scan::local): Likewise.
226 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
227 (Target_i386::Scan::global): Likewise.
228 (Target_i386::Relocate::relocate): Likewise.
229 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
230 Likewise.
231
0fd15345
L
2322015-10-20 H.J. Lu <hongjiu.lu@intel.com>
233
234 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
235 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
236 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
237 x86_64_mov_to_lea1.o.
238 * testsuite/Makefile.in: Regenerated.
239
64571972
L
2402015-10-16 H.J. Lu <hongjiu.lu@intel.com>
241
242 PR gold/19119
243 * options.h (General_options): Remove "obsolete" from -m.
244 * parameters.cc (set_parameters_target): Check if input target
245 is compatible with output emulation set by "-m emulation".
246
01f573ad
L
2472015-10-13 H.J. Lu <hongjiu.lu@intel.com>
248
249 PR gold/19118
250 * i386.cc (Target_iamcu): New class.
251 (Target_selector_iamcu): Likewise.
252 (Target_iamcu::iamcu_info): New variable.
253 (target_selector_iamcu): Likewise.
254
3b0357da
AS
2552015-10-07 Andreas Schwab <schwab@suse.de>
256
257 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
258
9eacb935
CC
2592015-10-06 Cary Coutant <ccoutant@gmail.com>
260
261 PR gold/18855
262 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
263 parameter.
264 (Sparc_relocate_functions::gdop_lox10): Likewise.
265 (Target_sparc::Relocate::relocate): Use addend when computing
266 symbol value for R_SPARC_GOTDATA_OP*.
267
3d4fde69
CC
2682015-09-07 Cary Coutant <ccoutant@gmail.com>
269
270 PR gold/18930
271 PR gold/18886
272 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
273 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
274
358de988
L
2752015-09-02 H.J. Lu <hongjiu.lu@intel.com>
276
277 PR gold/18886
278 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
279 shared libraries into normal FUNC symbols.
280 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
281 symbols aren't from shared libraries.
282
d49044c7
AM
2832015-09-02 Alan Modra <amodra@gmail.com>
284
285 PR 18878
286 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
287 (Target_powerpc::Branch_info::make_stub): Determine whether long
288 branch stub is for save/restore function.
289 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
290 (Stub_table): Add need_save_res_.
291 (Stub_table:clear_stubs): Clear need_save_res_.
292 (Stub_table:set_address_and_size): Add save/restore section size.
293 (Stub_table::add_long_branch_entry): Add save_res param. Set
294 need_save_res_, but don't add space for save/restore stubs.
295 (Stub_table::find_long_branch_entry): Return offset to local copy
296 of save/restore func.
297 (Stub_table::do_write): Don't output save/restore stubs. Instead
298 copy the save/restore functions.
299 (Output_data_save_res:contents): New accessor.
300 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
301
7c61d651
CC
3022015-08-25 Cary Coutant <ccoutant@gmail.com>
303
304 PR gold/18847
305 * script-sections.cc (Memory_region::set_address): New method.
306 (Script_sections::find_memory_region): Add explicit_only parameter.
307 (Output_section_definition::set_section_addresses): Handle case where
308 script specifies both address and vma region.
309 * script-sections.h (Script_sections::find_memory_region): Add
310 explicit_only parameter.
311
4bfacfd3
CC
3122015-08-25 Cary Coutant <ccoutant@gmail.com>
313
314 PR gold/18859
315 * object.cc (Input_objects::add_object): Store objects in a map,
316 indexed by soname; update as-needed flag when necessary.
317 * object.h (Object::clear_as_needed): New method.
318 (Input_objects::so_names_): Change from set to map.
319
1757d35c
CC
3202015-08-25 Cary Coutant <ccoutant@gmail.com>
321
322 PR gold/14746
323 * expression.cc (Expression::Expression_eval_info): Add
324 is_valid_pointer field.
325 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
326 Adjust all callers.
327 (Addr_expression::value_from_output_section): Check whether address
328 is valid.
329 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
330 if evaluation failed due to address that is not yet valid.
331 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
332 parameter.
333
3ac0a36c
CC
3342015-08-25 Cary Coutant <ccoutant@gmail.com>
335
336 PR gold/18866
337 PR gold/18703
338 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
339
9215b98b
AM
3402015-08-20 Alan Modra <amodra@gmail.com>
341
342 PR gold/18846
343 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
344 Subtract os->address() from addend.
345 * powerpc.cc (relocate_relocs): Likewise.
346
40fc1451
SD
3472015-08-12 Simon Dardis <simon.dardis@imgtec.com>
348
349 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
350 lazy_stub_normal_1, lazy_stub_normal_1_n64,
351 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
352 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
353 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
354 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
355 of 'addu/daddu'.
356
37a42ee9
L
3572015-07-27 H.J. Lu <hongjiu.lu@intel.com>
358
359 * configure: Regenerated.
360
ab3b14b0
DK
3612015-07-26 Doug Kwan <dougkwan@google.com>
362
363 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
364 disassembler output format.
365
cdb06167
HS
3662015-07-23 Ian Coolidge <icoolidge@google.com>
367 Plumb --pic-veneer option for gold.
368
369 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
370 generation.
371 * options.h (General_options): Add --pic-veneer option.
372
5b2af7dd
L
3732015-07-22 H.J. Lu <hongjiu.lu@intel.com>
374
375 PR gold/18663
376 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
377 script_test_1a.cc script_test_1b.cc.
378 (script_test_11_r.o): Replace script_test_11.o with
379 script_test_11a.o script_test_11b.o.
380 (script_test_11.o): Removed.
381 (script_test_11a.o): New.
382 (script_test_11b.o): Likewise.
383 * testsuite/Makefile.in: Regenerated.
384 * testsuite/script_test_1.h: New file.
385 * testsuite/script_test_1b.cc: Likewise.
386 * testsuite/script_test_11.h: Likewise.
387 * testsuite/script_test_11b.c: Likewise.
388 * testsuite/script_test_1.cc: Renamed to ...
389 * testsuite/script_test_1a.cc: This.
390 Include "script_test_1.h".
391 (main): Call check_int and check_ptr.
392 * testsuite/script_test_11.c: Renamed to ...
393 * testsuite/script_test_11a.c: This.
394 Include "script_test_11.h".
395 (main): Call ptr_equal.
396
cd78ea77
L
3972015-07-22 H.J. Lu <hongjiu.lu@intel.com>
398
399 PR gold/18628
400 * testsuite/ifuncdep2.c (global): Change protected to hidden.
401 * testsuite/ifuncmod1.c (global): Likewise.
402 * testsuite/ifuncmod5.c (global): Likewise.
403
f945ba50
AM
4042015-07-22 Alan Modra <amodra@gmail.com>
405
406 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
407
5417c94d
CC
4082015-07-21 Cary Coutant <ccoutant@gmail.com>
409
410 PR gold/18548
411 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
412 forced local symbol even when oldsym != NULL.
413 (Symbol_table::do_define_in_output_segment): Likewise.
414 (Symbol_table::do_define_as_constant): Likewise.
415
cb5cf5e2
CC
4162015-07-21 Cary Coutant <ccoutant@gmail.com>
417
b8c6c5ef 418 PR gold/18698
cb5cf5e2
CC
419 * archive.cc (Library_base::should_include_member): Don't use entry
420 point for relocatable links, or if target is not yet valid.
421 * parameters.cc (Parameters::entry): Check target_valid().
422
0ef3814f
HS
4232015-07-20 Han Shen <shenhan@google.com>
424
425 Optimize erratum 843419 fix.
426
427 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
428 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
429 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
430 (E843419_stub): New sub-class of Erratum_stub.
431 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
432 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
433 (AArch64_relobj::create_erratum_stub): Add 1 argument.
434 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
435
2bca0377
HS
4362015-07-20 Han Shen <shenhan@google.com>
437
438 Fix arm elf header flags wrt hardfp bit.
439
440 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
441
f54f5e31
L
4422015-07-20 H.J. Lu <hongjiu.lu@intel.com>
443
444 PR gold/18689
445 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
446 from input group section for relocatable link.
447 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
448 (check_DATA): Add pr18689.stdout.
449 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
450 (pr18689.stdout): New rule.
451 (pr18689a.o): Likewise.
452 (pr18689b.o): Likewise.
453 (pr18689.o): Likewise.
454 * testsuite/pr18689.c: New file.
455 * testsuite/pr18689.sh: Likewise.
456 * testsuite/Makefile.in: Regenerated.
457
c20ceeb2
YW
4582015-07-20 Yiran Wang <yiran@google.com>
459 Cary Coutant <ccoutant@gmail.com>
460
461 PR gold/15574
462 * resolve.cc (Symbol_table): Remove warning about references
463 from shared objects to hidden symbols.
464 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
465 * testsuite/Makefile.in: Regenerate.
466 * testsuite/hidden_test.sh: Check dynamic symbol table; update
467 expected error messages.
468
19a7fe52
L
4692015-07-14 H.J. Lu <hongjiu.lu@intel.com>
470
471 * compressed_output.cc (Output_compressed_section::set_final_data_size):
472 Make --compress-debug-sections=zlib the same as
473 --compress-debug-sections=zlib-gabi.
474 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
475 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
476 ".zdebug_".
477 * testsuite/Makefile.in: Regenerated.
478
fb8b9dbc
L
4792015-07-12 H.J. Lu <hongjiu.lu@intel.com>
480
481 PR gold/18322
482 * compressed_output.cc (zlib_compress): Add argument for
483 compression header size. Set header size to compression header
484 size if it isn't 0. Don't write out the zlib header here.
485 (Output_compressed_section::set_final_data_size): Support
486 zlib-gnu and zlib-gabi compressions. Pass compression header
487 size to zlib_compress and write out compression header. Set
488 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
489 clear the SHF_COMPRESSED bit
490 * options.h (compress_debug_sections): Add zlib-gnu and
491 zlib-gabi.
492 * output.h (Output_section::set_flags): New.
493 * testsuite/Makefile.am (check_PROGRAMS): Add
494 flagstest_compress_debug_sections_none,
495 flagstest_compress_debug_sections_gnu and
496 flagstest_compress_debug_sections_gabi.
497 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
498 flagstest_compress_debug_sections.stdout,
499 flagstest_compress_debug_sections.cmp,
500 flagstest_compress_debug_sections.check,
501 flagstest_compress_debug_sections_gnu.stdout,
502 flagstest_compress_debug_sections_gnu.cmp,
503 flagstest_compress_debug_sections_gnu.check,
504 flagstest_compress_debug_sections_gabi.stdout,
505 flagstest_compress_debug_sections_gabi.cmp and
506 flagstest_compress_debug_sections_gabi.check.
507 (flagstest_compress_debug_sections_none): New.
508 (flagstest_compress_debug_sections_none.stdout): Likewise.
509 (flagstest_compress_debug_sections.stdout): Likewise.
510 (flagstest_compress_debug_sections.check): Likewise.
511 (flagstest_compress_debug_sections.cmp): Likewise.
512 (flagstest_compress_debug_sections_gnu): Likewise.
513 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
514 (flagstest_compress_debug_sections_gnu.check): Likewise.
515 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
516 (flagstest_compress_debug_sections_gabi): Likewise.
517 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
518 (flagstest_compress_debug_sections_gnu.check): Likewise.
519 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
520 * testsuite/Makefile.in: Regenerated.
521
48058663
L
5222015-07-12 H.J. Lu <hongjiu.lu@intel.com>
523
524 PR gold/18321
525 * compressed_output.h (decompress_input_section): Add arguments
526 for ELF class, big endian and sh_flags.
527 * compressed_output.cc (decompress_input_section): Likewise.
528 Support the SHF_COMPRESSED section.
529 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
530 functions.
531 * plugin.h (Pluginobj): Likewise.
532 * layout.cc (Layout::get_output_section_flags): Also clear the
533 SHF_COMPRESSED bit.
534 * object.h (Compressed_section_info): Add flag to store sh_flags.
535 (Object): Add pure virtual elfsize and is_big_endian member
536 functions.
537 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
538 prefix here.
539 (build_compressed_section_map): Check SHF_COMPRESSED for
540 uncompressed size. Store sh_flags in Compressed_section_info.
541 Pass size, big_endian and sh_flags to decompress_input_section.
542 Skip the ".debug"/".zdebug" prefix when passing section name to
543 need_decompressed_section.
544 (Sized_relobj_file<size, big_endian>::do_find_special_section):
545 Don't check ".zdebug_*" sections.
546 (Object::decompressed_section_contents): Pass ELF class, big
547 endian and sh_flags to decompress_input_section.
548 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
549 Likewise.
550 * testsuite/Makefile.am (check_DATA): Add
551 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
552 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
553 gdb_index_test_2_gabi.stdout.
554 (debug_msg_cdebug_gabi.o): New.
555 (odr_violation1_cdebug_gabi.o): Likewise.
556 (odr_violation2_cdebug_gabi.o): Likewise.
557 (debug_msg_cdebug_gabi.err): Likewise.
558 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
559 (gdb_index_test_cdebug_gabi.o): Likewise.
560 (gdb_index_test_2_gabi): Likewise.
561 (gdb_index_test_2_gabi.stdout): Likewise.
562 * testsuite/gdb_index_test_2_gabi.sh: New file.
563 * testsuite/Makefile.in: Regenerated.
564
73854cdd
HS
5652015-07-09 Han Shen <shenhan@google.com>
566
567 Use "gold_info" instead of "gold_warning" for erratum fix.
568
569 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
570 'gold_info'.
571 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
572
61163dfa
HS
5732015-07-09 Han Shen <shenhan@google.com>
574
575 Drop missing symbol warning for arm/aarch64.
576
577 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
578 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
579 symbol warning.
580
b91deca9
HS
5812015-07-07 Han Shen <shenhan@google.com>
582
583 Make gold aarch64 accept long form of mapping symbols.
584
585 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
586 of mapping symbols.
587
15162bef
DK
5882015-06-29 Doug Kwan <dougkwan@google.com>
589
590 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
591 at address expected by test.
592 * testsuite/arm_cortex_a8_b.s: Ditto.
593 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
594 * testsuite/arm_cortex_a8_bl.s: Ditto.
595 * testsuite/arm_cortex_a8_blx.s: Ditto.
596 * testsuite/arm_cortex_a8_local.s: Ditto.
597 * testsuite/arm_fix_v4bx.s: Ditto.
598 * testsuite/arm_unaligned_reloc.s: Ditto.
599 * testsuite/thumb_bl_out_of_range.s: Ditto.
600 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
601 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 602
56b06706
HS
6032015-06-29 Han Shen <shenhan@google.com>
604
605 Patch for erratum 843419 internal error.
606
72f4393d
L
607 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
608 (Erratum_stub::update_erratum_insn): New method.
609 (Stub_table::relocate_stubs): Modified to place relocated insn.
610 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 611
2f0c79aa
HS
6122015-06-12 Han Shen <shenhan@google.com>
613
614 Fix erratum 835769.
615
72f4393d
L
616 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
617 defintion outside class definition.
618 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
619 (AArch64_insn_utilities::aarch64_op31): New member.
620 (AArch64_insn_utilities::aarch64_ra): New member.
621 (AArch64_insn_utilities::aarch64_mac): New member.
622 (AArch64_insn_utilities::aarch64_mlxl): New member.
623 (ST_E_835769): New global enum member.
624 (Stub_table::relocate_stubs): Add 835769 handler.
625 (Stub_template_repertoire::Stub_template_repertoire): Install new
626 stub type.
627 (AArch64_relobj::scan_errata): This func is renamed from
628 scan_erratum_843419.
629 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
630 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
631 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
632 (Target_aarch64::scan_erratum_835769_span): New method.
633 (Target_aarch64::create_erratum_stub): New method.
634 (Target_aarch64::is_erratum_835769_sequence): New method.
635 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
636 code into create_erratum_stub.
637 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 638
5d7908e0
CC
6392015-06-11 Cary Coutant <ccoutant@gmail.com>
640
641 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
642 outside class body.
643 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
644
dd68f8fa
CC
6452015-06-11 Cary Coutant <ccoutant@gmail.com>
646
647 PR gold/17731
648 * layout.cc (corresponding_uncompressed_section_name): New function.
649 (Layout::choose_output_section): Call it.
650 * layout.h (corresponding_uncompressed_section_name): New function.
651 * script-sections.cc (Input_section_info::set_section_name): Check
652 for compressed debug section (.zdebug style).
653
a3a0c391
JY
6542015-06-11 Jing Yu <jingyu@google.com>
655
656 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
657 * testsuite/Makefile.in: Regenerate.
658
970cdef2
DI
6592015-06-11 Davide Italiano <dccitaliano@gmail.com>
660
661 * gold.h (is_cident): Correct typo.
662
a48d0c12
HS
6632015-06-10 Han Shen <shenhan@google.com>
664 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
665
666 Now fixing for 843419 is fully functional.
667
668 The first part of the erratum fix CL is here -
669 https://sourceware.org/ml/binutils/2015-04/msg00229.html
670
671 * aarch64.cc(global enum): New constants representing stub types.
672 (Stub_template): New POD struct.
673 (Stub_template_repertoire): New class.
674 (Stub_base): New class.
675 (Erratum_stub): New class.
676 (Reloc_stub): Refactored to be a subclass of Stub_base.
677 (Reloc_stub::Stub_type): Removed.
678 (Reloc_stub::offset): Moved to Stub_base.
679 (Reloc_stub::set_offset): Moved to Stub_base.
680 (Reloc_stub::destination_address): Moved to Stub_base.
681 (Reloc_stub::set_destination_address): Moved to Stub_base.
682 (Reloc_stub::reset_destination_address): Moved to Stub_base.
683 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
684 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
685 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
686 (Reloc_stub::write): Moved to Stub_base.
687 (Reloc_stub::invalid_offset): Moved to Stub_base.
688 (Reloc_stub::invalid_address): Moved to Stub_base.
689 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
690 (Reloc_stub::stub_insns_): Moved to Stub_base.
691 (Reloc_stub::offset_): Moved to Stub_base.
692 (Reloc_stub::destination_address_): Moved to Stub_base.
693 (Stub_table::The_aarch64_relobj): New typedef.
694 (Stub_table::The_erratum_stub): New typedef.
695 (Stub_table::The_erratum_stub_less): New typedef.
696 (Stub_table::The_erratum_stub_set): New typedef.
697 (Stub_table::The_erratum_stub_set_iter): New typedef.
698 (Stub_table::empty): Added emptiness testing for erratum stubs.
699 (Stub_table::add_erratum_stub): New method to add an erratum stub.
700 (Stub_table::find_erratum_stub): New method.
701 (Stub_table::find_erratum_stubs_for_input_section): New method.
702 (Stub_table::erratum_stub_address): New method.
703 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
704 (Stub_table::do_addralign): Modified to handle erratum stubs.
705 (Stub_table::erratum_stubs_): New member.
706 (Stub_table::erratum_stub_size_): New member.
707 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
708 (Stub_table::do_write): Modified to handle erratum stubs.
709 (AArch64_relobj::The_erratum_stub): New typedef.
710 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
711 (AArch64_relobj::fix_errata): New method.
712 (Target_aarch64::The_reloc_stub_type): Removed.
713 (Target_aarch64::The_erratum_stub): New typede.
714 (AArch64_relocate_functions::construct_b): New method.
715
1e1b2efc
NC
7162015-06-08 Nick Clifton <nickc@redhat.com>
717
718 * po/fr.po: New French Translation.
719
b8cf5075
CC
7202015-06-07 Cary Coutant <ccoutant@gmail.com>
721
722 PR gold/18288
723 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
724 callers. Don't use STT_COMMON to check for common symbols.
725 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
726 symbol that's not in a common section.
727 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
728 common symbols.
729
bdd2d2b7
CC
7302015-06-04 Cary Coutant <ccoutant@gmail.com>
731
732 PR gold/18200
733 * Makefile.am (diststuff): Add target.
734 * Makefile.in: Regenerate.
735
cd3c333f
CC
7362015-06-04 Cary Coutant <ccoutant@gmail.com>
737
738 PR gold/17498
739 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
740 temporary locals in merge sections.
741 * options.cc (General_options::parse_discard_all): New method.
742 (General_options::parse_discard_locals): New method.
743 (General_options::parse_discard_none): New method.
744 (General_options::General_options): Initialize discard_locals_.
745 * options.h (--discard-all): Convert to special option.
746 (--discard-locals): Likewise.
747 (--discard-none): New option.
748 (General_options::discard_all): New method.
749 (General_options::discard_locals): New method.
750 (General_options::discard_sec_merge): New method.
751 (General_options::Discard_locals): New enum.
752 (General_options::discard_locals_): New data member.
753
8086551f
CC
7542015-06-03 Cary Coutant <cary@google.com>
755
756 * script-sections.cc (Script_sections::Script_sections): Initialize
757 segments_created_.
758 (Script_sections::create_note_and_tls_segments): Set flag when
759 segments are created.
760 (Script_sections::expected_segment_count): Count PT_INTERP.
761 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
762 segments are created.
763 * script-sections.h (Script_sections::segments_created_): New data
764 member.
765
374082df
CC
7662015-06-03 Cary Coutant <ccoutant@gmail.com>
767
768 PR gold/15370
769 * script-sections.cc
770 (Output_section_element_input::set_section_addresses): When there
771 are several patterns with no sort spec, put all sections in the same
772 bin.
773 * testsuite/Makefile.am (script_test_12): New testcase.
774 (script_test_12i): New testcase.
775 * testsuite/Makefile.in: Regenerate.
776 * testsuite/script_test_12.t: New test linker script.
777 * testsuite/script_test_12i.t: New test linker script.
778 * testsuite/script_test_12a.c: New test source file.
779 * testsuite/script_test_12b.c: New test source file.
780
775ed62e
CC
7812015-06-02 Cary Coutant <ccoutant@gmail.com>
782
783 * nacl.h (Sniff_file): Switch parameters to get_view to get an
784 aligned view.
785
9c7fe3c5
CC
7862015-06-03 Cary Coutant <ccoutant@gmail.com>
787
72f4393d
L
788 PR gold/17819
789 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
790 separate task to schedule the build id computation.
791 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
792 add Output_file and offset.
793 (Hash_task::run): Get and release the input views.
794 (Hash_task::is_runnable): Always return NULL (always runnable).
795 (Layout::queue_build_id_tasks): Remove.
796 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
797 parameters; use them instead of class members.
798 (Build_id_task_runner::run): New function.
799 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
800 to write_build_id.
801 * layout.h (Layout::queue_build_id_tasks): Remove.
802 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
803 parameters.
804 (Layout::array_of_hashes_): Remove.
805 (Layout::size_of_array_of_hashes_): Remove.
806 (Layout::input_view_): Remove.
807 (Build_id_task_runner): New class.
808 (Close_task_runner::Close_task_runner): Add array_of_hashes and
809 size_of_hashes parameters.
810 (Close_task_runner::array_of_hashes_): New data member.
811 (Close_task_runner::size_of_hashes_): New data member.
812 * testsuite/Makefile.am
813 (flagstest_compress_debug_sections_and_build_id_tree): New test.
814 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 815
400f8944
RÁE
8162015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
817
818 * merge.cc (get_input_merge_map): Update for data structure change.
819 (get_or_make_input_merge_map): Update for data structure change.
820 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
821 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
822
bbec1a5d
AM
8232015-05-16 Alan Modra <amodra@gmail.com>
824
825 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
826 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
827 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
828 (lis_0): Rename from lis_0_0.
829
efc6fa12
CC
8302015-04-29 Cary Coutant <cary@google.com>
831 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
832
833 * gc.h (Garbage_collection::is_section_garbage): Change Object*
834 to Relobj*.
835 (Garbage_collection::add_reference): Likewise.
836 (Garbage_collection::gc_process_relocs): Likewise. Don't push
837 object/shndx pair onto *secvec for dynamic objects. Don't follow
838 relocations pointing to dynamic objects for GC.
839 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
840 (Icf::unfold_section): Likewise.
841 (Icf::is_section_folded): Likewise.
842 (Icf::get_folded_section): Likewise.
843 * icf.h: (Icf::get_folded_section): Likewise.
844 (Icf::unfold_section): Likewise.
845 (Icf::is_section_folded): Likewise.
846 (Icf::section_has_function_pointers): Likewise.
847 (Icf::set_section_has_function_pointers): Likewise.
848 * object.h (Section_id): Likewise.
849 (Const_section_id): Likewise.
850 * output.cc (Output_section::update_section_layout): Likewise.
851 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
852 Likewise.
853 * plugin.cc (update_section_order): Likewise.
854 (unique_segment_for_sections): Likewise.
855 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
856 (Target_powerpc::do_gc_add_reference): Likewise.
857 (Target_powerpc::gc_process_relocs): Likewise.
858 (Target_powerpc::do_gc_add_reference): Likewise.
859 * symtab.cc (Symbol_table::is_section_folded): Likewise.
860 (Symbol_table::gc_mark_symbol): Likewise.
861 * symtab.h: (Symbol_table::is_section_folded): Likewise.
862 * target.h: (Sized_target::gc_add_reference): Likewise.
863 (Sized_target::do_gc_add_reference): Likewise.
864
f9d3ecaa
NC
8652015-04-29 Nick Clifton <nickc@redhat.com>
866
867 * po/fi.po: Updated Finnish translation.
868
faa2211d
AM
8692015-04-28 Alan Modra <amodra@gmail.com>
870
871 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
872 than unsigned int for find_global_entry result temp. Compare
873 against invalid_address.
874 (Target_powerpc::do_plt_address_for_global): Likewise.
875 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
876 on plt call stub existence for debug info. Do assert for plt
877 and global entry stub existence if an alloc section.
878
6ec65f28
AM
8792015-04-28 Alan Modra <amodra@gmail.com>
880
881 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
882 on missing global entry stub due to bogus debug info.
883
7a2a1c79
HS
8842015-04-27 Han Shen <shenhan@google.com>
885
886 * options.h (--fix-cortex-a53-843419): Rename option.
887 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
888 option.
889 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
890
cfbf0e3c
RÁE
8912015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
892
893 PR gold/18327
894 * output.cc (Output_section::is_input_address_mapped): Assume a missing
895 entry is mapped.
896 * testsuite/Makefile.am: Add the eh_test test.
897 * testsuite/Makefile.in: Regenerate.
898 * testsuite/eh_test_a.cc: New test.
899 * testsuite/eh_test_b.cc: New test.
900
6ec65f28
AM
9012015-04-23 Sriraman Tallam <tmsriram@google.com>
902
a100d66f
ST
903 * options.h (--weak-unresolved-symbols): New option.
904 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
905 binding to weak with new option.
906 * symtab.h (is_weak_undefined): Check for new option.
907 (is_strong_undefined): Check for new option.
908 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
909 * testsuite/Makefile.in: Regenerate.
910 * testsuite/weak_unresolved_symbols_test.cc: New file.
911
4b889c30
IC
9122015-04-20 Ian Coolidge <icoolidge@google.com>
913
914 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
915 GNU_UNIQUE.
916
4277535c
RÁE
9172015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
918
919 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
920 push_back.
921 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
922 * object.cc (Sized_relobj_file::do_layout): Use push_back.
923 * powerpc.cc (process_gc_mark): Use push_back.
924 (Target_powerpc::do_gc_mark_symbol): Use push_back.
925 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
926
7a2a1c79 9272015-04-16 Han Shen <shenhan@google.com>
5019d64a 928
6ec65f28
AM
929 * aarch64.cc (AArch64_insn_utilities): New utility class.
930 (AArch64_relobj::Mapping_symbol_position): New struct.
931 (AArch64_relobj::Mapping_symbol_info): New typedef.
932 (AArch64_relobj::do_count_local_symbols): New function overriding
933 parent's implementation.
934 (AArch64_relobj::mapping_symbol_info_): New member
935 (AArch64_relobj::scan_erratum_843419): New method.
936 (Target_aarch64::scan_erratum_843419_span): New method.
937 (Target_aarch64::is_erratum_843419_sequence): New method.
938 * options.h (fix_cortex_a53): New option.
5019d64a 939
a6a17750
CC
9402015-04-09 Cary Coutant <ccoutant@google.com>
941
942 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
943 in a PIE link.
944 * testsuite/Makefile.am (tls_pie_test.sh): New test.
945 * testsuite/Makefile.in: Regenerate.
946 * testsuite/tls_pie_test.sh: New.
947
437ddf0c
CC
9482015-04-09 Cary Coutant <ccoutant@google.com>
949
950 * debug.h (DEBUG_LOCATION): New.
951 (DEBUG_ALL): Include DEBUG_LOCATION.
952 (debug_string_to_enum): Add DEBUG_LOCATION.
953 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
954 output to print correct context.
955 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
956 up to 4 more locations at the beginning of the function.
957 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
958 result before sorting list of line numbers.
959 * testsuite/debug_msg.sh: Allow range of line numbers for
960 canonical results on optimized code.
961
24491327
HS
9622015-04-07 HC Yen <hc.yen@mediatek.com>
963
964 Add AArch32 support for gold linker.
965 gold/
966 * arm.cc: Add V8 arch combine table.
967
7fa5525f
RÁE
9682015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
969
970 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
971
5368dcf2
RÁE
9722015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
973
974 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
975 to find by using the return value of insert.
976
9dbb4b02
RÁE
9772015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
978
979 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
980 constructor call.
981
1fa29f10
IT
9822015-04-06 Ilya Tocar <ilya.tocar@intel.com>
983
984 PR gold/17641
985 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
986 (Target_x86_64::Scan::local): Don't create GOT entry, when we
987 can convert mov to lea.
988 (Target_x86_64::Scan::global): Ditto.
989 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
990 %reg to lea foo(%rip), %reg if possible.
991 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
992 * testsuite/x86_64_mov_to_lea1.s: New.
993 * testsuite/x86_64_mov_to_lea2.s: Ditto.
994 * testsuite/x86_64_mov_to_lea3.s: Ditto.
995 * testsuite/x86_64_mov_to_lea4.s: Ditto.
996 * testsuite/x86_64_mov_to_lea.sh: Ditto.
997
39f3de7c
L
9982015-04-02 H.J. Lu <hongjiu.lu@intel.com>
999
1000 * configure: Regenerated.
1001
c4fc4724
IT
10022015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1003
1004 PR gold/17640
1005 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1006 (Target_i386::Scan::local): Don't create GOT entry, when we
1007 can convert GOT to GOTOFF.
1008 (Target_i386::Scan::global): Ditto.
1009 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1010 lea foo@GOTOFF(%reg), %reg if possible.
1011 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1012 * testsuite/i386_mov_to_lea1.s: New.
1013 * testsuite/i386_mov_to_lea2.s: Ditto.
1014 * testsuite/i386_mov_to_lea3.s: Ditto.
1015 * testsuite/i386_mov_to_lea4.s: Ditto.
1016 * testsuite/i386_mov_to_lea5.s: Ditto.
1017 * testsuite/i386_mov_to_lea.sh: Ditto.
1018
918357b9
L
10192015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1020
1021 * Makefile.am (ZLIB): New.
1022 (ZLIBINC): Likewise.
1023 (AM_CFLAGS): Add $(ZLIBINC).
1024 (AM_CXXFLAGS): Likewise.
1025 (ldadd_varldadd_var): Add $(ZLIB).
1026 (incremental_dump_LDADD): Likewise.
1027 (dwp_LDADD): Likewise.
1028 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1029 <zlib.h>.
1030 (zlib_compress): Don't check HAVE_ZLIB_H.
1031 (zlib_decompress): Likewise.
1032 * options.h (compress_debug_sections): Likewise.
1033 * configure.ac (AM_CONDITIONAL): Removed.
1034 * testsuite/Makefile.am (ZLIB): New.
1035 (LDADD): Add $(ZLIB).
1036 Don't check HAVE_ZLIB.
1037 * Makefile.in: Regenerated.
1038 * config.in: Likewise.
1039 * configure: Likewise.
1040 * testsuite/Makefile.in: Likewise.
1041
6b0ad2eb
JY
10422015-03-30 Jing Yu <jingyu@google.com>
1043
1044 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1045 TLSLD_ADD_DTPREL_LO12_NC.
1046 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1047 _TLS_MODULE_BASE_ point to the start of tls segment.
1048 (Target_aarch64::optimize_tls_reloc): Add cases for
1049 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1050 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1051 (Target_aarch64::Scan::local): Likewise.
1052 (Target_aarch64::Scan::global): Likewise.
1053 (Target_aarch64::Relocate::relocate): Likewise.
1054 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1055 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1056 relocations.
1057
0916f9e7
RÁE
10582015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1059
1060 * merge.cc (Object_merge_map::add_mapping): call
1061 Object_merge_map::Input_merge_map::add_mapping.
1062 (Object_merge_map::Input_merge_map::add_mapping): New.
1063 (Output_merge_data::do_add_input_section): Call
1064 get_or_make_input_merge_map before a loop.
1065 (Output_merge_string<Char_type>::finalize_merged_data): Call
1066 get_or_make_input_merge_map before a loop.
1067 * merge.h (Object_merge_map): Make Input_merge_map public.
1068 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1069 (Relobj::get_or_create_merge_map): New.
1070 * object.h (Relobj::get_or_create_merge_map): New.
1071
282c9750
AM
10722015-03-24 Alan Modra <amodra@gmail.com>
1073
1074 PR 18147
1075 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1076 relocation errors for branches to strong undefined symbols.
1077
67f95b96
RÁE
10782015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1079
1080 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1081 (Object_merge_map::is_merge_section_for): Remove.
1082 (Object_merge_map::find_merge_section): New.
1083 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1084 (Object_merge_map::find_merge_section): New.
1085 (Object_merge_map::get_input_merge_map): Add a const version.
1086 * object.cc (Relobj::is_merge_section_for): Remove.
1087 (Relobj::find_merge_section): New.
1088 * object.h (Relobj::is_merge_section_for): Remove.
1089 (Relobj::find_merge_section): New.
1090 * output.cc
1091 (Output_section::Input_section::is_merge_section_for): Remove.
1092 (Output_section::add_merge_input_section): Don't call
1093 add_merge_input_section.
1094 (Output_section::find_merge_section): Return const. Use
1095 object->find_merge_section.
1096 (Output_section::build_lookup_maps): Don't build a map for
1097 merge sections.
1098 (Output_section::is_input_address_mapped): Return false if
1099 section is not found.
1100 (Output_section::find_starting_output_address): Use
1101 find_merge_section instead of is_merge_section_for.
1102 (Output_section::add_script_input_section): Don't build a map for
1103 merge sections.
1104 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1105 (Output_section_lookup_maps::find_merge_section): Remove.
1106 (Output_section_lookup_maps::add_merge_input_section) Remove.
1107 (Output_section::find_merge_section): Return const.
1108
152f7024
CC
11092015-03-22 Cary Coutant <cary@google.com>
1110
1111 PR gold/18106
1112 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1113 non-SIB form of lea, with nop after the call.
1114
bccffdfd
CC
11152015-03-21 Cary Coutant <cary@google.com>
1116
1117 PR gold/14217
1118 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1119 .tdata section.
1120 (Output_segment::set_section_addresses): Don't align size of relro
1121 segment for .tbss.
1122
1c582fe7
CC
11232015-03-21 Cary Coutant <cary@google.com>
1124
1125 PR gold/18010
1126 * stringpool.cc (Stringpool_template): Don't optimize if section
1127 alignment is greater than sizeof(char).
1128
410da591
CC
11292015-03-21 Cary Coutant <cary@google.com>
1130
1131 PR gold/18048
1132 * script-c.h (script_include_directive): Add first_token parameter.
1133 * script.cc (script_include_directive): Add first_token parameter, and
1134 pass it to read_script_file.
1135 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1136 (PARSING_MEMORY_DEF): New tokens.
1137 (top): Add new productions for INCLUDE files.
1138 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1139 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1140 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1141 (section_cmd): Pass PARSING_SECTION_CMDS.
1142 (file_or_sections_cmd): Remove.
1143 (memory_def): Pass PARSING_MEMORY_DEF.
1144 * testsuite/Makefile.am (memory_test_2): New test.
1145 * testsuite/Makefile.in: Regenerate.
1146 * testsuite/memory_test_inc.t: New script file.
1147 * testsuite/memory_test_inc_1.t.src: New script file.
1148 * testsuite/memory_test_inc_2.t.src: New script file.
1149 * testsuite/memory_test_inc_3.t.src: New script file.
1150
0d5bbdb0
CC
11512015-03-21 Cary Coutant <cary@google.com>
1152
1153 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1154 (Sized_relobj_dwo::setup): Build compressed section map.
1155 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1156 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1157 section map.
1158 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1159 compressed_sections_ field.
1160 (build_compressed_section_map): Take Object instead of
1161 Sized_relobj_file parameter; add decompress_if_needed parameter.
1162 (Sized_relobj_file::do_find_special_sections): Store compressed
1163 section map in parent Object.
1164 (Sized_relobj_file::do_decompressed_section_contents): Move
1165 implementation to Object::decompressed_section_contents.
1166 (Sized_relobj_file::do_discard_decompressed_sections): Move
1167 implementation to Object::discard_decompressed_sections.
1168 * object.h (build_compressed_section_map): Declare.
1169 (Object::Object): Add compressed_sections_ field.
1170 (Object::section_is_compressed): Move implementation here.
1171 (Object::decompressed_section_contents): De-virtualize.
1172 (Object::discard_decompressed_sections): De-virtualize.
1173 (Object::do_section_is_compressed): Delete.
1174 (Object::do_decompressed_section_contents): Delete.
1175 (Object::set_compressed_sections): New method.
1176 (Object::compressed_sections): New method.
1177 (Object::compressed_sections_): New data member.
1178 (Compressed_section_info, Compressed_section_map): Move to top of file.
1179 (Sized_relobj_file::do_section_is_compressed): Delete.
1180 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1181 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1182 (Sized_relobj_file::compressed_sections_): Move to Object class.
1183
bd9e0d46
CC
11842015-03-21 Cary Coutant <ccoutant@google.com>
1185
1186 PR gold/18152
1187 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1188 deferred objects.
1189
943c8b43
CC
11902015-03-11 Cary Coutant <ccoutant@google.com>
1191
1192 * options.cc (General_options::finalize): Don't allow -z relro
1193 with incremental linking.
1194 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1195 (incremental_test_2): Likewise.
1196 (incremental_test_3): Likewise.
1197 (incremental_test_4): Likewise.
1198 (incremental_test_5): Likewise.
1199 (incremental_test_6): Likewise.
1200 (incremental_copy_test): Likewise.
1201 (incremental_common_test_1): Likewise.
1202 (incremental_comdat_test_1): Likewise.
1203 * testsuite/Makefile.in: Regenerate.
1204
e1663197
CC
12052015-03-09 Cary Coutant <ccoutant@google.com>
1206
1207 PR gold/14675
1208 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1209 return enum indicating whether .eh_frame section is empty, optimizable,
1210 unrecognized, or an end marker. Adjust explicit instantiations.
1211 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1212 (Eh_frame::add_ehframe_input_section): Change return type.
1213 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1214 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1215 to the .eh_frame output section until we see the end marker.
1216 (Layout::finalize_eh_frame_section): New.
1217 * layout.h: (Layout::finalize_eh_frame_section): New.
1218
beb8418f
L
12192015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1220
1221 * output.cc (Relobj::initialize_input_to_output_map<size>):
1222 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1223
48c73428
CC
12242015-03-04 Cary Coutant <ccoutant@google.com>
1225
1226 * parameters.cc (Parameters::set_target_once): Call
1227 Target::select_as_default_target just once from here...
1228 (set_parameters_target): ...instead of from here.
1229
12302015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1231
1232 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1233 Output_section_data instead of a Merge_map.
1234 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1235 (Eh_frame::read_cie): Use add_merge_mapping instead of
1236 Merge_map::add_mapping.
1237 (Eh_frame::read_fde): Ditto.
1238 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1239 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1240 merge_map_->get_output_offset.
1241 (Eh_frame::do_is_merge_section_for): Delete.
1242 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1243 instead of a Merge_map.
1244 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1245 Merge_map.
1246 (Eh_frame::do_is_merge_section_for): Delete.
1247 (Eh_frame::merge_map_): Delete.
1248 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1249 and use a Output_section_data instead of a Merge_map.
1250 (Object_merge_map::add_mapping): Ditto.
1251 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1252 (Object_merge_map::is_merge_section_for): Pass in and use a
1253 Output_section_data instead of a Merge_map.
1254 (Merge_map): Delete.
1255 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1256 of merge_map_.get_output_offset.
1257 (Output_merge_base::do_is_merge_section_for): Delete.
1258 (Output_merge_data::do_add_input_section): Use
1259 object->add_merge_mapping instead of add_mapping.
1260 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1261 * merge.h (Merge_map): Delete forward declaration.
1262 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1263 instead of a Merge_map.
1264 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1265 (Object_merge_map::is_merge_section_for): Pass in and use a
1266 Output_section_data instead of a Merge_map.
1267 (Input_merge_map::Object_merge_map::merge_map): Replace with
1268 output_data.
1269 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1270 Output_section_data instead of a Merge_map.
1271 (Merge_map): Delete.
1272 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1273 (Output_merge_base::do_is_merge_section_for): Delete.
1274 (Output_merge_base::add_mapping): Delete.
1275 (Output_merge_base::merge_map_): Delete.
1276 * object.cc (Relobj::initialize_input_to_output_map): New.
1277 (Relobj::initialize_input_to_output_map): New.
1278 (Relobj::merge_output_offset): New.
1279 (Relobj::is_merge_section_for): New.
1280 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1281 bits.
1282 * object.h (Relobj::merge_map): Delete.
1283 (initialize_input_to_output_map): New.
1284 (set_merge_map): Delete.
1285 (add_merge_mapping): New.
1286 (merge_output_offset): New.
1287 (is_merge_section_for): New.
1288 * output.cc (Output_section::Input_section::is_merge_section_for):
1289 Use object->is_merge_section_for.
1290 * output.h (Output_section_data::is_merge_section_for): Delete.
1291 (Output_section_data::do_is_merge_section_for): Delete.
1292 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1293 Use object->initialize_input_to_output_map.
1294 (Merged_symbol_value<size>::value_from_output_section): Use
1295 object->merge_output_offset.
1296
48c73428 12972015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1298 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1299
1300 * output.cc (Output_section::add_merge_input_section): Do not
1301 attempt to merge sections with an entsize of 0.
1302
48c73428 13032015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1304
1305 * attributes.h (class Output_attributes_section_data ): Add
1306 do_print_to_mapfile function.
1307
ec86f434
AM
13082015-02-24 Alan Modra <amodra@gmail.com>
1309
1310 PR 18010
1311 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1312 complain if value is not a multiple of four.
1313 (Target_powerpc::Relocate::relocate): Correct handling of
1314 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1315
be66981e
L
13162015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1317
1318 * configure.ac (default_size): Set to 32 for x32.
1319 * configure: Regenerated.
1320
e3ee8ed4
AM
13212015-02-18 Alan Modra <amodra@gmail.com>
1322
1323 PR 17954
1324 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1325 visibility.
1326
3a935c6c
RÁE
13272015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1328
1329 * gc.h (Garbage_collection::add_reference): Don't use find.
1330
e0a1e121
RÁE
13312015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1332
1333 * object.cc (write_local_symbols): avoid std::vector copy.
1334
45a4fb1a
RÁE
13352015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1336
1337 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1338
2d9afefe
MW
13392015-02-09 Mark Wielaard <mjw@redhat.com>
1340
1341 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1342 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1343
e9c1bdad
CC
13442015-02-16 Cary Coutant <ccoutant@google.com>
1345
1346 PR gold/13577
1347 PR gold/16992
1348 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1349 DF_SYMBOLIC if --dynamic-list option is used.
1350 * options.cc (General_options::finalize): --dynamic-list is not
1351 mutually exclusive with -Bsymbolic.
1352 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1353 listed in --dynamic-list.
1354 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1355 -Bsymbolic-functions.
1356 * testsuite/Makefile.in: Regenerate.
1357
0ed4b0bf
CC
13582015-02-16 Cary Coutant <ccoutant@google.com>
1359
1360 PR gold/17971
1361 * incremental.cc: Remove redundant include of "output.h".
1362
1a920511
JY
13632015-02-12 Jing Yu <jingyu@google.com>
1364
1365 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1366 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1367 New relocation.
1368 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1369 TLSLE_MOVW_* relocations.
1370 (Target_aarch64::Scan::global): Likewise.
1371 (Target_aarch64::Relocate::relocate): Likewise.
1372 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1373 for new TLSLE_MOVW_* relocations.
1374
07f107f3
WN
13752015-02-11 Will Newton <will.newton@linaro.org>
1376
1377 PR gold/13321
1378 * arm.cc (Target_arm::make_plt_section): Create an ARM
1379 state mapping symbol at the start of the PLT.
1380
e051a5b5
L
13812015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1382
1383 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1384 Replace two_file_shared_2.so with two_file_shared_1.so.
1385 * testsuite/Makefile.in: Regenerated.
1386
dddcc5b9
AM
13872015-02-09 Alan Modra <amodra@gmail.com>
1388
1389 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1390 plugin_test_thin.a and defsym_test.
1391 * testsuite/Makefile.in: Regenerate.
1392
b39b8b9d
RÁE
13932015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1394
1395 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1396 body.
1397
b66d1c52
CC
13982015-02-04 Peter Collingbourne <pcc@google.com>
1399
1400 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1401 forwarding symbols when computing symbol resolution info for plugins.
1402 * plugin.h (Plugin_manager::symtab): New method.
1403 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1404
23081de0
CC
14052015-02-03 Cary Coutant <ccoutant@google.com>
1406 Peter Collingbourne <pcc@google.com>
1407
1408 PR gold/15660
1409 * archive.cc (Thin_archive_object_unlocker): New class.
1410 (Archive::include_member): Unlock external members of thin archives.
1411 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1412 (plugin_test_2): Likewise.
1413 (plugin_test_3): Likewise.
1414 (plugin_test_4): Likewise.
1415 (plugin_test_5): Likewise.
1416 (plugin_test_6): Likewise.
1417 (plugin_test_7): Likewise.
1418 (plugin_test_8): Likewise.
1419 (plugin_test_9): Likewise.
1420 (plugin_test_10): Likewise.
1421 (plugin_test_11): New test case.
1422 * testsuite/Makefile.in: Regenerate.
1423 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1424 file to decide whether to claim file.
1425 (all_symbols_read_hook): Likewise.
1426 * testsuite/plugin_test_1.sh: Adjust expected output.
1427 * testsuite/plugin_test_2.sh: Likewise.
1428 * testsuite/plugin_test_3.sh: Likewise.
1429 * testsuite/plugin_test_6.sh: Likewise.
1430 * testsuite/plugin_test_tls.sh: Likewise.
1431 * testsuite/plugin_test_11.sh: New testcase.
1432
14332015-02-03 Cary Coutant <ccoutant@google.com>
1434
1435 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1436 file descriptors when debugging enabled. Add debug output.
1437 (Descriptors::release): Add debug output.
1438 (Descriptors::close_some_descriptor): Likewise.
1439 (Descriptors::close_all): Likewise.
1440 * fileread.cc (File_read::lock): Likewise.
1441 (File_read::unlock): Likewise.
1442
24dd5808
CC
14432015-02-02 Cary Coutant <ccoutant@google.com>
1444
1445 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1446 executable output file.
1447
fa89cc82
HS
14482015-01-22 Han Shen <shenhan@google.com>
1449
1450 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1451 (Target_arm::do_plt_address_for_global): New method.
1452 (Target_arm::do_plt_address_for_local): New method.
1453 (Target_arm::rel_irelative_section): New method.
1454 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1455 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1456 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1457 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1458 (Target_arm::Scan::check_non_pic): Add ifunc support.
1459 (Target_arm::Scan::local): Add ifunc support.
1460 (Target_arm::Scan::global): Add ifunc support.
1461 (Target_arm::make_plt_section): New method.
1462 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1463 (Target_arm::make_local_ifunc_plt_entry): New method.
1464 (Target_arm::got_irelative_): New member.
1465 (Target_arm::rel_irelative_): New member.
1466 (Target_arm::got_section): Add creation for got_irelative_.
1467 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1468 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1469 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1470 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1471 (Output_data_plt_arm::IRelative_data): New type.
1472 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1473 (Output_data_plt_arm::add_entry): Add more parameters.
1474 (Output_data_plt_arm::add_relocation): New method.
1475 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1476 (Output_data_plt_arm::rel_irelative): New method.
1477 (Output_data_plt_arm::entry_count): Modified.
1478 (Output_data_plt_arm::address_for_global): New method.
1479 (Output_data_plt_arm::address_for_local): New method.
23081de0 1480gold/
fa89cc82
HS
1481 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1482 (Output_data_plt_arm::insert_irelative_data): New method.
1483 (Output_data_plt_arm::irelative_rel_): New member.
1484 (Output_data_plt_arm::got_): New member.
1485 (Output_data_plt_arm::got_irelative_): New member.
1486 (Output_data_plt_arm::irelative_count_): New member.
1487 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1488 (Output_data_plt_arm::irelative_data_vec_): New member.
1489 (Output_data_plt_arm::do_write): Write out irelative entries.
1490 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1491 more parameters to ctor.
1492 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1493 more parameters to ctor.
1494 * output.h (Output_data_reloc::add_local_relative): New method.
1495 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1496
0f81d3f0
AM
14972015-01-29 Alan Modra <amodra@gmail.com>
1498
1499 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1500 and GOT_TLSGD to LE optimization.
1501
65d92137
CC
15022015-01-28 Cary Coutant <ccoutant@google.com>
1503
1504 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1505 for undef TLS symbols.
1506 (Target_x86_64::Relocate::relocate_tls): Likewise.
1507 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1508
5485698a
CC
15092015-01-25 Cary Coutant <ccoutant@google.com>
1510
1511 * output.cc (Output_segment::set_section_addresses): Fix calculation
1512 of size of relro segment.
1513
b01a4b04
AM
15142015-01-22 Alan Modra <amodra@gmail.com>
1515
1516 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1517 condition for need of ifunc plt entry.
1518 (Target_powerpc::Scan::global <got relocs>): Likewise.
1519
3d0064a9
CC
15202015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1521
1522 * mips.cc (reloc_high): Add r_sym.
1523 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1524 reloc_high constructor.
1525 (Mips_relocate_functions::relgot16_local): Likewise.
1526 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1527 r_type to decide whether LO16 matches HI16.
1528 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1529 rello16 and relgot16_local.
1530
a5cd8f05
CC
15312015-01-09 Cary Coutant <ccoutant@google.com>
1532
1533 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1534 unless alignment is larger than page size.
1535
4fc1b9d4
L
15362015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1537 Cary Coutant <ccoutant@google.com>
1538
1539 PR gold/17729
1540 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1541 (DEFAULT_TARGET_X32): Set for x32.
1542 * x86_64.cc (cmp_insn_32): New.
1543 (lea_r10_insn_32): Likewise.
1544 (lea_r11_insn_32): Likewise.
1545 (cmp_insn_64): Likewise.
1546 (lea_r10_insn_64): Likewise.
1547 (lea_r11_insn_64): Likewise.
1548 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1549 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1550 (check_DATA): Add split_x32 files.
1551 (split_x32_[1234n].o): New targets.
1552 (split_x32_[124]): New targets.
1553 (split_x32_[1234r].stdout): New targets.
1554 * testsuite/split_x32.sh: New file.
1555 * testsuite/split_x32_1.s: Likewise.
1556 * testsuite/split_x32_2.s: Likewise.
1557 * testsuite/split_x32_3.s: Likewise.
1558 * testsuite/split_x32_4.s: Likewise.
1559 * testsuite/split_x32_n.s: Likewise.
1560 * configure: Regenerated.
1561 * testsuite/Makefile.in: Likewise.
1562
e749cab8
L
15632015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1564
1565 PR gold/17809
1566 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1567 x32.
1568
af759df0
AM
15692015-01-02 Alan Modra <amodra@gmail.com>
1570
1571 * version.cc (print_version): Just print current year.
1572 * dwp.cc (print_version): Likewise.
1573
b90efa5b
AM
15742015-01-01 Alan Modra <amodra@gmail.com>
1575
1576 Update year range in copyright notice of all files.
1577
f12d1e8a
AM
15782014-12-25 Alan Modra <amodra@gmail.com>
1579
1580 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1581 new enums.
1582 (Target_arm::merge_object_attributes, ): Likewise.
1583
5c294fee
TG
15842014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1585
1586 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1587 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1588 AEABI_VFP_args_vfp to check that.
1589 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1590 value and replace hardcoded values by enum values.
1591
e30880c2
CC
15922014-12-22 Cary Coutant <ccoutant@google.com>
1593
1594 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1595
bd040da1
L
15962014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1597
1598 PR gold/14608
1599 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1600 to "return i * i * 3;".
1601
e02a4046
CC
16022014-12-16 Cary Coutant <ccoutant@google.com>
1603
1604 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1605 (Mapfile::print_output_data): Use current_data_size() to avoid
1606 assert for sections requiring postprocessing; if address is not valid,
1607 print 0.
1608 (Mapfile::print_output_section): Use current_data_size(); print note
1609 that addresses and sizes are before compression.
1610
add6016b
L
16112014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1612
1613 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1614 Cast current_group_size to unsigned long when reporting error.
1615
0bf32ea9
JY
16162014-12-10 Jing Yu <jingyu@google.com>
1617
1618 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1619 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1620 Update error message.
1621 (Target_aarch64::do_relax): Use absolute value of option
1622 stub_group_size. Replace local variable with class member
1623 stub_group_size_.
1624
cbcb23fa
AM
16252014-12-04 Alan Modra <amodra@gmail.com>
1626
1627 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1628 addend of PLTREL24 reloc when not generating a plt stub. Make
1629 max_branch_offset an "Address".
fbad6518 1630 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1631 (Target_powerpc::Relocate::relocate): Likewise.
1632
1611bc4a
AM
16332014-12-04 Alan Modra <amodra@gmail.com>
1634
1635 PR 17670
1636 * symtab.cc (Symbol::set_undefined): Remove assertion.
1637 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1638 on symbols defined in discarded sections, instead return false.
1639 Rearrange params, update all callers.
1640 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1641 branches to syms in discarded sections.
1642 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1643 undefined and flag as discarded.
1644 (Target_powerpc::Relocate::relocate): Localize variable.
1645
4759c34e
L
16462014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1647
1648 PR gold/17675
1649 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1650 * testsuite/Makefile.in: Regenerated.
1651
1f98a074
AM
16522014-12-03 Alan Modra <amodra@gmail.com>
1653
1654 PR 17566
1655 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1656 when adding dynamic relocations against section symbols.
1657
fb257835
DI
16582014-12-01 Dimitry Ivanov <dimitry@google.com>
1659
1660 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1661 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1662 * options.h (General_options): New -z option (global).
1663
d8e60314
CC
16642014-12-01 Cary Coutant <ccoutant@google.com>
1665
1666 PR gold/17578
1667 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1668 is given.
1669 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1670 given but some inputs require executable stack.
1671
982bbd97
CC
16722014-11-26 Cary Coutant <ccoutant@google.com>
1673
1674 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1675 .debug_str_offsets; strip .debug_gnu_pubnames and
1676 .debug_gnu_pubtypes.
1677 (lines_only_debug_sections): Strip all four new sections.
1678
bb779192
HS
16792014-11-26 Jing Yu <jingyu@google.com>
1680
1681 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1682 register to be x0 when to relax TLSDESC_LD64_LO12.
1683
a3e60ddb
AM
16842014-11-26 Alan Modra <amodra@gmail.com>
1685
1686 * powerpc.cc (struct Stub_table_owner): New.
1687 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1688 unsigned int vector. Update all references.
1689 (powerpc_relobj::set_stub_table): Take an unsigned int param
1690 rather than a Stub_table. Update callers.
1691 (Powerpc_relobj::clear_stub_table): New function.
1692 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1693 stub_group_size_ vars.
1694 (Target_powerpc::new_stub_table): Delete.
1695 (max_branch_delta): New function, extracted from..
1696 (Target_powerpc::Relocate::relocate): ..here..
1697 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1698 status on whether stub created successfully.
1699 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1700 default sizing to..
1701 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1702 reduce on relax failure.
1703 (Target_powerpc::group_sections): Add "no_size_errors" param.
1704 Use stub_group_size_. Set up group info in a temp vector,
1705 before building Stub_table vector. Account for input sections
1706 possibly already converted to relaxed sections.
1707 (Stub_table::init): Delete. Merge into..
1708 (Stub_table::Stub_table): ..here.
1709 (Stub_table::can_reach_stub): New function.
1710 (Stub_table::add_plt_call_entry): Add "from" parameter and
1711 return true iff stub could be reached.
1712 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1713 param too.
1714 (Stub_table::clear_stubs): Add "all" param.
1715
a20605cf
AM
17162014-11-26 Alan Modra <amodra@gmail.com>
1717
1718 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1719 (Target_powerpc::group_sections): Use it.
1720
43b64deb
CC
17212014-11-25 Cary Coutant <ccoutant@google.com>
1722
1723 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1724 (Binary_to_elf::write_symbol): Add st_size parameter.
1725 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1726
c924eb67
CC
17272014-11-25 Cary Coutant <ccoutant@google.com>
1728
1729 PR gold/17639
1730 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1731 (Sized_relobj_file::do_layout): Handle deferred sections properly
1732 during GC pass 1. Don't add reloc sections to deferred list twice.
1733 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1734 (Sized_relobj_file::is_deferred_layout_): New data member.
1735
9d585188
L
17362014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1737
1738 PR gold/17619
1739 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1740 Check PC-relative offset overflow in PLT entry.
1741
3ffaac20
AM
17422014-11-21 Alan Modra <amodra@gmail.com>
1743
1744 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1745 for undefined weaks.
1746
0cfb0717
AM
17472014-11-20 Alan Modra <amodra@gmail.com>
1748
1749 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1750 from --stub-group-size parameter divided by 1024.
1751 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1752 template parameter. Update all uses.
1753 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1754 has_stub_value. Set for long branches. Don't report overflow for
1755 branch to undefined weak symbols. Print info message on
1756 overflowing branch to stub.
1757
f9dffbf0
AM
17582014-11-20 Alan Modra <amodra@gmail.com>
1759
1760 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1761
e88ba8d5
L
17622014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1763
1764 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1765 entry for R_X86_64_GOTPLT64.
1766 (Target_x86_64<size>::Relocate::relocate): Update comments for
1767 R_X86_64_GOTPLT64.
1768
d37ffe25
ED
17692014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1770
1771 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1772 * plugin.h: add lock definition
1773
9726c3c1
HS
17742014-10-29 Han Shen <shenhan@google.com>
1775 Jing Yu <jingyu@google.com>
1776
1777 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1778 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1779 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1780 Symbol::TLS_REF.
1781 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1782 method.
1783 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1784 (Target_aarch64::tls_ld_to_le): New method.
1785 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1786 for 64bit targets.
1787 (Output_data_plt_aarch64::irelative_rel_): New data member.
1788 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1789 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1790 (Output_data_plt_aarch64::add_relocation): New method.
1791 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1792 offset. Add got_irelative size to got size.
1793 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1794 type string with the new typename.
1795 (AArch64_relocate_functions::update_adr): Replace parameter x with
1796 immed.
1797 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1798 (AArch64_relocate_functions::reloc_common): New method.
1799 (AArch64_relocate_funcsions::rela_general): Extract common part out
1800 into reloc_common method.
1801 (AArch64_relocate_functions::rela_general): Likewise.
1802 (AArch64_relocate_functions::pcrela_general): Likewise.
1803 (AArch64_relocate_functions::adr): New method.
1804 (AArch64_relocate_functions::adrp): Calculate immed before calling
1805 update_adr.
1806 (AArch64_relocate_functions::adrp): Likewise.
1807 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1808 comparing x to 0. Calculate immed from ~x when x < 0.
1809 (Target_aarch64::optimize_tls_reloc): Add new cases for
1810 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1811 TLSLD_MOVW_DTPREL_G0_NC.
1812 (Target_aarch64::possible_function_pointer_reloc): Implement this
1813 method.
1814 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1815 comment.
1816 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1817 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1818 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1819 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1820 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1821 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1822 (Target_aarch64::make_plt_entry): Call add_entry with two more
1823 parameters.
1824 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1825 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1826 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1827 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1828 (Target_aarch64::Relocate::relocate_tls): Add cases for
1829 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1830 TLSLD_MOVW_DTPREL_G0_NC.
1831 * testsuite/icf_safe_so_test.cc: Correct test comment.
1832 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1833
80272b8c
AM
18342014-10-22 Alan Modra <amodra@gmail.com>
1835
1836 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1837 thread_starter.
1838
998a69f4
AS
18392014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1840
1841 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1842
aed56ec5
CC
18432014-10-17 Cary Coutant <ccoutant@google.com>
1844
1845 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1846 Add "typename" keyword.
1847
bb779192 18482014-10-15 Han Shen <shenhan@google.com>
72f4393d 1849 Jing Yu <jingyu@google.com>
83a01957
HS
1850
1851 Patch for gold aarch64 backend to support relaxation.
1852 * aarch64-reloc.def: Change format.
1853 * aarch64.cc (class Reloc_stub): New class.
1854 (class Stub_table): New class.
1855 (class AArch64_relobj): New class.
1856 (class AArch64_input_section): New class.
1857 (class AArch64_output_section): New class.
1858 (Target_aarch64::new_stub_table): New method.
1859 (Target_aarch64::new_aarch64_input_section): New method.
1860 (Target_aarch64::find_aarch64_input_section): New method.
1861 (Target_aarch64::scan_section_for_stubs): New method.
1862 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1863 (Target_aarch64::relocate_stub): New method.
1864 (Target_aarch64::current_target): New method.
1865 (Target_aarch64::do_make_elf_object): New method.
1866 (Target_aarch64::do_may_relax): New method.
1867 (Target_aarch64::do_relax): New method.
1868 (Target_aarch64::group_sections): New method.
1869 (Target_aarch64::scan_reloc_for_stub): New method.
1870 (Target_aarch64::do_make_output_section): New method.
1871 (Target_aarch64::stub_tables_): New data member.
1872 (Target_aarch64::aarch64_input_section_map_): New data member.
1873 (AArch64_relocate_functions::maybe_apply_stub): New method.
1874
db4c9594
CC
18752014-09-30 Cary Coutant <ccoutant@google.com>
1876
1877 PR gold/17432
1878 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1879
cd6da036
KC
18802014-09-30 Kito Cheng <kito@0xlab.org>
1881
1882 PR gold/13597
1883 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1884 hash table before sysv-style hash table.
1885
5f772412
ST
18862014-09-29 Sriraman Tallam <tmsriram@google.com>
1887
1888 * options.h (--pic-executable): Add negative to alias to -no-pie.
1889
5efeedf6
CC
18902014-09-26 Cary Coutant <ccoutant@google.com>
1891
1892 PR gold/16773
1893 * object.cc (Sized_relobj_file): Compute value of section symbols
1894 for TLS sections the same as TLS symbols.
1895
1707f183
CC
18962014-09-25 Cary Coutant <ccoutant@google.com>
1897
1898 PR gold/17432
1899 * resolve.cc (Symbol_table::resolve): Override common placeholder
1900 symbols, but adjust sizes.
1901 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1902 symbols to common lists.
1903
00cac886
AM
19042014-09-24 Alan Modra <amodra@gmail.com>
1905
1906 * po/POTFILES.in: Regenerate.
1907
635aa30e 19082014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1909 Cary Coutant <ccoutant@google.com>
635aa30e 1910
71b9b91b 1911 PR gold/14860
635aa30e
CC
1912 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1913 on input_sections_blocker.
1914 * layout.cc (Write_sections_task::locks): Unblock
1915 input_sections_blocker_.
1916 * layout.h (Write_sections_task::Write_sections_task): Add
1917 input_sections_blocker.
1918 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1919 to DEPENDENCIES.
1920 * testsuite/Makefile.in: Regenerate.
1921
c0c71592
RÁE
19222014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1923
1924 * testsuite/Makefile.am (plugin_test_10): New test.
1925 * testsuite/Makefile.in: Regenerate
1926 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1927 * testsuite/plugin_test_10.sh: New file.
1928
6168c2a1
RÁE
19292014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1930
1931 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1932 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1933 during the replacement phase.
1934
3a531937
JY
19352014-09-17 Han Shen <shenhan@google.com>
1936 Jing Yu <jingyu@google.com>
1937
1938 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1939 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1940 * aarch64.cc (Target_aarch64): Add data members
1941 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1942 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1943 constructor.
1944 (Target_aarch64::do_reloc_symbol_index): New method.
1945 (Target_aarch64::do_reloc_addend): New method.
1946 (Target_aarch64::add_tlsdesc_info): New method.
1947 (Target_aarch64::do_dynsym_value): New method.
1948 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1949 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1950 (Target_aarch64::make_data_plt): Add new parameters: got,
1951 got_irelative. Pass them to do_make_data_plt.
1952 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1953 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1954 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1955 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1956 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1957 (Target_aarch64::got_tlsdesc_section): New method.
1958 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1959 (Target_aarch64::define_tls_base_symbol): New method.
1960 (Target_aarch64::reserve_tlsdesc_entries): New method.
1961 (Target_aarch64::got_mod_index_entry): New method.
1962 (Target_aarch64::rela_tlsdesc_section): New method.
1963 (Target_aarch64::rela_irelative_section): New method.
1964 (Target_aarch64::Tlsdesc_info): New struct.
1965 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1966 relocations and tlsdesc relocations.
1967 (Target_aarch64::optimize_tls_reloc): Implement method.
1968 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1969 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1970 in constructor.
1971 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1972 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1973 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1974 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1975 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1976 (Output_data_plt_aarch64::rela_irelative): New method.
1977 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1978 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1979 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1980 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1981 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1982 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1983 (Output_data_plt_aarch64_standard): New member variables:
1984 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1985 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1986 New parameter: got, got_irelative.
1987 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1988 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1989 (Output_data_plt_aarch64::do_write): Replace got_address with
1990 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1991 (AArch64_relocate_functions::update_movnz): New method.
1992 (AArch64_relocate_functions): Correct format.
1993 (AArch64_relocate_functions::movnz): New method.
1994 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1995 before the switch. Add new cases to switch.
00cac886 1996 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1997 tlsgd tlsdesc cases.
1998 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1999 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2000 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2001 Call reloc_name_in_error_message to print unsupported reloc.
2002 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2003 make_data_plt.
2004 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2005 relocs. Fill in some more dynamic tags.
2006 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2007 Skip call tls_get_addr when tlsgd is relaxed.
2008 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2009 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2010 tlsdesc->ie relaxation.
2011
62661c93
SS
20122014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2013
2014 * mips.cc (Target_mips_nacl): New class.
2015 (Target_selector_mips_nacl): New class.
2016 (target_selector_mips32): Rename from target_selector_mips32be and use
2017 Target_selector_mips_nacl instead of Target_selector_mips.
2018 (target_selector_mips32el): Rename from target_selector_mips32 and use
2019 Target_selector_mips_nacl instead of Target_selector_mips.
2020 (target_selector_mips64): Rename from target_selector_mips64be and use
2021 Target_selector_mips_nacl instead of Target_selector_mips.
2022 (target_selector_mips64el): Rename from target_selector_mips64 and use
2023 Target_selector_mips_nacl instead of Target_selector_mips.
2024 (Target_mips::mips_info): Add const attribute.
2025
54674d38
CC
20262014-09-02 Cary Coutant <ccoutant@google.com>
2027
2028 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2029 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2030 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2031 (Sized_incr_dynobj::do_section_name): Likewise.
2032 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2033 (Sized_incr_dynobj::do_section_name): Likewise.
2034 * object.h (Object::section_name): Likewise.
2035 (Object::do_section_name): Likewise.
2036 (Sized_relobj_file::do_section_name): Likewise.
2037 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2038 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2039
9860cbcf
CC
20402014-09-02 Cary Coutant <ccoutant@google.com>
2041
2042 PR gold/17005
2043 * ehframe.cc (Fde::write): Add output_offset parameter.
2044 (Cie::write): Likewise.
2045 (Eh_frame::set_final_data_size): Account for offset within output
2046 section.
2047 (Eh_frame::do_sized_write): Likewise.
2048 * ehframe.h (Fde::write): Add output_offset parameter.
2049 (Cie::write): Likewise.
2050 * output.cc (Output_section::Input_section_sort_entry): Remove
2051 section_has_name_; add output_section_name parameter. Use
2052 output section name for non-input sections.
2053 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2054 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2055 (Output_section::Input_section_sort_compare): Remove logic for
2056 sections without names.
2057 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2058 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2059 Likewise.
2060 (Output_section::Input_section_sort_section_name_compare): Likewise.
2061
8e33481e
HS
20622014-08-29 Han Shen <shenhan@google.com>
2063 Jing Yu <jingyu@google.com>
2064
2065 * aarch64-reloc-property.cc
2066 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2067 reference reloc property in the table.
2068 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2069 3 other entries.
2070 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2071 2 new overloaded methods.
2072 (Output_data_got_aarch64::do_write): Add code to write out
2073 static relocs.
2074 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2075 static relocs.
2076 (Output_data_got_aarch64::static_relocs): New vector to
2077 hold static relocs.
2078 (Target_aarch64::TCB_SIZE): New const static memeber.
2079 (Target_aarch64::tcb_size): New method.
2080 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2081 (Target_aarch64::Relocate::relocate_tls): New method.
2082 (Target_aarch64::Scan::local): Add code handling new reloc types.
2083 (Target_aarch64::Scan::global): Add code handling new reloc types.
2084
81233653
ST
20852014-08-13 Sriraman Tallam <tmsriram@google.com>
2086
2087 * options.h (-no-pie): Add option.
2088
9363c7c3
JY
20892014-08-08 Jing Yu <jingyu@google.com>
2090 Han Shen <shenhan@google.com>
2091
2092 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2093 (DEFFILES): add aarch64-reloc.def.
2094 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2095 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2096 * Makefile.in: Regenerate.
2097 * aarch64-reloc-property.cc: New file.
2098 * aarch64-reloc-property.h: New file.
2099 * aarch64-reloc.def: New file.
2100 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2101 with tab to make the format consistent.
2102 (Output_data_got_aarch64::symbol_table_): New method.
2103 (Target_aarch64::do_plt_address_for_global): New method.
2104 (Target_aarch64::do_plt_address_for_local): New method.
2105 (Target_aarch64::do_select_as_default_target): New method.
2106 (Target_aarch64::do_make_data_plt): New method.
2107 (Target_aarch64::make_data_plt): New method.
2108 (Output_data_plt_aarch64::has_irelative_section): New method.
2109 (Output_data_plt_aarch64::address_for_global): New method.
2110 (Output_data_plt_aarch64::address_for_local): New method.
2111 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2112 (Output_data_plt_aarch64::add_entry): Implement contents.
2113 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2114 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2115 the got_pov entry to plt0.
2116 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2117 Implement contents.
2118 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2119 (AArch64_howto): New struct.
2120 (aarch64_howto[]): New static const array.
2121 (AArch64_relocate_functions): New class.
2122 (Target_aarch64::Scan::get_reference_flags): Remove method.
2123 (Target_aarch64::Scan::local): Implement to support a few relocations.
2124 (Target_aarch64::Scan::global): Implement to support a few relocations.
2125 (Target_aarch64::make_plt_section): Implement contents.
2126 (Target_aarch64::make_plt_entry): Implement contents.
2127 (Target_aarch64::do_finalize_sections): Implement contents.
2128 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2129 (Target_aarch64::relocate_section): Implement contents.
2130
ad9fe6c1
AM
21312014-08-06 Alan Modra <amodra@gmail.com>
2132
2133 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2134
7cd4e5b7
AM
21352014-08-06 Alan Modra <amodra@gmail.com>
2136
2137 PR 13227
2138 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2139
5ad9b0a7
ST
21402014-07-21 Sriraman Tallam <tmsriram@google.com>
2141
2142 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2143 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2144
e051745c
CC
21452014-07-08 Cary Coutant <ccoutant@google.com>
2146
2147 * expression.cc (struct Expression::Expression_eval_info): Add
2148 new fields type_pointer, vis_pointer, and nonvis_pointer.
2149 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2150 nonvis_pointer parameters. Adjust all calls.
2151 (Symbol_expression::value): Update type, visibility, and nonvis bits
2152 in caller.
2153 * script.cc (Symbol_assignment::sized_finalize): Update type,
2154 visibility, and remaining st_other bits for new symbol.
2155 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2156 vis_pointer, and nonvis_pointer parameters.
2157 * symtab.h (Symbol::set_type): New method.
2158
2159 * testsuite/Makefile.am (defsym_test): New test.
2160 * testsuite/Makefile.in: Regenerate.
2161 * testsuite/defsym_test.c: New file.
2162 * testsuite/defsym_test.sh: New file.
2163
f35c4853
CC
21642014-07-08 Cary Coutant <ccoutant@google.com>
2165
2166 PR gold/15639
2167 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2168 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2169 (Sized_dynobj::base_read_symbols): ...new method.
2170 * object.h (Sized_relobj_file::base_read_symbols): New method.
2171 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2172 (Sized_relobj_file::base_read_symbols): ...new method.
2173 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2174 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2175 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2176
2900af2d
AM
21772014-07-04 Alan Modra <amodra@gmail.com>
2178
2179 * po/POTFILES.in: Regenerate.
2180
053a4d68
JY
21812014-07-02 Jing Yu <jingyu@google.com>
2182
2183 * aarch64.cc: New file
2184 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2185 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2186 * Makefile.in: Regenerate.
2187 * configure.tgt: Add entries for aarch64*.
2188 * configure.ac: Likewise.
2189 * configure: Likewise.
2190
7b549045
AM
21912014-06-27 Alan Modra <amodra@gmail.com>
2192
2193 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2194
cb818dbf
CC
21952014-06-24 Cary Coutant <ccoutant@google.com>
2196
2197 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2198 sections.
2199 (Dwo_file::sized_read_unit_index): Likewise.
2200
9810d34d
SS
22012014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2202
2203 * mips.cc: New file.
2204 * Makefile.am (TARGETSOURCES): Add mips.cc
2205 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2206 * configure.tgt: Add entries for mips*.
2207 * configure.ac: Likewise.
2208 * Makefile.in: Regenerate.
2209 * configure: Likewise.
2210
9baa787b
CC
22112014-06-09 Cary Coutant <ccoutant@google.com>
2212
2213 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2214 unit_length is within section bounds.
2215
8f89af0a
CC
22162014-06-09 Cary Coutant <ccoutant@google.com>
2217
2218 PR gold/16980
2219 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2220 map.
2221
a47622ac
AM
22222014-06-07 Alan Modra <amodra@gmail.com>
2223
2224 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2225
4320c691
CC
22262014-06-06 Cary Coutant <ccoutant@google.com>
2227
2228 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2229 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2230 (Dwarf_pubnames_table::read_header): Likewise.
2231 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2232 .debug_gnu_pubtypes.
2233
270c9937
JB
22342014-06-05 Joel Brobecker <brobecker@adacore.com>
2235
2236 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2237 * Makefile.in, configure: Regenerate.
2238
397998fc
AM
22392014-06-03 Alan Modra <amodra@gmail.com>
2240
2241 * powerpc.cc (addis_12_2): Define.
2242 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2243
61f5c66f
AM
22442014-06-03 Alan Modra <amodra@gmail.com>
2245
2246 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2247 st_other output.
2248
f6971787
AM
22492014-06-02 Alan Modra <amodra@gmail.com>
2250
2251 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2252 Only ignore relocs on ELFv1.
2253 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2254
f6fb8322
CC
22552014-05-30 Cary Coutant <ccoutant@google.com>
2256
2257 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2258 * testsuite/Makefile.in: Regenerate.
2259 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2260
c23dd342
L
22612014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2262
2263 PR gold/16945
2264 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2265 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2266
5fe7ffdc
AM
22672014-05-15 Alan Modra <amodra@gmail.com>
2268
2269 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2270 Compare FDE contents with DW_CFA_nop rather than 0.
2271
a82bef93
ST
22722014-05-13 Sriraman Tallam <tmsriram@google.com>
2273
2274 * symtab.h (may_need_copy_reloc): Remove check for position independent
2275 code.
2276 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2277 position independence before pc absolute may_need_copy_reloc call.
2278 Add check for executable output befor pc relative may_need_copy_reloc
2279 call.
2280 * i386.cc: Ditto.
2281 * arm.cc: Ditto.
2282 * sparc.cc: Ditto.
2283 * tilegx.cc: Ditto.
2284 * powerpc.cc: Add check for no position independence before
2285 may_need_copy_reloc calls.
2286 * testsuite/pie_copyrelocs_test.cc: New file.
2287 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2288 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2289 * Makefile.in: Regenerate.
a82bef93 2290
53c66605
ML
22912014-05-08 Martin Liška <mliska@suse.cz>
2292
2293 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2294
57b2284c
CC
22952014-05-06 Cary Coutant <ccoutant@google.com>
2296
2297 PR gold/16900
2298 * i386.cc (Output_data_got_plt_i386): New class.
2299 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2300 parameter. Change all callers.
2301 (Output_data_plt_i386::layout_): Remove.
2302 (Output_data_plt_i386::got_plt_): Change type.
2303 (Target_i386::got_plt_): Change type. Change all references.
2304 (Target_i386::got_section): Create instance of new class.
2305 (Output_data_got_plt_i386::do_write): New function.
2306 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2307 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2308 parameter. Change all callers.
2309 (Output_data_plt_x86_64::layout_): Remove.
2310 (Output_data_plt_x86_64::got_plt_): Change type.
2311 (Target_x86_64::got_plt_): Change type. Change all references.
2312 (Target_x86_64::got_section): Create instance of new class.
2313 (Output_data_got_plt_x86_64::do_write): New function.
2314 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2315 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2316 class.
2317
6b97515d 23182014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2319
6b97515d
CC
2320 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2321 if we have pubnames/pubtypes.
2322
d1bddd3c
CC
23232014-05-02 Cary Coutant <ccoutant@google.com>
2324
5fe7ffdc
AM
2325 * defstd.cc (in_segment): Define __ehdr_start here...
2326 * layout.cc (Layout::finalize): ...Instead of here. Set the
2327 output segment when known.
2328 * resolve.cc (Symbol::override_base_with_special): Remember
2329 the original binding.
2330 * symtab.cc (Symbol::set_output_segment): New function.
2331 (Symbol::set_undefined): New function.
2332 * symtab.h (Symbol::is_weak_undefined): Check original undef
2333 binding.
2334 (Symbol::is_strong_undefined): New function.
2335 (Symbol::set_output_segment): New function.
2336 (Symbol::set_undefined): New function.
2337 * target-reloc.h (is_strong_undefined): Remove.
2338 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2339 Check for hidden undefs.
2340 (relocate_section): Call Symbol::is_strong_undefined.
2341
2342 * testsuite/Makefile.am (ehdr_start_test_1)
2343 (ehdr_start_test_2, ehdr_start_test_3)
2344 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2345 * testsuite/Makefile.in: Regenerate.
2346 * testsuite/ehdr_start_def.cc: New source file.
2347 * testsuite/ehdr_start_test.cc: New source file.
2348 * testsuite/ehdr_start_test.t: New linker script.
2349 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2350
7849f6d8
CC
23512014-04-23 Cary Coutant <ccoutant@google.com>
2352
bf2cc635 2353 PR gold/16870
7849f6d8
CC
2354 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2355
99fd8cff
CC
23562014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2357
2358 * layout.cc (Layout::include_section): Allow a target to decide
2359 whether to include a section.
2360 * target.h (Target::should_include_section): New function.
2361 (Target::do_should_include_section): New function.
2362
91f43acd
CC
23632014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2364
2365 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2366 inline into ...
2367 (Copy_relocs::emit): ... here.
2368 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2369 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2370 (Copy_reloc_entry::entries_): Change from private to protected.
2371
c4eb27e1
ST
23722014-04-02 Sriraman Tallam <tmsriram@google.com>
2373
2374 * icf.cc (get_section_contents): Replace copies of reloc
2375 vectors with const references.
2376
ae447ddd
CC
23772014-04-02 Cary Coutant <ccoutant@google.com>
2378
2379 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2380 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2381 * configure: Regenerate.
2382 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2383 -fno-use-linker-plugin.
2384 (LINK1, CXXLINK1): Add it to the link command.
2385 * testsuite/Makefile.in: Regenerate.
2386
fa47fa92
AM
23872014-03-12 Alan Modra <amodra@gmail.com>
2388
2389 * Makefile.in: Regenerate.
2390
9b12c500
CC
23912014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2392
2393 * symtab.h (Symbol::set_nonvis): New function.
2394
beacaa96
CC
23952014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2396
2397 * symtab.cc (Sized_symbol<32>::init_output_data):
2398 Instantiate the template.
2399 (Sized_symbol<64>::init_output_data): Likewise.
2400
800d9823
CC
24012014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2402
2403 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2404 adjust dynamic symbol value.
2405 * target.h (Target::adjust_dyn_symbol): New function.
2406 (Target::do_adjust_dyn_symbol): New function.
2407
918fc1f8 24082014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2409
918fc1f8
CC
2410 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2411 Get the value of DYNAMIC_CUSTOM dynamic entry.
2412 * output.h (Output_data_dynamic::add_custom): New function.
2413 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2414 dynamic entry.
2415 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2416 * target.h (Target::dynamic_tag_custom_value): New function.
2417 (Target::do_dynamic_tag_custom_value): New function.
2418
98ff9231
CC
24192014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2420
2421 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2422 dynsym indexes.
2423 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2424 (Target::do_has_custom_set_dynsym_indexes): New function.
2425 (Target::set_dynsym_indexes): New function.
2426 (Target::do_set_dynsym_indexes): New function.
2427
b80eed39
AM
24282014-03-07 Alan Modra <amodra@gmail.com>
2429
2430 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2431 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2432 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2433 (Powerpc_relocate_functions::has_overflow_bitfield,
2434 overflowed): Use the above.
2435 (Target_powerpc::Relocate::relocate): Correct overflow checking
2436 for a number of relocations. Modify overflow test for 16-bit
2437 fields in instructions to signed/unsigned according to whether
2438 the field takes a signed or unsigned value.
2439
4b95cf5c
AM
24402014-03-05 Alan Modra <amodra@gmail.com>
2441
2442 Update copyright years.
2443
45965137
AM
24442014-03-05 Alan Modra <amodra@gmail.com>
2445
2446 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2447 R_PPC64_ADDR64_LOCAL.
2448 (Target_powerpc::Relocate::relocate): Likewise.
2449
2c80b753
AM
24502014-03-03 Alan Modra <amodra@gmail.com>
2451
2452 * dwp.cc (print_version): Update copyright year to current.
2453
c1c69e83
AM
24542014-02-10 Alan Modra <amodra@gmail.com>
2455
2456 * po/gold.pot: Regenerate.
2457
dd0c4e70
CC
24582014-02-06 Cary Coutant <ccoutant@google.com>
2459
2460 Fix problem where -u is ignored when a weak undef is seen.
2461
2462 * archive.cc (Library_base::should_include_member): Reorder
2463 code to check for -u option if a weak undef has already been seen.
2464 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2465 * testsuite/Makefile.in: Regenerate.
2466 * testsuite/weak_undef_file3.cc: New file.
2467 * testsuite/weak_undef_file4.cc: New file.
2468 * testsuite/weak_undef_test_2.cc: New file.
2469
1a221d3d
CC
24702014-02-05 Cary Coutant <ccoutant@google.com>
2471
2472 Fix issues with gold undefined symbol diagnostics.
2473
2474 PR binutils/15435
2475 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2476 check to here.
2477 * target-reloc.h (is_strong_undefined): New function.
2478 (relocate_section): Move undef vtable symbol check from here.
2479 Check for is_strong_undefined.
2480
e889f0a4 24812014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2482
e889f0a4
CC
2483 Fix problems with the --dynamic-list option.
2484
2485 PR gold/13577
2486 * options.cc (General_options::parse_dynamic_list):
2487 Set have_dynamic_list_.
2488 (General_options::General_options): Initialize have_dynamic_list_.
2489 (General_options::finalize): Turn off -Bsymbolic and
2490 -Bsymbolic-functions if --dynamic-list provided.
2491 * options.h (General_options::have_dynamic_list): New function.
2492 (General_options::have_dynamic_list_): New data member.
2493 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2494 correctly.
5fe7ffdc 2495
e889f0a4
CC
2496 PR gold/16530
2497 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2498 in --dynamic-list, mark it.
5fe7ffdc 2499
e889f0a4
CC
2500 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2501 (dynamic_list_2): New test case.
2502 * testsuite/Makefile.in: Regenerate.
2503 * testsuite/dynamic_list_2.cc: New file.
2504 * testsuite/dynamic_list_2.t: New file.
2505 * testsuite/dynamic_list_lib1.cc: New file.
2506 * testsuite/dynamic_list_lib2.cc: New file.
2507 * testsuite/gc_dynamic_list_test.c: New file.
2508 * testsuite/gc_dynamic_list_test.sh: New file.
2509 * testsuite/gc_dynamic_list_test.t: New file.
2510
ec673e64
CC
25112014-01-28 Cary Coutant <ccoutant@google.com>
2512
2513 Add .gdb_index version 7 support.
2514
2515 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2516 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2517 debug sections.
2518 (Dwarf_ranges_table::read_ranges_table): Likewise.
2519 (Dwarf_pubnames_table::read_section): Check for GNU-style
2520 sections, and for compressed debug sections.
2521 (Dwarf_pubnames_table::read_header): Compute end address of table.
2522 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2523 for end of list by offset, not by offset == 0.
2524 (Dwarf_info_reader::do_read_string_table): Check for compressed
2525 debug sections.
2526 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2527 Initialize new data members.
2528 (Dwarf_pubnames_table::next_name): return flag_byte.
2529 (Dwarf_pubnames_table::end_of_table_): New data member.
2530 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2531 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2532 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2533 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2534 read skeleton type unit DIEs.
2535 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2536 (Gdb_index::do_write): Write flag_byte.
2537 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2538 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2539 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2540 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2541
221fd5d5
L
25422014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2543
2544 * version.cc (print_version): Update copyright year to 2014.
2545
6c09fb0b
ILT
25462013-12-19 Dimitry Andric <dimitry@andric.com>
2547
2548 * stringpool.cc (Stringpool_template::reserve): Add
2549 HAVE_UNORDERED_MAP case.
2550 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2551
8356f2d0
CC
25522013-12-18 Cary Coutant <ccoutant@google.com>
2553
2554 * configure.ac: Check for <unordered_set> and <unordered_map>.
2555 * config.in: Regenerate.
2556 * configure: Regenerate.
2557 * system.h: Use <unordered_set> and <unordered_map> if available.
2558
f2c7d7ee
RM
25592013-12-10 Roland McGrath <mcgrathr@google.com>
2560
2561 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2562 with $(INSTALL_PROGRAM_ENV).
2563 * Makefile.in: Regenerate.
2564
6632e8cc
CC
25652013-11-22 Cary Coutant <ccoutant@google.com>
2566
2567 * configure.ac: Add check for which library is needed for
2568 dlopen.
2569 * configure: Regenerate.
2570
0c075858
CC
25712013-11-22 Cary Coutant <ccoutant@google.com>
2572
2573 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2574 assembler.
2575 * testsuite/Makefile.in: Regenerate.
2576
f49fe902
L
25772013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2578
2579 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2580 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2581 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2582 (Target_x86_64<size>::Scan::local): Likewise.
2583 (Target_x86_64<size>::Scan::global): Likewise.
2584 (Target_x86_64<size>::Relocate::relocate): Likewise.
2585 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2586 Likewise.
2587 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2588 R_X86_64_PC32_BND.
2589
2590 * testsuite/Makefile.am (check_PROGRAMS): Add
2591 exception_x86_64_bnd_test.
2592 (exception_x86_64_bnd_test_SOURCES): New macro.
2593 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2594 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2595 (exception_x86_64_bnd_test_LDADD): Likewise.
2596 (exception_x86_64_bnd_1.o): New rule.
2597 (exception_x86_64_bnd_2.o): Likewise.
2598 * testsuite/Makefile.in: Regenerated.
2599
9055360d
AM
26002013-11-15 Alan Modra <amodra@gmail.com>
2601
2602 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2603 accessor.
2604 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2605 Only call ppc64_local_entry_offset for 64-bit. Restrict
2606 symval_for_branch lookup to ELFv1.
2607 (Stub_table::add_plt_call_entry): Use unsigned int off.
2608 (Output_data_glink::Address, invalid_address): New.
2609 (Output_data_glink::add_eh_frame): Move out of line. Add
2610 support for ELFv2.
2611 (Output_data_glink::add_global_entry, find_global_entry,
2612 global_entry_address): New functions.
2613 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2614 ge_size): New variables.
2615 (Output_data_glink::set_final_data_size): Add global entry
2616 stub sizing.
2617 (Output_data_glink::do_write): Write global entry stubs.
2618 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2619 parameter. Return true for ELFv2. Adjust callers.
2620 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2621 ELFv1. Similarly for ifunc and dynamic relocation processing
2622 specific to ELFv1. Recognize that symbols are defined on
2623 their plt entries for ELFv2.
2624 (Target_powerpc::symval_for_branch): Assert if called for
2625 ELFv2 or ppc32.
2626 (Target_powerpc::Relocate::relocate): Use global entry plt
2627 stub for symbol value if such exists on ELFv2.
2628 (Target_powerpc::Relocate::relocate): Don't call
2629 symval_for_branch when ELFv2. Do adjust for local entry
2630 offset when ELFv2.
2631 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2632 plt stub for ELFv2.
2633 (Target_powerpc::do_plt_address_for_global): Similarly.
2634
cafdd569
CC
26352013-11-14 Cary Coutant <ccoutant@google.com>
2636
2637 Revert patch -- this did not fix the problem, and there is
2638 no race there.
2639
2640 2013-11-14 Cary Coutant <ccoutant@google.com>
2641
2642 PR gold/14860
2643 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2644 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2645 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2646 updating fde_offsets_.
2647 (Eh_frame_hdr::lock_): New data member.
2648
94e49e16
CC
26492013-11-14 Cary Coutant <ccoutant@google.com>
2650
2651 * dwp.cc (Dwo_file_entry): New type.
2652 (File_list): Use Dwo_file_entry.
2653 (Dwo_file::verify): New function.
2654 (Dwo_file::verify_dwo_list): New function.
2655 (Dwo_file::sized_verify_dwo_list): New function.
2656 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2657 list.
2658 (Dwp_options): New enum type.
2659 (dwp_options): Add --verify-only.
2660 (usage): Likewise.
2661 (main): Likewise.
2662 * dwp.h (gold_info): Add declaration.
2663
7cdd7d57
CC
26642013-11-14 Cary Coutant <ccoutant@google.com>
2665
2666 PR gold/14860
2667 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2668 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2669 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2670 updating fde_offsets_.
2671 (Eh_frame_hdr::lock_): New data member.
2672
1d946cb3
CC
26732013-11-06 Cary Coutant <ccoutant@google.com>
2674
2675 PR gold/15758
2676 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2677 before reloc sections.
2678
4f65b40e
AM
26792013-11-04 Alan Modra <amodra@gmail.com>
2680
2681 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2682 (Symbol::needs_dynamic_reloc): Test new flag.
2683 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2684 (Target_powerpc::Scan::get_reference_flags): Add target param.
2685 Return FUNC_DESC_ABI for 64-bit ELFv1.
2686 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2687 call.
2688 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2689 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2690
908794a9
CC
26912013-10-31 Cary Coutant <ccoutant@google.com>
2692
2693 Restore support for dwp v2 DWARF package file format.
2694
2695 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2696 tu_length parameter. Adjust all callers.
2697 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2698 * dwp.cc: Include dwarf.h.
2699 (Section_bounds): New struct type.
2700 (Unit_set): New struct type.
2701 (Dwo_file::Dwo_file): Initialize new data member.
2702 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2703 Combine and rename to...
2704 (Dwo_file::read_unit_index): ...this.
2705 (Dwo_file::sized_read_compunit_index)
2706 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2707 (Dwo_file::sized_read_unit_index): ...this.
2708 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2709 parameters; add section_id parameter.
2710 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2711 (Dwo_file::add_unit_set): ...this.
2712 (Dwo_file::shndx_map_): Remove.
2713 (Dwo_file::sect_offsets_): New data member.
2714 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2715 (Dwp_output_file::add_section): Rename to...
2716 (Dwp_output_file::add_contribution): ...this.
2717 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2718 (Dwp_output_file::add_tu_set): Likewise.
2719 (Dwp_output_file::Contribution): New type.
2720 (Dwp_output_file::Section::contributions): New data member.
2721 (Dwp_output_file::Cu_or_tu_set): Remove.
2722 (Dwp_output_file::Section::Section): New ctor.
2723 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2724 (Dwp_output_file::Dwp_index::Section_table): New type.
2725 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2726 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2727 parameter.
2728 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2729 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2730 (Dwp_output_file::Dwp_index::section_table): New member function.
2731 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2732 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2733 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2734 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2735 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2736 (Dwp_output_file::Dwp_index::section_table_): New data member.
2737 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2738 (Dwp_output_file::add_output_section): New member function.
2739 (Dwp_output_file::write_new_section): New member function.
2740 (Dwp_output_file::write_contributions): New member function.
2741 (Dwp_output_file::section_id_map_): New data member.
2742 (class Dwo_id_info_reader): Remove.
2743 (class Unit_reader): New class.
2744 (get_dwarf_section_name): New function.
2745 (Dwo_file::read_executable): Adjust initializations of class data.
2746 (Dwo_file::read): Add support for v2 package file format.
2747 (Dwo_file::read_unit_index): Likewise.
2748 (Dwo_file::sized_read_unit_index): Likewise.
2749 (Dwo_file::copy_section): Likewise.
2750 (Dwo_file::add_unit_set): Likewise.
2751 (Dwp_output_file::add_output_section): Likewise.
2752 (Dwp_output_file::add_contribution): Likewise.
2753 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2754 for empty slot.
2755 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2756 file format.
2757 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2758 slot.
2759 (Dwp_output_file::initialize): Remove unused function.
2760 (Dwp_output_file::finalize): Add support for v2 package file format.
2761 (Dwp_output_file::write_index): Likewise.
2762 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2763 function prototype.
2764
2500c017
CC
27652013-10-31 Cary Coutant <ccoutant@google.com>
2766
2767 * configure.ac: Fix check for -fmerge-constants.
2768 * configure.ac: Regenerate.
2769
dd0845d7
RM
27702013-10-30 Roland McGrath <mcgrathr@google.com>
2771
2772 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2773 Correct 9-byte nop sequence to match what the assembler generates.
2774
b4f7960d
AM
27752013-10-30 Alan Modra <amodra@gmail.com>
2776
2777 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2778 ppc64_local_entry_offset, ppc64_local_entry_offset,
2779 do_read_symbols): New functions.
2780 (Powerpc_relobj::e_flags_, st_other_): New vars.
2781 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2782 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2783 (Powerpc_relobj::e_flags_): New var.
2784 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2785 and adjust for ELFv2.
2786 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2787 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2788 (Powerpc_dynobj::do_find_special_sections): Likewise.
2789 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2790 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2791 to ELFv2 local entry.
2792 (Target_powerpc::do_relax): No thread safe barriers needed for
2793 ELFv2.
2794 (Output_data_plt_powerpc::initial_plt_entry_size_,
2795 plt_entry_size): Delete. Replace all uses with
2796 first_plt_entry_offset() and plt_entry_size().
2797 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2798 reserved_size parm. Update callers.
2799 (Output_data_plt_powerpc::entry_count): Update.
2800 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2801 and use Target_powerpc::first_plt_entry_offset().
2802 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2803 rename to plt_entry_size.
2804 (Output_data_plt_powerpc::add_ifunc_entry,
2805 add_local_ifunc_entry): Adjust reloc for ELFv2.
2806 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2807 (glink_eh_frame_fde_64v2): New.
2808 (Stub_table::plt_call_size): Support ELFv2 sizing.
2809 (Output_data_glink::add_eh_frame): Use the new FDE.
2810 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2811 (Stub_table::do_write): Write ELFv2 stubs and glink.
2812 (Target_powerpc::Relocate::relocate): Replaces nop after call
2813 with ld 2,24(1) and adjust local offset destination for ELFv2.
2814
f9c6b907
AM
28152013-10-30 Alan Modra <amodra@gmail.com>
2816
2817 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2818 (Target_powerpc::Scan::global, local): Likewise.
2819 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2820 on all ppc64 @h and @ha relocs.
2821
e84fe78f
AM
28222013-10-14 Alan Modra <amodra@gmail.com>
2823
2824 * output.h (Output_data_got::add_constant): Tidy.
2825 (Output_data_got::add_constant_pair): New function.
2826 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2827 methods used so as to first call reserve_ent().
2828
679e4abf
RM
28292013-10-11 Roland McGrath <mcgrathr@google.com>
2830
44dcb735
RM
2831 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2832 add_got_entry and add_got_entry_pair.
2833
13323c49
RM
2834 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2835 (HAVE_PUBNAMES): Likewise.
2836 * configure: Regenerate.
2837
1496b446
RM
2838 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2839 * testsuite/Makefile.in: Regenerate.
2840
cc84c10b
RM
2841 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2842 Remove const from declaration.
2843 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2844 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2845 * output.h (Output_file_header): Remove const from member target_
2846 and corresponding constructor argument.
2847 * output.cc (Output_file_header::Output_file_header): Update prototype.
2848 (Output_file_header::do_sized_write): Use this->target_ in place
2849 of parameters()->target().
2850
52f66a2c
RM
2851 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2852
2b64b551
RM
2853 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2854 * configure: Regenerate.
2855 * Makefile.in: Regenerate.
2856 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2857 * testsuite/merge_string_literals_2.c: Likewise.
2858 * testsuite/Makefile.am
2859 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2860 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2861 literal -fmerge-constants.
2862 * testsuite/Makefile.in: Regenerate.
2863
43819297
RM
2864 * i386.cc (Target_i386): Remove unused member dynbss_.
2865 * arm.cc (Target_arm): Likewise.
2866 * powerpc.cc (Target_powerpc): Likewise.
2867 * sparc.cc (Target_sparc): Likewise.
2868 * tilegx.cc (Target_tilegx): Likewise.
2869 * x86_64.cc (Target_x86_64): Likewise.
2870 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2871 type_signature_, type_offset_.
2872 * plugin.h (Plugin_hook): Remove unused member layout_.
2873 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2874 mapfile_.
2875 (Read_member): Remove unused members input_objects_, symtab_,
2876 mapfile_, layout_.
2877 (Check_library): Remove unused member symtab_.
2878 * archive.h (Lib_group): Remove unused member lib_.
2879 * archive.cc (Lib_group::Lib_group): Update initializer.
2880 * incremental.h (Incremental_binary): Remove unused member target_.
2881 (Incremental_script_entry): Removed unused member script_.
2882 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2883 * icf.h (Icf): Remove unused member num_tracked_relocs.
2884
39d9ead7
RM
2885 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2886 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2887 its only use.
2888 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2889
679e4abf
RM
2890 * archive.h: Use struct rather than class for forward declaration
2891 of Read_symbols_data.
2892
54de2ea6
CC
28932013-10-07 Cary Coutant <ccoutant@google.com>
2894
2895 PR gold/16010
2896 * testsuite/Makefile.am (icf_test): Fix dependencies.
2897 (icf_safe_test): Likewise.
2898 (icf_safe_so_test): Likewise.
2899 (large_symbol_alignment): Add empty _LDADD rule.
2900 * testsuite/Makefile.in: Regenerate.
2901
b14016f0
L
29022013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2903
2904 PR gold/15927
2905 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2906 relocation for R_X86_64_32 on x32.
2907
eb426534
RM
29082013-08-27 Roland McGrath <mcgrathr@google.com>
2909
2910 * output.cc (Output_segment::set_section_addresses): Take new
2911 Target* argument. If target->isolate_execinstr() and the segment
2912 is executable and starts at a target->abi_pagesize() boundary,
2913 pad its end out to a target->abi_pagesize() boundary with code fill.
2914 * output.h (Output_segment::set_section_addresses): Update decl.
2915 * layout.h (Layout::check_output_data_for_reset_values): Take new
2916 argument RELAX_OUTPUTS.
2917 (Layout): New member relax_output_list_.
2918 (Layout::add_relax_output): New method.
2919 * layout.cc (Layout::Layout): Update constructor.
2920 (Layout::reset_relax_output): New method.
2921 (Layout::clean_up_after_relaxation): Call it.
2922 (Layout::prepare_for_relaxation): Update caller.
2923 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2924 Call reset_relax_output before re-processing segments for
2925 isolate_execinstr case.
2926 (Layout::write_data): Handle relax_output_list_.
2927 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2928 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2929
9aff4b7a
NC
29302013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2931
2932 PR binutils/15834
2933 * object.h: Fix typos.
2934
93f8221c
RM
29352013-08-16 Roland McGrath <mcgrathr@google.com>
2936
2937 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2938 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2939
e44c3715
CC
29402013-08-07 Cary Coutant <ccoutant@google.com>
2941
2942 Revert support for v2 DWP files:
2943
2944 2013-03-01 Cary Coutant <ccoutant@google.com>
2945
2946 Add dwp support for v2 DWARF package file format.
2947 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2948 tu_length parameter. Adjust all callers.
2949 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2950 * dwp.cc: Include dwarf.h.
2951 (Section_bounds): New struct type.
2952 (Unit_set): New struct type.
2953 (Dwo_file::Dwo_file): Initialize new data member.
2954 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2955 Combine and rename to...
2956 (Dwo_file::read_unit_index): ...this.
2957 (Dwo_file::sized_read_compunit_index)
2958 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2959 (Dwo_file::sized_read_unit_index): ...this.
2960 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2961 parameters; add section_id parameter.
2962 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2963 (Dwo_file::add_unit_set): ...this.
2964 (Dwo_file::shndx_map_): Remove.
2965 (Dwo_file::sect_offsets_): New data member.
2966 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2967 (Dwp_output_file::add_section): Rename to...
2968 (Dwp_output_file::add_contribution): ...this.
2969 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2970 (Dwp_output_file::add_tu_set): Likewise.
2971 (Dwp_output_file::Contribution): New type.
2972 (Dwp_output_file::Section::contributions): New data member.
2973 (Dwp_output_file::Cu_or_tu_set): Remove.
2974 (Dwp_output_file::Section::Section): New ctor.
2975 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2976 (Dwp_output_file::Dwp_index::Section_table): New type.
2977 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2978 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2979 parameter.
2980 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2981 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2982 (Dwp_output_file::Dwp_index::section_table): New member function.
2983 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2984 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2985 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2986 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2987 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2988 (Dwp_output_file::Dwp_index::section_table_): New data member.
2989 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2990 (Dwp_output_file::add_output_section): New member function.
2991 (Dwp_output_file::write_new_section): New member function.
2992 (Dwp_output_file::write_contributions): New member function.
2993 (Dwp_output_file::section_id_map_): New data member.
2994 (class Dwo_id_info_reader): Remove.
2995 (class Unit_reader): New class.
2996 (get_dwarf_section_name): New function.
2997 (Dwo_file::read_executable): Adjust initializations of class data.
2998 (Dwo_file::read): Add support for v2 package file format.
2999 (Dwo_file::read_unit_index): Likewise.
3000 (Dwo_file::sized_read_unit_index): Likewise.
3001 (Dwo_file::copy_section): Likewise.
3002 (Dwo_file::add_unit_set): Likewise.
3003 (Dwp_output_file::add_output_section): Likewise.
3004 (Dwp_output_file::add_contribution): Likewise.
3005 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3006 for empty slot.
3007 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3008 file format.
3009 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3010 slot.
3011 (Dwp_output_file::initialize): Remove unused function.
3012 (Dwp_output_file::finalize): Add support for v2 package file format.
3013 (Dwp_output_file::write_index): Likewise.
3014 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3015 function prototype.
3016
c6905c28
CC
30172013-07-31 Cary Coutant <ccoutant@google.com>
3018
3019 * object.cc (Sized_relobj::do_output_section_address): New function.
3020 (Sized_relobj): Instantiate explicitly.
3021 * object.h (Object::output_section_address): New function.
3022 (Object::do_output_section_address): New function.
3023 (Sized_relobj::do_output_section_address): New function.
3024 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3025
30262013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3027 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3028
3029 * parameters.cc (Parameters::entry): Return target-specific entry
3030 symbol name.
3031 * target.h (Target::entry_symbol_name): New function.
3032 (Target_info::entry_symbol_name): New data member.
3033
3034 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3035 * i386.cc (Target_i386::i386_info): Likewise.
3036 (Target_i386_nacl::i386_nacl_info): Likewise.
3037 * sparc.cc (Target_sparc::sparc_info): Likewise.
3038 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3039 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3040 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3041 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3042
234d4ab8
SA
30432013-07-22 Sterling Augustine <saugustine@google.com>
3044
3045 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3046 Convert parameter shndx to local variable. Add parameters symtab
3047 and symtab_size. Scan over section names. Find relocation
3048 section corresponding to current section. Create and initialize
3049 reloc_mapper_ and reloc_type_.
3050 (Dwarf_pubnames_table::read_header): Add assertion. Change
3051 unit_length to off_t. Initialize member unit_length_. Fill in field
3052 cu_offset_.
3053 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3054 Initialize new fields unit_length_ and cu_offset_.
3055 (Dwarf_pubnames_table::read_section): Update prototype.
3056 (Dwarf_pubnames_table::cu_offset): New member function.
3057 (Dwarf_pubnames_table::subsection_size): Likewise.
3058 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3059 New fields.
3060 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3061 member functions public.
3062 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3063 Update comment. Rework logic. Move repeated parts to...
3064 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3065 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3066 pubtypes_table_, and stmt_list_offset.
3067 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3068 Gdb_index::find_pubtype_offset,
3069 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3070 (Gdb_index::pubnames_read): Update prototype and rework logic.
3071 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3072 Forward declare.
3073 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3074 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3075 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3076 Gdb_index::map_pubtable_to_dies):
3077 Declare functions.
3078 (Gdb_index::pubnames_read): Update declaration.
3079 (Gdb_index::Pubname_offset_map): New type.
3080 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3081 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3082 Gdb_index::stmt_list_offset): Declare.
3083 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3084 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3085 Gdb_index::pubtypes_offset_): Remove.
3086
a3ed37d8
RM
30872013-07-19 Roland McGrath <mcgrathr@google.com>
3088
3089 * options.h (General_options): Add -Trodata-segment option.
3090 * parameters.cc (Parameters::check_rodata_segment): New function.
3091 (Parameters::set_target_once): Call it.
3092 * parameters.h (Parameters): Declare it (private member function).
3093 * layout.cc (load_seg_unusable_for_headers): New function, broken
3094 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3095 then validate rodata segment rather than text segment.
3096 (relaxation_loop_body): Call that.
3097 (is_text_segment): New function. Don't admit a non-executable
3098 segment if TARGET->isolate_execinstr().
3099 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3100
eb5b4ded
CC
31012013-07-15 Shawn Landden <shawnlandden@gmail.com>
3102
3103 PR gold/15070
3104 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3105 * nacl.h (Sniff_file::View::View): Request aligned view.
3106
4d5effb9
CC
31072013-07-11 Cary Coutant <ccoutant@google.com>
3108
3109 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3110 correct BRLT entry size.
3111
ba8ca3e7
AM
31122013-07-03 Alan Modra <amodra@gmail.com>
3113
3114 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3115 comment.
3116
267257d2
CC
31172013-07-01 Cary Coutant <ccoutant@google.com>
3118
3119 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3120 reloc_type_.
3121 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3122 (Dwarf_ranges_table::lookup_reloc): New function.
3123 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3124 reloc_type_.
3125 (Dwarf_ranges_table::lookup_reloc): New function.
3126 (Dwarf_ranges_table::reloc_type_): New data member.
3127
06f30c9d
CC
31282013-06-27 Jing Yu <jingyu@google.com>
3129
3130 PR gold/15662
3131 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3132 function.
3133 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3134 (Target_powerpc::do_relax): Call the above.
3135
a2d7bf59
AM
31362013-06-27 Cary Coutant <ccoutant@google.com>
3137
3138 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3139 on garbage collected .opd section.
3140
31412013-06-27 Alan Modra <amodra@gmail.com>
3142
3143 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3144 is non-zero.
3145 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3146 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3147
32364e50
CC
31482013-06-14 Cary Coutant <ccoutant@google.com>
3149
3150 * resolve.cc (Symbol::override_base): Don't override st_type
3151 from plugin placeholder symbols.
3152 (Symbol_table::resolve): Likewise.
3153 (Symbol_table::should_override): Don't complain about TLS mismatch
3154 if the TO symbol is a plugin placeholder.
3155 * testsuite/Makefile.am (plugin_test_tls): New test.
3156 * testsuite/Makefile.in: Regenerate.
3157 * testsuite/plugin_test_tls.sh: New test script.
3158 * testsuite/two_file_test_2_tls.cc: New test source.
3159 * testsuite/two_file_test_tls.cc: New test source.
3160
7fb47cc9
CC
31612013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3162
3163 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3164 the maximum segment alignment is larger than the page size.
3165 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3166 correctly aligns the symbols with large alignemnt.
3167 * testsuite/Makefile.in: Regenerate.
3168 * testsuite/large_symbol_alignment.cc: New file.
3169
6934001a
CC
31702013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3171 Sriraman Tallam <tmsriram@google.com>
3172
3173 * options.h (sort_section): New option.
3174 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3175 Rename from Input_section_sort_section_name_special_ordering_compare.
3176 (Input_section_sort_section_name_compare): New struct.
3177 * output.cc (Output_section::Input_section_sort_section_name_compare::
3178 operator()): New function.
3179 (Output_section::sort_attached_input_sections): Use new sort function
3180 for .text if --sort-section=name is specified.
3181 * layout.cc (Layout::make_output_section):
3182 Add sorting by name when --sort-section=name is specified.
3183 * testsuite/Makefile.am (text_section_grouping): Test option
3184 --sort-section=name.
3185 * testsuite/Makefile.in: Regenerate.
3186 * testsuite/section_sorting_name.cc: New file.
3187 * testsuite/section_sorting_name.sh: New file.
3188
93acabad
CC
31892013-05-21 Cary Coutant <ccoutant@google.com>
3190
3191 * symtab.h (Symbol::is_cxx_vtable): New function.
3192 * target-reloc.h (relocate_section): Check for vtable symbol.
3193 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3194 * testsuite/Makefile.in: Regenerate.
3195 * testsuite/missing_key_func.cc: New test source.
3196 * testsuite/missing_key_func.sh: New test script.
3197
60e8b3fc
CC
31982013-05-21 Cary Coutant <ccoutant@google.com>
3199
2b64b551
RM
3200 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3201 type of enclosing symbol.
3202 (Relocate_info::location): Check symbol type when describing symbol.
3203 * object.h (Symbol_location_info): Remove unused line_number;
3204 add enclosing_symbol_type.
3205 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3206
9df9de2c
CC
32072013-05-13 Cary Coutant <ccoutant@google.com>
3208
2b64b551
RM
3209 * configure.ac: Export DEFAULT_TARGET.
3210 * configure: Regenerate.
3211 * Makefile.in: Regenerate.
3212 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3213 * testsuite/Makefile.in: Regenerate.
3214 * testsuite/debug_msg.sh: Delete duplicate tests.
3215 Don't check undef_int error message match for powerpc where the
3216 source file and line number aren't available.
9df9de2c 3217
bbc5ae17
RM
32182013-05-10 Roland McGrath <mcgrathr@google.com>
3219
3220 * options.h (General_options): Add --rosegment-gap option.
3221 * options.cc (finalize): --rosegment-gap implies --rosegment.
3222 * layout.cc (set_segment_offsets): Let user option override
3223 target->rosegment_gap().
3224
0c6e6c39
RM
32252013-05-10 Roland McGrath <mcgrathr@google.com>
3226
3227 * options.h (General_options): Remove leading space from help
3228 messages for -nostdlib and --rosegment.
3229
cde7cb01
MR
32302013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3231
3232 PR ld/15365
3233 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3234
f31ae5b8
AM
32352013-05-03 Alan Modra <amodra@gmail.com>
3236
3237 * merge.cc (Output_merge_string::do_add_input_section): Correct
3238 scan for number of strings. Rename vars to avoid shadowing.
3239 Include missing terminator in input_size_.
3240
d3a7cd45
L
32412013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3242
3243 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3244 Restore empty string handling.
3245
6ad3daba
CC
32462013-05-01 Cary Coutant <ccoutant@google.com>
3247
3248 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3249 uninitialized warning.
3250
e31908b6
CC
32512013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3252
3253 * output.cc (Output_section::add_merge_input_section): Allow
3254 to merge sections if the alignment is more than character size.
3255 * merge.h (Output_merge_string::Output_merge_string): Remove
3256 assert.
3257 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3258 only not-null strings. Check the alignment of strings.
3259 * stringpool.h
3260 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3261 alignment as the argument.
3262 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3263 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3264 Align non-zero length strings according to the addralign_.
3265 (Stringpool_template<Stringpool_char>::set_string_offsets):
3266 Updating offsets according to the given alignment.
3267 * testsuite/Makefile.am (text_section_grouping): Test if string
3268 literals are getting merged.
3269 * testsuite/Makefile.in: Regenerate.
3270 * testsuite/merge_string_literals_1.c: New file.
3271 * testsuite/merge_string_literals_2.c: Ditto.
3272 * testsuite/merge_string_literals.sh: Ditto.
3273
0e804863
ILT
32742013-04-26 Ian Lance Taylor <iant@google.com>
3275
3276 * target-reloc.h (relocate_section): If the reloc offset is out of
3277 range, pass VIEW as NULL to relocate.relocate.
3278 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3279 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3280 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3281 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3282 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3283 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3284
e7c5ea40
CC
32852013-04-26 Geoff Pike <gpike@chromium.org>
3286
3287 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3288 * layout.cc (Hash_task): New class.
3289 (Layout::queue_build_id_tasks): New function.
3290 (Layout::write_build_id): Handle single-thread portion of build ID
3291 computation. (In some cases, all of it is single-threaded.) Replace
3292 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3293 functionality in fewer lines of code.
3294 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3295 * options.h (General_options): make "--build-id" default to tree
3296 rather than sha1. Add two new options related to --build-id=tree:
3297 --build-id-chunk-size-for-treehash and
3298 --build-id-min-file-size-for-treehash.
3299 * Makefile.am: add testing of --build-id=tree and related new options
3300 (these tests will be invoked by "make check").
3301 * Makefile.in: Regenerate.
3302
49926cd0
AM
33032013-04-25 Alan Modra <amodra@gmail.com>
3304
3305 * configure.tgt: Add powerpcle and powerpc64le.
3306
a4034750
AM
33072013-04-22 Alan Modra <amodra@gmail.com>
3308
3309 PR gold/15355
3310 * layout.cc (Layout::segment_precedes): Allow more than one
3311 segment with the same type and flags.
3312
e79c84aa
CC
33132013-04-15 Cary Coutant <ccoutant@google.com>
3314
3315 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3316 allocate space in file for BSS sections.
3317
2199fbe7
CC
33182013-04-15 Cary Coutant <ccoutant@google.com>
3319
3320 * script-sections.cc (Orphan_output_section): Reset address
3321 to zero after each orphaned section for relocatable links.
3322
502e8a84
CC
33232013-04-15 Cary Coutant <ccoutant@google.com>
3324
a4034750
AM
3325 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3326 section starting address for relocatable link.
3327 * testsuite/Makefile.am (script_test_11): New test.
3328 * testsuite/Makefile.in: Regenerate.
3329 * testsuite/script_test_11.c: New source file.
3330 * testsuite/script_test_11.t: New linker script.
502e8a84 3331
0cfdc767
AM
33322013-04-13 Alan Modra <amodra@gmail.com>
3333
3334 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3335 owner when sections are not adjacent and exceed group size.
3336 (Target_powerpc::group_sections): Handle corner case.
3337 (Target_powerpc::Branch_info::make_stub): Handle case where
3338 stub table doesn't exist due to branches in non-exec sections.
3339 (Target_powerpc::Relocate::relocate): Likewise.
3340
6830ee24
AM
33412013-04-11 Alan Modra <amodra@gmail.com>
3342
3343 PR gold/15354
3344 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3345 .branch_lt to match bfd ld. Adjust comments throughout file.
3346
54a3d865
ILT
33472013-04-04 Ian Lance Taylor <iant@google.com>
3348
3349 GCC PR c++/56840
3350 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3351 sections before checking whether they are included in the link.
3352
9993ba11
ST
33532013-03-29 Sriraman Tallam <tmsriram@google.com>
3354
3355 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3356 object before calling the plugin claim_file handler. Pass the elf
3357 object of the archive to the plugin. Delete the elf object if the
3358 plugin claims the file.
3359
ebacd51e
AM
33602013-03-21 Alan Modra <amodra@gmail.com>
3361
3362 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3363 segment when omagic.
3364
117be58f
AM
33652013-03-21 Alan Modra <amodra@gmail.com>
3366
3367 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3368 comparison warning.
3369 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3370 uninitialized" warning.
3371
32e2b61d
AM
33722013-03-20 Alan Modra <amodra@gmail.com>
3373
3374 * symtab.h (Symbol::clear_version): New function.
3375 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3376 is_needed by weak references. Clear version for symbols defined
3377 in as-needed objects that are not needed.
3378
b3ccdeb5
AM
33792013-03-15 Alan Modra <amodra@gmail.com>
3380
3381 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3382 static and public. Add report_err param. Return false for data refs.
3383 (Target_powerpc::rela_dyn_section): New overloaded function.
3384 (Target_powerpc::plt_, iplt_): Elucidate.
3385 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3386 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3387 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3388 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3389 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3390 push_branch and make_plt_entry for ifunc syms when
3391 reloc_needs_plt_for_ifunc.
3392 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3393 for ifunc unless reloc_needs_plt_for_ifunc.
3394
ad3d8a2f
AM
33952013-03-15 Alan Modra <amodra@gmail.com>
3396
3397 * gc.h (gc_process_relocs): Don't look through function descriptors.
3398 * icf.cc (get_section_contents): Do so here instead.
3399
4d9aa155
AM
34002013-03-13 Alan Modra <amodra@gmail.com>
3401
3402 * powerpc.cc (is_branch_reloc): Forward declare.
3403 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3404 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3405 false for 64-bit, true for 32-bit non-branch relocs.
3406 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3407 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3408 nm output.
3409 (icf_safe_test): Generate linker map file as well as nm output.
3410 (icf_safe_so_test): Likewise.
3411 * testsuite/Makefile.in: Regenerate.
3412 * testsuite/icf_test.sh: Parse linker map file to determine
3413 section folding.
3414 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3415 * testsuite/icf_safe_so_test.sh: Likewise.
3416 (X86_32_or_ARM_specific_safe_fold): Merge into..
3417 (arch_specific_safe_fold): ..this.
3418 (X86_64_specific_safe_fold): Delete unused function.
3419
57420c20
AM
34202013-03-12 Alan Modra <amodra@gmail.com>
3421
3422 * gc.h (gc_process_relocs): Look through function descriptors
3423 to determine shndx, symvalue and addend used by ICF. Tidy
3424 variable duplication.
3425
dc3714f3
AM
34262013-03-11 Alan Modra <amodra@gmail.com>
3427
3428 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3429 * layout.cc (Layout_task_runner::run): ..to here.
3430 * symtab.h (struct Symbol_location): Extract from..
3431 (class Symbol_table): ..here.
3432 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3433 * target.h (class Target): Add function_location and
3434 do_function_location functions.
3435 (class Sized_target): Add do_function_location.
3436 * object.h (class Sized_relobj_file): Move find_shdr..
3437 (class Object): ..to here.
3438 * object.cc: Likewise. Update to suit. Instantiate.
3439 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3440 * powerpc.cc (class Powerpc_dynobj): New.
3441 (Target_powerpc::do_function_location): New function.
3442 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3443 (Powerpc_dynobj::do_read_symbols): New function.
3444 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3445
956b03bb
ILT
34462013-03-08 Ian Lance Taylor <iant@google.com>
3447
3448 * options.cc (General_options::string_to_object_format): Accept
3449 "default".
3450
4bead2d5
AM
34512013-03-08 Alan Modra <amodra@gmail.com>
3452
3453 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3454 pointer to Post_fde.
3455 (struct Post_fde): Move definition to here..
3456 * ehframe.cc (struct Post_fde): ..from here.
3457 (Cie::write): Don't alloc Post_fde.
3458 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3459
02e60bf7
AM
34602013-03-07 Alan Modra <amodra@gmail.com>
3461
3462 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3463 relocation referencing .LC0.
3464 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3465
8343f03a
AM
34662013-03-07 Alan Modra <amodra@gmail.com>
3467
3468 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3469 always_inline. Add assembly for powerpc to avoid GOT.
3470
3366d57c
AM
34712013-03-07 Alan Modra <amodra@gmail.com>
3472
3473 * testsuite/script_test_10.sh: Don't test .bss section
3474 header number.
3475
6c77229c
AM
34762013-03-06 Alan Modra <amodra@gmail.com>
3477
3478 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3479 (Target_powerpc::symval_for_branch): Add symtab param. Update
3480 all callers. Handle folded sections.
3481 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3482 to Powerpc_relobj.
3483 (Global_symbol_visitor_opd::operator()): Likewise.
3484
a39e4af6
AM
34852013-03-04 Alan Modra <amodra@gmail.com>
3486
3487 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3488 * testsuite/Makefile.in: Regenerate.
3489
d5834edb
CC
34902013-03-01 Cary Coutant <ccoutant@google.com>
3491
3492 Add dwp support for v2 DWARF package file format.
3493 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3494 tu_length parameter. Adjust all callers.
3495 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3496 * dwp.cc: Include dwarf.h.
3497 (Section_bounds): New struct type.
3498 (Unit_set): New struct type.
3499 (Dwo_file::Dwo_file): Initialize new data member.
3500 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3501 Combine and rename to...
3502 (Dwo_file::read_unit_index): ...this.
3503 (Dwo_file::sized_read_compunit_index)
3504 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3505 (Dwo_file::sized_read_unit_index): ...this.
3506 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3507 parameters; add section_id parameter.
3508 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3509 (Dwo_file::add_unit_set): ...this.
3510 (Dwo_file::shndx_map_): Remove.
3511 (Dwo_file::sect_offsets_): New data member.
3512 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3513 (Dwp_output_file::add_section): Rename to...
3514 (Dwp_output_file::add_contribution): ...this.
3515 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3516 (Dwp_output_file::add_tu_set): Likewise.
3517 (Dwp_output_file::Contribution): New type.
3518 (Dwp_output_file::Section::contributions): New data member.
3519 (Dwp_output_file::Cu_or_tu_set): Remove.
3520 (Dwp_output_file::Section::Section): New ctor.
3521 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3522 (Dwp_output_file::Dwp_index::Section_table): New type.
3523 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3524 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3525 parameter.
3526 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3527 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3528 (Dwp_output_file::Dwp_index::section_table): New member function.
3529 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3530 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3531 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3532 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3533 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3534 (Dwp_output_file::Dwp_index::section_table_): New data member.
3535 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3536 (Dwp_output_file::add_output_section): New member function.
3537 (Dwp_output_file::write_new_section): New member function.
3538 (Dwp_output_file::write_contributions): New member function.
3539 (Dwp_output_file::section_id_map_): New data member.
3540 (class Dwo_id_info_reader): Remove.
3541 (class Unit_reader): New class.
3542 (get_dwarf_section_name): New function.
3543 (Dwo_file::read_executable): Adjust initializations of class data.
3544 (Dwo_file::read): Add support for v2 package file format.
3545 (Dwo_file::read_unit_index): Likewise.
3546 (Dwo_file::sized_read_unit_index): Likewise.
3547 (Dwo_file::copy_section): Likewise.
3548 (Dwo_file::add_unit_set): Likewise.
3549 (Dwp_output_file::add_output_section): Likewise.
3550 (Dwp_output_file::add_contribution): Likewise.
3551 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3552 for empty slot.
3553 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3554 file format.
3555 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3556 slot.
3557 (Dwp_output_file::initialize): Remove unused function.
3558 (Dwp_output_file::finalize): Add support for v2 package file format.
3559 (Dwp_output_file::write_index): Likewise.
3560 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3561 function prototype.
3562
a68a081d
CC
35632013-03-01 Cary Coutant <ccoutant@google.com>
3564
3565 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3566 function into class definition in header file.
3567 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3568 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3569 New function.
3570 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3571
9d5781f8
AM
35722013-02-28 Alan Modra <amodra@gmail.com>
3573
3574 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3575 * target.cc (Target::do_plt_fde_location): New function.
3576 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3577 accessor function, and constructor param.
3578 (struct Post_fde, Post_fdes): Declare.
3579 (Cie::write): Add post_fdes param.
3580 * ehframe.cc (Fde::write): Use plt_fde_location.
3581 (struct Post_fde): Define.
3582 (Cie::write): Stash FDEs added post merge mapping.
3583 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3584 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3585 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3586 other FDEs.
3587 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3588 (Target_powerpc::has_glink): New function.
3589 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3590 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3591 glink_eh_frame_fde_32, default_fde): New data.
3592 (Stub_table::eh_frame_added_): New var.
3593 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3594 Make const.
3595 (Stub_table::add_eh_frame): New function.
3596 (Output_data_glink::add_eh_frame): New function.
3597 (Target_powerpc::make_glink_section): Call add_eh_frame.
3598
214383dd
ILT
35992013-02-15 Ian Lance Taylor <iant@google.com>
3600
3601 * options.h (DEFINE_uint64_alias): Define.
3602 (class General_options): Add -Ttext-segment as an alias for
3603 -Ttext.
3604
91c2b899
AM
36052013-02-15 Alan Modra <amodra@gmail.com>
3606
3607 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3608 (Stub_table::do_write): ..here, two places.
3609 (Stub_table::plt_call_size): Use it here too.
3610
20e2a8aa
ILT
36112013-02-11 Ian Lance Taylor <iant@google.com>
3612
3613 * descriptors.cc (Descriptors::close_all): New function.
3614 * descriptors.h (class Descriptors): Declare close_all.
3615 (close_all_descriptors): New inline function.
3616 * plugin.cc: Include "descriptors.h".
3617 (Plugin_manager::cleanup): Call close_all_descriptors.
3618
8952bc69
AM
36192013-02-06 Alan Modra <amodra@gmail.com>
3620
3621 * README: Update coding style link.
3622
29bd8b6b
CC
36232013-01-28 Cary Coutant <ccoutant@google.com>
3624
a4034750
AM
3625 * dwp.cc (File_list): New typedef.
3626 (Dwo_name_info_reader): New class.
3627 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3628 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3629 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3630 (Dwo_file::read_executable): New function.
3631 (Dwo_file::read): Move common setup code to ...
3632 (Dwo_file::make_object): ... here.
3633 (dwp_options): Add --exec/-e.
3634 (usage): Likewise.
3635 (main): Likewise.
29bd8b6b 3636
c6ac678d
ST
36372013-01-24 Sriraman Tallam <tmsriram@google.com>
3638
3639 * layout.cc (Layout::layout): Check for option text_reorder.
3640 (Layout::make_output_section): Ditto.
3641 * options.h (text_reorder): New option.
3642 * output.cc (Input_section_sort_compare): Remove special ordering
3643 of section names.
3644 (Output_section::
3645 Input_section_sort_section_name_special_ordering_compare::
3646 operator()): New function.
3647 (Output_section::sort_attached_input_sections): Use new sort function
3648 for .text.
3649 * output.h (Input_section_sort_section_name_special_ordering_compare):
3650 New struct.
3651 * testsuite/Makefile.am (text_section_grouping): Test option
3652 --no-text-reorder
3653 * testsuite/Makefile.in: Regenerate.
3654 * testsuite/text_section_grouping.sh: Check order of functions without
3655 default text reordering.
3656
50701cc1
MF
36572013-01-18 Mike Frysinger <vapier@gentoo.org>
3658
3659 * options.h (General_options): Change default to true for new_dtags.
3660
b1b00fcc
MF
36612013-01-18 Mike Frysinger <vapier@gentoo.org>
3662
3663 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3664 when enable_new_dtags is false. Only add DT_RUNPATH when
3665 enable_new_dtags is true.
3666
ec5b8187
AM
36672013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3668
3669 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3670 used in declaration and definition consistent.
3671 (Target_powerpc::symval_for_branch): Ditto.
3672
a880d4c4
ST
36732013-01-16 Sriraman Tallam <tmsriram@google.com>
3674
3675 * testsuite/plugin_final_layout.cc: Fix comment.
3676
7c381248
ST
36772013-01-16 Sriraman Tallam <tmsriram@google.com>
3678
3679 * layout.cc (Layout::layout): Do not do default sorting for
3680 text sections when section ordering is specified.
3681 (make_output_section): Ditto.
3682 * testsuite/plugin_final_layout.cc: Name the function sections
3683 to catch reordering issues.
3684
e2458743
AM
36852013-01-15 Alan Modra <amodra@gmail.com>
3686
3687 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3688 plt-thread-safe.
3689
431ed302
AM
36902013-01-15 Alan Modra <amodra@gmail.com>
3691
3692 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3693 * testsuite/Makefile.in: Regenerate.
3694
0ec6429b
AM
36952013-01-14 Alan Modra <amodra@gmail.com>
3696
3697 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3698 * testsuite/Makefile.in: Regenerate.
3699
0bf402d5
ILT
37002013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3701
36af3926 3702 PR bfd/14430
0bf402d5
ILT
3703 Fix mingw gold build with plugins enabled
3704 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3705 * configure.ac: Export DLOPEN_LIBS and add headers check.
3706 * plugin.cc: Handle non-dlfcn case.
3707 * Makefile.in: Regenerate.
3708 * config.in: Regenerate.
3709 * configure: Regenerate.
3710 * testsuite/Makefile.in: Regenerate.
3711
9e9143bc
ST
37122013-01-09 Sriraman Tallam <tmsriram@google.com>
3713
3714 * output.h (sort_attached_input_sections): Change to be public.
3715 * script-sections.cc
3716 (Output_section_definition::set_section_addresses): Sort
3717 attached input sections according to section order before linker
3718 script assigns section addresses.
3719 (Orphan_output_section::set_section_addresses): Sort
3720 attached input sections according to section order before linker
3721 script assigns section addresses.
3722 * Makefile.am (final_layout.sh): Use a simple linker script to
3723 check if section ordering still works.
3724 * Makefile.in: Regenerate.
3725
679af368
ILT
37262013-01-09 Ben Cheng <bccheng@google.com>
3727
3728 * arm.cc (Target_arm::attributes_accept_div): New function.
3729 (Target_arm::attributes_forbid_div): New function.
3730 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3731 attribute using the same new functions as what bfd/elf32_arm.c
3732 does.
3733
3136a00e
CC
37342013-01-07 Cary Coutant <ccoutant@google.com>
3735
3736 PR gold/14993
3737 * output.cc (Output_section::add_input_section): For incremental
3738 updates, don't track input sections that are allocated from patch
3739 space.
3740
f2a6224b
L
37412013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3742 Ian Lance Taylor <iant@google.com>
3743
3744 PR gold/14897
3745 * configure.ac (--enable-ld): Removed.
3746 (install_as_default): Set to yes only for --enable-gold=default
3747 or --disable-ld.
3748 * configure: Regenerated.
3749
4f46f626
L
37502013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3751
3752 * options.h (General_options): Add -fuse-ld= for GCC linker
3753 option compatibility.
3754
26e4ef59
CC
37552013-01-04 Cary Coutant <ccoutant@google.com>
3756
3757 * configure.ac: Fix typo restoring CXXFLAGS.
3758 * configure: Regenerate.
3759
3d587466
CC
37602013-01-04 Cary Coutant <ccoutant@google.com>
3761
4f46f626
L
3762 * testsuite/Makefile.am (CXXLINK_S): New macro.
3763 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3764 * testsuite/Makefile.in: Regenerate.
3d587466 3765
44db6695
L
37662013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3767
3768 * version.cc (print_version): Update copyright year to 2013.
3769
edcac0c1
ILT
37702012-12-20 Ian Lance Taylor <iant@google.com>
3771
3772 * layout.cc (Layout::special_ordering_of_input_section): New
3773 function.
3774 (Layout::layout): If input section requires special ordering, must
3775 sort input sections.
3776 (Layout::make_output_section): May sort .text input sections.
3777 (Layout::is_section_name_prefix_grouped): Remove.
3778 * layout.h (class Layout): Declare
3779 special_ordering_of_input_section. Don't declare
3780 is_section_name_prefix_grouped.
3781 * output.cc (Output_section::add_input_section): Revert last
3782 change.
3783 (Output_section::Input_section_sort::match_file_name): Don't crash
3784 if called on output section data.
3785 (Output_section::Input_section_sort_compare): Sort based on
3786 special ordering.
3787 (Output_section::Input_section_sort_section_order_index_compare):
3788 Revert last patch.
3789 (Output_section::sort_attached_input_sections): Likewise.
3790
28f2a4ac
ST
37912012-12-18 Sriraman Tallam <tmsriram@google.com>
3792
edcac0c1 3793 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3794 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3795 * output.cc (Output_section::add_input_section): Check if section
3796 name contains special prefix. Keep input sections to sort such
3797 sections.
3798 (Output_section::Input_section_sort_section_order_index_compare
3799 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3800 (Output_section::sort_attached_input_sections): Add condition to
3801 Input_section_entry constructor call.
28f2a4ac
ST
3802 * testsuite/Makefile.am (text_section_grouping): New test.
3803 * testsuite/Makefile.in: Regenerate.
3804 * testsuite/text_section_grouping.cc: New file.
3805 * testsuite/text_section_grouping.sh: New file.
3806
5bf135a7
NC
38072012-12-17 Nick Clifton <nickc@redhat.com>
3808
3809 * Makefile.am: Add copyright notice.
3810 * NEWS: Likewise.
3811 * README: Likewise.
3812 * configure.ac: Likewise.
3813 * ftruncate.c: Likewise.
3814 * Makefile.in: Regenerate.
3815
59965708
CC
38162012-12-14 Cary Coutant <ccoutant@google.com>
3817
a4034750
AM
3818 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3819 --no-as-needed flag.
3820 (exception_separate_shared_12_test): Likewise.
3821 (incremental_copy_test): Likewise.
3822 * testsuite/Makefile.in: Regenerate.
59965708 3823
2a77e2ab
CC
38242012-12-14 Cary Coutant <ccoutant@google.com>
3825
3826 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3827 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3828
e3deeb9c
AM
38292012-12-12 Alan Modra <amodra@gmail.com>
3830
3831 * powerpc.cc (class Track_tls): New.
3832 (class Relocate, class Scan): Inherit Track_tls.
3833 (Target_powerpc::Scan::local, global): Track tls optimization
3834 and avoid creating plt entry for __tls_get_addr if all uses
3835 are optimized away.
3836 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3837
d8f5a274
AM
38382012-12-12 Alan Modra <amodra@gmail.com>
3839
3840 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3841 Replace no_toc_optimize with toc_optimize.
3842 * output.h (Output_section::input_sections): Provide non-const variant.
3843 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3844 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3845 accessors.
3846 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3847 (class Sort_toc_sections): New.
3848 (Target_powerpc::do_finalize_sections): Sort toc sections.
3849 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3850
4c8a1de1
RM
38512012-12-10 Roland McGrath <mcgrathr@google.com>
3852
3853 * testsuite/binary_unittest.cc (read_all): New function.
3854 (Sized_binary_test): Use it instead of ::read.
3855 * fileread.cc (do_read): Don't assume pread always reads the whole
3856 amount in a single call.
3857
edc27beb
AM
38582012-12-10 Alan Modra <amodra@gmail.com>
3859
3860 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3861 Set EM_PPC64 or EM_PPC here.
3862 (Target_selector_powerpc::do_recognize): Delete.
3863
906b9150
AM
38642012-12-10 Alan Modra <amodra@gmail.com>
3865
3866 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3867 stub_table_.
3868 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3869
418c15ae
RM
38702012-12-07 Roland McGrath <mcgrathr@google.com>
3871
3872 * testsuite/binary_unittest.cc (Sized_binary_test):
3873 Use open_descriptor rather than ::open.
3874
decdd3bc
AM
38752012-12-07 Alan Modra <amodra@gmail.com>
3876
3877 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3878 typedef and invalid_address constant.
3879 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3880 instantiate constants.
3881
db399005
ILT
38822012-12-06 Roland McGrath <mcgrathr@google.com>
3883
3884 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3885 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3886 * aclocal.m4: Regenerate.
3887 * configure: Regenerate.
3888 * Makefile.in: Regenerate.
3889 * testsuite/Makefile.in: Regenerate.
3890
aba6bc71
AM
38912012-12-07 Alan Modra <amodra@gmail.com>
3892
3893 * options.h (General_options): Add no_toc_optimize.
3894 * powerpc.cc (ok_lo_toc_insn): New function.
3895 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3896
9e69ed50
AM
38972012-12-06 Alan Modra <amodra@gmail.com>
3898
3899 * options.h (General_options): Add plt_align, plt_static_chain,
3900 plt_thread_safe. Update stub_group_size help text.
3901 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3902 for new plt_thread_safe_ var.
3903 (use_plt_offset): Correct comments.
3904 (Target_powerpc::do_relax): Look for thread creation symbols to
3905 determine default plt_thread_safe value. Clear plt call stubs
3906 as well as branch stubs each iteration.
3907 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3908 insn constants.
3909 (l, hi, ha, write_insn): Move earlier.
3910 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3911 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3912 plt stubs too.
3913 (Stub_table::update_size): Adjust.
3914 (Stub_table::prev_size, set_prev_size): Delete.
3915 (Stub_table::stub_align): Let --plt-align affect result.
3916 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3917 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3918 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3919 (Stub_table::do_write): Support more stub variants.
3920
f43ba157
AM
39212012-12-04 Alan Modra <amodra@gmail.com>
3922
3923 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3924 (Target_powerpc::do_define_standard_symbols): New function.
3925
34171bc5
AM
39262012-12-03 Alan Modra <amodra@gmail.com>
3927
3928 * output.h: Formatting, whitespace.
3929
dc9589e9 39302012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3931
3932 * layout.h (Layout::get_executable_sections): Declare.
3933 * layout.cc (Layout::get_executable_sections): New function.
3934 * arm.cc (Target_arm::group_sections): Use it.
3935 (Arm_output_section::group_sections): Delete now redundant test.
3936 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3937 param to handle relative relocs.
3938 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3939 (Output_data_reloc::add_absolute): Adjust.
3940 (Output_data_reloc::add_relative): New function.
3941 (Output_data::reset_data_size): New function.
3942 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3943 (Output_section::set_addralign): New function.
3944 (Output_section::checkpoint_set_addralign): New function.
3945 (Output_section::clear_section_offsets_need_adjustment): New function.
3946 (Output_section::input_sections): Make public.
3947 * powerpc.cc (class Output_data_brlt_powerpc): New.
3948 (class Stub_table, class Stub_control): New.
3949 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3950 stub_table_, set_stub_table, stub_table): New vectors and accessor
3951 functions.
3952 (Target_powerpc::do_may_relax, do_relax, push_branch,
3953 new_stub_table, stub_tables, brlt_section, group_sections,
3954 add_branch_lookup_table, find_branch_lookup_table,
3955 write_branch_lookup_table, make_brlt_section): New functions.
3956 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3957 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3958 branch_info_): New vars.
3959 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3960 make call stubs here.
3961 (Output_data_glink): Remove all call stub handling from this class.
3962 (Target_powerpc::Scan::local, global): Save interesting branch
3963 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3964 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3965 functions on final link.
3966 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3967 Handle long branch destinations too.
3968 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3969 do_plt_address_for_local): Adjust lookup of plt call stubs.
3970
627b30b7
AM
39712012-11-30 Alan Modra <amodra@gmail.com>
3972
3973 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3974 relocs against protected symbols when building 32-bit shared libs.
3975
40b469d7
AM
39762012-11-30 Alan Modra <amodra@gmail.com>
3977
3978 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3979 param. Call got_section() to make .got. Update all callers
3980 and their callers and so on.
3981
bb66a627
AM
39822012-11-30 Alan Modra <amodra@gmail.com>
3983
3984 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3985 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3986 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3987 value if it already exists.
3988
d2cf1c6c
L
39892012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3990
3991 PR gold/14858
3992 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3993
edccdf7c
RM
39942012-11-14 Roland McGrath <mcgrathr@google.com>
3995
3996 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3997 than bfc instruction for data sandboxing.
3998
6febeb74
AM
39992012-11-08 Alan Modra <amodra@gmail.com>
4000
4001 * po/POTFILES.in: Regenerate.
4002
0a6f1bf2
AM
40032012-11-05 Alan Modra <amodra@gmail.com>
4004
4005 * configure.ac: Apply 2012-09-10 change to config.in here.
4006 * configure: Regenerate.
4007
26a4e9cb
AM
40082012-11-05 Alan Modra <amodra@gmail.com>
4009
4010 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4011 (struct Opd_ent): Use "Address" rather than "Offset".
4012 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4013 (Target_powerpc::got_section): Make public.
4014 (Target_powerpc::scan_relocs): Move code setting symbols..
4015 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4016 Create _SDA_BASE_ only when referenced.
4017
cc928013
RM
40182012-11-02 Roland McGrath <mcgrathr@google.com>
4019
4020 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4021 from last change.
4022
50ed5eb1
RM
40232012-11-01 Roland McGrath <mcgrathr@google.com>
4024
62fe925a
RM
4025 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4026 for offset_in_output_section parameter.
4027 (Sized_target::relocate_special_relocatable): Likewise.
4028 * arm.cc (Target_arm::relocate_relocs): Likewise.
4029 (Target_arm::relocate_special_relocatable): Likewise.
4030 * i386.cc (Target_i386::relocate_relocs): Likewise.
4031 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4032 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4033 * target-reloc.h (relocate_relocs): Likewise.
4034 * testsuite/testfile.cc (Target_test): Likewise.
4035 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4036 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4037
4038 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4039 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4040
4041 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4042 parameter, which is unused in the [!F_SETFD] case.
4043
50ed5eb1
RM
4044 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4045 SYMNDX to off_t before comparing it to this->data_size().
4046 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4047 * incremental.cc (Output_section_incremental_inputs::do_write):
4048 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4049
2cadc0bf
RM
4050 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4051
3bfcb652
NC
40522012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4053
4054 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4055 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4056 in EABI_VER5.
4057
c1a8d56e
CC
40582012-10-29 Cary Coutant <ccoutant@google.com>
4059
4060 * dwp.cc (usage): Add file and exit status parameters;
4061 add --help and --version options.
4062 (print_version): New function.
4063 (main): Add --help and --version options.
4064
b2490a7b
L
40652012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4066
4067 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4068 final_layout_sequence.txt.
4069 * testsuite/Makefile.in: Regenerated.
4070
aa543512
L
40712012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4072
4073 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4074 COMPILE generated by automake.
4075 (LINK1): Likewise.
4076 (CXXCOMPILE1): Likewise.
4077 (CXXLINK1): Likewise.
4078 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4079 (LINK): Likewise.
4080 (CXXCOMPILE): Likewise.
4081 (CXXLINK): Likewise.
4082 * testsuite/Makefile.in: Regenerated.
4083
d361fafb
L
40842012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4085
4086 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4087 on bad fwrite return.
4088
598c7410
L
40892012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4090
4091 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4092 on val.
4093
35c813e2
CC
40942012-10-23 Cary Coutant <ccoutant@google.com>
4095
4096 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4097 * testsuite/Makefile.in: Regenerate.
4098 * testsuite/dwp_test.h: New source file.
4099 * testsuite/dwp_test_1.cc: New source file.
4100 * testsuite/dwp_test_1.s: New source file.
4101 * testsuite/dwp_test_1.sh: New source file.
4102 * testsuite/dwp_test_1b.cc: New source file.
4103 * testsuite/dwp_test_1b.s: New source file.
4104 * testsuite/dwp_test_2.cc: New source file.
4105 * testsuite/dwp_test_2.s: New source file.
4106 * testsuite/dwp_test_2.sh: New source file.
4107 * testsuite/dwp_test_main.cc: New source file.
4108 * testsuite/dwp_test_main.s: New source file.
4109
77429909
CC
41102012-10-23 Cary Coutant <ccoutant@google.com>
4111
4112 * dwp.h: New header file.
4113 * dwp.cc: New source file.
4114 * gold.h: Move shared declarations to system.h.
4115 * system.h: New header file.
4116 * Makefile.am: Add dwp.
4117 * Makefile.in: Regenerate.
4118
ed5d6712
CC
41192012-10-23 Cary Coutant <ccoutant@google.com>
4120
4121 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4122 Dwarf_info_reader::read_from_pointer.
4123 (Dwarf_pubnames_table::read_header): Likewise.
4124 (Dwarf_pubnames_table::next_name): Likewise.
4125 (Dwarf_die::read_attributes): Likewise.
4126 (Dwarf_die::skip_attributes): Likewise.
4127 (Dwarf_info_reader::read_from_pointer): New function template.
4128 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4129 (Dwarf_pubnames_table): Likewise.
4130 (Dwarf_info_reader::read_from_pointer): New function template.
4131 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4132 Dwarf_pubnames_table ctor.
4133
8787852d
CC
41342012-10-23 Cary Coutant <ccoutant@google.com>
4135
4136 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4137 abbrev_shndx.
4138 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4139 abbrev_shndx_.
4140 (Dwarf_info_reader::set_abbrev_shndx): New method.
4141 (Dwarf_info_reader::abbrev_shndx_): New data member.
4142
9fc236f3
CC
41432012-10-23 Cary Coutant <ccoutant@google.com>
4144
4145 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4146 from object, not parameters.
4147 (Dwarf_info_reader::parse): Likewise.
4148 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4149 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4150 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4151 methods.
4152
effe8365
CC
41532012-10-23 Cary Coutant <ccoutant@google.com>
4154
4155 * fileread.cc (Input_file::Input_file): New constructor.
4156 * fileread.h (class Input_file): Add new constructor.
4157
1698990d
AM
41582012-10-18 Alan Modra <amodra@gmail.com>
4159
4160 PR gold/14727
4161 * object.cc (Relobj::is_section_name_included): Also match
4162 .sdata personality section.
4163
168a4726
AM
41642012-10-18 Alan Modra <amodra@gmail.com>
4165
4166 * target-reloc.h (class Default_comdat_behavior): New, package up..
4167 (get_comdat_behaviour): ..this.
4168 (relocate_section): Add Relocate_comdat_behavior template arg,
4169 adjust code to suit.
4170 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4171 (Target_arm::scan_reloc_section): Likewise.
4172 * i386.cc (Target_i386::relocate_section): Likewise.
4173 * sparc.cc (Target_sparc::relocate_section): Likewise.
4174 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4175 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4176 * powerpc.cc (class Relocate_comdat_behavior): New.
4177 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4178 gold::relocate_section with new template arg.
4179
acc276d8
AM
41802012-10-18 Alan Modra <amodra@gmail.com>
4181
4182 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4183 dynamic relocs for GOT_TPREL got entries, without symbol if
4184 resolving locally.
4185 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4186 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4187 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4188
e10f9870
AM
41892012-10-17 Alan Modra <amodra@gmail.com>
4190
4191 PR gold/14726
4192 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4193
ae034989
ST
41942012-10-16 Sriraman Tallam <tmsriram@google.com>
4195
4196 * layout.cc (Layout::include_section): Keep sections marked
4197 SHF_EXCLUDE when doing relocatable links.
4198
f3a0ed29
AM
41992012-10-16 Alan Modra <amodra@gmail.com>
4200
4201 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4202 (Target_powerpc::do_finalize_sections): Call it.
4203 (Output_data_save_res): New class and supporting functions.
4204 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4205 normal symbols defined in object files.
4206
c6de8ed4
AM
42072012-10-12 Alan Modra <amodra@gmail.com>
4208
4209 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4210 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4211 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4212 section if scan_opd_relocs not yet called.
4213 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4214
03e25981
AM
42152012-10-12 Alan Modra <amodra@gmail.com>
4216
4217 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4218 add_local_ifunc_entry): Revert last change.
4219 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4220
c9824451
AM
42212012-10-05 Alan Modra <amodra@gmail.com>
4222
4223 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4224 do_plt_address_for_global): New functions.
4225 (Output_data_got_powerpc::do_write): Don't segfault when linking
4226 statically.
4227 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4228 add_local_ifunc_entry): Return true on adding entry..
4229 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4230 glink->add_entry call. Remove unused symtab param. Adjust calls.
4231 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4232 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4233 set up symbols here.
4234 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4235 syms here. Do so even when no .iplt. Don't segfault when linking
4236 statically.
4237 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4238 new variants without reloc param.
4239 (Glink_sym_ent::Glink_sym_ent): Likewise.
4240 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4241 reloc when refs will resolve to plt call stub.
4242 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4243 R_PPC_PLTREL24 to resolve locally.
4244 (Target_powerpc::Scan::global): Correct ifunc handling.
4245 (Target_powerpc::Relocate::relocate): Correct local sym glink
4246 lookup. Don't destroy "value" when we have a plt call stub,
4247 and when checking plt call validity.
4248 (Target_powerpc::do_dynsym_value): Simplify.
4249
19fec8c1
AM
42502012-10-05 Alan Modra <amodra@gmail.com>
4251
4252 * i386.cc (Output_data_plt_i386::address_for_global,
4253 address_for_local): Add plt offset to returned value. Adjust uses.
4254 * sparc.cc (Output_data_plt_sparc::address_for_global,
4255 address_for_local): Likewise.
4256 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4257 address_for_local): Likewise.
4258 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4259 address_for_local): Likewise.
4260 * target.h (Target::plt_address_for_global, plt_address_for_local):
4261 Update comment.
4262 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4263 (Output_data_got::Got_entry::write): Nor here.
4264 * output.h: Comment fix.
4265
e867b647
WL
42662012-10-02 Jiong Wang <jiwang@tilera.com>
4267
4268 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4269 global_offset_table_ value for larget got.
4270 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4271
e5d5f5ed
AM
42722012-09-29 Alan Modra <amodra@gmail.com>
4273
4274 * powerpc.cc (Target_powerpc::iplt_): New output section.
4275 (Target_powerpc::iplt_section, make_iplt_section,
4276 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4277 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4278 Target_powerpc::plt_entry_count): Count iplt entries too.
4279 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4280 reloc section in constructor. New params.
4281 (Target_powerpc::make_plt_section): Create reloc section here instead.
4282 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4283 functions.
4284 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4285 (Output_data_glink::add_entry, find_entry): New functions to
4286 deal with local syms.
4287 (Glink_sym_ent): Add support for local syms.
4288 (Output_data_glink::do_write): Handle ifunc plt entries.
4289 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4290 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4291 (Target_powerpc::Relocate::relocate): Likewise.
4292 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4293
ec4dbad3
AM
42942012-09-25 Alan Modra <amodra@gmail.com>
4295
4296 * object.h (Sized_relobj_file::adjust_local_symbol,
4297 do_adjust_local_symbol): New functions.
4298 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4299 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4300 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4301 and irregular opd entry spacing.
4302 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4303 (Global_symbol_visitor_opd): New functor.
4304 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4305 on deleted opd entries.
4306
5c0b3823
WL
43072012-09-15 Jiong Wang <jiwang@tilera.com>
4308
4309 * tilegx.cc: New file.
4310 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4311 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4312 * configure.tgt: Add entries for tilegx*.
4313 * configure.ac: Likewise.
4314 * Makefile.in: Rebuild.
4315 * configure: Likewise.
4316 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4317 tilegx.
4318
bfdfa4cd
AM
43192012-09-13 Alan Modra <amodra@gmail.com>
4320
4321 * target-reloc.h (scan_relocs): Call scan.local for relocs
4322 against symbols in discarded sections. Pass is_discarded
4323 param.
4324 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4325 Add is_discarded param.
4326 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4327 is_discarded to flag opd entry as discarded. Don't emit dyn
4328 relocs on such entries.
4329 (Target_powerpc::Scan::global): Similarly detect and handle
4330 such opd entries.
4331 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4332 opd_ent_. Update all uses.
4333 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4334 (Target_powerpc::relocate_section): Zero out discarded opd
4335 entry relocs.
4336
d77a0555
ILT
43372012-09-12 Ian Lance Taylor <iant@google.com>
4338
4339 PR gold/14570
4340 * output.cc: Rename Output_data_got template parameter from size
4341 to got_size for all functions. Compile all variants of
4342 Output_data_got.
4343 (Output_data_got::Got_entry::write): Correct use of size for
4344 symbol value. Use local_is_tls rather than casting to
4345 Sized_relobj_file.
4346 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4347 (class Sized_relobj_file): Add do_local_is_tls.
4348 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4349
815a1205
AM
43502012-09-11 Alan Modra <amodra@gmail.com>
4351
4352 PR gold/14566
4353 * layout.cc (Layout::set_segment_offsets): When using
4354 common-page-size alignment, ensure we are on a new max-page-size
4355 page.
4356 * output.cc (Output_segment::set_section_addresses): Use
4357 abi_pagesize, not common_pagesize for relro boundary.
4358 (Output_segment::set_offset): Likewise.
4359
bd73a62d
AM
43602012-09-11 Alan Modra <amodra@gmail.com>
4361
4362 * output.h (Output_data_got::add_global_tls, add_local_tls,
4363 add_local_tls_pair): New functions.
4364 (Output_data_got::add_local_pair_with_rel): Remove second
4365 reloc param. Expand comment.
4366 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4367 use_plt_or_tls_offset_, similarly for constructor param.
4368 (Output_data_got::Got_entry::write): Add got_index param.
4369 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4370 add_local_tls_pair): New functions.
4371 (Output_data_got::Got_entry::write): Handle tls symbols
4372 with use_plt_or_tls_offset_ set specially.
4373 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4374 (Output_data_got::do_write): Replace iterator with index, pass
4375 index to entry write function.
4376 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4377 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4378 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4379 call.
4380 * i386.cc (Target_i386::Scan::local): Likewise.
4381 * sparc.cc (Target_sparc::Scan::local): Likewise.
4382 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4383 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4384 do_tls_offset_for_global): New functions.
4385 (Target_powerpc::Scan::local): Correct TLS relocations and got
4386 entry values.
4387 (Target_powerpc::Scan::global): Don't emit unnecessary
4388 dynamic relocations on TLS GOT entries.
4389
00716ab1
AM
43902012-09-10 Matthias Klose <doko@ubuntu.com>
4391
4392 * config.in: Disable sanity check for kfreebsd.
4393
c891b3f9
SA
43942012-09-10 Sterling Augustine <saugustine@google.com>
4395
4396 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4397 (Gdb_index::pubtypes_read): New parameter.
4398 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4399 to calls.
4400 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4401 pubtypes_object_.
4402
e81fea4d
AM
44032012-09-09 Alan Modra <amodra@gmail.com>
4404
4405 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4406 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4407 * gc.h (gc_process_relocs): Call target gc_add_reference.
4408 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4409 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4410 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4411 unnecessary cast.
4412 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4413 to cater for when we don't need code offset. Update use.
4414 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4415 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4416 set_opd_valid): New functions.
4417 (Target_powerpc::do_gc_add_reference): New function.
4418 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4419 stashed refs.
4420 (Target_powerpc::do_gc_mark_symbol): New function.
4421
d2d60eef
CC
44222012-09-06 Cary Coutant <ccoutant@google.com>
4423
4424 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4425 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4426 (Dwarf_die::skip_attributes): Likewise.
4427 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4428 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4429 (main): Call it.
4430 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4431
32ed4573
L
44322012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4433
4434 * testsuite/script_test_3.t: Add .got.plt output section
4435 statement.
4436 * testsuite/script_test_4.t: Likewise.
4437
f4baf0d4
AM
44382012-09-05 Alan Modra <amodra@gmail.com>
4439
4440 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4441 update all uses and lose "enum" when using type.
4442
864a1b56
AM
44432012-09-05 Alan Modra <amodra@gmail.com>
4444
4445 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4446 * configure: Regenerate.
4447 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4448 (plugin_final_layout.stdout): Likewise.
4449 (memory_test): Set page sizes to 0x1000.
4450 * testsuite/Makefile.in: Regenerate.
4451 * testsuite/discard_locals_test.sh: Add FIXME comment.
4452 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4453 * testsuite/pr14265.t: Add .got output section statement.
4454 * testsuite/script_test_2.t: Likewise.
4455 * testsuite/script_test_3.t: Likewise.
4456 * testsuite/script_test_4.t: Likewise.
4457 * testsuite/script_test_5.t: Likewise.
4458 * testsuite/script_test_6.t: Likewise.
4459 * testsuite/script_test_7.t: Likewise.
4460 * testsuite/script_test_9.t: Likewise.
4461
3ea0a085
AM
44622012-09-05 Alan Modra <amodra@gmail.com>
4463
4464 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4465 (Powerpc_relocate_functions::Status): New typedef.
4466 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4467 (Target_powerpc::Scan::local): Handle REL64.
4468 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4469 for REL32 and REL64.
4470 (Target_powerpc::symval_for_branch): New function, extracted from..
4471 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4472 checks. Report overflow errors.
4473
7404fe1b
AM
44742012-09-05 Alan Modra <amodra@gmail.com>
4475
4476 * object.h (Sized_relobj_file::emit_relocs): Delete.
4477 (Sized_relobj_file::emit_relocs_reltype): Delete.
4478 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4479 relocate_relocs for --emit-relocs.
4480 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4481 * output.h: Update comment.
4482 (Output_segment::first_section): New function.
4483 (Output_segment::first_section_load_address): Use first_section.
4484 * output.cc (Output_segment::first_section): New function extracted..
4485 (Output_segment::first_section_load_address): ..from here. Delete.
4486 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4487 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4488 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4489 adjust call to target.h function.
4490 * i386.cc (Target_i386): Likewise.
4491 * sparc.cc (Target_sparc): Likewise.
4492 * x86_64.cc (Target_x86_64): Likewise.
4493 * powerpc.cc (Target_powerpc): Likewise.
4494 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4495 first tls section has section symbol for optimised local dynamic
4496 output relocs.
4497 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4498 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4499 optimised tls code.
4500 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4501 Rename to relocate_relocs. Update error message.
4502
957564c9
AS
45032012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4504
4505 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4506 --just-symbols.
4507
dd93cd0a
AM
45082012-08-31 Alan Modra <amodra@gmail.com>
4509
4510 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4511 (Powerpc_relobj::toc_base_offset): New stub function.
4512 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4513 got_mod_index_offset to tlsld_got_offset. Update all refs.
4514 (Target_powerpc::Relocate::enum skip_tls): New.
4515 (Target_powerpc::call_tls_get_addr_): New var.
4516 (Target_powerpc::is_branch_reloc): Move to file scope.
4517 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4518 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4519 New functions.
4520 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4521 (powerpc_info): Correct common_pagesize for ppc64.
4522 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4523 (Powerpc_relocate_functions): Add overflow check enums and functions.
4524 Add non-shift version of rela, rela_ua. Delete all rel public
4525 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4526 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4527 addr16_ha3, addr14 functions.
4528 (Output_data_got_powerpc::add_constant_pair): New function.
4529 (Output_data_got_powerpc::got_base_offset): Likewise.
4530 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4531 (instruction constants): Sort, add some more.
4532 (Output_data_glink::do_write): Add and use Address typedef. Use
4533 object->toc_base_offset() stub for 64-bit.
4534 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4535 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4536 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4537 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4538 Always treat .opd relocs as against locally defined symbol.
4539 Correct condition for RELATIVE relocs.
4540 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4541 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4542 for 32-bit syms with a plt entry. Correct ppc64 toc base
4543 calculations. Handle TLS relocs, and more. Add overflow
4544 checking and adjust for Powerpc_relocate_functions changes.
4545 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4546 Reinstate --emit-relocs code with FIXME.
4547
a1373b60
AM
45482012-08-30 Alan Modra <amodra@gmail.com>
4549
4550 * layout.cc (Layout::set_segment_offsets): Set p_align to
4551 abi_pagesize, not common_pagesize.
4552 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4553 to determine whether file header can go in segment.
4554
703d02da
AM
45552012-08-30 Alan Modra <amodra@gmail.com>
4556
4557 * output.h (Output_reloc::Output_reloc <output section>): Add
4558 is_relative param. Adjust calls.
4559 (Output_reloc::add_output_section_relative): New functions.
4560 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4561 is_relative.
4562 (Output_reloc::symbol_value): Handle SECTION_CODE.
4563
16164a6b
ST
45642012-08-24 Sriraman Tallam <tmsriram@google.com>
4565
4566 * gold.cc (queue_middle_tasks): Call layout again when unique
4567 segments for sections is desired.
4568 * layout.cc (Layout::Layout): Initialize new members.
4569 (Layout::get_output_section_flags): New function.
4570 (Layout::choose_output_section): Call get_output_section_flags.
4571 (Layout::layout): Make output section for mapping to a unique segment.
4572 (Layout::insert_section_segment_map): New function.
4573 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4574 output sections marked so.
16164a6b
ST
4575 (Layout::segment_precedes): Check for unique segments when sorting.
4576 * layout.h (Layout::Unique_segment_info): New struct.
4577 (Layout::Section_segment_map): New typedef.
4578 (Layout::insert_section_segment_map): New function.
4579 (Layout::get_output_section_flags): New function.
4580 (Layout::is_unique_segment_for_sections_specified): New function.
4581 (Layout::set_unique_segment_for_sections_specified): New function.
4582 (Layout::unique_segment_for_sections_specified_): New member.
4583 (Layout::section_segment_map_): New member.
4584 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4585 Rename is_gc_pass_one to is_pass_one.
4586 Rename is_gc_pass_two to is_pass_two.
4587 Rename is_gc_or_icf to is_two_pass.
4588 Check for which pass based on whether symbols data is present.
4589 Make it two pass when unique segments for sections is desired.
4590 * output.cc (Output_section::Output_section): Initialize new
4591 members.
4592 * output.h (Output_section::is_unique_segment): New function.
4593 (Output_section::set_is_unique_segment): New function.
4594 (Output_section::is_unique_segment_): New member.
4595 (Output_section::extra_segment_flags): New function.
4596 (Output_section::set_extra_segment_flags): New function.
4597 (Output_section::extra_segment_flags_): New member.
4598 (Output_section::segment_alignment): New function.
4599 (Output_section::set_segment_alignment): New function.
4600 (Output_section::segment_alignment_): New member.
4601 (Output_segment::Output_segment): Initialize is_unique_segment_.
4602 (Output_segment::is_unique_segment): New function.
4603 (Output_segment::set_is_unique_segment): New function.
4604 (Output_segment::is_unique_segment_): New member.
4605 * plugin.cc (allow_unique_segment_for_sections): New function.
4606 (unique_segment_for_sections): New function.
4607 (Plugin::load): Add new functions to transfer vector.
4608 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4609 * Makefile.in: Regenerate.
4610 * testsuite/plugin_final_layout.sh: Check if unique segment
4611 functionality works.
4612 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4613 are available.
4614 (allow_unique_segment_for_sections): New global.
4615 (unique_segment_for_sections): New global.
4616 (claim_file_hook): Call allow_unique_segment_for_sections.
4617 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4618
1e2bee4f
CC
46192012-08-22 Cary Coutant <ccoutant@google.com>
4620
4621 * layout.cc (Layout::include_section): Don't assert on GROUP
4622 sections with --emit-relocs.
4623
1d5dfe78
CC
46242012-08-21 Cary Coutant <ccoutant@google.com>
4625
4626 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4627 if --export-dynamic-symbol names an undef symbol.
4628
c9269dff
AM
46292012-08-18 Alan Modra <amodra@gmail.com>
4630
4631 * powerpc.cc: Formatting and white space.
4632 (Powerpc_relobj): Rename got2_section_ to special_.
4633 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4634 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4635 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4636 (Target_powerpc): Add Address typedef and invalid_address. Use
4637 throughout.
4638 (Target_powerpc::is_branch_reloc): New function.
4639 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4640 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4641 for dst_mask, value and addend.
4642 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4643 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4644 (Output_data_glink::do_write): Correct toc base. Don't try to use
4645 uint16_t for 24-bit offset. Use get_output_section_offset and
4646 check return.
4647 (Target_powerpc::Scan::local): Handle more relocs.
4648 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4649 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4650 Plug in toc restoring insn after plt calls. Translate branches
4651 to function descriptor symbols to corresponding entry point.
4652 (Target_powerpc::relocate_for_relocatable): Check return from
4653 get_output_section_offset.
4654 * symtab.h: Comment typo.
4655
b1759dce
ILT
46562012-08-14 Ian Lance Taylor <iant@google.com>
4657
4658 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4659 unsupported_relocal_local to call unsupported_reloc_global.
4660
b9b2ae8b
NC
46612012-08-14 Nick Clifton <nickc@redhat.com>
4662
4663 PR ld/14265
4664 * script-sections.cc (Sections_element::output_section_name): Add
4665 keep return parameter.
4666 (Output_section_element::match_name): Add keep return parameter.
4667 Return the value of the keep_ member.
4668 * script-sections.h (class Output_section): Update
4669 output_section_name prototype.
4670 * layout.cc (Layout::keep_input_section): New public member
4671 function.
4672 (Layout::choose_output_section): Pass keep parameter to
4673 output_section_name.
4674 * layout.h (class Layout): Add keep_input_section.
4675 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4676 sections.
4677 * testsuite/Makefile.am: Add a test.
4678 * testsuite/Makefile.in: Regenerate.
4679 * testsuite/pr14265.c: Source file for the test.
4680 * testsuite/pr14265.t: Linker script for the test.
4681 * testsuite/pr14265.sh: Shell script for the test.
4682
921b5322
AM
46832012-08-14 Alan Modra <amodra@gmail.com>
4684
4685 * target.h (Target::output_section_name): New function.
4686 (Target::do_output_section_name): New function.
4687 * layout.cc (Layout::choose_output_section): Call the above.
4688 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4689
6ce78956
AM
46902012-08-14 Alan Modra <amodra@gmail.com>
4691
4692 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4693 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4694 for replace_constant call.
4695 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4696 (Output_data_glink::do_print_to_mapfile): New function.
4697 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4698 (Target_powerpc::Relocate::relocate): Likewise.
4699
d1a8cabd
AM
47002012-08-14 Alan Modra <amodra@gmail.com>
4701
4702 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4703 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4704 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4705 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4706 all references to shndx_. Handle special case for R_PPC_PLTREL24
4707 here.
4708 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4709 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4710 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4711 here.
4712 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4713 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4714
d83ce4e3
AM
47152012-08-12 Alan Modra <amodra@gmail.com>
4716
4717 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4718 (glink insn constants): Use uint32_t.
4719 (Output_data_glink::add_entry): Use insert, not [] operator.
4720
cf43a2fe
AM
47212012-08-11 Alan Modra <amodra@gmail.com>
4722
4723 * object.h (Sized_relobj_file::find_shdr): New function.
4724 (Sized_relobj_file::find_special_sections): New function.
4725 * object.cc (Sized_relobj_file::find_shdr): New function.
4726 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4727 (Sized_relobj_file::find_special_sections): New function, split out..
4728 (Sized_relobj_file::do_read_symbols): ..from here.
4729 * output.h (Output_data_got::replace_constant): New function.
4730 (Output_data_got::num_entries): New function.
4731 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4732 (Output_data_got::got_offset): Protected rather than private.
4733 (Output_data_got::replace_got_entry): New function.
4734 * output.cc (Output_data_got::replace_got_entry): New function.
4735 * powerpc.cc (class Powerpc_relobj): New.
4736 (class Powerpc_relocate_functions): Delete all psymval variants or
4737 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4738 Implement _ha functions using corresponding _hi function.
4739 (Powerpc_relobj::find_special_sections): New function.
4740 (Target_powerpc::do_make_elf_object): New function.
4741 (class Output_data_got_powerpc): New.
4742 (class Output_data_glink): New.
4743 (class Powerpc_scan_relocatable_reloc): New.
4744 Many more changes througout file.
4745
3c892704
NC
47462012-08-09 Nick Clifton <nickc@redhat.com>
4747
4748 * po/vi.po: Updated Vietnamese translation.
4749
82435b3b
ILT
47502012-08-07 Ian Lance Taylor <iant@google.com>
4751
4752 * layout.cc (Layout::add_target_dynamic_tags): If
4753 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4754 plt_rel.
4755
a6dc81d2
NC
47562012-07-30 Nick Clifton <nickc@redhat.com>
4757
4758 * po/gold.pot: Updated template.
4759 * po/es.po: Updated Spanish translation.
4760
f1415016
CC
47612012-07-18 Cary Coutant <ccoutant@google.com>
4762
4763 PR gold/14344
4764 * configure.ac: Add check for -gpubnames support.
4765 * configure: Regenerate.
4766 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4767 support; force -gno-pubnames.
4768 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4769 support.
4770 (gdb_index_test_4): New test.
4771 * testsuite/Makefile.in: Regenerate.
4772 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4773 * testsuite/gdb_index_test_2.sh: Likewise.
4774 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4775 * testsuite/gdb_index_test_4.sh: New script.
4776 * testsuite/gdb_index_test_comm.sh: New script with common code;
4777 don't look for space after colon.
4778
b7fd7c37
ST
47792012-07-16 Sriraman Tallam <tmsriram@google.com>
4780
4781 * gold.cc (queue_middle_tasks): Update function order only after
4782 deferred objects due to plugins are processed.
4783
1f3212db
ILT
47842012-07-11 Ian Lance Taylor <iant@google.com>
4785
4786 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4787 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4788 (Target_arm::scan_reloc_for_stub): Likewise.
4789 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4790 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4791 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4792 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4793 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4794
81c82a68
ILT
47952012-07-10 Dodji Seketeli <dodji@redhat.com>
4796 Ian Lance Taylor <iant@google.com>
4797
4798 PR gold/14309
4799 * configure.ac: Test whether std::tr1::hash<off_t> works.
4800 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4801 needed.
4802 * output.h (class Output_fill): Add virtual destructor.
4803 * configure, config.in: Rebuild.
4804
eabc84f4
RM
48052012-06-22 Roland McGrath <mcgrathr@google.com>
4806
4807 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4808
370e30b6
RÁE
48092012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4810
4811 * plugin.cc (Plugin::load): Handle position independent executables.
4812
fb1b895d
CC
48132012-06-06 Cary Coutant <ccoutant@google.com>
4814
4815 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4816 add .debug_macro.
4817 (lines_only_debug_sections): Likewise.
4818 (gdb_fast_lookup_sections): New static array.
4819 (is_gdb_debug_section): Rename formal parameter.
4820 (is_lines_only_debug_section): Likewise.
4821 (is_gdb_fast_lookup_section): New function.
4822 (Layout::include_section): Check for ".zdebug_" prefix; pass
4823 section name suffix to is_gdb_debug_section, et al.; check for
4824 fast-lookup sections when building .gdb_index.
4825 * options.h (--strip-debug-gdb): Update GDB version number.
4826
7c0640fa
CC
48272012-06-06 Cary Coutant <ccoutant@google.com>
4828
4829 * configure.ac: Add check for fallocate.
4830 * configure: Regenerate.
4831 * config.in: Regenerate.
4832
4833 * options.h (class General_options): Add --mmap-output-file and
4834 --posix-fallocate options.
4835 * output.cc: (posix_fallocate): Remove; replace with...
4836 (gold_fallocate): New function.
4837 (Output_file::map_no_anonymous): Call gold_fallocate.
4838 (Output_file::map): Check --mmap-output-file option.
4839
2a49eb69
DK
48402012-06-05 Jing Yu <jingyu@google.com>
4841
4842 * gold.h (textdomain): Add do {} to empty while(0).
4843 (bindtextdomain): Likewise.
4844
fad072ac
CC
48452012-06-04 Cary Coutant <ccoutant@google.com>
4846
4847 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4848 has_dynsym_index.
4849
8cc69fb6
ST
48502012-05-25 Sriraman Tallam <tmsriram@google.com>
4851
4852 * symtab.cc (Symbol_table::define_special_symbol):
4853 Initialize *poldsym to prevent uninitialized variable errors.
4854
1be75daa
CC
48552012-05-23 Cary Coutant <ccoutant@google.com>
4856
4857 * layout.cc (Layout::section_name_mapping): Add rules to handle
4858 exact match on .data.rel.ro.local or .data.rel.ro.
4859 (Layout::output_section_name): Check for exact matches.
4860
9b689de0
CC
48612012-05-23 Cary Coutant <ccoutant@google.com>
4862
4863 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4864 more carefully.
4865
b24fdbf5
CC
48662012-05-22 Cary Coutant <ccoutant@google.com>
4867
4868 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4869 object before exporting symbol.
4870
e550e1a2
L
48712012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4872
4873 * testsuite/tls_test.cc: Include "config.h" first.
4874 * testsuite/tls_test_c.c: Likewise.
4875
df7b86aa
NC
48762012-05-17 Daniel Richard G. <skunk@iskunk.org>
4877 Nick Clifton <nickc@redhat.com>
4878
4879 PR 14072
4880 * configure.in: Add check that sysdep.h has been included before
4881 any system header files.
4882 * configure: Regenerate.
4883 * config.in: Regenerate.
4884
1007b503
CC
48852012-05-14 Cary Coutant <ccoutant@google.com>
4886
4887 * layout.cc (Layout::make_output_section): Mark .tdata section
4888 as RELRO.
4889 * testsuite/relro_test.cc: Add a TLS variable.
4890
fd885f3a
L
48912012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4892
4893 PR gold/14091
4894 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4895 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4896 R_X86_64_64.
4897
80f5885c
CC
48982012-05-08 Cary Coutant <ccoutant@google.com>
4899
4900 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4901 (lines_only_debug_sections): Likewise.
4902
2e702c99
RM
49032012-05-02 Roland McGrath <mcgrathr@google.com>
4904
4905 * nacl.cc: New file.
4906 * nacl.h: New file.
4907 * Makefile.am (CCFILES, HFILES): Add them.
4908 * Makefile.in: Regenerate.
4909 * i386.cc (Output_data_plt_i386_nacl): New class.
4910 (Output_data_plt_i386_nacl_exec): New class.
4911 (Output_data_plt_i386_nacl_dyn): New class.
4912 (Target_i386_nacl): New class.
4913 (Target_selector_i386_nacl): New class.
4914 (target_selector_i386): Use it instead of Target_selector_i386.
4915 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4916 (Target_x86_64_nacl): New class.
4917 (Target_selector_x86_64_nacl): New class.
4918 (target_selector_x86_64, target_selector_x32): Use it instead of
4919 Target_selector_x86_64.
4920 * arm.cc (Output_data_plt_arm_nacl): New class.
4921 (Target_arm_nacl): New class.
4922 (Target_selector_arm_nacl): New class.
4923 (target_selector_arm, target_selector_armbe): Use it instead of
4924 Target_selector_arm.
4925
4926 * target-select.cc (select_target): Take new Input_file* and off_t
4927 arguments, pass them on to recognize method of selector.
4928 * object.cc (make_elf_sized_object): Update caller.
4929 * parameters.cc (parameters_force_valid_target): Likewise.
4930 * incremental.cc (make_sized_incremental_binary): Likewise.
4931 * target-select.h: Update decl.
4932 (Target_selector::recognize): Take new Input_file* argument,
4933 pass it on to do_recognize.
4934 (Target_selector::do_recognize): Take new Input_file* argument.
4935 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4936 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4937 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4938 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4939
4940 * target.h (Target::Target_info): New members isolate_execinstr
4941 and rosegment_gap.
4942 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4943 * arm.cc (Target_arm::arm_info): Update initializer.
4944 * i386.cc (Target_i386::i386_info): Likewise.
4945 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4946 * sparc.cc (Target_sparc::sparc_info): Likewise.
4947 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4948 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4949 * layout.cc (Layout::attach_allocated_section_to_segment):
4950 Take new const Target* argument. If target->isolate_execinstr(), act
4951 like --rosegment.
4952 (Layout::find_first_load_seg): Take new const Target* argument;
4953 if target->isolate_execinstr(), reject PF_X segments.
4954 (Layout::relaxation_loop_body): Update caller.
4955 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4956 reset file offset to zero when we hit LOAD_SEG, and then do a second
4957 loop over the segments before LOAD_SEG to reassign offsets after
4958 addresses have been determined. Handle target->rosegment_gap().
4959 (Layout::attach_section_to_segment): Take new const Target* argument;
4960 pass it to attach_allocated_section_to_segment.
4961 (Layout::make_output_section): Update caller.
4962 (Layout::attach_sections_to_segments): Take new const Target* argument;
4963 pass it to attach_section_to_segment.
4964 * gold.cc (queue_middle_tasks): Update caller.
4965 * layout.h (Layout): Update method decls with new arguments.
4966
4967 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4968 Target_info pointer to use.
4969 (Target_arm::do_make_data_plt): New virtual method.
4970 (Target_arm::make_data_plt): New method that calls it.
4971 (Target_arm::make_plt_entry): Use it.
4972 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4973 for the section alignment.
4974 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4975 method.
4976 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4977 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4978 method.
4979 (Output_data_plt_arm::get_plt_entry_size): Call it.
4980 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4981 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4982 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4983 method.
4984 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4985 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4986 method instead of sizeof(plt_entry).
4987 (Output_data_plt_arm::add_entry): Likewise.
4988 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4989 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4990 than static method.
4991 (Target_arm::plt_entry_size): Likewise.
4992 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4993 Move to ...
4994 (Output_data_plt_arm_standard): ... here, new class.
4995 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4996 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4997 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4998
4999 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5000 Take additional argument for the PLT entry size.
5001 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5002 Use get_plt_entry_size method rather than plt_entry_size variable.
5003 (Output_data_plt_x86_64::reserve_slot): Likewise.
5004 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5005 (Output_data_plt_x86_64::add_entry): Likewise.
5006 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5007 (Output_data_plt_x86_64::address_for_global): Likewise.
5008 (Output_data_plt_x86_64::address_for_local): Likewise.
5009 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5010 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5011 Make method non-static.
5012 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5013 method.
5014 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5015 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5016 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5017 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5018 virtual method.
5019 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5020 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5021 virtual method.
5022 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5023 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5024 virtual method.
5025 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5026 (Output_data_plt_x86_64::plt_entry_size)
5027 (Output_data_plt_x86_64::first_plt_entry)
5028 (Output_data_plt_x86_64::plt_entry)
5029 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5030 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5031 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5032 (Output_data_plt_x86_64_standard): ... here, new class.
5033 (Target_x86_64::Target_x86_64): Take optional argument for the
5034 Target_info pointer to use.
5035 (Target_x86_64::do_make_data_plt): New virtual method.
5036 (Target_x86_64::make_data_plt): New method to call it.
5037 (Target_x86_64::init_got_plt_for_update): Use that.
5038 Call this->plt_->add_eh_frame method here.
5039 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5040 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5041 rather than static method.
5042 (Target_x86_64::plt_entry_size): Likewise.
5043 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5044 rather than plt_entry_size variable. Move guts of PLT filling to...
5045 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5046 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5047 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5048
5049 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5050 additional argument for the section alignment.
5051 Don't do add_eh_frame_for_plt here.
5052 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5053 non-static. Use get_plt_entry_size method rather than plt_entry_size
5054 variable.
5055 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5056 method.
5057 (Output_data_plt_i386::get_plt_entry_size): Call it.
5058 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5059 (Output_data_plt_i386::add_eh_frame): New method to call it.
5060 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5061 method.
5062 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5063 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5064 method.
5065 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5066 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5067 method instead of plt_entry_size.
5068 (Output_data_plt_i386::plt_entry_size)
5069 (Output_data_plt_i386::plt_eh_frame_fde_size)
5070 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5071 (Output_data_plt_i386_standard): ... here, new class.
5072 (Output_data_plt_i386_exec): New class.
5073 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5074 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5075 (Output_data_plt_i386::exec_plt_entry): Move to ...
5076 (Output_data_plt_i386_exec::plt_entry): ... here.
5077 (Output_data_plt_i386_dyn): New class.
5078 (Output_data_plt_i386::first_plt_entry): Move to ...
5079 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5080 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5081 (Output_data_plt_i386_dyn::plt_entry): ... here.
5082 (Target_i386::Target_i386): Take optional argument for the Target_info
5083 pointer to use.
5084 (Target_i386::do_make_data_plt): New virtual method.
5085 (Target_i386::make_data_plt): New method to call it.
5086 (Target_i386::make_plt_section): Use that.
5087 Call this->plt_->add_eh_frame method here.
5088 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5089 rather than plt_entry_size variable.
5090 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5091 (Output_data_plt_i386::address_for_local): Likewise.
5092 (Output_data_plt_i386::do_write): Likewise.
5093 Move guts of PLT filling to...
5094 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5095 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5096 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5097 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5098
b9b9f2ee
CC
50992012-05-01 Cary Coutant <ccoutant@google.com>
5100
5101 * dwarf_reader.cc (Dwarf_die::read_attributes)
5102 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5103 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5104 * reduced_debug_output.cc
5105 (Output_reduced_debug_info_section::get_die_end): Remove
5106 DW_FORM_GNU_ref_index. Add default case.
5107
57923f48
MW
51082012-04-26 Mark Wielaard <mjw@redhat.com>
5109
5110 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5111 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5112 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5113 DW_AT_high_pc as offset from DW_AT_low_pc.
5114
5115 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5116 * testsuite/Makefile.in: Regenerate.
5117 * testsuite/gdb_index_test_3.c: New test source file.
5118 * testsuite/gdb_index_test_3.sh: New test source file.
5119
2c54b4f4
ILT
51202012-04-25 Ian Lance Taylor <iant@google.com>
5121
5122 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5123 pointer.
5124 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5125 as a class, not a struct.
5126 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5127 (Target_arm::apply_cortex_a8_workaround): Likewise.
5128 * gc.h: Declare Reloc_types as a struct, not a class.
5129 * object.h: Declare Symbols_data as a struct.
5130 * reloc.h: Declare Read_relocs_data as a struct.
5131 * target.h: Declare Relocate_info as a struct.
5132
a5a5f7a3
DM
51332012-04-24 David S. Miller <davem@davemloft.net>
5134
5135 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5136 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5137 and R_SPARC_WPLT30.
5138
f038d496
CC
51392012-04-24 Cary Coutant <ccoutant@google.com>
5140
5141 * incremental-dump.cc (find_input_containing_global): Replace
5142 magic number with symbolic constant.
5143 (dump_incremental_inputs): Update version number.
5144 * incremental.cc (Output_section_incremental_inputs): Update version
5145 number; import symbolic constants from Incremental_inputs_reader.
5146 (Incremental_inputs::create_data_sections): Align relocations
5147 section correctly for 64-bit targets.
5148 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5149 constants; add padding.
5150 (Output_section_incremental_inputs::write_header): Add assert for
5151 header_size.
5152 (Output_section_incremental_inputs::write_input_files): Add assert
5153 for input_entry_size.
5154 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5155 add assert for object_info_size, input_section_entry_size,
5156 global_sym_entry_size.
5157 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5158 for data structure sizes; use them.
5159 (Incremental_input_entry_reader): Import symbolic constants from
5160 Incremental_inputs_reader; use them.
5161
a4d85145
DM
51622012-04-23 David S. Miller <davem@davemloft.net>
5163
5164 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5165 and elf_flags_set_.
5166 (Target_sparc::Target_sparc): Initialize new fields.
5167 (Target_sparc::do_make_elf_object): New function.
5168 (Target_sparc::do_adjust_elf_header): New function.
5169
1d509098
CC
51702012-04-23 Cary Coutant <ccoutant@google.com>
5171
5172 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5173 CU range table of gdb index.
5174
7ebeff7f
DM
51752012-04-20 David S. Miller <davem@davemloft.net>
5176
5177 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5178 instead of false.
5179
13cf9988
DM
51802012-04-16 David S. Miller <davem@davemloft.net>
5181
2a1079e8
DM
5182 * sparc.cc (Target_sparc::got_address): New function.
5183 (Sparc_relocate_functions::gdop_hix22): New function.
5184 (Sparc_relocate_functions::gdop_lox10): New function.
5185 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5186 relocs.
5187 (Target_sparc::Scan::local): Likewise if the global symbol is not
5188 preemptible and is not IFUNC.
5189 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5190 transformations for local and non-preemptible non-IFUNC global
5191 symbols.
5192
0bc964fc
DM
5193 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5194 writing out 64-bit part of ranges.
5195
661d7a80
DM
5196 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5197 -fpic and -fpie respectively.
5198 * Makefile.in: Regenerate.
5199
8c2bf391
DM
5200 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5201 (Target_sparc::Target_sparc): Initialize new field.
5202 (Target_sparc::do_plt_section_for_global): New function.
5203 (Target_sparc::do_plt_section_for_local): New function.
5204 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5205 (Target_sparc::make_plt_section): New function, broken out of
5206 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5207 (Target_sparc::make_plt_entry): Call make_plt_section.
5208 (Target_sparc::make_local_ifunc_plt_entry): New function.
5209 (Target_sparc::rela_ifunc_section): New function.
5210 (Target_sparc::plt_section): Remove const.
5211 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5212 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5213 and ifunc_count_ fields.
5214 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5215 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5216 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5217 (Output_data_plt_sparc::rela_ifunc): New function.
5218 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5219 (Output_data_plt_sparc::has_ifunc_section): New function.
5220 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5221 (Output_data_plt_sparc::address_for_global): New function.
5222 (Output_data_plt_sparc::address_for_local): New function.
5223 (Output_data_plt_sparc::plt_index_to_offset): New function.
5224 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5225 and entry_count.
5226 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5227 entry_count.
5228 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5229 R_SPARC_JMP_IREL to switch.
5230 (Target_sparc::Scan::check_non_pic): Likewise.
5231 (Target_sparc::Scan::local): Handle IFUNC symbols.
5232 (Target_sparc::Scan::local): Likewise.
5233 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5234 and plt_address_for_local.
5235 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5236 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5237
13cf9988
DM
5238 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5239 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5240 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5241 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5242 global relocs too.
5243 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5244 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5245 calls.
5246 * sparc.cc (Target_sparc::Scan::global): Likewise.
5247 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5248
31821be0
CC
52492012-04-16 Cary Coutant <ccoutant@google.com>
5250
5251 * archive.cc (Library_base::should_include_member): Check for
5252 --export-dynamic-symbol.
5253 * options.h (class General_options): Add --export-dynamic-symbol.
5254 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5255 --export-dynamic-symbol.
5256 (Symbol_table::gc_mark_undef_symbols): Likewise.
5257 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5258
2615994e
DM
52592012-04-12 David S. Miller <davem@davemloft.net>
5260
5261 * sparc.cc (Reloc::wdisp10): New relocation method.
5262 (Reloc::h34): Likewise.
5263 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5264 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5265 R_SPARC_WDISP10.
5266 (Target_sparc::Scan::local): Likewise.
5267 (Target_sparc::Scan::global): Likewise.
5268 (Target_sparc::Relocate::relocate): Likewise.
5269
6782735d
CC
52702012-04-09 Cary Coutant <ccoutant@google.com>
5271
5272 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5273 low_pc == 0.
5274
8c7a0b00
ILT
52752012-04-06 Ian Lance Taylor <iant@google.com>
5276
5277 * timer.cc: #include <unistd.h>.
5278
58797674
RM
52792012-04-06 Roland McGrath <mcgrathr@google.com>
5280
5281 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5282 * config.in: Regenerate.
5283 * configure: Regenerate.
5284
44350750
NC
52852012-04-05 Nick Clifton <nickc@redhat.com>
5286
5287 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5288 (AM_LC_MESSAGES): Add.
5289 * aclocal.m4: Regenerate.
5290 * config.in: Regenerate.
5291 * configure: Regenerate.
5292
c1027032
CC
52932012-03-21 Cary Coutant <ccoutant@google.com>
5294
5295 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5296 * Makefile.in: Regenerate.
5297 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5298 (Sized_elf_reloc_mapper::symbol_section): New function.
5299 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5300 (make_elf_reloc_mapper): New function.
5301 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5302 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5303 (Dwarf_abbrev_table::do_get_abbrev): New function.
5304 (Dwarf_ranges_table::read_ranges_table): New function.
5305 (Dwarf_ranges_table::read_range_list): New function.
5306 (Dwarf_pubnames_table::read_section): New function.
5307 (Dwarf_pubnames_table::read_header): New function.
5308 (Dwarf_pubnames_table::next_name): New function.
5309 (Dwarf_die::Dwarf_die): New function.
5310 (Dwarf_die::read_attributes): New function.
5311 (Dwarf_die::skip_attributes): New function.
5312 (Dwarf_die::set_name): New function.
5313 (Dwarf_die::set_linkage_name): New function.
5314 (Dwarf_die::attribute): New function.
5315 (Dwarf_die::string_attribute): New function.
5316 (Dwarf_die::int_attribute): New function.
5317 (Dwarf_die::uint_attribute): New function.
5318 (Dwarf_die::ref_attribute): New function.
5319 (Dwarf_die::child_offset): New function.
5320 (Dwarf_die::sibling_offset): New function.
5321 (Dwarf_info_reader::check_buffer): New function.
5322 (Dwarf_info_reader::parse): New function.
5323 (Dwarf_info_reader::do_parse): New function.
5324 (Dwarf_info_reader::do_read_string_table): New function.
5325 (Dwarf_info_reader::lookup_reloc): New function.
5326 (Dwarf_info_reader::get_string): New function.
5327 (Dwarf_info_reader::visit_compilation_unit): New function.
5328 (Dwarf_info_reader::visit_type_unit): New function.
5329 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5330 Sized_elf_reloc_mapper.
5331 (Sized_dwarf_line_info::symbol_section): Remove function.
5332 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5333 (Sized_dwarf_line_info::read_line_mappings): Remove object
5334 parameter, adjust callers.
5335 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5336 * dwarf_reader.h: Include <sys/types.h>.
5337 (class Track_relocs): Remove forward declaration.
5338 (class Elf_reloc_mapper): New class.
5339 (class Sized_elf_reloc_mapper): New class.
5340 (class Dwarf_abbrev_table): New class.
5341 (class Dwarf_range_list): New class.
5342 (class Dwarf_ranges_table): New class.
5343 (class Dwarf_pubnames_table): New class.
5344 (class Dwarf_die): New class.
5345 (class Dwarf_info_reader): New class.
5346 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5347 (Sized_dwarf_line_info::symbol_section): Remove member function.
5348 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5349 base class.
5350 * gdb-index.cc: New source file.
5351 * gdb-index.h: New source file.
5352 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5353 and .debug_types sections, call Layout::add_to_gdb_index.
5354 (Sized_relobj_incr::do_section_name): Implement.
5355 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5356 return type; Implement.
5357 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5358 return type.
5359 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5360 parameter list and return type.
5361 (Sized_incr_dynobj::do_section_contents): Likewise.
5362 * layout.cc: Include gdb-index.h.
5363 (Layout::Layout): Initialize gdb_index_data_.
5364 (Layout::init_fixed_output_section): Check for .gdb_index section.
5365 (Layout::add_to_gdb_index): New function. Instantiate.
5366 * layout.h: Add forward declaration for class Gdb_index.
5367 (Layout::add_to_gdb_index): New member function.
5368 (Layout::gdb_index_data_): New data member.
5369 * main.cc: Include gdb-index.h.
5370 (main): Print statistics for gdb index.
5371 * object.cc (Object::section_contents): Move code into
5372 do_section_contents.
5373 (need_decompressed_section): Check for sections needed when building
5374 gdb index.
5375 (build_compressed_section_map): Likewise.
5376 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5377 gdb index.
5378 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5379 sections; call Layout::add_to_gdb_index.
5380 (Sized_relobj_file::do_decompressed_section_contents): Call
5381 do_section_contents directly.
5382 * object.h (Object::do_section_contents): Adjust parameter list and
5383 return type.
5384 (Object::do_decompressed_section_contents): Call do_section_contents
5385 directly.
5386 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5387 return type.
5388 * options.h (class General_options): Add --gdb-index option.
5389 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5390 list and return type.
5391 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5392 * reloc.h (Track_relocs::checkpoint): New function.
5393 (Track_relocs::reset): New function.
5394
5395 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5396 New test cases.
5397 * testsuite/Makefile.in: Regenerate.
5398 * testsuite/gdb_index_test.cc: New test source file.
5399 * testsuite/gdb_index_test_1.sh: New test source file.
5400 * testsuite/gdb_index_test_2.sh: New test source file.
5401
647f1574
DK
54022012-03-19 Doug Kwan <dougkwan@google.com>
5403
5404 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5405 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5406 __exidx_start and __exidx_end. Make symbol table parameter
5407 anonymous as it is not used.
5408 * gold.cc (queue_middle_tasks): Call target hook to define any
5409 target-specific symbols.
5410 * target.h (Target::define_standard_symbols): New method.
5411 (Target::do_define_standard_symbols): Same.
5412 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5413 * testsuite/Makefile.in: Regenerate.
5414 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5415 and __exidx_end.
5416 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5417 relocations are generated for __exidx_start and __exidx_end.
5418
7c6109da
DK
54192012-03-16 Doug Kwan <dougkwan@google.com>
5420
5421 * testsuite/Makefile.am: Disable test initpri3b.
5422 * testsuite/Makefile.in: Regenerate.
5423
7b8957f8
DK
54242012-03-15 Doug Kwan <dougkwan@google.com>
5425
5426 * arm.cc (Target_arm::got_section): Make .got section read-only
5427 if -z now is given.
5428
14dc9ef7
ILT
54292012-03-15 Ian Lance Taylor <iant@google.com>
5430
5431 PR gold/13850
5432 * layout.cc (Layout::make_output_section): Correctly mark
5433 SHT_INIT_ARRAY, et. al., as relro.
5434
fa40b62a
DK
54352012-03-14 Doug Kwan <dougkwan@google.com>
5436
5437 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5438 dynamic relocations for protected symbols in shared objects.
5439
fd325007
ILT
54402012-03-13 Ian Lance Taylor <iant@google.com>
5441
5442 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5443 keep the larger alignment.
5444
e8dd54e1
CC
54452012-03-12 Cary Coutant <ccoutant@google.com>
5446
5447 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5448 handling of DW_LNE_define_file.
5449
feb5f3b0
CC
54502012-03-12 Cary Coutant <ccoutant@google.com>
5451
5452 * reduced_debug_output.cc
5453 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5454 codes to switch.
5455
a1fb4256
CC
54562012-02-29 Cary Coutant <ccoutant@google.com>
5457
5458 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5459
5dd8762a
CC
54602012-02-29 Cary Coutant <ccoutant@google.com>
5461
5462 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5463 Call Object::decompressed_section_contents.
5464 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5465 New dtor.
5466 (Sized_dwarf_line_info::buffer_start_): New data member.
5467 * merge.cc (Output_merge_data::do_add_input_section): Call
5468 Object::decompressed_section_contents.
5469 (Output_merge_string::do_add_input_section): Likewise.
5470 * object.cc (need_decompressed_section): New function.
5471 (build_compressed_section_map): Decompress sections needed later.
5472 (Sized_relobj_file::do_decompressed_section_contents): New function.
5473 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5474 * object.h (Object::decompressed_section_contents): New function.
5475 (Object::discard_decompressed_sections): New function.
5476 (Object::do_decompressed_section_contents): New function.
5477 (Object::do_discard_decompressed_sections): New function.
5478 (Compressed_section_info): New type.
5479 (Compressed_section_map): Include decompressed section contents.
5480 (Sized_relobj_file::do_decompressed_section_contents): New function.
5481 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5482
7b5de7ee
CC
54832012-02-16 Cary Coutant <ccoutant@google.com>
5484
5485 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5486 * testsuite/Makefile.in: Regenerate.
5487
f9fa4a63
CC
54882012-02-14 Cary Coutant <ccoutant@google.com>
5489
5490 * options.cc (General_options::finalize): Disallow -pie and -static.
5491
2c175ebc
DK
54922012-02-03 Doug Kwan <dougkwan@google.com>
5493
5494 * arm.cc (Arm_relocate_functions::abs8,
5495 Arm_relocate_functions::abs16): Use
5496 Bits::has_signed_unsigned_overflow32.
5497 (Arm_relocate_functions::thm_abs8): Correct range of
5498 overflow check.
5499 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5500 in assertions.
5501
90cff06f
DK
55022012-02-02 Doug Kwan <dougkwan@google.com>
5503
5504 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5505 position independent outputs, not just shared objects.
5506
63887f3d
L
55072012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5508
5509 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5510 * configure: Regenerated.
5511
bef2b434
ILT
55122012-01-27 Ian Lance Taylor <iant@google.com>
5513
5514 * reloc.h (Bits): New class with static functions, copied from
5515 namespace utils in arm.cc.
5516 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5517 instead.
5518
c335b55d
L
55192012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5520
5521 * incremental.cc (write_info_blocks): Correct relocation offset.
5522
41194d9f
L
55232012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5524
5525 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5526 (Relocate::tls_gd_to_le): Likewise.
5527
1bae613c
L
55282012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5529
5530 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5531
24482ca0
L
55322012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5533
5534 * configure.ac: Check if -mcmodel=medium works.
5535 * configure: Regenerated.
5536
c2c7840a
CC
55372012-01-24 Cary Coutant <ccoutant@google.com>
5538
5539 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5540 definition and ...
5541 (read_unsigned_LEB_128_x): ... this new function.
5542 (read_signed_LEB_128): Replaced with inline definition and ...
5543 (read_signed_LEB_128_x): ... this new function.
5544 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5545 (read_unsigned_LEB_128): Add inline definition.
5546 (read_signed_LEB_128_x): New function.
5547 (read_signed_LEB_128): Add inline definition.
5548 * testsuite/Makefile.am (leb128_unittest): New unit test.
5549 * testsuite/Makefile.in: Regenerate.
5550 * testsuite/leb128_unittest.cc: New unit test.
5551
833de760 55522012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5553
5554 PR gold/13617
5555 * i386.cc (Target_i386::do_code_fill): When using a jmp
5556 instruction, pad with nop instructions.
5557 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5558
618d6666
L
55592012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5560
5561 * x86_64.cc (gc_process_relocs): Add typename on types used in
5562 template.
5563 (scan_relocs): Likewise.
5564 (relocate_section): Likewise.
5565 (apply_relocation): Likewise.
5566
3660ff06
L
55672012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5568
5569 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5570 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5571 under x32.
5572
fc51264f
L
55732012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5574
5575 * x86_64.cc: Initial support for x32.
5576
dd74ae06
CC
55772012-01-03 Cary Coutant <ccoutant@google.com>
5578
5579 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5580 Use abstract base class for GOT.
5581 * gold/output.h (class Output_data_got_base): New abstract base class.
5582 (class Output_data_got): Derive from new base class, adjust ctors.
5583 (Output_data_got::reserve_slot): Make virtual; rename to
5584 do_reserve_slot; Adjust callers.
5585 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5586 pointer to abstract base class.
5587 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5588
83896202
ILT
55892011-12-18 Ian Lance Taylor <iant@google.com>
5590
5591 * object.h (Relobj::local_symbol_value): New function.
5592 (Relobj::local_plt_offset): New function.
5593 (Relobj::local_has_got_offset): New function.
5594 (Relobj::local_got_offset): New function.
5595 (Relobj::set_local_got_offset): New function.
5596 (Relobj::do_local_symbol_value): New pure virtual function.
5597 (Relobj::do_local_plt_offset): Likewise.
5598 (Relobj::do_local_has_got_offset): Likewise.
5599 (Relobj::do_local_got_offset): Likewise.
5600 (Relobj::do_set_local_got_offset): Likewise.
5601 (Sized_relobj::do_local_has_got_offset): Rename from
5602 local_has_got_offset.
5603 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5604 (Sized_relobj::do_set_local_got_offset): Rename from
5605 set_local_got_offset.
5606 (Sized_relobj_file::do_local_plt_offset): Rename from
5607 local_plt_offset.
5608 (Sized_relobj_file::do_local_symbol_value): New function.
5609 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5610 local_plt_offset.
5611 * output.cc (Output_data_got::Got_entry::write): Change object to
5612 Relobj. Use local_symbol_value.
5613 (Output_data_got::add_global_with_rel): Change rel_dyn to
5614 Output_data_reloc_generic*. Use add_global_generic.
5615 (Output_data_got::add_global_with_rela): Remove. Change all
5616 callers to use add_global_with_rel.
5617 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5618 Output_data_reloc_generic*. Use add_global_generic.
5619 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5620 callers to use add_global_pair_with_rel.
5621 (Output_data_got::add_local): Change object to Relobj*.
5622 (Output_data_got::add_local_plt): Likewise.
5623 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5624 change rel_dyn to Output_data_reloc_generic*. Use
5625 add_local_generic.
5626 (Output_data_got::add_local_with_rela): Remove. Change all
5627 callers to use all_local_with_rel.
5628 (Output_data_got::add_local_pair_with_rel): Change object to
5629 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5630 add_output_section_generic.
5631 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5632 callers to use add_local_pair_with_rel.
5633 (Output_data_got::reserve_local): Change object to Relobj*.
5634 * output.h: (class Output_data_reloc_generic): Add pure virtual
5635 declarations for add_global_generic, add_local_generic,
5636 add_output_section_generic.
5637 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5638 functions for Output_data_reloc_generic. Update declarations for
5639 changes listed in output.cc.
5640 (class Output_data_got): Change template parameter to got_size.
5641 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5642 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5643 function.
5644 (Sized_relobj_incr::do_local_plt_offset): New function.
5645 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5646 add_global_generic.
5647
76677ad0
CC
56482011-12-17 Cary Coutant <ccoutant@google.com>
5649
5650 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5651 * resolve.cc (Symbol_table::resolve): Likewise.
5652 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5653 arrays.
5654 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5655
8b8dd8d5
ILT
56562011-12-16 Ian Lance Taylor <iant@google.com>
5657
5658 * output.h (Output_data_reloc_generic::add): Only call
5659 add_dynamic_reloc if this is a dynamic reloc section.
5660
d55525b9
L
56612011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5662
5663 PR gold/13505
5664 * target-reloc.h (apply_relocation): Replace <64, false> with
5665 <size, big_endian>.
5666
ff81c7c1
NC
56672011-11-25 Nick Clifton <nickc@redhat.com>
5668
5669 * po/it.po: New Italian translation.
5670
628f39be
SA
56712011-11-17 Sterling Augustine <saugustine@google.com>
5672
5673 * script.cc (script_include_directive): Implement.
5674 (read_script_file): New local variables name and search_path. Update
5675 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5676 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5677 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5678
98ef3ea4
SA
56792011-11-11 Sterling Augustine <saugustine@google.com>
5680
5681 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5682 (file_or_sections_cmd): Likewise.
5683
f4a8b6d7
DK
56842011-11-11 Doug Kwan <dougkwan@google.com>
5685
5686 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5687 if --just-symbols is given.
5688
29ab395d
DK
56892011-11-10 Doug Kwan <dougkwan@google.com>
5690
5691 PR gold/13362
5692 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5693 when processing data relocs.
5694 * reloc.h (Relocate_functions::rel_unaligned): New method.
5695 (Relocate_functions::pcrel_unaligned): Ditto.
5696 (Relocate_functions::rel32_unaligned): Ditto.
5697 (Relocate_functions::pcrel32_unaligned): Ditto.
5698
2c339f71
DK
56992011-11-09 Doug Kwan <dougkwan@google.com>
5700
5701 PR gold/13362
5702 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5703 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5704 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5705 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5706 (Relocate_functions::rel_unaligned): New.
5707 (Relocate_functions::rel32_unaligned): New.
5708 * target-reloc.h (relocate_for_relocatable): Add code to handle
5709 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5710 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5711 arm_unaligned_reloc_r): New targets.
5712 * testsuite/Makefile.in: Regenerate.
5713 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5714 linking.
5715
3f3cddf1
ILT
57162011-11-02 Ian Lance Taylor <iant@google.com>
5717
5718 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5719 NATIVE_LINKER.
5720 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5721 * options.cc (General_options::finalize): Use library search path
5722 from configure script if specified. If not native and no sysroot,
5723 only search TOOLLIBDIR.
5724 * options.h (Search_directory::Search_directory): Change name to
5725 const std::string&.
5726 (General_options::add_to_library_path_with_sysroot): Change arg to
5727 const std::string&.
5728 * configure, Makefile.in, config.in: Rebuild.
5729
a8e2273b
ILT
57302011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5731
5732 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5733 we are working around the ARM1176 Erratum.
5734 * options.h (General_options::fix_arm1176): Add option.
5735 * testsuite/Makefile.am: Add testcases, and keep current ones
5736 working.
5737 * testsuite/Makefile.in: Regenerate.
5738 * testsuite/arm_fix_1176.s: New file.
5739 * testsuite/arm_fix_1176.sh: Likewise.
5740
cd6eab1c
ILT
57412011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5742
5743 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5744 may_use_blx_.
5745 (Target_arm::may_use_blx): Remove method.
5746 (Target_arm::set_may_use_blx): Likewise.
5747 (Target_arm::may_use_v4t_interworking): New method.
5748 (Target_arm::may_use_v5t_interworking): Likewise.
5749 (Target_arm::may_use_blx_): Remove member variable.
5750 (Arm_relocate_functions::arm_branch_common): Check for v5T
5751 interworking.
5752 (Arm_relocate_functions::thumb_branch_common): Likewise.
5753 (Reloc_stub::stub_type_for_reloc): Likewise.
5754 (Target_arm::do_finalize_sections): Correct interworking checks.
5755 * testsuite/Makefile.am: Add new tests.
5756 * testsuite/Makefile.in: Regenerate.
5757 * testsuite/arm_farcall_arm_arm.s: New test.
5758 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5759 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5760 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5761 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5762 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5763 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5764 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5765
286adcf4
CC
57662011-10-31 Cary Coutant <ccoutant@google.com>
5767
5768 PR gold/13023
5769 * expression.cc (Expression::eval_with_dot): Add
5770 is_section_dot_assignment parameter.
5771 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5772 absolute and assigning to dot within a section.
5773 * script-sections.cc
5774 (Output_section_element_assignment::set_section_addresses): Pass
5775 dot_section to set_if_absolute.
5776 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5777 as is_section_dot_assignment flag to eval_with_dot.
5778 (Output_section_element_dot_assignment::set_section_addresses):
5779 Likewise.
5780 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5781 parameter. Also set value if relative to dot_section; set the
5782 symbol's output_section.
5783 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5784 parameter. Adjust all callers.
5785 (Expression::eval_maybe_dot): Likewise.
5786 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5787 Adjust all callers.
5788 * testsuite/script_test_2.t: Test assignment of an absolute value
5789 to dot within an output section element.
5790
9634ed06
CC
57912011-10-31 Cary Coutant <ccoutant@google.com>
5792
5793 * options.h (class General_options): Add --[no-]gnu-unique options.
5794 * symtab.cc (Symbol_table::sized_write_globals): Convert
5795 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5796
de4101c7
CC
57972011-10-31 Cary Coutant <ccoutant@google.com>
5798
5799 PR gold/13359
5800 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5801 unnecessary assertion.
5802 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5803
7257cc92
ST
58042011-10-31 Sriraman Tallam <tmsriram@google.com>
5805
5806 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5807 gc_mark_symbol.
5808 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5809 gc_mark_symbol.
5810 Change to just keep the section associated with symbol.
5811 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5812 they are externally visible and --export-dynamic is turned on.
5813 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5814
bfc34b3f
ILT
58152011-10-19 Ian Lance Taylor <iant@google.com>
5816
5817 PR gold/13163
5818 * script-sections.cc
5819 (Output_section_element_dot_assignment::needs_output_section): New
5820 function.
5821
ea0d8c47
ILT
58222011-10-19 Ian Lance Taylor <iant@google.com>
5823
5824 PR gold/13204
5825 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5826 --section-start option was seen.
5827 * options.h (General_options::any_section_start): New function.
5828
abd242a9
DM
58292011-10-18 David S. Miller <davem@davemloft.net>
5830
5831 PR binutils/13301
5832 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5833 member to track relocation locations that have moved during TLS
5834 reloc optimizations.
5835 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5836 (Target_sparc::Relocate::relocate): Adjust view down by 4
5837 bytes if it matches reloc_adjust_addr_.
5838 (Target_sparc::Relocate::relocate_tls): Always move the
5839 __tls_get_addr call delay slot instruction forward 4 bytes when
5840 performing relaxation.
5841
bab9090f
CC
58422011-10-18 Cary Coutant <ccoutant@google.com>
5843
5844 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5845 (Output_file::map_no_anonymous): Check for non-zero
5846 return code from posix_fallocate.
5847
f7c5b166
CC
58482011-10-17 Cary Coutant <ccoutant@google.com>
5849
5850 PR gold/13245
5851 * plugin.cc (is_visible_from_outside): Check for symbols
5852 referenced from dynamic objects.
5853 * resolve.cc (Symbol_table::resolve): Don't count references
5854 from dynamic objects as references from real ELF files.
5855 * testsuite/plugin_test_2.sh: Adjust expected result.
5856
b490c0bb
CC
58572011-10-17 Cary Coutant <ccoutant@google.com>
5858
5859 * gold.cc: Include timer.h.
5860 (queue_middle_tasks): Stamp time.
5861 (queue_final_tasks): Likewise.
5862 * main.cc (main): Store timer in parameters. Print timers
5863 for each pass.
5864 * parameters.cc (Parameters::Parameters): Initialize timer_.
5865 (Parameters::set_timer): New function.
5866 (set_parameters_timer): New function.
5867 * parameters.h (Parameters::set_timer): New function.
5868 (Parameters::timer): New function.
5869 (Parameters::timer_): New data member.
5870 (set_parameters_timer): New function.
5871 * timer.cc (Timer::stamp): New function.
5872 (Timer::get_pass_time): New function.
5873 * timer.h (Timer::stamp): New function.
5874 (Timer::get_pass_time): New function.
5875 (Timer::pass_times_): New data member.
5876
f475cf7b
CC
58772011-10-17 Cary Coutant <ccoutant@google.com>
5878
5879 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5880 task for members of lib groups.
5881
cdd7e244
CC
58822011-10-17 Cary Coutant <ccoutant@google.com>
5883
5884 PR gold/13288
4f95c8b4 5885 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5886 (File_read::make_view): Move bounds check (replace with assert)...
5887 (File_read::find_or_make_view): ... to here.
5888
dfb45471
CC
58892011-10-12 Cary Coutant <ccoutant@google.com>
5890
4f95c8b4 5891 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5892 ::read returns less than requested size.
5893
53bbcc1b
CC
58942011-10-10 Cary Coutant <ccoutant@google.com>
5895
4f95c8b4 5896 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5897 Initialize defined_count_.
5898 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5899 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5900 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5901 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5902 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5903 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5904 member.
5905 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5906 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5907 Return zeroes instead of internal error.
5908
397b129b
CC
59092011-10-10 Cary Coutant <ccoutant@google.com>
5910
5911 PR gold/13249
4f95c8b4 5912 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5913 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5914 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5915 (Output_reloc::type_): Adjust size of bit field.
5916 (Output_reloc::use_plt_offset_): New bit field.
5917 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5918 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5919 flag. Adjust all callers.
4f95c8b4 5920 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5921 creating RELATIVE relocations.
5922
d5698657
NC
59232011-10-10 Nick Clifton <nickc@redhat.com>
5924
5925 * po/es.po: Updated Spanish translation.
5926 * po/fi.po: Updated Finnish translation.
5927
6a59a5c2
DN
59282011-10-03 Diego Novillo <dnovillo@google.com>
5929
5930 * options.cc (parse_uint): Fix dereference of RETVAL.
5931
f0558624
ST
59322011-09-29 Sriraman Tallam <tmsriram@google.com>
5933
5934 * layout.h (section_order_map_): New member.
5935 (get_section_order_map): New member function.
5936 * output.cc (Output_section::add_input_section): Check for patterns
5937 only when --section-ordering-file is specified.
5938 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5939 output_sections have been formed.
5940 * layout.cc (Layout_Layout): Initialize section_order_map_.
5941 * plugin.cc (update_section_order): Store order in order_map. Do not
5942 update the order.
5943 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5944 * testsuite/Makefile.in: Regenerate.
5945 * testsuite/plugin_section_order.c: New file.
5946 * testsuite/plugin_final_layout.cc: New file.
5947 * testsuite/plugin_final_layout.sh: New file.
5948
a7dac153
CC
59492011-09-29 Cary Coutant <ccoutant@google.com>
5950
4f95c8b4 5951 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5952 Check for NULL.
4f95c8b4 5953 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5954 symbols during incremental update.
5955 (Symbol_table::add_from_dynobj): Likewise.
5956
eebd87a5
ILT
59572011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5958 Ian Lance Taylor <iant@google.com>
5959
5960 * symtab.cc (Symbol_table::define_special_symbol): Always
5961 canonicalize version string.
5962
403a3331
CC
59632011-09-26 Cary Coutant <ccoutant@google.com>
5964
4f95c8b4
CC
5965 * gold.cc (queue_initial_tasks): Move option checks ...
5966 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5967 some options; make others fatal.
5968
235061c2
CC
59692011-09-26 Cary Coutant <ccoutant@google.com>
5970
5971 gcc PR lto/47247
5972 * plugin.cc (get_symbols_v2): New function.
5973 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5974 (is_referenced_from_outside): New function.
5975 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5976 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5977 (get_symbols): Pass version parameter.
5978 (get_symbols_v2): New function.
5979 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5980 parameter.
5981 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5982 (onload): Add LDPT_GET_SYMBOLS_V2.
5983 (all_symbols_read_hook): Use get_symbols_v2; check for
5984 LDPR_PREVAILING_DEF_IRONLY_EXP.
5985 * testsuite/plugin_test_3.sh: Update expected results.
5986
dc87f620
ILT
59872011-09-23 Simon Baldwin <simonb@google.com>
5988
5989 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5990 configuration options.
5991 * configure: Regenerate.
5992 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5993 * Makefile.in: Regenerate.
5994 * testsuite/Makefile.in: Regenerate.
5995
a8279f82
ST
59962011-09-19 Sriraman Tallam <tmsriram@google.com>
5997
5998 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5999
0c9350c8
CC
60002011-09-19 Cary Coutant <ccoutant@google.com>
6001
6002 * incremental.cc (can_incremental_update): Fix typo in comment.
6003 * incremental.h (can_incremental_update): Likewise.
6004
aa06ae28
CC
60052011-09-18 Cary Coutant <ccoutant@google.com>
6006
6007 * incremental.cc (can_incremental_update): New function.
6008 * incremental.h (can_incremental_update): New function.
6009 * layout.cc (Layout::init_fixed_output_section): Call it.
6010 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6011 * object.cc (Sized_relobj_file::do_layout): Call
6012 can_incremental_update.
6013
ebb300b2
CC
60142011-09-13 Cary Coutant <ccoutant@google.com>
6015
6016 * configure.ac: Check for glibc support for gnu_indirect_function
6017 support with static linking, setting automake conditional
6018 IFUNC_STATIC.
6019 * Makefile.in: Regenerate.
6020 * configure: Regenerate.
6021
6022 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6023 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6024 for IFUNC_STATIC.
6025 * testsuite/Makefile.in: Regenerate.
6026
1206d0d5
CC
60272011-09-13 Cary Coutant <ccoutant@google.com>
6028
6029 * incremental.cc (Sized_relobj_incr::do_layout): Call
6030 report_comdat_group for kept comdat sections.
6031 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6032 * testsuite/Makefile.in: Regenerate.
6033 * testsuite/incr_comdat_test_1.cc: New source file.
6034 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6035 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6036 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6037
40b29874
ILT
60382011-09-13 Ian Lance Taylor <iant@google.com>
6039
6040 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6041 variable external_symbols_offset.
6042
1b045aac
ILT
60432011-09-12 Ian Lance Taylor <iant@google.com>
6044
6045 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6046 triggered if object has no symbols.
6047
24c6c55a
DM
60482011-09-09 David S. Miller <davem@davemloft.net>
6049
6050 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6051 (Output_fill_debug_line::do_write): Likewise.
6052
66570254
CC
60532011-08-29 Cary Coutant <ccoutant@google.com>
6054
6055 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6056 casts to match formatting specs.
6057 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6058
8ea8cd50
CC
60592011-08-26 Cary Coutant <ccoutant@google.com>
6060
6061 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6062 remaining hole size when allocating.
6063 (Layout::make_output_section): Set fill methods for debug sections.
6064 * layout.h (Free_list::Free_list_node): Move from private to
6065 public.
6066 (Free_list::set_min_hole_size): New function.
6067 (Free_list::begin, Free_list::end): New functions.
6068 (Free_list::min_hole_): New data member.
6069 * output.cc: Include dwarf.h.
6070 (Output_fill_debug_info::do_minimum_hole_size): New function.
6071 (Output_fill_debug_info::do_write): New function.
6072 (Output_fill_debug_line::do_minimum_hole_size): New function.
6073 (Output_fill_debug_line::do_write): New function.
6074 (Output_section::Output_section): Initialize new data member.
6075 (Output_section::set_final_data_size): Ensure patch space is larger
6076 than minimum hole size.
6077 (Output_section::do_write): Fill holes in debug sections.
6078 * output.h (Output_fill): New class.
6079 (Output_fill_debug_info): New class.
6080 (Output_fill_debug_line): New class.
6081 (Output_section::set_free_space_fill): New function.
6082 (Output_section::free_space_fill_): New data member.
6083 * testsuite/Makefile.am (incremental_test_3): Add
6084 --incremental-patch option.
6085 (incremental_test_4): Likewise.
6086 (incremental_test_5): Likewise.
6087 (incremental_test_6): Likewise.
6088 (incremental_copy_test): Likewise.
6089 (incremental_common_test_1): Likewise.
6090 * testsuite/Makefile.in: Regenerate.
6091
7cf80422
NC
60922011-08-26 Nick Clifton <nickc@redhat.com>
6093
6094 * po/es.po: Updated Spanish translation.
6095
c3f7b0e5
CC
60962011-08-01 Cary Coutant <ccoutant@google.com>
6097
6098 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6099 * gold/testsuite/Makefile.in: Regenerate.
6100 * gold/testsuite/justsyms_exec.c: New source file.
6101 * gold/testsuite/justsyms_lib.c: New source file.
6102
9590bf25
CC
61032011-08-01 Cary Coutant <ccoutant@google.com>
6104
6105 * layout.cc (Layout::set_segment_offsets): Don't realign text
6106 segment if -Ttext was specified.
6107 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6108 file type.
6109 * object.h (Sized_relobj_file::e_type): New function.
6110 (Sized_relobj_file::e_type_): New data member.
6111 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6112 base address for ET_EXEC files.
6113 * target.cc (Target::do_make_elf_object_implementation): Allow
6114 ET_EXEC files with --just-symbols option.
6115
dcd8d12e
CC
61162011-07-28 Cary Coutant <ccoutant@google.com>
6117
6118 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6119 Add thread_number parameter.
6120 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6121 * workqueue-threads.cc
6122 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6123 current thread if its thread number is greater than desired thread
6124 count.
6125 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6126 Add thread_number parameter.
6127 (Workqueue::should_cancel_thread): Likewise.
6128 (Workqueue::find_runnable_or_wait): Pass thread_number to
6129 should_cancel_thread.
6130 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6131 parameter.
6132
804eb480
ST
61332011-07-22 Sriraman Tallam <tmsriram@google.com>
6134
6135 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6136 only after checking if it cannot be forced local.
6137 * symtab.h (is_externally_visible): Check if the symbol is not forced
6138 local.
6139
f1ddb600
ILT
61402011-07-15 Ian Lance Taylor <iant@google.com>
6141
6142 * options.h (class General_options): Add --print-output-format.
6143 Move -EL next to -EB, for better --help output.
6144 * target-select.cc: Include <cstdio>, "options.h", and
6145 "parameters.h".
6146 (Target_selector::do_target_bfd_name): New function.
6147 (print_output_format): New function.
6148 * target-select.h (class Target_selector): Update declarations.
6149 (Target_selector::target_bfd_name): New function.
6150 (print_output_format): Declare.
6151 * main.cc: Include "target-select.h".
6152 (main): Handle --print-output-format.
6153 * gold.cc: Include "target-select.h".
6154 (queue_initial_tasks): Handle --print-output-format when there are
6155 no input files.
6156 * parameters.cc (parameters_force_valid_target): Give a better
6157 error message if -EB/-EL does not match target.
6158 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6159 function.
6160
7d172687
ILT
61612011-07-15 Ian Lance Taylor <iant@google.com>
6162
6163 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6164 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6165 (Output_data_plt_i386::do_write): Write address of .dynamic
6166 section to first entry in .got.plt section.
6167 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6168 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6169 Initialize layout_.
6170 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6171 section to first entry in .got.plt section.
6172 * layout.h (Layout::dynamic_section): New function.
6173
e9552f7e
ST
61742011-07-13 Sriraman Tallam <tmsriram@google.com>
6175
6176 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6177 to claim_file call.
6178 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6179 input_section_position_, and input_section_glob_.
6180 (read_layout_from_file): Call function section_ordering_specified.
6181 * layout.h (is_section_ordering_specified): New function.
6182 (section_ordering_specified): New function.
6183 (section_ordering_specified_): New boolean member.
6184 * main.cc(main): Call load_plugins after layout object is defined.
6185 * output.cc (Output_section::add_input_section): Use
6186 function section_ordering_specified to check if section ordering is
6187 needed.
6188 * output.cc (Output_section::add_relaxed_input_section): Use
6189 function section_ordering_specified to check if section ordering is
6190 needed.
6191 (Output_section::update_section_layout): New function.
6192 (Output_section::sort_attached_input_sections): Check if input section
6193 must be reordered.
6194 * output.h (Output_section::update_section_layout): New function.
6195 * plugin.cc (get_section_count): New function.
6196 (get_section_type): New function.
6197 (get_section_name): New function.
6198 (get_section_contents): New function.
6199 (update_section_order): New function.
58797674 6200 (allow_section_ordering): New function.
e9552f7e
ST
6201 (Plugin::load): Add the new interfaces to the transfer vector.
6202 (Plugin_manager::load_plugins): New parameter.
6203 (Plugin_manager::all_symbols_read): New parameter.
6204 (Plugin_manager::claim_file): New parameter. Save the elf object for
6205 unclaimed objects.
6206 (Plugin_manager::get_elf_object): New function.
6207 (Plugin_manager::get_view): Change to directly use the bool to check
6208 if get_view is called from claim_file_hook.
6209 * plugin.h (input_objects): New function
6210 (Plugin__manager::load_plugins): New parameter.
6211 (Plugin_manager::claim_file): New parameter.
6212 (Plugin_manager::get_elf_object): New function.
6213 (Plugin_manager::in_claim_file_handler): New function.
6214 (Plugin_manager::in_claim_file_handler_): New member.
6215 (layout): New function.
6216 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6217 handler with an extra parameter. Make the elf object before calling
6218 claim_file handler.
6219 * testsuite/plugin_test.c (get_section_count): New function pointer.
6220 (get_section_type): New function pointer.
6221 (get_section_name): New function pointer.
6222 (get_section_contents): New function pointer.
6223 (update_section_order): New function pointer.
6224 (allow_section_ordering): New function pointer.
6225 (onload): Check if the new interfaces exist.
6226
9446efde
ILT
62272011-07-13 Ian Lance Taylor <iant@google.com>
6228
6229 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6230 relro section.
6231 * x86_64.cc (Target_x86_64::got_section): Likewise.
6232 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6233 (relro_now_test_SOURCES): New variable.
6234 (relro_now_test_DEPENDENCIES): New variable.
6235 (relro_now_test_LDFLAGS): New variable.
6236 (relro_now_test_LDADD): New variable.
6237 (relro_now_test.so): New target.
6238 * testsuite/Makefile.in: Rebuild.
6239
07aa62f2
ILT
62402011-07-12 Ian Lance Taylor <iant@google.com>
6241
6242 PR gold/12980
6243 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6244 GLOB_DAT relocation rather than a RELATIVE relocation for a
6245 protected symbol when creating a shared library.
6246 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6247 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6248 * testsuite/protected_main_1.cc (main): Test that protected
6249 function has same address.
6250
e2153196
ILT
62512011-07-11 Ian Lance Taylor <iant@google.com>
6252
6253 PR gold/12979
6254 * options.h (class General_options): Add -Bgroup.
6255 * options.cc (General_options::finalize): If -Bgroup is set,
6256 default to --unresolved-symbols=report-all.
6257 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6258 * target-reloc.h (issue_undefined_symbol_error): Handle
6259 --unresolved-symbols=report-all.
6260
6daf5215
ILT
62612011-07-08 Ian Lance Taylor <iant@google.com>
6262
6263 PR gold/11985
6264 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6265 if linker script discards key sections.
6266 (Layout::create_dynamic_symtab): Likewise.
6267 (Layout::assign_local_dynsym_offsets): Likewise.
6268 (Layout::sized_create_version_sections): Likewise.
6269 (Layout::create_interp): Likewise.
6270 (Layout::finish_dynamic_section): Likewise.
6271 (Layout::set_dynamic_symbol_size): Likewise.
6272
beabb2c6
ILT
62732011-07-08 Ian Lance Taylor <iant@google.com>
6274
6275 PR gold/12386
6276 * options.h (class General_options): Add --unresolved-symbols.
6277 * target-reloc.h (issue_undefined_symbol_error): Check
6278 --unresolved-symbols. Add comments.
6279
9c16daf1
ILT
62802011-07-08 Ian Lance Taylor <iant@google.com>
6281
6282 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6283 expression more complex.
6284
191f1a2d
ILT
62852011-07-08 Ian Lance Taylor <iant@google.com>
6286
6287 PR gold/11317
6288 * target-reloc.h (issue_undefined_symbol_error): New inline
6289 function, broken out of relocate_section.
6290 (relocate_section): Call issue_undefined_symbol_error.
6291 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6292 there is no TLS segment if we are about to issue an undefined
6293 symbol error.
6294 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6295
62855347
ILT
62962011-07-08 Ian Lance Taylor <iant@google.com>
6297
6298 PR gold/12279
6299 * resolve.cc (Symbol_table::should_override): Add fromtype
6300 parameter. Change all callers. Give error when linking together
6301 TLS and non-TLS symbol.
6302 (Symbol_table::should_override_with_special): Add fromtype
6303 parameter. Change all callers.
6304 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6305 there is no TLS segment if we have reported some errors.
6306 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6307
67181c72
ILT
63082011-07-08 Ian Lance Taylor <iant@google.com>
6309
6310 PR gold/12372
6311 * target.h (Target::plt_address_for_global): New function.
6312 (Target::plt_address_for_local): New function.
6313 (Target::plt_section_for_global): Remove.
6314 (Target::plt_section_for_local): Remove.
6315 (Target::do_plt_address_for_global): New virtual function.
6316 (Target::do_plt_address_for_local): New virtual function.
6317 (Target::do_plt_section_for_global): Remove.
6318 (Target::do_plt_section_for_local): Remove.
6319 (Target::register_global_plt_entry): Add Symbol_table and Layout
6320 parameters.
6321 * output.cc (Output_data_got::Got_entry::write): Use
6322 plt_address_for_global and plt_address_for_local.
6323 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6324 address of output section.
6325 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6326 got_irelative_, and irelative_count_ fields. Update
6327 declarations.
6328 (Output_data_plt_i386::has_irelative_section): New function.
6329 (Output_data_plt_i386::entry_count): Add irelative_count_.
6330 (Output_data_plt_i386::set_final_data_size): Likewise.
6331 (class Target_i386): Add got_irelative_ and rel_irelative_
6332 fields. Update declarations.
6333 (Target_i386::Target_i386): Initialize new fields.
6334 (Target_i386::do_plt_address_for_global): New function replacing
6335 do_plt_section_for_global.
6336 (Target_i386::do_plt_address_for_local): New function replacing
6337 do_plt_section_for_local.
6338 (Target_i386::got_section): Create got_irelative_.
6339 (Target_i386::rel_irelative_section): New function.
6340 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6341 fields. Don't define __rel_iplt_{start,end}.
6342 (Output_data_plt_i386::add_entry): Add symtab and layout
6343 parameters. Change all callers. Use different PLT and GOT for
6344 IFUNC symbols.
6345 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6346 layout parameters. Change all callers. Use different PLT and
6347 GOT.
6348 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6349 (Output_data_plt_i386::rel_irelative): New function.
6350 (Output_data_plt_i386::address_for_global): New function.
6351 (Output_data_plt_i386::address_for_local): New function.
6352 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6353 IRELATIVE GOT when changing IFUNC GOT entries.
6354 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6355 reloc.
6356 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6357 if we didn't create an IRELATIVE GOT.
6358 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6359 plt_address_for_local.
6360 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6361 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6362 got_irelative_, and irelative_count_ fields. Update
6363 declarations.
6364 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6365 Initialize new fields. Remove symtab parameter. Change all
6366 callers.
6367 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6368 irelative_count_.
6369 (Output_data_plt_x86_64::has_irelative_section): New function.
6370 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6371 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6372 fields. Update declarations.
6373 (Target_x86_64::Target_x86_64): Initialize new fields.
6374 (Target_x86_64::do_plt_address_for_global): New function replacing
6375 do_plt_section_for_global.
6376 (Target_x86_64::do_plt_address_for_local): New function replacing
6377 do_plt_section_for_local.
6378 (Target_x86_64::got_section): Create got_irelative_.
6379 (Target_x86_64::rela_irelative_section): New function.
6380 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6381 all callers. Don't create __rel_iplt_{start,end}.
6382 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6383 parameters. Change all callers. Use different PLT and GOT for
6384 IFUNC symbols.
6385 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6386 layout parameters. Change all callers. Use different PLT and
6387 GOT.
6388 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6389 parameters. Change all callers. Use different PLT and GOT for
6390 IFUNC symbols.
6391 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6392 (Output_data_plt_x86_64::rela_irelative): New function.
6393 (Output_data_plt_x86_64::address_for_global): New function.
6394 (Output_data_plt_x86_64::address_for_local): New function.
6395 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6396 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6397 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6398 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6399 parameters.
6400 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6401 reloc.
6402 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6403 symbols if we didn't create an IRELATIVE GOT.
6404 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6405 plt_address_for_local.
6406 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6407 * testsuite/ifuncvar1.c: New test file.
6408 * testsuite/ifuncvar2.c: New test file.
6409 * testsuite/ifuncvar3.c: New test file.
6410 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6411 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6412 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6413 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6414 * testsuite/Makefile.in: Rebuild.
6415
33c15b45
CC
64162011-07-07 Cary Coutant <ccoutant@google.com>
6417
6418 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6419 (two_file_test_1_ndebug.o): Likewise.
6420 (two_file_test_1b_ndebug.o): Likewise.
6421 (two_file_test_2_ndebug.o): Likewise.
6422 (two_file_test_main_ndebug.o): Likewise.
6423 (incremental_test_2): Link with no-debug versions.
6424
f48b5fb7
CC
64252011-07-06 Cary Coutant <ccoutant@google.com>
6426
6427 * gold/incremental.cc
6428 (Output_section_incremental_inputs::write_info_blocks): Check for
6429 hidden and internal symbols.
6430
221597a5
CC
64312011-07-06 Cary Coutant <ccoutant@google.com>
6432
6433 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6434 Check disposition for startup file.
6435 (Incremental_inputs::report_command_line): Ignore
6436 --incremental-startup-unchanged option.
6437 * options.cc (General_options::parse_incremental_startup_unchanged):
6438 New function.
6439 (General_options::General_options): Initialize new data member.
6440 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6441 (General_options): Add --incremental-startup-unchanged option.
6442 (General_options::incremental_startup_disposition): New function.
6443 (General_options::incremental_startup_disposition_): New data member.
6444
e24719f6
CC
64452011-07-06 Cary Coutant <ccoutant@google.com>
6446
6447 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6448 input file index to Script_info ctor.
6449 (Sized_incremental_binary::do_file_has_changed): Find the
6450 command-line argument for files named in scripts.
6451 * incremental.h (Script_info::Script_info): New ctor
6452 with input file index.
6453 (Script_info::input_file_index): New function.
6454 (Script_info::input_file_index_): New data member.
6455 (Incremental_binary::get_library): Add const.
6456 (Incremental_binary::get_script_info): Add const.
6457 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6458 * testsuite/Makefile.am (incremental_test_5): New test case.
6459 (incremental_test_6): New test case.
6460 * testsuite/Makefile.in: Regenerate.
6461
8f7c81e8
CC
64622011-07-06 Cary Coutant <ccoutant@google.com>
6463
6464 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6465 debug output when command lines differ.
6466
9fbd3822
CC
64672011-07-06 Cary Coutant <ccoutant@google.com>
6468
6469 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6470 --incremental-patch option.
6471 * layout.cc (Free_list::allocate): Extend allocation beyond original
6472 end if enabled.
6473 (Layout::make_output_section): Mark sections that should get
6474 patch space.
6475 * options.cc (parse_percent): New function.
6476 * options.h (parse_percent): New function.
6477 (DEFINE_percent): New macro.
6478 (General_options): Add --incremental-patch option.
6479 * output.cc (Output_section::Output_section): Initialize new data
6480 members.
6481 (Output_section::add_input_section): Print section name when out
6482 of patch space.
6483 (Output_section::add_output_section_data): Likewise.
6484 (Output_section::set_final_data_size): Add patch space when
6485 doing --incremental-full.
6486 (Output_section::do_reset_address_and_file_offset): Remove patch
6487 space.
6488 (Output_segment::set_section_list_addresses): Print debug output
6489 only if --incremental-update.
6490 * output.h (Output_section::set_is_patch_space_allowed): New function.
6491 (Output_section::is_patch_space_allowed_): New data member.
6492 (Output_section::patch_space_): New data member.
6493 * parameters.cc (Parameters::incremental_full): New function.
6494 * parameters.h (Parameters::incremental_full): New function
6495 * testsuite/Makefile.am (incremental_test_2): Add test for
6496 --incremental-patch option.
6497 * testsuite/Makefile.in: Regenerate.
6498 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6499 (t18): Remove function body.
6500
f6cccc2c
DK
65012011-07-05 Doug Kwan <dougkwan@google.com>
6502
6503 PR gold/12771
6504 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6505 Arm_Address type for relocation result.
6506 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6507 overflow check.
6508 (Arm_relocate_functions::abs32): Use unaligned access.
6509 (Arm_relocate_functions::rel32): Ditto.
6510 (Arm_relocate_functions::prel31): Ditto.
6511 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6512 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6513 static data relocations.
6514 * testsuite/Makefile.in: Regnerate.
6515 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6516
28a13fec
ILT
65172011-07-05 Ian Lance Taylor <iant@google.com>
6518
6519 PR gold/12392
6520 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6521 symbols if necessary.
6522 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6523
24d47b34
ILT
65242011-07-05 Ian Lance Taylor <iant@google.com>
6525
6526 PR gold/12952
6527 * resolve.cc (Symbol::override_base_with_special): Simply override
6528 version with special symbol version, ignoring previous version.
6529
41f9cbbe
ILT
65302011-07-05 Ian Lance Taylor <iant@google.com>
6531
6532 * object.cc (Sized_relobj_file::include_section_group): Add
6533 information to comment about signature location.
6534
886288f1
ILT
65352011-07-02 Ian Lance Taylor <iant@google.com>
6536
6537 PR gold/12957
6538 * options.h (class General_options): Add -f and -F.
6539 * options.cc (General_options::finalize): Fatal error if -f/-F
6540 are used without -shared.
6541 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6542
ae3a6d4f
ILT
65432011-07-02 Ian Lance Taylor <iant@google.com>
6544
6545 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6546
21131061
ILT
65472011-07-01 Ian Lance Taylor <iant@google.com>
6548
6549 PR gold/12525
6550 PR gold/12952
6551 * resolve.cc (Symbol::override_base_with_special): Don't override
6552 the version if the overriding symbol has a different name.
6553 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6554 all callers. If we give an error about an undefined version,
6555 define the base version if necessary.
6556 * dynobj.h (class Versions): Update declaration.
6557 * testsuite/weak_alias_test_5.cc: New file.
6558 * testsuite/weak_alias_test.script: New file.
6559 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6560 and versioned_alias have the right value, and call t2.
6561 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6562 weak_alias_test_5.so.
6563 (weak_alias_test_LDADD): Likewise.
6564 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6565 * testsuite/Makefile.in: Rebuild.
6566
611062c0
ILT
65672011-07-01 Ian Lance Taylor <iant@google.com>
6568
6569 PR gold/12525
6570 * options.h (class General_options): Support -z notext.
6571 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6572 -Wl,-z,notext.
6573 (two_file_shared_nonpic.so): Likewise.
6574 (two_file_shared_mixed.so): Likewise.
6575 (two_file_shared_mixed_1.so): Likewise.
6576 (weak_undef_lib_nonpic.so): Likewise.
6577 (alt/weak_undef_lib_nonpic.so): Likewise.
6578 (tls_test_shared_nonpic.so): Likewise.
6579 * testsuite/Makefile.in: Rebuild.
6580
328c7c2f
ILT
65812011-07-01 Ian Lance Taylor <iant@google.com>
6582
6583 PR gold/12525
6584 * configure.ac: Test whether static linking works, setting
6585 the automake conditional HAVE_STATIC.
6586 * testsuite/Makefile.am: Disable tests using -static if
6587 HAVE_STATIC is not true.
6588 * configure, testsuite/Makefile.in: Rebuild.
6589
02d7cd44
ILT
65902011-07-01 Ian Lance Taylor <iant@google.com>
6591
6592 PR gold/12525
6593 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6594 Assert if we see DW_EH_PE_indirect.
6595 * target.h (Target::ehframe_datarel_base): New function.
6596 (Target::do_ehframe_datarel_base): New target function.
6597 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6598 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6599 function.
6600
07a60597
ILT
66012011-07-01 Ian Lance Taylor <iant@google.com>
6602
6603 PR gold/12571
6604 * options.h (class General_options): Add
6605 --ld-generated-unwind-info.
6606 * ehframe.cc (Fde::write): Add address parameter. Change all
6607 callers. If associated with PLT, fill in address and size.
6608 (Cie::set_output_offset): Only add merge mapping if there is an
6609 object.
6610 (Cie::write): Add address parameter. Change all callers.
6611 (Eh_frame::add_ehframe_for_plt): New function.
6612 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6613 input_offset_ fields into union u_, with new plt field.
6614 (Fde::Fde): Adjust for new union field.
6615 (Fde::Fde) [Output_data version]: New constructor.
6616 (Fde::add_mapping): Only add merge mapping if there is an object.
6617 (class Cie): Update declarations.
6618 (class Eh_frame): Declare add_ehframe_for_plt.
6619 * layout.cc (Layout::layout_eh_frame): Break out code into
6620 make_eh_frame_section, and call it.
6621 (Layout::make_eh_frame_section): New function.
6622 (Layout::add_eh_frame_for_plt): New function.
6623 * layout.h (class Layout): Update declarations.
6624 * merge.cc (Merge_map::add_mapping): Add assertion.
6625 * i386.cc: Include "dwarf.h".
6626 (class Output_data_plt_i386): Make first_plt_entry,
6627 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6628 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6629 and plt_eh_frame_fde.
6630 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6631 boundary. Call add_eh_frame_for_plt if appropriate.
6632 * x86_64.cc: Include "dwarf.h".
6633 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6634 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6635 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6636 and plt_eh_frame_fde.
6637 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6638 appropriate.
6639
14788a3f
ILT
66402011-06-29 Ian Lance Taylor <iant@google.com>
6641
6642 PR gold/12629
6643 * object.cc (Sized_relobj_file::layout_section): Change shdr
6644 parameter to be const.
6645 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6646 out of do_layout.
6647 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6648 appropriate. Call layout_eh_frame_section.
6649 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6650 sections.
6651 * object.h (class Sized_relobj_file): Update declarations.
6652
6c21fce1
ILT
66532011-06-29 Ian Lance Taylor <iant@google.com>
6654
37e41b03 6655 PR gold/12652
6c21fce1
ILT
6656 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6657 modifier.
6658 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6659
4d5e4e62
ILT
66602011-06-29 Ian Lance Taylor <iant@google.com>
6661
6662 PR gold/12675
6663 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6664 SHT_X86_64_UNWIND.
6665 * layout.cc (Layout::layout_eh_frame): Likewise.
6666
886f533a
ILT
66672011-06-29 Ian Lance Taylor <iant@google.com>
6668
6669 PR gold/12695
6670 * layout.cc (Layout::symtab_section_shndx): New function.
6671 * layout.h (class Layout): Declare symtab_section_shndx.
6672 * output.cc (Output_section::write_header): Call it.
6673
f3ae1b28
ILT
66742011-06-29 Ian Lance Taylor <iant@google.com>
6675
6676 PR gold/12818
6677 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6678 symbols which are not used in a relocation.
6679
aecf301f
ILT
66802011-06-28 Ian Lance Taylor <iant@google.com>
6681
6682 PR gold/12898
6683 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6684 script create indistinguishable segments.
6685 (Layout::set_segment_offsets): Use stable_sort when sorting
6686 segments. Pass this to Compare_segments constructor.
6687 * layout.h (class Layout): Make segment_precedes non-static.
6688 (class Compare_segments): Change from struct to class. Add
6689 layout_ field. Add constructor.
6690 * script-sections.cc
6691 (Script_sections::attach_sections_using_phdrs_clause): Rename
6692 local orphan to is_orphan. Don't report failure to put empty
6693 section in segment. On attachment failure, report name of
6694 section, and attach to first PT_LOAD segment.
6695
03ef7571
ILT
66962011-06-28 Ian Lance Taylor <iant@google.com>
6697
6698 PR gold/12934
6699 * target-select.cc (Target_selector::Target_selector): Add
6700 emulation parameter. Change all callers.
6701 (select_target_by_bfd_name): Rename from select_target_by_name.
6702 Change all callers.
6703 (select_target_by_emulation): New function.
6704 (supported_emulation_names): New function.
6705 * target-select.h (class Target_selector): Add emulation_ field.
6706 Update declarations.
6707 (Target_selector::recognize_by_bfd_name): Rename from
6708 recognize_by_name. Change all callers.
6709 (Target_selector::supported_bfd_names): Rename from
6710 supported_names. Change all callers.
6711 (Target_selector::recognize_by_emulation): New function.
6712 (Target_selector::supported_emulations): New function.
6713 (Target_selector::emulation): New function.
6714 (Target_selector::do_recognize_by_bfd_name): Rename from
6715 do_recognize_by_name. Change all callers.
6716 (Target_selector::do_supported_bfd_names): Rename from
6717 do_supported_names. Change all callers.
6718 (Target_selector::do_recognize_by_emulation): New function.
6719 (Target_selector::do_supported_emulations): New function.
6720 (select_target_by_bfd_name): Change name in declaration.
6721 (select_target_by_emulation): Declare.
6722 (supported_emulation_names): Declare.
6723 * parameters.cc (parameters_force_valid_target): Try to find
6724 target based on emulation from -m option.
6725 * options.h (class General_options): Change doc string for -m.
6726 * options.cc (help): Print emulations.
6727 (General_options::parse_V): Likewise.
6728 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6729 Add emulation parameter. Change all callers.
6730
200b2bb9
ILT
67312011-06-28 Ian Lance Taylor <iant@google.com>
6732
6733 * target.h (class Target): Add osabi_ field.
6734 (Target::osabi): New function.
6735 (Target::set_osabi): New function.
6736 (Target::Target): Initialize osabi_.
6737 (Target::do_adjust_elf_header): Make pure virtual.
6738 (Sized_target::do_adjust_elf_header): Declare.
6739 * target.cc (Sized_target::do_adjust_elf_header): New function.
6740 (class Sized_target): Instantiate all versions.
6741 * freebsd.h (class Target_freebsd): Remove.
6742 (Target_selector_freebsd::do_recognize): Call set_osabi on
6743 Target.
6744 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6745 (Target_selector_freebsd::set_osabi): Remove.
6746 * i386.cc (class Target_i386): Inherit from Sized_target rather
6747 than Target_freebsd.
6748 * x86_64.cc (class Target_x86_64): Likewise.
6749
b3ce541e
ILT
67502011-06-28 Ian Lance Taylor <iant@google.com>
6751
6752 * target.h (Target::can_check_for_function_pointers): Rewrite.
6753 Make non-virtual.
6754 (Target::can_icf_inline_merge_sections): Likewise.
6755 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6756 (Target::Target_info): Add can_icf_inline_merge_sections field.
6757 (Target::do_can_check_for_function_pointers): New virtual
6758 function.
6759 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6760 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6761 from can_check_for_function_pointers, move in file.
6762 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6763 section_may_have_icf_unsafe_poineters, move in file.
6764 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6765 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6766 Rename from can_check_for_function_pointers, move in file.
6767 (Target_i386::can_icf_inline_merge_sections): Remove.
6768 (Target_i386::i386_info): Initialize
6769 can_icf_inline_merge_sections.
6770 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6771 Initialize can_icf_inline_merge_sections.
6772 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6773 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6774 Rename from can_check_for_function_pointers, move in file.
6775 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6776 (Target_x86_64::x86_64_info): Initialize
6777 can_icf_inline_merge_sections.
6778 * testsuite/testfile.cc (Target_test::test_target_info):
6779 Likewise.
6780 * icf.cc (get_section_contents): Correct formatting.
6781
6d1c4efb
ILT
67822011-06-27 Ian Lance Taylor <iant@google.com>
6783
6784 * symtab.cc (Symbol::versioned_name): New function.
6785 (Symbol_table::add_to_final_symtab): Use versioned_name when
6786 appropriate.
6787 (Symbol_table::sized_write_symbol): Likewise.
6788 * symtab.h (class Symbol): Declare versioned_name.
6789 * stringpool.h (class Stringpool_template): Add variant of add
6790 which takes a std::basic_string.
6791 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6792 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6793 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6794 (ver_test_12.o): New target.
6795 * testsuite/Makefile.in: Rebuild.
6796
57eb9b50
DK
67972011-06-27 Doug Kwan <dougkwan@google.com>
6798
6799 * arm.cc (Arm_relocate_functions::thm_jump8,
6800 Arm_relocate_functions::thm_jump11): Use a wider signed
6801 type to compute offset.
6802 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6803 arm_thm_jump8.
6804 * testsuite/Makefile.in: Regenerate.
6805 * testsuite/arm_branch_in_range.sh: Check test results of
6806 arm_thm_jump11 and arm_thm_jump8.
6807 * testsuite/arm_thm_jump11.s: New test source file.
6808 * testsuite/arm_thm_jump11.t: New linker script.
6809 * testsuite/arm_thm_jump8.s: New test source file.
6810 * testsuite/arm_thm_jump8.t: New linker script.
6811
487b39df
ILT
68122011-06-24 Ian Lance Taylor <iant@google.com>
6813
6814 * layout.cc: Include "object.h".
6815 (ctors_sections_in_init_array): New static variable.
6816 (Layout::is_ctors_in_init_array): New function.
6817 (Layout::layout): Add entry to ctors_sections_in_init_array if
6818 appropriate.
6819 * layout.h (class Layout): Declare is_ctors_in_init_array.
6820 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6821 is_ctors_reverse_view is set.
6822 (Sized_relobj_file::write_sections): Add layout parameter. Change
6823 all callers. Set is_ctors_reverse_view field of View_size.
6824 (Sized_relobj_file::reverse_words): New function.
6825 * object.h (Sized_relobj_file::View_size): Add
6826 is_ctors_reverse_view field.
6827 (class Sized_relobj_file): Update declarations.
6828 * testsuite/initpri3.c: New test.
6829 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6830 initpri3b.
6831 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6832 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6833 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6834 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6835 * testsuite/Makefile.in: Rebuild.
6836
472076e4
CC
68372011-06-24 Cary Coutant <ccoutant@google.com>
6838
6839 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6840 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6841 (debug_msg_cdebug.err): New targets.
6842 * testsuite/Makefile.in: Regenerate.
6843 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6844 Fix checks for link with shared library.
6845
a60af0db
DK
68462011-06-24 Doug Kwan <dougkwan@google.com>
6847
6848 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6849 skip empty text sections.
6850 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6851
5393d741
ILT
68522011-06-22 Ian Lance Taylor <iant@google.com>
6853
6854 PR gold/12910
6855 * options.h (class General_options): Add --ctors-in-init-array.
6856 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6857 friends as SHT_PROGBITS for merging sections.
6858 (Layout::layout): Remove special handling of .init_array and
6859 friends. Don't sort if doing relocatable link. Sort for .ctors
6860 and .dtors if ctors_in_init_array.
6861 (Layout::make_output_section): Force correct section types for
6862 .init_array and friends. Don't sort if doing relocatable link,
6863 Don't sort .ctors and .dtors if ctors_in_init_array.
6864 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6865 (Layout::output_section_name): Add relobj parameter. Change all
6866 callers. Handle .ctors. and .dtors. in code rather than table.
6867 Handle .ctors and .dtors if ctors_in_init_array.
6868 (Layout::match_file_name): New function, moved from output.cc.
6869 * layout.h (class Layout): Update declarations.
6870 * output.cc: Include "layout.h".
6871 (Input_section_sort_entry::get_priority): New function.
6872 (Input_section_sort_entry::match_file_name): Just call
6873 Layout::match_file_name.
6874 (Output_section::Input_section_sort_init_fini_compare::operator()):
6875 Handle .ctors and .dtors. Sort by explicit priority rather than
6876 by name.
6877 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6878 * testsuite/initpri2.c: New test.
6879 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6880 (check_PROGRAMS): Add initpri2.
6881 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6882 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6883 * configure, testsuite/Makefile.in: Rebuild.
6884
e1f74f98
ILT
68852011-06-19 Ian Lance Taylor <iant@google.com>
6886
6887 PR gold/12880
6888 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6889 .interp section to a PT_INTERP segment even if we have seen a
6890 --dynamic-linker option. Don't do it if we have seen a PHDRS
6891 clause in a linker script.
6892 (Layout::finalize): Don't create a .interp section if we've
6893 already create a PT_INTERP segment.
6894 (Layout::create_interp): Always call choose_output_section (revert
6895 patch of 2011-06-17). Don't create PT_INTERP segment.
6896 * script-sections.cc
6897 (Script_sections::create_note_and_tls_segments): Add a .interp
6898 section to a PT_INTERP segment even if we have seen a
6899 --dynamic-linker option.
6900
766f91bb
ILT
69012011-06-18 Ian Lance Taylor <iant@google.com>
6902
6903 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6904 merely because a non-PT_LOAD segment has a dynamic reloc.
6905
0d212c3a
ILT
69062011-06-18 Ian Lance Taylor <iant@google.com>
6907
6908 * layout.cc (Layout::finish_dynamic_section): Don't create
6909 DT_FLAGS entry if not needed.
6910
911a5072
ILT
69112011-06-18 Ian Lance Taylor <iant@google.com>
6912
6913 PR gold/12745
6914 * layout.cc (Layout::layout_eh_frame): Correct handling of
6915 writable .eh_frame section.
6916
534b4e5f
ILT
69172011-06-17 Ian Lance Taylor <iant@google.com>
6918
6919 PR gold/12893
6920 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6921 symbol is redefined with the exact same object and value.
6922
10b4f102
ILT
69232011-06-17 Ian Lance Taylor <iant@google.com>
6924
6925 PR gold/12880
6926 * layout.h (class Layout): Add interp_segment_ field.
6927 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6928 (Layout::attach_allocated_section_to_segment): If making shared
6929 library, put .interp section in PT_INTERP segment.
6930 (Layout::finalize): Also call create_interp if -dynamic-linker
6931 option was used.
6932 (Layout::create_interp): Assert that there is no PT_INTERP
6933 segment. If not using a SECTIONS clause, use make_output_section.
6934 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6935 * script-sections.cc
6936 (Script_sections::create_note_and_tls_segments): If making shared
6937 library, put .interp section in PT_INTERP segment.
6938
a29b0dad
ILT
69392011-06-17 Ian Lance Taylor <iant@google.com>
6940
e588ea8d
ILT
6941 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6942 when making a shared library.
6943
69442011-06-17 Ian Lance Taylor <iant@google.com>
6945
6946 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6947 parameter. Change all callers. Don't issue warning about PC32
6948 against locally defined symbol.
a29b0dad 6949
9d3b0698
ILT
69502011-06-16 Ian Lance Taylor <iant@google.com>
6951
6952 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6953 occurs in same object.
6954
85b0f90c
AM
69552011-06-14 Alan Modra <amodra@gmail.com>
6956
6957 * po/POTFILES.in: Regenerate.
6958
a94907d9
ILT
69592011-06-09 Ian Lance Taylor <iant@google.com>
6960
6961 * script-sections.cc
6962 (Orphan_output_section::set_section_addresses): For a relocatable
6963 link set address to 0.
6964
4fb3a1c3
CC
69652011-06-09 Cary Coutant <ccoutant@google.com>
6966
6967 PR gold/12804
6968 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6969 used with --compress-debug-sections.
6970 * gold/object.cc (Sized_relobj_file::do_layout): Report
6971 uncompressed size of compressed input sections.
6972
61220854
CC
69732011-06-08 Cary Coutant <ccoutant@google.com>
6974
6975 PR gold/12804
6976 * testsuite/two_file_test_2_v1.cc: Change initialization of
6977 v2 to keep it in .data.
6978
e6455dfb
CC
69792011-06-07 Cary Coutant <ccoutant@google.com>
6980
6981 * common.cc (Symbol_table::do_allocate_commons_list): Call
6982 gold_fallback.
6983 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6984 (Errors::fallback): New function.
6985 (gold_fallback): New function.
6986 * errors.h (Errors::fallback): New function.
6987 * gold.cc (gold_exit): Change status parameter to enum; adjust
6988 all callers.
6989 (queue_initial_tasks): Call gold_fallback.
6990 * gold.h: Include cstdlib.
6991 (Exit_status): New enum type.
6992 (gold_exit): Change status parameter to enum.
6993 (gold_fallback): New function.
6994 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6995 (Layout::create_symtab_sections): Likewise.
6996 (Layout::create_shdrs): Likewise.
6997 * main.cc (main): Adjust call to gold_exit.
6998 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6999 (Output_data_got::add_got_entry_pair): Likewise.
7000 (Output_section::add_input_section): Likewise.
7001 (Output_section::add_output_section_data): Likewise.
7002 (Output_segment::set_section_list_addresses): Likewise.
7003 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7004
fb0e076f
CC
70052011-06-07 Cary Coutant <ccoutant@google.com>
7006
7007 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7008 for incremental links.
7009 * output.cc (Output_segment::set_section_list_addresses): Remove
7010 FIXME and test for TLS or BSS.
7011
a5ee4d5d
CC
70122011-06-07 Cary Coutant <ccoutant@google.com>
7013
7014 * testsuite/Makefile.am: Add incremental_copy_test,
7015 incremental_common_test_1.
7016 * testsuite/Makefile.in: Regenerate.
7017 * testsuite/common_test_1_v1.c: New source file.
7018 * testsuite/common_test_1_v2.c: New source file.
7019 * testsuite/copy_test_v1.cc: New source file.
7020
5146f448
CC
70212011-06-07 Cary Coutant <ccoutant@google.com>
7022
7023 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7024 update, allocate common from bss section's free list.
7025 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7026 linker-defined symbols.
7027 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7028 Skip GOT and PLT entries that are no longer referenced.
7029 (Output_section_incremental_inputs::write_info_blocks): Mark
7030 linker-defined symbols.
7031 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7032 * output.cc (Output_section::allocate): New function.
7033 * output.h (Output_section::allocate): New function.
7034 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7035 linker-defined symbols.
7036 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7037 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7038 (Symbol::init_base_output_data): Likewise.
7039 (Symbol::init_base_output_segment): Likewise.
7040 (Symbol::init_base_constant): Likewise.
7041 (Sized_symbol::init_output_data): Likewise.
7042 (Sized_symbol::init_output_segment): Likewise.
7043 (Sized_symbol::init_constant): Likewise.
7044 (Symbol_table::do_define_in_output_data): Likewise.
7045 (Symbol_table::do_define_in_output_segment): Likewise.
7046 (Symbol_table::do_define_as_constant): Likewise.
7047 * symtab.h (Symbol::is_predefined): New function.
7048 (Symbol::init_base_output_data): Add is_predefined parameter.
7049 (Symbol::init_base_output_segment): Likewise.
7050 (Symbol::init_base_constant): Likewise.
7051 (Symbol::is_predefined_): New data member.
7052 (Sized_symbol::init_output_data): Add is_predefined parameter.
7053 (Sized_symbol::init_output_segment): Likewise.
7054 (Sized_symbol::init_constant): Likewise.
7055 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7056
26d3c67d
CC
70572011-06-07 Cary Coutant <ccoutant@google.com>
7058
7059 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7060 instead of emit_copy_reloc.
7061 (Copy_relocs::emit_copy_reloc): Refactor.
7062 (Copy_relocs::make_copy_reloc): New function.
7063 (Copy_relocs::add_copy_reloc): Remove.
7064 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7065 section.
7066 (Copy_relocs::make_copy_reloc): New function.
7067 (Copy_relocs::add_copy_reloc): Remove.
7068 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7069 unchanged input files.
7070 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7071 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7072 Reserve BSS space for COPY relocations.
7073 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7074 (Output_section_incremental_inputs::write_info_blocks): Record
7075 whether a symbol is copied from a shared object.
7076 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7077 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7078 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7079 (Incremental_input_entry_reader::get_output_symbol_index): Add
7080 is_copy parameter.
7081 (Incremental_binary::emit_copy_relocs): New function.
7082 (Incremental_binary::do_emit_copy_relocs): New function.
7083 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7084 new data member.
7085 (Sized_incremental_binary::add_copy_reloc): New function.
7086 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7087 (Sized_incremental_binary::Copy_reloc): New struct.
7088 (Sized_incremental_binary::Copy_relocs): New typedef.
7089 (Sized_incremental_binary::copy_relocs_): New data member.
7090 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7091 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7092 * target.h (Sized_target::emit_copy_reloc): New function.
7093 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7094
7cdb37d9
CC
70952011-06-02 Cary Coutant <ccoutant@google.com>
7096
7097 PR gold/12163
7098 * gold/archive.cc (Archive::Archive): Initialize new data member.
7099 (Archive::include_all_members): Return if archive has already been
7100 included.
7101 * gold/archive.h (Archive::include_all_members_): New data member.
7102
cc643b88
NC
71032011-06-02 Nick Clifton <nickc@redhat.com>
7104
7105 * dynobj.h: Fix spelling mistake in comment.
7106 * output.cc: Likewise.
7107
f62a3ca7 71082011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7109 Asier Llano
f62a3ca7
DK
7110
7111 PR gold/12826
cc643b88 7112 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7113 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7114 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7115 redundant arm_exidx_test.so.
7116 * testsuite/Makefile.in: Regenerate.
7117 (check_SCRIPTS): Add pr12826.sh
7118 (check_DATA): Add pr12826.stdout
7119 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7120 * testsuite/pr12826.sh: New file.
7121 * testsuite/pr12826_1.s: Ditto.
7122 * testsuite/pr12826_1.s: Ditto.
7123
8dbe1edc
ILT
71242011-05-30 Ian Lance Taylor <iant@google.com>
7125
7126 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7127 sections.
7128
c49875be
ILT
71292011-05-29 Ian Lance Taylor <iant@google.com>
7130
7131 PR gold/12804
7132 * testsuite/Makefile.am: Use different file name for two_file_test
7133 temporary file for each incremental test.
7134 * testsuite/Makefile.in: Rebuild.
7135
69d53f7a
ILT
71362011-05-29 Ian Lance Taylor <iant@google.com>
7137
7138 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7139 binary input file is empty.
7140
41d0ab5f
ILT
71412011-05-27 Ian Lance Taylor <iant@google.com>
7142
7143 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7144 (ver_test_9.so): Likewise.
7145 * testsuite/Makefile.in: Rebuild.
7146
89d8a36b
CC
71472011-05-26 Cary Coutant <ccoutant@google.com>
7148
7149 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7150 * incremental.cc (Incremental_inputs::report_input_section): Fix
7151 comment, indentation.
7152 (Incremental_inputs::report_comdat_group): New function.
7153 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7154 of data for incremental input file entry.
7155 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7156 group count, COMDAT group signatures.
7157 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7158 an unchanged input file.
7159 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7160 Initialize new data member.
7161 (Incremental_object_entry::add_comdat_group): New function.
7162 (Incremental_object_entry::get_comdat_group_count): New function.
7163 (Incremental_object_entry::get_comdat_signature_key): New function.
7164 (Incremental_object_entry::groups_): New data member.
7165 (Incremental_inputs::report_comdat_group): New function.
7166 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7167 data for incremental input file entry.
7168 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7169 (Incremental_input_entry_reader::get_input_section): Adjust size of
7170 data for incremental input file entry.
7171 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7172 (Incremental_input_entry_reader::get_comdat_group_signature): New
7173 function.
7174 * object.cc (Sized_relobj::include_section_group): Report kept
7175 COMDAT groups for incremental links.
7176
1706a06f
ILT
71772011-05-24 David Meyer <pdox@google.com>
7178
7179 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7180 with name parameter. Add found_name parameter.
7181 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7182 * dirsearch.h (class Dirsearch): Update declaration.
7183
a10ae760
ILT
71842011-05-24 Ian Lance Taylor <iant@google.com>
7185
7186 * archive.cc (Library_base::should_include_member): Pull in object
7187 from archive if it defines the entry symbol.
7188 * parameters.cc (Parameters::entry): New function.
7189 * parameters.h (class Parameters): Declare entry.
7190 * output.h (class Output_file_header): Remove entry_ field.
7191 * output.cc (Output_file_header::Output_file_header): Remove entry
7192 parameter. Change all callers.
7193 (Output_file_header::entry): Use parameters->entry.
7194 * gold.cc (queue_middle_tasks): Likewise.
7195 * plugin.cc (Plugin_hook::run): Likewise.
7196
aa92d6ed
CC
71972011-05-24 Cary Coutant <ccoutant@google.com>
7198
7199 * gold.cc (queue_initial_tasks): Pass incremental base filename
7200 to Output_file::open_base_file; don't print error message.
7201 * incremental-dump.cc (main): Adjust call to
7202 Output_file::open_for_modification.
7203 * incremental-dump.cc (main): Likewise.
7204 * incremental.cc (Incremental_inputs::report_command_line):
7205 Ignore --incremental-base option when comparing command lines.
7206 Ignore parameter when given as separate argument.
7207 * options.h (class General_options): Add --incremental-base.
7208 * output.cc (Output_file::Output_file):
7209 (Output_file::open_base_file): Add base_name and writable parameters;
7210 read base file into new file; print error message here.
7211 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7212 callers.
7213 * output.h (Output_file::open_for_modification): Rename to...
7214 (Output_file::open_base_file): ...this; add base_name and
7215 writable parameters; adjust all callers.
7216 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7217 callers.
7218 * testsuite/Makefile.am (incremental_test_4): Test
7219 --incremental-base.
7220 * testsuite/Makefile.in: Regenerate.
7221
2eedd706
CC
72222011-05-24 Cary Coutant <ccoutant@google.com>
7223
7224 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7225 incremental_test_4.
7226 * testsuite/Makefile.in: Regenerate.
7227 * testsuite/two_file_test_1_v1.cc: New test source file.
7228 * testsuite/two_file_test_1b_v1.cc: New test source file.
7229 * testsuite/two_file_test_2_v1.cc: New test source file.
7230
0f1c85a6
CC
72312011-05-24 Cary Coutant <ccoutant@google.com>
7232
7233 * dynobj.h (Dynobj::do_dynobj): New function.
7234 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7235 flag and soname for shared objects.
7236 * incremental.cc (Incremental_inputs::report_object): Make
7237 either Incremental_object_entry or Incremental_dynobj_entry; add
7238 soname to string table.
7239 (Incremental_inputs::report_input_section): Add assertion.
7240 (Output_section_incremental_inputs::set_final_data_size): Adjust
7241 type of input file entry for shared libraries; adjust size of
7242 shared library info entry.
7243 (Output_section_incremental_inputs::write_input_files): Write
7244 as_needed flag for shared libraries.
7245 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7246 of input file entry for shared libraries; write soname.
7247 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7248 soname from incremental info.
7249 * incremental.h (enum Incremental_input_flags): Add
7250 INCREMENTAL_INPUT_AS_NEEDED.
7251 (Incremental_input_entry::Incremental_input_entry): Initialize new
7252 data member.
7253 (Incremental_input_entry::set_as_needed): New function.
7254 (Incremental_input_entry::as_needed): New function.
7255 (Incremental_input_entry::do_dynobj_entry): New function.
7256 (Incremental_input_entry::as_needed_): New data member.
7257 (Incremental_object_entry::Incremental_object_entry): Don't check
7258 for shared library.
7259 (Incremental_object_entry::do_type): Likewise.
7260 (class Incremental_dynobj_entry): New class.
7261 (Incremental_input_entry_reader::as_needed): New function.
7262 (Incremental_input_entry_reader::get_soname): New function.
7263 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7264 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7265 size of shared library info entry.
58797674 7266 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7267 incremental link when adding DT_NEEDED entries.
7268 * object.h (Object::Object): Initialize new data member.
7269 (Object::dynobj): New function.
7270 (Object::set_as_needed): New function.
7271 (Object::as_needed): New function.
7272 (Object::do_dynobj): New function.
7273 (Object::as_needed_): New data member.
7274
6fa2a40b
CC
72752011-05-24 Cary Coutant <ccoutant@google.com>
7276
7277 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7278 info; adjust display of GOT entries.
7279 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7280 vector of input objects; remove file_status_.
7281 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7282 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7283 got_plt reader; call target hooks to reserve GOT entries.
7284 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7285 of input file info header and GOT info entry.
7286 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7287 relocation info.
7288 (Got_plt_view_info::got_descriptor): Remove.
7289 (Got_plt_view_info::sym_index): New data member.
7290 (Got_plt_view_info::input_index): New data member.
7291 (Local_got_offset_visitor::visit): Write input file index.
7292 (Global_got_offset_visitor::visit): Write 0 for input file index.
7293 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7294 with sym_index and input_index.
7295 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7296 incremental info GOT entry; replace got_descriptor with input_index.
7297 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7298 map from input file index to object.
7299 (Sized_relobj_incr::do_layout): Replace direct data member reference
7300 with accessor function.
7301 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7302 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7303 Adjust size of input file info header.
7304 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7305 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7306 (Incremental_input_entry_reader::get_input_section): Adjust size of
7307 input file info header.
7308 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7309 of incremental info GOT entry.
7310 (Incremental_got_plt_reader::get_got_desc): Remove.
7311 (Incremental_got_plt_reader::get_got_symndx): New function.
7312 (Incremental_got_plt_reader::get_got_input_index): New function.
7313 (Sized_incremental_binary::Sized_incremental_binary): Remove
7314 file_status_; add input_objects_.
7315 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7316 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7317 (Sized_incremental_binary::file_is_unchanged): Remove.
7318 (Sized_incremental_binary::set_input_object): New function.
7319 (Sized_incremental_binary::input_object): New function.
7320 (Sized_incremental_binary::file_status_): Remove.
7321 (Sized_incremental_binary::input_objects_): New data member.
7322 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7323 references.
7324 (Sized_relobj_incr::invalid_address): Move to base class.
7325 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7326 class.
7327 (Sized_relobj_incr::do_output_section_offset): Likewise.
7328 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7329 (Sized_relobj_incr::section_offsets_): Likewise.
7330 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7331 function.
7332 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7333 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7334 with accessor function.
7335 (Sized_relobj_file::do_layout): Likewise.
7336 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7337 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7338 (Sized_relobj_file::compute_final_local_value): Replace refs to
7339 section_offsets_ with accessor function.
7340 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7341 * object.h (Relobj::Relobj): Initialize new data members.
7342 (Relobj::add_dyn_reloc): New function.
7343 (Relobj::first_dyn_reloc): New function.
7344 (Relobj::dyn_reloc_count): New function.
7345 (Relobj::first_dyn_reloc_): New data member.
7346 (Relobj::dyn_reloc_count_): New data member.
7347 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7348 references.
7349 (Sized_relobj::Address): New typedef.
7350 (Sized_relobj::invalid_address): Move here from child class.
7351 (Sized_relobj::Sized_relobj): Initialize new data members.
7352 (Sized_relobj::sized_relobj): New function.
7353 (Sized_relobj::is_output_section_offset_invalid): Move here from
7354 child class.
7355 (Sized_relobj::get_output_section_offset): Likewise.
7356 (Sized_relobj::local_has_got_offset): Likewise.
7357 (Sized_relobj::local_got_offset): Likewise.
7358 (Sized_relobj::set_local_got_offset): Likewise.
7359 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7360 (Sized_relobj::clear_got_offsets): New function.
7361 (Sized_relobj::section_offsets): Move here from child class.
7362 (Sized_relobj::do_output_section_offset): Likewise.
7363 (Sized_relobj::do_set_section_offset): Likewise.
7364 (Sized_relobj::Local_got_offsets): Likewise.
7365 (Sized_relobj::local_got_offsets_): Likewise.
7366 (Sized_relobj::section_offsets_): Likewise.
7367 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7368 references.
7369 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7370 class.
7371 (Sized_relobj_file::sized_relobj): New function
7372 (Sized_relobj_file::local_has_got_offset): Move to base class.
7373 (Sized_relobj_file::local_got_offset): Likewise.
7374 (Sized_relobj_file::set_local_got_offset): Likewise.
7375 (Sized_relobj_file::get_output_section_offset): Likewise.
7376 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7377 (Sized_relobj_file::do_output_section_offset): Likewise.
7378 (Sized_relobj_file::do_set_section_offset): Likewise.
7379 (Sized_relobj_file::Local_got_offsets): Likewise.
7380 (Sized_relobj_file::local_got_offsets_): Likewise.
7381 (Sized_relobj_file::section_offsets_): Likewise.
7382 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7383 (all constructors).
7384 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7385 (Output_reloc::get_symbol_index): Likewise.
7386 (Output_reloc::local_section_offset): Likewise.
7387 (Output_reloc::get_address): Likewise.
7388 (Output_reloc::symbol_value): Likewise.
7389 (Output_data_got::reserve_slot): Move to class definition.
7390 (Output_data_got::reserve_local): New function.
7391 (Output_data_got::reserve_slot_for_global): Remove.
7392 (Output_data_got::reserve_global): New function.
7393 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7394 (all constructors, two instantiations).
7395 (Output_reloc::get_relobj): New function (two instantiations).
7396 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7397 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7398 (Output_data_reloc::add_global): Adjust type of relobj.
7399 (Output_data_reloc::add_global_relative): Likewise.
7400 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7401 (Output_data_reloc::add_local): Likewise.
7402 (Output_data_reloc::add_local_relative): Likewise.
7403 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7404 (Output_data_reloc::add_local_section): Likewise.
7405 (Output_data_reloc::add_output_section): Likewise.
7406 (Output_data_reloc::add_absolute): Likewise.
7407 (Output_data_reloc::add_target_specific): Likewise.
7408 (Output_data_got::reserve_slot): Move definition here.
7409 (Output_data_got::reserve_local): New function.
7410 (Output_data_got::reserve_global): New function.
7411 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7412 section_offsets_ with accessor function.
7413 (Sized_relobj_file::write_sections): Likewise.
7414 (Sized_relobj_file::do_relocate_sections): Likewise.
7415 * target.h (Sized_target::reserve_local_got_entry): New function.
7416 (Sized_target::reserve_global_got_entry): New function.
7417 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7418 (Target_x86_64::reserve_global_got_entry): New function.
7419 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7420
4829d394
CC
74212011-05-23 Cary Coutant <ccoutant@google.com>
7422
7423 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7424 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7425 bit when checking got_type.
7426 * incremental.cc (Sized_incremental_binary::setup_readers):
7427 Store symbol table and string table locations; initialize bit vector
7428 of file status flags.
7429 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7430 unchanged files.
7431 (Sized_incremental_binary::do_process_got_plt): New function.
7432 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7433 (Output_section_incremental_inputs::set_final_data_size): Record
7434 file index for each input file.
7435 (Output_section_incremental_inputs::write_got_plt): Store file index
7436 instead of input entry offset for each GOT entry.
7437 * incremental.h
7438 (Incremental_input_entry::Incremental_input_entry): Initialize new
7439 data member.
7440 (Incremental_input_entry::set_offset): Store file index.
7441 (Incremental_input_entry::get_file_index): New function.
7442 (Incremental_input_entry::file_index_): New data member.
7443 (Incremental_binary::process_got_plt): New function.
7444 (Incremental_binary::do_process_got_plt): New function.
7445 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7446 data members.
7447 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7448 (Sized_incremental_binary::set_file_is_unchanged): New function.
7449 (Sized_incremental_binary::file_is_unchanged): New function.
7450 (Sized_incremental_binary::do_process_got_plt): New function.
7451 (Sized_incremental_binary::file_status_): New data member.
7452 (Sized_incremental_binary::main_symtab_loc_): New data member.
7453 (Sized_incremental_binary::main_strtab_loc_): New data member.
7454 * output.cc (Output_data_got::Got_entry::write): Add case
7455 RESERVED_CODE.
7456 (Output_data_got::add_global): Call add_got_entry.
7457 (Output_data_got::add_global_plt): Likewise.
7458 (Output_data_got::add_global_with_rel): Likewise.
7459 (Output_data_got::add_global_with_rela): Likewise.
7460 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7461 (Output_data_got::add_global_pair_with_rela): Likewise.
7462 (Output_data_got::add_local): Call add_got_entry.
7463 (Output_data_got::add_local_plt): Likewise.
7464 (Output_data_got::add_local_with_rel): Likewise.
7465 (Output_data_got::add_local_with_rela): Likewise.
7466 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7467 (Output_data_got::add_local_pair_with_rela): Likewise.
7468 (Output_data_got::reserve_slot): New function.
7469 (Output_data_got::reserve_slot_for_global): New function.
7470 (Output_data_got::add_got_entry): New function.
7471 (Output_data_got::add_got_entry_pair): New function.
7472 (Output_section::add_output_section_data): Edit FIXME.
7473 * output.h
7474 (Output_section_data_build::Output_section_data_build): New
7475 constructor with size parameter.
7476 (Output_data_space::Output_data_space): Likewise.
7477 (Output_data_got::Output_data_got): Initialize new data member; new
7478 constructor with size parameter.
7479 (Output_data_got::add_constant): Call add_got_entry.
7480 (Output_data_got::reserve_slot): New function.
7481 (Output_data_got::reserve_slot_for_global): New function.
7482 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7483 (Output_data_got::add_got_entry): New function.
7484 (Output_data_got::add_got_entry_pair): New function.
7485 (Output_data_got::free_list_): New data member.
7486 * target.h (Sized_target::init_got_plt_for_update): New function.
7487 (Sized_target::register_global_plt_entry): New function.
7488 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7489 Initialize new data member; call init; add constructor with PLT count.
7490 (Output_data_plt_x86_64::init): New function.
7491 (Output_data_plt_x86_64::add_relocation): New function.
7492 (Output_data_plt_x86_64::reserve_slot): New function.
7493 (Output_data_plt_x86_64::free_list_): New data member.
7494 (Target_x86_64::init_got_plt_for_update): New function.
7495 (Target_x86_64::register_global_plt_entry): New function.
7496 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7497 incremental updates.
7498 (Output_data_plt_x86_64::add_relocation): New function.
7499 * testsuite/object_unittest.cc (Object_test): Set default options.
7500
ec69d6da
ILT
75012011-05-16 Ian Lance Taylor <iant@google.com>
7502
7503 * options.h (class General_options): Make -i a synonym for -r.
7504
732e31de
ILT
75052011-05-16 Ian Lance Taylor <iant@google.com>
7506
7507 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7508
403676b5
CC
75092011-05-10 Cary Coutant <ccoutant@google.com>
7510
7511 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7512 strip_all (-s).
7513
5b7b7d6e
ILT
75142011-05-06 Ian Lance Taylor <iant@google.com>
7515
7516 * layout.cc (Layout::layout): If the output section flags change,
7517 update the ordering.
7518
f0f9babf
CC
75192011-04-25 Cary Coutant <ccoutant@google.com>
7520
7521 * incremental-dump.cc (dump_incremental_inputs): Print local
7522 symbol info for each input file.
7523 * incremental.cc
7524 (Output_section_incremental_inputs::set_final_data_size): Add local
7525 symbol info to input file entries in incremental info.
7526 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7527 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7528 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7529 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7530 implementation.
7531 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7532 (Sized_incr_relobj::do_relocate): Write the local symbols.
7533 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7534 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7535 Adjust size of input file header.
7536 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7537 (Incremental_inputs_reader::get_local_symbol_count): New function.
7538 (Incremental_inputs_reader::get_input_section): Adjust size of input
7539 file header.
7540 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7541 (Sized_incr_relobj::This): New typedef.
7542 (Sized_incr_relobj::sym_size): New const data member.
7543 (Sized_incr_relobj::Local_symbol): New struct.
7544 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7545 (Sized_incr_relobj::do_local_symbol_offset): New function.
7546 (Sized_incr_relobj::local_symbol_count_): New data member.
7547 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7548 (Sized_incr_relobj::local_symbol_index_): New data member.
7549 (Sized_incr_relobj::local_symbol_offset_): New data member.
7550 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7551 (Sized_incr_relobj::local_symbols_): New data member.
7552 * object.h (Relobj::output_local_symbol_count): New function.
7553 (Relobj::local_symbol_offset): New function.
7554 (Relobj::do_output_local_symbol_count): New function.
7555 (Relobj::do_local_symbol_offset): New function.
7556 (Sized_relobj::do_output_local_symbol_count): New function.
7557 (Sized_relobj::do_local_symbol_offset): New function.
7558
d0a9ace3
ILT
75592011-04-22 Vladimir Simonov <sv@sw.ru>
7560
7561 * descriptors.cc (set_close_on_exec): New function.
7562 (Descriptors::open): Use set_close_on_exec.
7563 * output.cc (S_ISLNK): Define if not defined.
7564
94a3fc8b
CC
75652011-04-22 Cary Coutant <ccoutant@google.com>
7566
7567 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7568 global symbol map.
7569 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7570 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7571 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7572 relocations.
7573 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7574 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7575 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7576 * incremental.h
7577 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7578 function.
7579 (Incremental_binary::apply_incremental_relocs): New function.
7580 (Incremental_binary::do_apply_incremental_relocs): New function.
7581 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7582 data member.
7583 (Sized_incremental_binary::add_global_symbol): New function.
7584 (Sized_incremental_binary::global_symbol): New function.
7585 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7586 (Sized_incremental_binary::symbol_map_): New data member.
7587 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7588 * target.h (Sized_target::apply_relocation): New function.
7589 * target-reloc.h (apply_relocation): New function.
7590 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7591
c87e4302
DK
75922011-04-22 Doug Kwan <dougkwan@google.com>
7593
7594 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7595 flag of a SHT_ARM_EXIDX section.
2e702c99 7596 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7597 * testsuite/Makefile.in: Regenerate.
7598 * testsuite/arm_exidx_test.s: New file.
7599 * testsuite/arm_exidx_test.sh: Same.
7600
e7782cf6
CC
76012011-04-20 Cary Coutant <ccoutant@google.com>
7602
7603 PR gold/12689
7604 * archive.h (Incremental_archive_entry::Archive_member):
7605 Initialize arg_serial_ (second constructor).
7606
308ecdc7
ILT
76072011-04-17 Ian Lance Taylor <iant@google.com>
7608
7609 * object.cc (Relocate_info::location): Simplify location string.
7610 * errors.cc (Errors::error_at_location): Don't print program
7611 name.
7612 (Errors::warning_at_location): Likewise.
7613 (Errors::undefined_symbol): Likewise.
7614 * testsuite/debug_msg.sh: Update accordingly.
7615
bec5b579
CC
76162011-04-14 Cary Coutant <ccoutant@google.com>
7617
7618 * gold/layout.cc (Layout::symtab_section_offset): New function.
7619 * gold/layout.h (Layout::symtab_section_offset): New function.
7620 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7621
88597d34
ILT
76222011-04-12 Ian Lance Taylor <iant@google.com>
7623
7624 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7625 with MREMAP_MAYMOVE.
7626 * output.h (class Output_file): Add map_is_allocated_ field.
7627 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7628 not available, provide stubs. If mremap is not available, #define
7629 it to gold_mremap.
7630 (MREMAP_MAYMOVE): Define if not defined.
7631 (Output_file::Output_file): Initialize map_is_allocated_.
7632 (Output_file::resize): Check map_is_allocated_.
7633 (Output_file::map_anonymous): If mmap fails, use malloc.
7634 (Output_file::unmap): Don't do anything for an anonymous map.
7635 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7636 is not available, provide stubs.
7637 (File_read::View::~View): Use free rather than delete[].
7638 (File_read::make_view): Use malloc rather than new[]. If mmap
7639 fails, use malloc.
7640 (File_read::find_or_make_view): Use malloc rather than new[].
7641 * gold.h: Remove HAVE_REMAP code.
7642 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7643 exists. Rename mremap to gold_mremap. If mmap is not available
7644 don't do anything.
7645 * configure, config.in: Rebuild.
7646
11e361bc
ILT
76472011-04-11 Ian Lance Taylor <iant@google.com>
7648
7649 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7650 initialize local variable v.
7651
cdc29364
CC
76522011-04-11 Cary Coutant <ccoutant@google.com>
7653
7654 * archive.cc (Archive::include_member): Adjust call to
7655 report_object.
7656 (Add_archive_symbols::run): Track argument serial numbers.
7657 (Lib_group::include_member): Likewise.
7658 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7659 * archive.h (Incremental_archive_entry::Archive_member):
7660 Initialize arg_serial_.
7661 (Archive_member::arg_serial_): New data member.
7662 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7663 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7664 incremental link.
7665 (Sized_dynobj::do_for_all_local_got_entries): New function.
7666 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7667 function.
7668 * fileread.cc (get_mtime): New function.
7669 * fileread.h (get_mtime): New function.
7670 * gold.cc (queue_initial_tasks): Check for incremental update.
7671 (process_incremental_input): New function.
7672 (queue_middle_tasks): Don't force valid target for incremental
7673 update.
7674 * incremental-dump.cc (find_input_containing_global): Adjust
7675 size of symbol info entry.
7676 (dump_incremental_inputs): Dump argument serial number and
7677 in_system_directory flag; bias shndx by 1; print symbol names
7678 when dumping per-file symbol lists; use new symbol info readers.
7679 * incremental.cc
7680 (Output_section_incremental_inputs:update_data_size): New function.
7681 (Sized_incremental_binary::setup_readers): Setup input readers
7682 for each input file; build maps for files added from libraries
7683 and scripts.
7684 (Sized_incremental_binary::check_input_args): New function.
7685 (Sized_incremental_binary::do_check_inputs): Build map of argument
7686 serial numbers to input arguments.
7687 (Sized_incremental_binary::do_file_has_changed): Rename
7688 do_file_is_unchanged to this; compare file modification times.
7689 (Sized_incremental_binary::do_init_layout): New function.
7690 (Sized_incremental_binary::do_reserve_layout): New function.
7691 (Sized_incremental_binary::do_get_input_reader): Remove.
7692 (Sized_incremental_binary::get_symtab_view): New function.
7693 (Incremental_checker::can_incrementally_link_output_file): Remove.
7694 (Incremental_inputs::report_command_line): Exclude --debug options.
7695 (Incremental_inputs::report_archive_begin): Add parameter; track
7696 argument serial numbers; don't put input file entry for archive
7697 before archive members.
7698 (Incremental_inputs::report_archive_end): Put input file entry
7699 for archive after archive members.
7700 (Incremental_inputs::report_object): Add parameter; track argument
7701 serial numbers and in_system_directory flag.
7702 (Incremental_inputs::report_script): Add parameter; track argument
7703 serial numbers.
7704 (Output_section_incremental_inputs::set_final_data_size): Adjust
7705 size of symbol info entry; check for forwarding symbols.
7706 (Output_section_incremental_inputs::write_input_files): Write
7707 in_system_directory flag and argument serial number.
7708 (Output_section_incremental_inputs::write_info_blocks): Map section
7709 indices between incremental info and original input file; store
7710 input section index for each symbol.
7711 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7712 change operator() to visit().
7713 (class Global_got_offset_visitor): Likewise.
7714 (class Global_symbol_visitor_got_plt):
7715 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7716 classes.
7717 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7718 (Sized_incr_relobj::do_read_symbols): New function.
7719 (Sized_incr_relobj::do_layout): New function.
7720 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7721 (Sized_incr_relobj::do_add_symbols): New function.
7722 (Sized_incr_relobj::do_should_include_member): New function.
7723 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7724 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7725 (Sized_incr_relobj::do_section_size): New function.
7726 (Sized_incr_relobj::do_section_name): New function.
7727 (Sized_incr_relobj::do_section_contents): New function.
7728 (Sized_incr_relobj::do_section_flags): New function.
7729 (Sized_incr_relobj::do_section_entsize): New function.
7730 (Sized_incr_relobj::do_section_address): New function.
7731 (Sized_incr_relobj::do_section_type): New function.
7732 (Sized_incr_relobj::do_section_link): New function.
7733 (Sized_incr_relobj::do_section_info): New function.
7734 (Sized_incr_relobj::do_section_addralign): New function.
7735 (Sized_incr_relobj::do_initialize_xindex): New function.
7736 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7737 (Sized_incr_relobj::do_read_relocs): New function.
7738 (Sized_incr_relobj::do_gc_process_relocs): New function.
7739 (Sized_incr_relobj::do_scan_relocs): New function.
7740 (Sized_incr_relobj::do_count_local_symbols): New function.
7741 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7742 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7743 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7744 (Sized_incr_relobj::do_relocate): New function.
7745 (Sized_incr_relobj::do_set_section_offset): New function.
7746 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7747 (Sized_incr_dynobj::do_read_symbols): New function.
7748 (Sized_incr_dynobj::do_layout): New function.
7749 (Sized_incr_dynobj::do_add_symbols): New function.
7750 (Sized_incr_dynobj::do_should_include_member): New function.
7751 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7752 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7753 (Sized_incr_dynobj::do_section_size): New function.
7754 (Sized_incr_dynobj::do_section_name): New function.
7755 (Sized_incr_dynobj::do_section_contents): New function.
7756 (Sized_incr_dynobj::do_section_flags): New function.
7757 (Sized_incr_dynobj::do_section_entsize): New function.
7758 (Sized_incr_dynobj::do_section_address): New function.
7759 (Sized_incr_dynobj::do_section_type): New function.
7760 (Sized_incr_dynobj::do_section_link): New function.
7761 (Sized_incr_dynobj::do_section_info): New function.
7762 (Sized_incr_dynobj::do_section_addralign): New function.
7763 (Sized_incr_dynobj::do_initialize_xindex): New function.
7764 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7765 (make_sized_incremental_object): New function.
7766 (Incremental_library::copy_unused_symbols): New function.
7767 (Incremental_library::do_for_all_unused_symbols): New function.
7768 * incremental.h (enum Incremental_input_flags): New type.
7769 (class Incremental_checker): Remove.
7770 (Incremental_input_entry::Incremental_input_entry): Add argument
7771 serial number.
7772 (Incremental_input_entry::arg_serial): New function.
7773 (Incremental_input_entry::set_is_in_system_directory): New function.
7774 (Incremental_input_entry::is_in_system_directory): New function.
7775 (Incremental_input_entry::arg_serial_): New data member.
7776 (Incremental_input_entry::is_in_system_directory_): New data member.
7777 (class Script_info): Move here from script.h.
7778 (Script_info::Script_info): Add filename parameter.
7779 (Script_info::filename): New function.
7780 (Script_info::filename_): New data member.
7781 (Incremental_script_entry::Incremental_script_entry): Add argument
7782 serial number.
7783 (Incremental_object_entry::Incremental_object_entry): Likewise.
7784 (Incremental_object_entry::add_input_section): Build list of input
7785 sections with map to original shndx.
7786 (Incremental_object_entry::get_input_section_index): New function.
7787 (Incremental_object_entry::shndx_): New data member.
7788 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7789 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7790 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7791 serial number.
7792 (Incremental_inputs::report_archive_begin): Likewise.
7793 (Incremental_inputs::report_object): Likewise.
7794 (Incremental_inputs::report_script): Likewise.
7795 (class Incremental_global_symbol_reader): New class.
7796 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7797 and store flags and input file type.
7798 (Incremental_input_entry_reader::arg_serial): New function.
7799 (Incremental_input_entry_reader::type): Extract type from flags.
7800 (Incremental_input_entry_reader::is_in_system_directory): New function.
7801 (Incremental_input_entry_reader::get_input_section_count): Call
7802 accessor function for type.
7803 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7804 function for type; adjust size of global symbol entry.
7805 (Incremental_input_entry_reader::get_global_symbol_count): Call
7806 accessor function for type.
7807 (Incremental_input_entry_reader::get_object_count): Likewise.
7808 (Incremental_input_entry_reader::get_object_offset): Likewise.
7809 (Incremental_input_entry_reader::get_member_count): Likewise.
7810 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7811 (Incremental_input_entry_reader::get_member_offset): Likewise.
7812 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7813 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7814 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7815 (Incremental_input_entry_reader::get_global_symbol_reader): New
7816 function.
7817 (Incremental_input_entry_reader::get_output_symbol_index): New
7818 function.
7819 (Incremental_input_entry_reader::type_): Remove.
7820 (Incremental_input_entry_reader::flags_): New data member.
7821 (Incremental_inputs_reader::input_file_offset): New function.
7822 (Incremental_inputs_reader::input_file_index): New function.
7823 (Incremental_inputs_reader::input_file): Call input_file_offset.
7824 (Incremental_inputs_reader::input_file_at_offset): New function.
7825 (Incremental_relocs_reader::get_r_type): Reformat.
7826 (Incremental_relocs_reader::get_r_shndx): Reformat.
7827 (Incremental_relocs_reader::get_r_offset): Reformat.
7828 (Incremental_relocs_reader::data): New function.
7829 (Incremental_binary::Incremental_binary): Initialize new data members.
7830 (Incremental_binary::check_inputs): Add cmdline parameter.
7831 (Incremental_binary::file_is_unchanged): Remove.
7832 (Input_reader::arg_serial): New function.
7833 (Input_reader::get_unused_symbol_count): New function.
7834 (Input_reader::get_unused_symbol): New function.
7835 (Input_reader::do_arg_serial): New function.
7836 (Input_reader::do_get_unused_symbol_count): New function.
7837 (Input_reader::do_get_unused_symbol): New function.
7838 (Incremental_binary::input_file_count): New function.
7839 (Incremental_binary::get_input_reader): Change signature to use
7840 index instead of filename.
7841 (Incremental_binary::file_has_changed): New function.
7842 (Incremental_binary::get_input_argument): New function.
7843 (Incremental_binary::get_library): New function.
7844 (Incremental_binary::get_script_info): New function.
7845 (Incremental_binary::init_layout): New function.
7846 (Incremental_binary::reserve_layout): New function.
7847 (Incremental_binary::output_file): New function.
7848 (Incremental_binary::do_check_inputs): New function.
7849 (Incremental_binary::do_file_is_unchanged): Remove.
7850 (Incremental_binary::do_file_has_changed): New function.
7851 (Incremental_binary::do_init_layout): New function.
7852 (Incremental_binary::do_reserve_layout): New function.
7853 (Incremental_binary::do_input_file_count): New function.
7854 (Incremental_binary::do_get_input_reader): Change signature.
7855 (Incremental_binary::input_args_map_): New data member.
7856 (Incremental_binary::library_map_): New data member.
7857 (Incremental_binary::script_map_): New data member.
7858 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7859 new data members.
7860 (Sized_incremental_binary::output_section): New function.
7861 (Sized_incremental_binary::inputs_reader): Add const.
7862 (Sized_incremental_binary::symtab_reader): Add const.
7863 (Sized_incremental_binary::relocs_reader): Add const.
7864 (Sized_incremental_binary::got_plt_reader): Add const.
7865 (Sized_incremental_binary::get_symtab_view): New function.
7866 (Sized_incremental_binary::Inputs_reader): New typedef.
7867 (Sized_incremental_binary::Input_entry_reader): New typedef.
7868 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7869 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7870 (Sized_incremental_binary::do_file_has_changed): New function.
7871 (Sized_incremental_binary::do_init_layout): New function.
7872 (Sized_incremental_binary::do_reserve_layout): New function.
7873 (Sized_input_reader::Inputs_reader): Remove.
7874 (Sized_input_reader::Input_entry_reader): Remove.
7875 (Sized_input_reader::do_arg_serial): New function.
7876 (Sized_input_reader::do_get_unused_symbol_count): New function.
7877 (Sized_input_reader::do_get_unused_symbol): New function.
7878 (Sized_incremental_binary::do_input_file_count): New function.
7879 (Sized_incremental_binary::do_get_input_reader): Change signature;
7880 use index instead of filename.
7881 (Sized_incremental_binary::section_map_): New data member.
7882 (Sized_incremental_binary::input_entry_readers_): New data member.
7883 (class Sized_incr_relobj): New class.
7884 (class Sized_incr_dynobj): New class.
7885 (make_sized_incremental_object): New function.
7886 (class Incremental_library): New class.
7887 * layout.cc (Free_list::num_lists): New static data member.
7888 (Free_list::num_nodes): New static data member.
7889 (Free_list::num_removes): New static data member.
7890 (Free_list::num_remove_visits): New static data member.
7891 (Free_list::num_allocates): New static data member.
7892 (Free_list::num_allocate_visits): New static data member.
7893 (Free_list::init): New function.
7894 (Free_list::remove): New function.
7895 (Free_list::allocate): New function.
7896 (Free_list::dump): New function.
7897 (Free_list::print_stats): New function.
7898 (Layout_task_runner::run): Resize output file for incremental updates.
7899 (Layout::Layout): Initialize new data members.
7900 (Layout::set_incremental_base): New function.
7901 (Layout::init_fixed_output_section): New function.
7902 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7903 incremental updates.
7904 (Layout::create_gold_note): Do not create gold note section for
7905 incremental updates.
7906 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7907 for incremental updates.
7908 (Layout::set_section_offsets): For incremental updates, allocate space
7909 from free list.
7910 (Layout::create_symtab_sections): Layout with offsets relative to
7911 start of section; for incremental updates, allocate space from free
7912 list.
7913 (Layout::create_shdrs): For incremental updates, allocate space from
7914 free list.
7915 (Layout::finish_dynamic_section): For incremental updates, do not
7916 check --as-needed (fixed in subsequent patch).
7917 * layout.h (class Free_list): New class.
7918 (Layout::set_incremental_base): New function.
7919 (Layout::incremental_base): New function.
7920 (Layout::init_fixed_output_section): New function.
7921 (Layout::allocate): New function.
7922 (Layout::incremental_base_): New data member.
7923 (Layout::free_list_): New data member.
7924 * main.cc (main): Print Free_list statistics.
7925 * object.cc (Relobj::finalize_incremental_relocs): Add
7926 clear_counts parameter; clear counts only when clear_counts is set.
7927 (Sized_relobj::Sized_relobj): Initialize new base class.
7928 (Sized_relobj::do_layout): Don't report special sections.
7929 (Sized_relobj::do_for_all_local_got_entries): New function.
7930 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7931 symtab_off to all symbol table offsets.
7932 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7933 * object.h (class Got_offset_list): Move to top of file.
7934 (Object::Object): Allow case where input_file == NULL.
7935 (Object::~Object): Likewise.
7936 (Object::input_file): Assert that input_file != NULL.
7937 (Object::lock): Allow case where input_file == NULL.
7938 (Object::unlock): Likewise.
7939 (Object::is_locked): Likewise.
7940 (Object::token): Likewise.
7941 (Object::release): Likewise.
7942 (Object::is_incremental): New function.
7943 (Object::get_mtime): New function.
7944 (Object::for_all_local_got_entries): New function.
7945 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7946 (Object::set_is_in_system_directory): New function.
7947 (Object::is_in_system_directory): New function.
7948 (Object::do_is_incremental): New function.
7949 (Object::do_get_mtime): New function.
7950 (Object::do_for_all_local_got_entries): New function.
7951 (Object::is_in_system_directory_): New data member.
7952 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7953 (class Sized_relobj_base): New class.
7954 (class Sized_relobj): Derive from Sized_relobj_base.
7955 (class Sized_relobj::Symbols): Redeclare from base class.
7956 (class Sized_relobj::local_got_offset_list): Remove.
7957 (class Sized_relobj::Output_sections): Redeclare from base class.
7958 (class Sized_relobj::do_for_all_local_got_entries): New function.
7959 (class Sized_relobj::write_local_symbols): Add offset parameter.
7960 (class Sized_relobj::local_symbol_offset_): Update comment.
7961 (class Sized_relobj::local_dynsym_offset_): Update comment.
7962 * options.cc (Input_arguments::add_file): Remove const.
7963 * options.h (Input_file_argument::Input_file_argument):
7964 Initialize arg_serial_ (all constructors).
7965 (Input_file_argument::set_arg_serial): New function.
7966 (Input_file_argument::arg_serial): New function.
7967 (Input_file_argument::arg_serial_): New data member.
7968 (Input_arguments::Input_arguments): Initialize file_count_.
7969 (Input_arguments::add_file): Remove const.
7970 (Input_arguments::number_of_input_files): New function.
7971 (Input_arguments::file_count_): New data member.
7972 (Command_line::number_of_input_files): Call
7973 Input_arguments::number_of_input_files.
7974 * output.cc (Output_segment_headers::Output_segment_headers):
7975 Set current size.
7976 (Output_section::Input_section::current_data_size): New function.
7977 (Output_section::Output_section): Initialize new data members.
7978 (Output_section::add_input_section): Don't do merge sections for
7979 an incremental link; allocate space from free list for an
7980 incremental update.
7981 (Output_section::add_output_section_data): Allocate space from
7982 free list for an incremental update.
7983 (Output_section::update_data_size): New function.
7984 (Output_section::set_fixed_layout): New function.
7985 (Output_section::reserve): New function.
7986 (Output_segment::set_section_addresses): Remove const.
7987 (Output_segment::set_section_list_addresses): Remove const; allocate
7988 space from free list for an incremental update.
7989 (Output_segment::set_offset): Adjust size of RELRO segment for an
7990 incremental update.
7991 * output.h (Output_data::current_data_size): Move here from
7992 child classes.
7993 (Output_data::pre_finalize_data_size): New function.
7994 (Output_data::update_data_size): New function.
7995 (Output_section_headers::update_data_size): new function.
7996 (Output_section_data_build::current_data_size): Move to Output_data.
7997 (Output_data_strtab::update_data_size): New function.
7998 (Output_section::current_data_size): Move to Output_data.
7999 (Output_section::set_fixed_layout): New function.
8000 (Output_section::has_fixed_layout): New function.
8001 (Output_section::reserve): New function.
8002 (Output_section::update_data_size): New function.
8003 (Output_section::has_fixed_layout_): New data member.
8004 (Output_section::free_list_): New data member.
8005 (Output_segment::set_section_addresses): Remove const.
8006 (Output_segment::set_section_list_addresses): Remove const.
8007 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8008 New function.
8009 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8010 New function.
8011 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8012 parameter when calling Add_symbols constructor; store argument
8013 serial number for members of a lib group.
8014 (Add_symbols::locks): Allow case where token == NULL.
8015 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8016 (Read_member::~Read_member): New function.
8017 (Read_member::is_runnable): New function.
8018 (Read_member::locks): New function.
8019 (Read_member::run): New function.
8020 (Check_script::~Check_script): New function.
8021 (Check_script::is_runnable): New function.
8022 (Check_script::locks): New function.
8023 (Check_script::run): New function.
8024 (Check_library::~Check_library): New function.
8025 (Check_library::is_runnable): New function.
8026 (Check_library::locks): New function.
8027 (Check_library::run): New function.
8028 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8029 (Add_symbols::library_): New data member.
8030 (class Read_member): New class.
8031 (class Check_script): New class.
8032 (class Check_library): New class.
8033 * reloc.cc (Read_relocs::is_runnable): Allow case where
8034 token == NULL.
8035 (Read_relocs::locks): Likewise.
8036 (Scan_relocs::locks): Likewise.
8037 (Relocate_task::locks): Likewise.
8038 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8039 to clear counters.
8040 (Sized_relobj::incremental_relocs_scan): Fix comment.
8041 (Sized_relobj::do_relocate): Pass output file offset to
8042 write_local_symbols.
8043 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8044 from class declaration.
8045 * script.cc (read_input_script): Allocate Script_info; pass
8046 argument serial number to report_script.
8047 * script.h (class Script_info): Move to incremental.h.
8048 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8049 * symtab.h (Symbol_table::add_from_incrobj): New function.
8050 (Symbol_table::set_file_offset): New function.
8051
b961d0d7
CC
80522011-04-05 Cary Coutant <ccoutant@google.com>
8053
8054 * incremental-dump.cc (dump_incremental_inputs): Change signature
8055 to take a Sized_incremental_binary; change caller. Use readers
8056 in Sized_incremental_binary.
8057 * incremental.cc
8058 (Sized_incremental_binary::find_incremental_inputs_sections):
8059 Rename do_find_incremental_inputs_sections to this.
8060 (Sized_incremental_binary::setup_readers): New function.
8061 (Sized_incremental_binary::do_check_inputs): Check
8062 has_incremental_info_ flag; move setup code to setup_readers;
8063 use input readers.
8064 (Sized_incremental_binary::do_file_is_unchanged): New function.
8065 (Sized_incremental_binary::do_get_input_reader): New function.
8066 * incremental.h (class Incremental_binary): Move to end of file.
8067 (Incremental_binary::file_is_unchanged): New function.
8068 (Incremental_binary::do_file_is_unchanged): New function.
8069 (Incremental_binary::Input_reader): New class.
8070 (Incremental_binary::get_input_reader): New function.
8071 (class Sized_incremental_binary): Move to end of file.
8072 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8073 input section reader classes.
8074 (Sized_incremental_binary::has_incremental_info): New function.
8075 (Sized_incremental_binary::inputs_reader): New function.
8076 (Sized_incremental_binary::symtab_reader): New function.
8077 (Sized_incremental_binary::relocs_reader): New function.
8078 (Sized_incremental_binary::got_plt_reader): New function.
8079 (Sized_incremental_binary::do_file_is_unchanged): New function.
8080 (Sized_incremental_binary::Sized_input_reader): New class.
8081 (Sized_incremental_binary::get_input_reader): New function.
8082 (Sized_incremental_binary::find_incremental_inputs_sections):
8083 Rename do_find_incremental_inputs_sections to this.
8084 (Sized_incremental_binary::setup_readers): New function.
8085 (Sized_incremental_binary::has_incremental_info_): New data member.
8086 (Sized_incremental_binary::inputs_reader_): New data member.
8087 (Sized_incremental_binary::symtab_reader_): New data member.
8088 (Sized_incremental_binary::relocs_reader_): New data member.
8089 (Sized_incremental_binary::got_plt_reader_): New data member.
8090 (Sized_incremental_binary::current_input_file_): New data member.
8091
a869183f
PP
80922011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8093
8094 PR gold/12640
8095 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8096 violation.
8097
80982011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8099
8100 * archive.cc (Archive::include_member): Adjust call to report_object.
8101 (Add_archive_symbols::run): Add script_info to call to
8102 report_archive_begin.
8103 (Lib_group::include_member): Adjust call to report_object.
8104 (Add_lib_group_symbols::run): Adjust call to report_object.
8105 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8106 blocks. Add object count for script input files.
8107 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8108 script_info parameter; change all callers.
8109 (Incremental_inputs::report_object): Add script_info parameter;
8110 change all callers.
8111 (Incremental_inputs::report_script): Store backpointer to
8112 incremental info entry.
8113 (Output_section_incremental_inputs::set_final_data_size): Record
8114 additional information for scripts.
8115 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8116 * incremental.h (Incremental_script_entry::add_object): New function.
8117 (Incremental_script_entry::get_object_count): New function.
8118 (Incremental_script_entry::get_object): New function.
8119 (Incremental_script_entry::objects_): New data member; adjust
8120 constructor.
8121 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8122 (Incremental_inputs::report_object): Add script_info parameter.
8123 (Incremental_inputs_reader::get_object_count): New function.
8124 (Incremental_inputs_reader::get_object_offset): New function.
8125 * options.cc (Input_arguments::add_file): Return reference to
8126 new input argument.
8127 * options.h (Input_argument::set_script_info): New function.
8128 (Input_argument::script_info): New function.
8129 (Input_argument::script_info_): New data member; adjust all
8130 constructors.
8131 (Input_file_group::add_file): Return reference to new input argument.
8132 (Input_file_lib::add_file): Likewise.
8133 (Input_arguments::add_file): Likewise.
8134 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8135 * script.cc (Parser_closure::Parser_closure): Add script_info
8136 parameter; adjust all callers.
8137 (Parser_closure::script_info): New function.
8138 (Parser_closure::script_info_): New data member.
8139 (read_input_script): Report scripts earlier to incremental info.
8140 (script_add_file): Set script_info in Input_argument.
8141 (script_add_library): Likewise.
8142 * script.h (Script_options::Script_info): Rewrite class.
8143
a869183f 81442011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8145
8146 * archive.cc (Library_base::should_include_member): Move
8147 method here from class Archive.
8148 (Archive::Archive): Initialize base class.
8149 (Archive::should_include_member): Move to base class.
8150 (Archive::do_for_all_unused_symbols): New function.
8151 (Add_archive_symbols::run): Remove redundant access to
8152 incremental_inputs.
8153 (Lib_group::Lib_group): Initialize base class.
8154 (Lib_group::do_filename): New function.
8155 (Lib_group::include_member): Pass pointer to Lib_group to
8156 report_object.
8157 (Lib_group::do_for_all_unused_symbols): New function.
8158 (Add_lib_group_symbols::run): Report archive information for
8159 incremental links.
8160 * archive.h (class Library_base): New base class.
8161 (class Archive): Derive from Library_base.
8162 (Archive::filename): Move to base class.
8163 (Archive::set_incremental_info): Likewise.
8164 (Archive::incremental_info): Likewise.
8165 (Archive::Should_include): Likewise.
8166 (Archive::should_include_member): Likewise.
8167 (Archive::Armap_entry): Remove.
8168 (Archive::Unused_symbol_iterator): Remove.
8169 (Archive::unused_symbols_begin): Remove.
8170 (Archive::unused_symbols_end): Remove.
8171 (Archive::do_filename): New function.
8172 (Archive::do_get_mtime): New function.
8173 (Archive::do_for_all_unused_symbols): New function.
8174 (Archive::task_): Move to base class.
8175 (Archive::incremental_info_): Likewise.
8176 (class Lib_group): Derive from Library_base.
8177 (Lib_group::do_filename): New function.
8178 (Lib_group::do_get_mtime): New function.
8179 (Lib_group::do_for_all_unused_symbols): New function.
8180 (Lib_group::task_): Move to base class.
8181 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8182 function.
8183 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8184 function.
8185 * incremental.cc (Incremental_inputs::report_archive_begin):
8186 Use Library_base; call library's get_mtime; add incremental inputs
8187 entry before members.
8188 (class Unused_symbol_visitor): New class.
8189 (Incremental_inputs::report_archive_end): Use Library_base; use
8190 visitor class to record unused symbols; don't add incremental inputs
8191 entry after members.
8192 (Incremental_inputs::report_object): Use Library_base.
8193 * incremental.h
8194 (Incremental_archive_entry::Incremental_archive_entry): Remove
8195 unused Archive parameter.
8196 (Incremental_inputs::report_archive_begin): Use Library_base.
8197 (Incremental_inputs::report_archive_end): Likewise.
8198 (Incremental_inputs::report_object): Likewise.
8199 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8200 function.
8201 * object.h (Object::for_all_global_symbols): New function.
8202 (Object::do_for_all_global_symbols): New function.
8203 (Sized_relobj::do_for_all_global_symbols): New function.
8204 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8205 function.
8206 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8207 function.
8208
61ab3e40
ILT
82092011-03-27 Ian Lance Taylor <iant@google.com>
8210
8211 * archive.cc (Archive::interpret_header): Return -1 if something
8212 goes wrong. Change callers accordingly.
8213
30e1f9e6
CC
82142011-03-25 Cary Coutant <ccoutant@google.com>
8215
8216 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8217 * testsuite/Makefile.in: Regenerate.
8218
9370ce59 82192011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8220
8221 * plugin.cc (get_view): New.
8222 (Plugin::load): Pass get_view to the plugin.
8223 (Plugin_manager::get_view): New.
8224
9312bb0a
ILT
82252011-03-21 Ian Lance Taylor <iant@google.com>
8226
8227 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8228 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8229
7e12ba9e
ST
82302011-03-21 Sriraman Tallam <tmsriram@google.com>
8231
8232 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8233 Change == to -eq.
8234 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8235 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8236 Change == to -eq.
8237 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8238 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8239
fd7a005d
ILT
82402011-03-14 Ian Lance Taylor <iant@google.com>
8241
8242 * script-sections.cc (Sort_output_sections::script_compare):
8243 Rename from is_before, change return type.
8244 (Sort_output_sections::operator()): Adjust accordingly.
8245
ed16fd1b
ILT
82462011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8247
8248 PR gold/12572
8249 * testsuite/odr_violation2.cc: Add comment to make all error line
8250 numbers double digits.
8251 * testsuite/debug_msg.sh: Adjust expected errors.
8252
71ff8986
ILT
82532011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8254
8255 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8256 but mark earlier ones as non-canonical
8257 (offset_to_iterator): Update search target and example
8258 (do_addr2line): Return extra lines in a vector*
8259 (format_file_lineno): Extract from do_addr2line
8260 (one_addr2line): Add vector* out-param
8261 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8262 when a lineno entry appeared last for its instruction
8263 (Dwarf_line_info): Add vector* out-param
8264 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8265 * symtab.cc (Odr_violation_compare): Include the lineno in the
8266 comparison again.
8267 (linenos_from_loc): New. Combine the canonical line for an
8268 address with its other lines.
8269 (True_if_intersect): New. Helper functor to make
8270 std::set_intersection a query.
8271 (detect_odr_violations): Compare sets of lines instead of just
8272 one line for each function. This became less deterministic, but
8273 has fewer false positives.
8274 * symtab.h: Declarations.
8275 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8276 mix an optimized and non-optimized object in the same binary
8277 (odr_violation2.so): Same.
8278 * testsuite/Makefile.in: Regenerate from Makefile.am.
8279 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8280 * testsuite/debug_msg.sh: Update line numbers and add
8281 assertions.
8282 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8283 non-optimized context.
8284 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8285 isn't inlined, and use OdrDerived in an optimized context.
8286 * testsuite/odr_header1.h: Defines OdrDerived, where
8287 optimization will change the
8288 first-instruction-in-the-destructor's file and line number.
8289 * testsuite/odr_header2.h: Defines OdrBase.
8290
a19fefdc
ILT
82912011-03-09 Ian Lance Taylor <iant@google.com>
8292
8293 * fileread.cc (File_read::clear_views): Don't delete the whole
8294 file view.
8295
ecb351e9
ILT
82962011-03-08 Ian Lance Taylor <iant@google.com>
8297
8298 PR gold/12525
8299 * fileread.cc: #include <climits>.
8300 (GOLD_IOV_MAX): Define.
8301 (File_read::read_multiple): Limit number of entries by iov_max.
8302 * fileread.h (class File_read): Always set max_readv_entries to
8303 128.
8304
b821d13c
ILT
83052011-03-07 Ian Lance Taylor <iant@google.com>
8306
8307 PR gold/12525
8308 * options.h (class General_options): Add -dy and -dn.
8309
89243142
CC
83102011-03-02 Cary Coutant <ccoutant@google.com>
8311
8312 * testsuite/script_test_9.t: Add TLS segment.
8313
d0773f31
ILT
83142011-03-02 Simon Baldwin <simonb@google.com>
8315
8316 * configure.ac: Add check for gnu_indirect_function support in
8317 the toolchain building binutils.
8318 * configure: Rebuild.
8319
9370ce59 83202011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8321
8322 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8323 plugin only symbols.
8324 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8325 in plugin files as not needed in the symbol table.
8326
4cf7a849
ST
83272011-02-11 Sriraman Tallam <tmsriram@google.com>
8328
8329 * output.cc (Output_section::add_input_section): Delay fill
8330 generation for section ordering.
8331
b578bd7d
ILT
83322011-02-09 Ian Lance Taylor <iant@google.com>
8333
8334 PR gold/12316
8335 * object.h (class Sized_relobj): Remove clear_local_symbols.
8336 * reloc.cc (Sized_relobj::do_relocate): Don't call
8337 clear_local_symbols.
8338
9370ce59 83392011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8340
8341 * plugin.cc (is_visible_from_outside): Return true for symbols
8342 in the -u option.
8343
55382fb7
ILT
83442011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8345
8346 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8347 filename.
8348
4e271fff
ST
83492011-02-02 Sriraman Tallam <tmsriram@google.com>
8350
8351 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8352 to std::string.
4e271fff 8353 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8354 section_name to be std::string.
4e271fff
ST
8355 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8356
d433c3ac
ILT
83572011-01-25 Ian Lance Taylor <iant@google.com>
8358
8359 * script.cc (script_add_extern): Rewrite to use
8360 add_symbol_reference.
8361
880473a6
DK
83622011-01-25 Doug Kwan <dougkwan@google.com>
8363
d433c3ac 8364 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8365
f30f86fa
ILT
83662011-01-24 Ian Lance Taylor <iant@google.com>
8367
8368 * options.h (class General_options): Accept
8369 --no-detect-odr-violations.
8370
8e51a0b9
ILT
83712011-01-24 Ian Lance Taylor <iant@google.com>
8372
8373 * version.cc (version_string): Bump to 1.11.
8374
0f3b89d8
ILT
83752011-01-24 Ian Lance Taylor <iant@google.com>
8376
8377 * plugin.cc (class Plugin_rescan): Define new class.
8378 (Plugin_manager::claim_file): Set any_claimed_.
8379 (Plugin_manager::save_archive): New function.
8380 (Plugin_manager::save_input_group): New function.
8381 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8382 necessary.
8383 (Plugin_manager::new_undefined_symbol): New function.
8384 (Plugin_manager::rescan): New function.
8385 (Plugin_manager::rescannable_defines): New function.
8386 (Plugin_manager::add_input_file): Set any_added_.
8387 * plugin.h (class Plugin_manager): define new fields rescannable_,
8388 undefined_symbols_, any_claimed_, and any_added_. Declare
8389 Plugin_rescan as friend. Declare new functions.
8390 (Plugin_manager::Rescannable): Define type.
8391 (Plugin_manager::Rescannable_list): Define type.
8392 (Plugin_manager::Undefined_symbol_list): Define type.
8393 (Plugin_manager::Plugin_manager): Initialize new fields.
8394 * archive.cc (Archive::defines_symbol): New function.
8395 (Add_archive_symbols::run): Pass archive to plugins if any.
8396 * archive.h (class Archive): Declare defines_symbol.
8397 * readsyms.cc (Input_group::~Input_group): New function.
8398 (Finish_group::run): Pass input_group to plugins if any.
8399 * readsyms.h (class Input_group): Declare destructor.
8400 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8401 any.
8402
3bb951e5
ILT
84032011-01-10 Ian Lance Taylor <iant@google.com>
8404
8405 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8406 section as relro.
8407 (Layout::set_segment_offsets): Reset increase_relro before calling
8408 set_section_addresses a second time.
8409
0aa45fac
CC
84102011-01-04 Cary Coutant <ccoutant@google.com>
8411
8412 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8413 sections before NOBITS sections.
8414
0db46eb4
L
84152011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8416
8417 * version.cc (print_version): Update copyright to 2011.
8418
829c9745
CC
84192010-12-23 Cary Coutant <ccoutant@google.com>
8420
8421 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8422 of OS to this->add. Add OD parameter to second form of the function.
8423
7500420b
ILT
84242010-12-20 Ian Lance Taylor <iant@google.com>
8425
8426 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8427 second of two consecutive entries with same offset.
8428
f8e9a930
RW
84292010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8430
8431 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8432 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8433 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8434 to avoid unneeded links against $(LDADD).
8435 * testsuite/Makefile.in: Regenerate.
8436
2fbb4320
ILT
84372010-12-15 Ian Lance Taylor <iant@google.com>
8438
8439 PR gold/12324
8440 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8441 for R_X86_64_32 and R_X86_64_PC32.
8442 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8443 ver_matching_def_pic.o.
8444 (ver_matching_def_pic.o): New target.
8445
fedb228d
RW
84462010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8447
8448 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8449 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8450 Move definition before File_read::View member definitions.
8451 (File_read::View::~View): Initialize and hold lock before
8452 updating current_mapped_bytes.
8453
9b547ce6
RW
84542010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8455
8456 * dwarf_reader.cc: Remove outdated comment.
8457 * gold-threads.cc: Fix typo in error message.
8458 * archive.cc: Fix typos in comments.
8459 * archive.h: Likewise.
8460 * arm-reloc-property.cc: Likewise.
8461 * arm-reloc-property.h: Likewise.
8462 * arm-reloc.def: Likewise.
8463 * arm.cc: Likewise.
8464 * attributes.h: Likewise.
8465 * cref.cc: Likewise.
8466 * ehframe.cc: Likewise.
8467 * fileread.h: Likewise.
8468 * gold.h: Likewise.
8469 * i386.cc: Likewise.
8470 * icf.cc: Likewise.
8471 * incremental.h: Likewise.
8472 * int_encoding.cc: Likewise.
8473 * layout.h: Likewise.
8474 * main.cc: Likewise.
8475 * merge.h: Likewise.
8476 * object.cc: Likewise.
8477 * object.h: Likewise.
8478 * options.cc: Likewise.
8479 * readsyms.cc: Likewise.
8480 * reduced_debug_output.cc: Likewise.
8481 * reloc.cc: Likewise.
8482 * script-sections.cc: Likewise.
8483 * sparc.cc: Likewise.
8484 * symtab.h: Likewise.
8485 * target-reloc.h: Likewise.
8486 * target.cc: Likewise.
8487 * target.h: Likewise.
8488 * timer.cc: Likewise.
8489 * timer.h: Likewise.
8490 * x86_64.cc: Likewise.
8491
83e17bd5
CC
84922010-12-09 Cary Coutant <ccoutant@google.com>
8493
8494 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8495 stack.
8496 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8497 parameter; change all callers.
8498 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8499 * options.h (warn_execstack): New option.
8500
017257f8
DK
85012010-12-07 Doug Kwan <dougkwan@google.com>
8502
8503 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8504 like function call relocations.
8505
c20cbc06
ILT
85062010-12-07 Ian Lance Taylor <iant@google.com>
8507
8508 * archive.cc (Archive::get_elf_object_for_member): Permit
8509 punconfigured to be NULL.
8510 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8511 (Archive::include_member): Pass NULL to get_elf_object_for_member
8512 if we searched for the archive and this is the first included
8513 object.
8514
4dbfafcc
ILT
85152010-12-01 Ian Lance Taylor <iant@google.com>
8516
8517 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8518 track_relocs_type_ field.
8519 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8520 Set track_relocs_type_.
8521 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8522 contents when using RELA relocs.
8523 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8524 reloc_map_.
8525 * reloc.cc (Track_relocs::next_addend): New function.
8526 * reloc.h (class Track_relocs): Declare next_addend.
8527
e5e19edd
ILT
85282010-12-01 Ian Lance Taylor <iant@google.com>
8529
8530 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8531 virtual destructor.
8532
9a5ce24c
ILT
85332010-12-01 Ian Lance Taylor <iant@google.com>
8534
8535 * README: Update compilers known to work and fail.
8536
c7791212
NC
85372010-11-23 Matthias Klose <doko@ubuntu.com>
8538
8539 * configure.in: For --enable-gold, handle value `default' instead of
8540 `both*'. Always install ld as ld.bfd, install as ld if gold is
8541 not the default.
8542 * configure: Regenerate.
8543
0ad220c9
DK
85442010-11-18 Doug Kwan <dougkwan@google.com>
8545
8546 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8547 and right_alignment to be zero. Store result alignment only if it is
8548 greater than existing alignment.
8549
ab8056e0
CC
85502010-11-16 Cary Coutant <ccoutant@google.com>
8551
8552 PR gold/12220
8553 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8554 Check for ".zdebug_line".
8555
fd064a5b
CC
85562010-11-16 Doug Kwan <dougkwan@google.com>
8557 Cary Coutant <ccoutant@google.com>
8558
8559 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8560 by reference; adjust all callers.
8561 * output.cc (Output_segment::set_section_addresses): Adjust references
8562 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8563 list is empty.
8564 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8565 end at page boundary.
8566
6fc6ea19
CC
85672010-11-16 Cary Coutant <ccoutant@google.com>
8568
8569 PR gold/12220
8570 * layout.cc (Layout::choose_output_section): Transform names of
8571 compressed sections even when using a script with a SECTIONS clause.
8572 (Layout::output_section_name): Remove code to transform
8573 compressed debug section names.
8574 * output.cc (Output_section::add_input_section): Use uncompressed
8575 section size when tracking input sections.
8576
95a2c8d6
RS
85772010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8578
8579 * symtab.h (Symbol::NON_PIC_REF): Remove.
8580 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8581 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8582 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8583 (Symbol::use_plt_offset): Take a flags argument and pass it
8584 directly to needs_dynamic_reloc. Restrict check for undefined
8585 weak symbols to function calls.
8586 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8587 (Target_arm::Scan::global): Use it.
8588 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8589 (Target_arm::Relocate::relocate): Likewise.
8590 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8591 parameter with an r_type parameter. Use get_reference_flags
8592 to get the flags.
8593 (Target_arm::Relocate::relocate): Update accordingly.
8594 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8595 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8596 (Target_i386::Scan::global): Likewise.
8597 (Target_i386::Relocate::relocate): Likewise.
8598 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8599 parameter with an r_type parameter. Use get_reference_flags
8600 to get the flags.
8601 (Target_i386::Relocate::relocate): Update accordingly.
8602 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8603 (Target_powerpc::Scan::global): Use it.
8604 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8605 (Target_powerpc::Relocate::relocate): Likewise.
8606 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8607 (Target_sparc::Scan::global): Use it.
8608 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8609 (Target_sparc::Relocate::relocate): Likewise.
8610 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8611 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8612 (Target_x86_64::Scan::global): Likewise.
8613 (Target_x86_64::Relocate::relocate): Likewise.
8614
f625ae50
DK
86152010-11-08 Doug Kwan <dougkwan@google.com>
8616 Cary Coutant <ccoutant@google.com>
8617
8618 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8619 (Arm_exidx_merge_section::section_contents_): New data member.
8620 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8621 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8622 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8623 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8624 in parameters instead of calling Object::section_contents without
8625 locking.
8626 (Arm_output_section::group_section): New parameter TASK. Pass it
8627 to callees that need locking objects.
8628 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8629 to lock EXIDX input sections. Fix a formatting issue. Call
8630 Arm_exidx_merged_section::build_contents to create merged section
8631 contents.
8632 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8633 to lock object of stub table owner.
8634 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8635 TEXT_SIZE to initialize data member TEXT_SIZE_.
8636 (Arm_exidx_input_section::addralign): Fix typo in comment.
8637 (Arm_exidx_input_section::text_size): New method.
8638 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8639 that require locking objects. Lock objects before scanning for stubs
8640 and updating local symbols.
8641 (Arm_input_section<big_endian>::init): Copy contents of original
8642 input section.
2e702c99 8643 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8644 original input section instead of calling Object::section_contents
8645 without locking.
8646 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8647 size without calling Object::section_size().
8648 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8649 for size. Allocate a buffer for merged EXIDX entries.
8650 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8651 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8652 building code to Arm_exidx_merged_section::build_contetns. Write
8653 out contetns in buffer instead of building it on the fly.
8654 (Arm_relobj::make_exidx_input_section): Also pass text section size
8655 to Arm_exidx_input_section constructor.
8656 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8657 (Arm_dynobj::do_read_symbols): Fix memory leak.
8658 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8659 * target.h: (class Task): Add forward declaration.
8660 (Target::relax): Add new parameter TASK and pass it to
8661 Target::do_relax().
8662 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8663
5f9bcf58
CC
86642010-11-05 Cary Coutant <ccoutant@google.com>
8665
8666 PR gold/10708
8667 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8668 object when reading from the file.
8669 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8670 second layout pass.
8671 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8672 when reading section contents.
8673 (get_section_contents): Likewise.
8674 (icf::find_identical_sections): Likewise.
8675 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8676 object when reading from the file.
8677 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8678 the object when doing deferred section layout.
8679
e597fa08
NC
86802010-11-03 Nick Clifton <nickc@redhat.com>
8681
8682 PR gold/12001
8683 * script.h (class Symbol_assignment: name): New member. Returns
8684 the name of the symbol.
8685 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8686 Returns true if the given symbol name is on the list of
8687 assignments wating to be processed.
8688 * archive.cc (should_incldue_member): If the symbol is undefined,
8689 check to see if it is on the list of symbols pending assignment.
8690
3f9a3278
ILT
86912010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8692
8693 * script-sections.cc (Script_sections::find_memory_region): Check
8694 for a NULL output section pointer.
8695
d06fb4d1
DK
86962010-10-29 Doug Kwan <dougkwan@google.com>
8697
8698 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8699 Output_section::add_relaxed_input_section.
8700 * output.cc (Output_section::add_relaxed_input_section): Add new
8701 arguments LAYOUT and NAME. Set section order index.
8702 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8703 Copy section order index.
8704 * output.h (Output_section::add_relaxed_input_section): Add new
8705 arguments LAYOUT and NAME.
8706
90e24de5
ILT
87072010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8708
8709 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8710 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8711 * testsuite/Makefile.in: Regenerate.
8712
c9484ea5
DK
87132010-10-20 Doug Kwan <dougkwan@google.com>
8714
8715 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8716 without SHF_LINK_ORDER flags.
8717 * layout.cc (Layout::choose_output_section): Do not filter
8718 SHF_LINK_ORDER flag in a relocatable link.
8719
5bc2f5be
CC
87202010-10-17 Cary Coutant <ccoutant@google.com>
8721
8722 * output.h (Output_segment::set_section_addresses): Change function
8723 signature. Update all callers.
8724 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8725 sections.
8726 (Output_segment::set_section_addresses): Align after last TLS
8727 section. Add padding before last relro section instead of after.
8728
0c91cf04
DK
87292010-10-17 Doug Kwan <dougkwan@google.com>
8730
8731 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8732 GOT output section to be writable.
8733
8c21d9d3
CC
87342010-10-14 Cary Coutant <ccoutant@google.com>
8735
8736 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8737 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8738 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8739 mode.
8740 * incremental.cc (report_command_line): Ignore all forms of
8741 --incremental.
8742 * layout.cc (Layout::Layout): Check parameters for incremental link
8743 mode.
8744 * options.cc (General_options::parse_incremental): New function.
8745 (General_options::parse_no_incremental): New function.
8746 (General_options::parse_incremental_full): New function.
8747 (General_options::parse_incremental_update): New function.
8748 (General_options::incremental_mode_): New data member.
8749 (General_options::finalize): Check incremental_mode_.
8750 * options.h (General_options): Update help text for --incremental.
8751 Add --no-incremental, --incremental-full, --incremental-update.
8752 (General_options::Incremental_mode): New enum type.
8753 (General_options::incremental_mode): New function.
8754 (General_options::incremental_mode_): New data member.
8755 * parameters.cc (Parameters::incremental_mode_): New data member.
8756 (Parameters::set_options): Set incremental_mode_.
8757 (Parameters::set_incremental_full): New function.
8758 (Parameters::incremental): New function.
8759 (Parameters::incremental_update): New function.
8760 (set_parameters_incremental_full): New function.
8761 * parameters.h (Parameters::set_incremental_full): New function.
8762 (Parameters::incremental): New function.
8763 (Parameters::incremental_update): New function.
8764 (Parameters::incremental_mode_): New data member.
8765 (set_parameters_incremental_full): New function.
8766 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8767 incremental link mode.
8768 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8769 (Sized_relobj::do_relocate_sections): Likewise.
8770 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8771 option.
8772 * testsuite/Makefile.in: Regenerate.
8773 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8774
bb32aa18 87752010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8776
8777 * script-sections.h (class Script_sections): Make
8778 Sections_elements typedef public.
8779 * script-sections.cc (class Sort_output_sections): Add elements_
8780 field. Add constructor which sets it; change all callers.
8781 (Sort_output_sections::is_before): New function.
8782 (Sort_output_sections::operator()): Call is_before.
8783 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8784 conditional.
8785 * testsuite/script_test_10.sh: New test. Test script section
8786 order.
8787 * testsuite/script_test_10.t: Likewise.
8788 * testsuite/script_test_10.s: Likewise.
8789 * testsuite/Makefile.am: Wrap the cross linker tests and the
8790 common tests into NATIVE_OR_CROSS_LINKER.
8791 (check_SCRIPTS): Add script_test_10.sh.
8792 (check_DATA): Add script_test_10.stdout.
8793 (script_test_10.o, script_test_10): New targets.
8794 (script_test_10.stdout): New target.
8795 * configure, testsuite/Makefile.in: Regenerate.
8796
3cef7179
ILT
87972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8798
8799 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8800 error for the deprecated relocations.
8801 (Target_arm::Scan::global): Likewise.
8802 (Target_arm::Relocate::relocate): Likewise.
8803
7411e9a8
RS
88042010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8805
8806 * fileread.cc (Input_file::find_file): Initialize *found_name
8807 and *namep when using the fallback search for case 4.
8808
6a9da32a
CC
88092010-10-11 Cary Coutant <ccoutant@google.com>
8810
8811 * options.h (class General_options): Redefine -z lazy as an alias for
8812 the negation of -z now.
8813
ac897c20
ILT
88142010-10-11 Ian Lance Taylor <iant@google.com>
8815
8816 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8817 binding.
8818
ea5cae92
NC
88192010-10-06 Nick Clifton <nickc@redhat.com>
8820
8821 * script-sections.cc(class Memory_region): Remove
8822 current_lma_offset_ field. Rename current_vma_offset_ to
8823 current_offset_. Add last_section_ field.
8824 (Memory_region::get_current_vma_address): Rename to
8825 get_current_address.
8826 (Memory_region::get_current_lma_address): Delete.
8827 (Memory_region::increment_vma_offset): Rename to
8828 increment_offset.
8829 (Memory_region::increment_lma_offset): Delete.
8830 (Memory_region::attributes_compatible): New method. Returns
8831 true if the provided section is compatible with the region.
8832 (Memory_region::get_last_section): New method. Returns the last
8833 section to use the region.
8834 (Memory_region::set_last_section): New method. Stores the last
8835 section to use the region.
8836 (Script_sections::block_in_region): New method. Returns true if
8837 a block of memory is contained within a region.
8838 (Script_sections::find_memory_region): New method. Locates a
8839 memory region to be used to set a VMA or LMA address.
8840 (Output_section_definition::set_section_addresses): Add code to
8841 check for addresses set by memory regions.
8842 (Output_segment::set_section_addresses): Remove memory region
8843 walking code.
8844 (Script_sections::create_segment): Add a warning if a header
8845 segment is created outside of any region.
8846 * script-sections.h (class Script_sections): Add prototypes for
8847 find_memory_region and block_in_region methods.
8848 * testsuite/memory_test.s: Use .long instead of .word.
8849 * testsuite/memory_test.t: Add some more output sections.
8850 * testsuite/memory_test.sh: Update expected output.
8851
a9bfd952
DK
88522010-10-02 Doug Kwan <dougkwan@google.com>
8853
8854 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8855 defintion to symtab.h
8856 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8857 declaration to defintion.
8858
bacff3ab
NC
88592010-10-01 Nick Clifton <nickc@redhat.com>
8860
8861 * expression.cc (eval): Replace dummy argument with NULL.
8862 (eval_maybe_dot): Check for a NULL result section pointer.
8863 (Symbol_expression::value): Likewise.
8864 (Dot_expression::value): Likewise.
8865 (BINARY_EXPRESSION): Likewise.
8866 (Max_expression::value): Likewise.
8867 (Min_expression::value): Likewise.
8868 (Absolute_expression::value): Likewise.
8869 (Addr_expression::value_from_output_section): Likewise.
8870 (Loaddddr_expression::value_from_output_section): Likewise.
8871 (Segment_start_expression::value): Likewise.
8872 * script-sections.cc
8873 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8874 argument with NULL.
8875 (Sections_elememt_dot_assignment::set_section_addresses):
8876 Likewise.
8877 (Output_data_expression::do_write_to_buffer): Likewise.
8878 (Output_section_definition::finalize_symbols): Likewise.
8879 (Output_section_definition::set_section_addresses): Likewise.
8880
f81bc8b5
DK
88812010-09-30 Doug Kwan <dougkwan@google.com>
8882
8883 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8884
c95e9f27
ST
88852010-09-28 Sriraman Tallam <tmsriram@google.com>
8886
8887 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8888 function.
c95e9f27
ST
8889 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8890 virtual function.
8891 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8892 virtual function.
8893 * icf.cc (get_section_contents): Inline merge sections only when
8894 target allows it.
8895
3cac54d2
RW
88962010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8897
8898 * configure: Regenerate.
8899
2904037a
ILT
89002010-09-17 Ian Lance Taylor <iant@google.com>
8901
8902 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8903 * testsuite/Makefile.am (memory_test.o): New target.
8904 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8905 memory_test.t.
8906 * testsuite/Makefile.in: Rebuild.
2904037a 8907
bca7fb63
DK
89082010-09-17 Doug Kwan <dougkwan@google.com>
8909
8910 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8911 defintion if relocation uses GOT entries of the symbol.
8912 * testsuite/icf_safe_test.sh: Fix test.
8913 * testsuite/icf_safe_so_test.sh: Fix test.
8914
4ef28648
CC
89152010-09-16 Cary Coutant <ccoutant@google.com>
8916
8917 * script_sections.cc (class Memory_region): Remove "NULL" from
8918 vector initializations.
8919
793990de
CC
89202010-09-15 Cary Coutant <ccoutant@google.com>
8921
8922 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8923 Resolve forwarding symbols.
8924
81e015e2
DK
89252010-09-15 Doug Kwan <dougkwan@google.com>
8926
8927 * gold/testsuite/script_test_3.t: Add ARM special sections.
8928 * gold/testsuite/script_test_4.t: Same.
8929 * gold/testsuite/script_test_5.t: Same.
8930 * gold/testsuite/script_test_6.t: Same.
8931 * gold/testsuite/script_test_7.t: Same.
8932 * gold/testsuite/script_test_7.t: Same.
8933 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8934
36171d64
CC
89352010-09-14 Cary Coutant <ccoutant@google.com>
8936
8937 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8938 (Target_x86_64::Relocate::relocate_tls): Replace check for
8939 saw_tls_block_reloc_ with test for executable section.
8940
d89051bd
CC
89412010-09-12 Cary Coutant <ccoutant@google.com>
8942
8943 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8944 position-independent executables to shared libraries need dynamic
8945 relocations.
8946 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8947 position-independent executables.
8948 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8949 * testsuite/Makefile.in: Regenerate.
8950
fca41f0f
NC
89512010-09-10 Nick Clifton <nickc@redhat.com>
8952
8953 PR gold/11997
8954 * testsuite/memory_test.t: Discard any sections that are not
8955 needed.
8956
6695e4b3
L
89572010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8958
8959 PR gold/11996
8960 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8961 "This::" to work around a bug in gcc 4.2.
8962
8963 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8964
0f72bf6f
RÁE
89652010-09-09 Rafael Espindola <espindola@google.com>
8966
8967 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8968 sections with different PF_X flags in the same segment.
8969 (Layout::find_first_load_seg): Search all segments to find the first
8970 one.
8971 * options.h (rosegment): New.
8972
89732010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8974
05a79166 8975 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8976
aa98ff75
DK
89772010-09-08 Doug Kwan <dougkwan@google.com>
8978
8979 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8980 (Arm_relobj::do_relocate_sections): Add new parameter for output
8981 file to match the parent.
8982 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8983 of local symbols instead of input values. Update code to track
8984 changes in gold::relocate_section.
8985 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8986 (Sized_relobj::compute_final_local_value_internal): New methods.
8987 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8988 body into private version of Sized_relobj::compute_final_local_value.
8989 Call the inline method.
8990 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8991 merged symbol value if there is one.
8992 (Symbol_value::has_output_value): New method defintiion.
8993 (Sized_relobj::Compute_final_local_value_status): New enum type.
8994 (Sized_relobj::compute_final_local_value): New methods.
8995 (Sized_relobj::compute_final_local_value_internal): New methods.
8996 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8997 and arm_cortex_a8.sh.
8998 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8999 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9000 New tests.
9001 * Makefile.in: Regenerate.
9002 * testsuite/arm_bl_out_of_range.s: Update test.
9003 * testsuite/thumb_bl_out_of_range.s: Ditto.
9004 * testsuite/thumb_blx_out_of_range.s: Ditto.
9005 * testsuite/arm_branch_out_of_range.sh: New file.
9006 * testsuite/arm_cortex_a8.sh: Ditto.
9007 * testsuite/arm_cortex_a8_b.s: Ditto.
9008 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9009 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9010 * testsuite/arm_cortex_a8_bl.s: Ditto.
9011 * testsuite/arm_cortex_a8_blx.s: Ditto.
9012 * testsuite/arm_cortex_a8_local.s: Ditto.
9013 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9014 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9015
05a79166
L
90162010-09-08 Rafael Espindola <espindola@google.com>
9017
9018 * Makefile.am (memory_test.stdout): Run readelf with -W.
9019 * Makefile.in: Regenerate.
9020 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9021 64 bit output.
9022
33dbc701
RÁE
90232010-09-08 Rafael Espindola <espindola@google.com>
9024
9025 * script-sections.cc (Script_sections::add_memory_region): Convert
9026 field precision to int.
9027 * script.cc (script_set_section_region, script_set_section_region):
9028 Convert field precision to int.
9029
731ca54a
RÁE
90302010-09-08 Rafael Espindola <espindola@google.com>
9031
9032 * arm.cc (do_finalize_sections): Create the __exidx_start and
9033 __exdix_end symbols even when the section is missing.
9034
7f8cd844
NC
90352010-09-08 Nick Clifton <nickc@redhat.com>
9036
9037 * README: Remove claim that MEMORY is not supported.
9038 * expression.cc (script_exp_function_origin)
9039 (script_exp_function_length): Move from here to ...
9040 * script.cc: ... here.
9041 (script_set_section_region, script_add_memory)
9042 (script_parse_memory_attr, script_include_directive): New
9043 functions.
9044 * script-sections.cc
9045 (class Memory_region): New class.
9046 (class Output_section_definition): Add set_memory_region,
9047 set_section_vma, set_section_lma and get_section_name methods.
9048 (class Script_Sections): Add add_memory_region,
9049 find_memory_region, find_memory_region_origin,
9050 find_memory_region_length and set_memory_region methods.
9051 Have set_section_addresses method walk the list of set memory
9052 regions.
9053 Extend the print methos to display memory regions.
9054 * script-sections.h: Add prototypes for new methods.
9055 Add enum for MEMORY region attributes.
9056 * yyscript.y: Add support for parsing MEMORY regions.
9057 * script-c.h: Add prototypes for new functions.
9058 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9059 * testsuite/Makefile.in: Regenerate.
9060 * testsuite/memory_test.sh: New script.
9061 * testsuite/memory_test.s: New assembler source file.
9062 * testsuite/memory_test.t: New linker script.
9063
a4649286
DK
90642010-08-27 Doug Kwan <dougkwan@google.com>
9065
9066 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9067 reference override an existing dynamic weak reference.
9068 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9069 * testsuite/Makefile.in: Regenerate.
9070 * testsuite/dyn_weak_ref.sh: New file.
9071 * testsuite/dyn_weak_ref_1.c: Ditto.
9072 * testsuite/dyn_weak_ref_2.c: Ditto.
9073
b56648ad
ILT
90742010-08-27 Ian Lance Taylor <iant@google.com>
9075
9076 * incremental.h (class Incremental_input_entry): Add virtual
9077 destructor.
9078
809313cb
ILT
90792010-08-27 Ian Lance Taylor <iant@google.com>
9080
9081 * testsuite/start_lib_test_3.c: Mark t3 as used.
9082
11e32464
NC
90832010-08-27 Nick Clifton <nickc@redhat.com>
9084
9085 * options.cc (version_script): Fix small typo in previous
9086 whitespace tidyup.
9087
ca09d69a
NC
90882010-08-25 Nick Clifton <nickc@redhat.com>
9089
9090 * archive.cc: Formatting fixes: Remove whitespace between
9091 typename and following asterisk. Remove whitespace between
9092 function name and opening parenthesis.
9093 * archive.h: Likewise.
9094 * arm.cc: Likewise.
9095 * attributes.cc: Likewise.
9096 * attributes.h: Likewise.
9097 * common.cc: Likewise.
9098 * copy-relocs.cc: Likewise.
9099 * dirsearch.h: Likewise.
9100 * dynobj.cc: Likewise.
9101 * ehframe.cc: Likewise.
9102 * ehframe.h: Likewise.
9103 * expression.cc: Likewise.
9104 * fileread.cc: Likewise.
9105 * fileread.h: Likewise.
9106 * gc.h: Likewise.
9107 * gold-threads.cc: Likewise.
9108 * gold.cc: Likewise.
9109 * i386.cc: Likewise.
9110 * icf.h: Likewise.
9111 * incremental-dump.cc: Likewise.
9112 * incremental.cc: Likewise.
9113 * layout.cc: Likewise.
9114 * layout.h: Likewise.
9115 * main.cc: Likewise.
9116 * merge.cc: Likewise.
9117 * merge.h: Likewise.
9118 * object.cc: Likewise.
9119 * object.h: Likewise.
9120 * options.cc: Likewise.
9121 * options.h: Likewise.
9122 * output.cc: Likewise.
9123 * output.h: Likewise.
9124 * plugin.cc: Likewise.
9125 * plugin.h: Likewise.
9126 * powerpc.cc: Likewise.
9127 * reloc.cc: Likewise.
9128 * script-c.h: Likewise.
9129 * script-sections.cc: Likewise.
9130 * script.cc: Likewise.
9131 * stringpool.cc: Likewise.
9132 * symtab.cc: Likewise.
9133 * symtab.h: Likewise.
9134 * target.cc: Likewise.
9135 * timer.cc: Likewise.
9136 * timer.h: Likewise.
9137 * version.cc: Likewise.
9138 * x86_64.cc: Likewise.
9139
b8fa8750
NC
91402010-08-24 Nick Clifton <nickc@redhat.com>
9141
9142 PR 11899
9143 * layout.cc (segment_precedes): Sort segments by their physical
9144 addresses, if they have been set.
9145
9919d93b
CC
91462010-08-23 Cary Coutant <ccoutant@google.com>
9147
9148 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9149 symbols data.
9150 (Lib_group::include_member): Unlock object after deleting its
9151 symbols data.
9152 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9153 the bug fixed here.
9154
97b4be1c
CC
91552010-08-19 Neil Vachharajani <nvachhar@google.com>
9156 Cary Coutant <ccoutant@google.com>
9157
9158 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9159 constructor, and set_blocker.
9160 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9161 readsyms_blocker_.
9162 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9163 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9164 * testsuite/Makefile.am (start_lib_test): New test case.
9165 * testsuite/Makefile.in: Regenerate.
9166 * testsuite/start_lib_test_main.c: New file.
9167 * testsuite/start_lib_test_1.c: New file.
9168 * testsuite/start_lib_test_2.c: New file.
9169 * testsuite/start_lib_test_3.c: New file.
9170
dd0b1884
ILT
91712010-08-19 Ian Lance Taylor <iant@google.com>
9172
9173 * Makefile.in: Rebuild with automake 1.11.1.
9174 * aclocal.m4: Likewise.
9175 * testsuite/Makefile.in: Likewise.
9176
7223e9ca
ILT
91772010-08-19 Ian Lance Taylor <iant@google.com>
9178
9179 PR 10893
9180 * i386.cc (class Output_data_plt_i386): Update declarations.
9181 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9182 local_ifuncs_ fields.
9183 (Target_i386::do_plt_section_for_global): New function.
9184 (Target_i386::do_plt_section_for_local): New function.
9185 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9186 parameter; change all callers. Initialize global_ifuncs_ and
9187 local_ifuncs_. If doing a static link define __rel_iplt_start and
9188 __rel_iplt_end.
9189 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9190 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9191 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9192 symbols.
9193 (Target_i386::make_plt_section): New function, broken out of
9194 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9195 (Target_i386::make_plt_entry): Call make_plt_section.
9196 (Target_i386::make_local_ifunc_plt_entry): New function.
9197 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9198 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9199 R_386_IRELATIVE to switch.
9200 (Target_i386::Scan::global): Likewise.
9201 (Target_i386::Relocate::relocate): Likewise.
9202 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9203 switch.
9204 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9205 (Target_x86_64::do_plt_section_for_global): New function.
9206 (Target_x86_64::do_plt_section_for_local): New function.
9207 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9208 parameter; change all callers. If doing a static link define
9209 __rela_iplt_start and __rela_iplt_end.
9210 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9211 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9212 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9213 to point to .plt.
9214 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9215 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9216 switch.
9217 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9218 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9219 R_X86_64_IRELATIVE to switch.
9220 (Target_x86_64::Scan::global): Likewise.
9221 (Target_x86_64::Relocate::relocate): Likewise.
9222 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9223 switch.
9224 * target.h (class Target): Add plt_section_for_global and
9225 plt_section_for_local functions. Add do_plt_section_for_global
9226 and do_plt_section_for_local virtual functions.
9227 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9228 clarifying comments.
9229 (Symbol::use_plt_offset): Handle IFUNC symbol.
9230 * object.cc (Sized_relobj::Sized_relobj): Initialize
9231 local_plt_offsets_.
9232 (Sized_relobj::local_has_plt_offset): New function.
9233 (Sized_relobj::local_plt_offset): New function.
9234 (Sized_relobj::set_local_plt_offset): New function.
9235 (Sized_relobj::do_count): Handle IFUNC symbol.
9236 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9237 a bit away from input_shndx_ field. Add set_is_func_symbol and
9238 is_ifunc_symbol functions.
9239 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9240 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9241 local_plt_offsets_ field.
9242 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9243 * output.h (class Output_section_data): Add non-const
9244 output_section function.
9245 (class Output_data_got): Update declarations.
9246 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9247 Add use_plt_offset parameter to global and local constructors.
9248 Change all callers. Change local_sym_index_ field to 31 bits.
9249 Change GSYM_CODE and CONSTANT_CODE accordingly.
9250 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9251 doing a static link don't set sh_link field.
9252 (Output_data_got::Got_entry::write): Use PLT offset if
9253 appropriate.
9254 (Output_data_got::add_global_plt): New function.
9255 (Output_data_got::add_local_plt): New function.
9256 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9257 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9258 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9259 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9260 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9261 IFUNC conditional.
9262 * testsuite/ifunc-sel.h: New file.
9263 * testsuite/ifuncmain1.c: New file.
9264 * testsuite/ifuncmain1vis.c: New file.
9265 * testsuite/ifuncmod1.c: New file.
9266 * testsuite/ifuncdep2.c: New file.
9267 * testsuite/ifuncmain2.c: New file.
9268 * testsuite/ifuncmain3.c: New file.
9269 * testsuite/ifuncmod3.c: New file.
9270 * testsuite/ifuncmain4.c: New file.
9271 * testsuite/ifuncmain5.c: New file.
9272 * testsuite/ifuncmod5.c: New file.
9273 * testsuite/ifuncmain6pie.c: New file.
9274 * testsuite/ifuncmod6.c: New file.
9275 * testsuite/ifuncmain7.c: New file.
9276 * configure, testsuite/Makefile.in: Rebuild.
9277
56f75c03
ILT
92782010-08-18 Ian Lance Taylor <iant@google.com>
9279
9280 * incremental.cc
9281 (Output_section_incremental_inputs::write_input_files): Add cast
9282 to avoid signed/unsigned comparison warning.
9283 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9284
55455f89
CC
92852010-08-12 Cary Coutant <ccoutant@google.com>
9286
9287 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9288
e2054bcb
ILT
92892010-08-13 Ian Lance Taylor <iant@google.com>
9290
9291 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9292
74f67560
DK
92932010-08-12 Cary Coutant <ccoutant@google.com>
9294 Doug Kwan <dougkwan@google.com>
9295
9296 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9297 defintion overrides non-weak undef, remember that the original undef
9298 is not weak.
9299 * symtab.cc (Symbol_table::sized_write_global): For undef without
9300 an original weak binding, set binding to global in output.
9301 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9302 * testsuite/Makefile.in: Regenerate.
9303 * testsuite/strong_ref_weak_def.sh: New file.
9304 * testsuite/strong_ref_weak_def_1.c: Ditto.
9305 * testsuite/strong_ref_weak_def_2.c: Ditto.
9306
d1238d12
CC
93072010-08-12 Cary Coutant <ccoutant@google.com>
9308
9309 * testsuite/incremental_test.sh: Rewrite.
9310 * testsuite/incremental_test_1.c: Rewrite.
9311 * testsuite/incremental_test_2.c: Rewrite.
9312
0e70b911
CC
93132010-08-12 Cary Coutant <ccoutant@google.com>
9314
9315 * arm.cc (Target_arm::got_size): Add const.
9316 (Target_arm::got_entry_count): New function.
9317 (Target_arm::plt_entry_count): New function.
9318 (Target_arm::first_plt_entry_offset): New function.
9319 (Target_arm::plt_entry_size): New function.
9320 (Output_data_plt_arm::entry_count): New function.
9321 (Output_data_plt_arm::first_plt_entry_offset): New function.
9322 (Output_data_plt_arm::get_plt_entry_size): New function.
9323 * i386.cc (Target_i386::got_size): Add const.
9324 (Target_i386::got_entry_count): New function.
9325 (Target_i386::plt_entry_count): New function.
9326 (Target_i386::first_plt_entry_offset): New function.
9327 (Target_i386::plt_entry_size): New function.
9328 (Output_data_plt_i386::entry_count): New function.
9329 (Output_data_plt_i386::first_plt_entry_offset): New function.
9330 (Output_data_plt_i386::get_plt_entry_size): New function.
9331 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9332 find_incremental_inputs_sections. Dump incremental_got_plt section.
9333 * incremental.cc: Include target.h.
9334 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9335 parameter. Adjust all callers. Find incremental_got_plt section.
9336 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9337 section.
9338 (Output_section_incremental_inputs::set_final_data_size): Calculate
9339 size of incremental_got_plt section.
9340 (Output_section_incremental_inputs::do_write): Write the
9341 incremental_got_plt section.
9342 (Got_plt_view_info): New struct.
9343 (Local_got_offset_visitor): New class.
9344 (Global_got_offset_visitor): New class.
9345 (Global_symbol_visitor_got_plt): New class.
9346 (Output_section_incremental_inputs::write_got_plt): New function.
9347 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9348 Add parameter. Adjust all callers.
9349 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9350 (Incremental_inputs::got_plt_section): New function.
9351 (Incremental_inputs::got_plt_section_): New data member.
9352 (Incremental_got_plt_reader): New class.
9353 * layout.cc (Layout::create_incremental_info_sections): Add the
9354 incremental_got_plt section.
9355 * object.h (Got_offset_list::get_list): New function.
9356 (Got offset_list::for_all_got_offsets): New function.
9357 (Sized_relobj::local_got_offset_list): New function.
9358 * powerpc.cc (Target_powerpc::got_size): Add const.
9359 (Target_powerpc::got_entry_count): New function.
9360 (Target_powerpc::plt_entry_count): New function.
9361 (Target_powerpc::first_plt_entry_offset): New function.
9362 (Target_powerpc::plt_entry_size): New function.
9363 (Output_data_plt_powerpc::entry_count): New function.
9364 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9365 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9366 * sparc.cc (Target_sparc::got_size): Add const.
9367 (Target_sparc::got_entry_count): New function.
9368 (Target_sparc::plt_entry_count): New function.
9369 (Target_sparc::first_plt_entry_offset): New function.
9370 (Target_sparc::plt_entry_size): New function.
9371 (Output_data_plt_sparc::entry_count): New function.
9372 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9373 (Output_data_plt_sparc::get_plt_entry_size): New function.
9374 * symtab.h (Symbol::got_offset_list): New function.
9375 (Symbol_table::for_all_symbols): New function.
9376 * target.h (Sized_target::got_entry_count): New function.
9377 (Sized_target::plt_entry_count): New function.
9378 (Sized_target::plt_entry_size): New function.
9379 * x86_64.cc (Target_x86_64::got_size): Add const.
9380 (Target_x86_64::got_entry_count): New function.
9381 (Target_x86_64::plt_entry_count): New function.
9382 (Target_x86_64::first_plt_entry_offset): New function.
9383 (Target_x86_64::plt_entry_size): New function.
9384 (Output_data_plt_x86_64::entry_count): New function.
9385 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9386 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9387
09ec0418
CC
93882010-08-12 Cary Coutant <ccoutant@google.com>
9389
9390 * archive.cc: Include incremental.h.
9391 (Archive::Archive): Initialize incremental_info_.
9392 (Archive::include_member): Record archive members in incremental info.
9393 (Add_archive_symbols::run): Record begin and end of an archive in
9394 incremental info.
9395 (Lib_group::include_member): Record objects in incremental info.
9396 * archive.h (Incremental_archive_entry): Forward declaration.
9397 (Archive::set_incremental_info): New member function.
9398 (Archive::incremental_info): New member function.
9399 (Archive::Unused_symbol_iterator): New class.
9400 (Archive::unused_symbols_begin): New member function.
9401 (Archive::unused_symbols_end): New member function.
9402 (Archive::incremental_info_): New data member.
9403 * incremental-dump.cc (find_input_containing_global): New function.
9404 (dump_incremental_inputs): Dump new incremental info sections.
9405 * incremental.cc: Include symtab.h.
9406 (Output_section_incremental_inputs): New class.
9407 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9408 new incremental info sections.
9409 (Sized_incremental_binary::do_check_inputs): Likewise.
9410 (Incremental_inputs::report_archive): Remove.
9411 (Incremental_inputs::report_archive_begin): New function.
9412 (Incremental_inputs::report_archive_end): New function.
9413 (Incremental_inputs::report_object): New function.
9414 (Incremental_inputs::finalize_inputs): Remove.
9415 (Incremental_inputs::report_input_section): New function.
9416 (Incremental_inputs::report_script): Rewrite.
9417 (Incremental_inputs::finalize): Do nothing but finalize string table.
9418 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9419 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9420 (Incremental_inputs::create_data_sections): New function.
9421 (Incremental_inputs::relocs_entsize): New function.
9422 (Output_section_incremental_inputs::set_final_data_size): New function.
9423 (Output_section_incremental_inputs::do_write): New function.
9424 (Output_section_incremental_inputs::write_header): New function.
9425 (Output_section_incremental_inputs::write_input_files): New function.
9426 (Output_section_incremental_inputs::write_info_blocks): New function.
9427 (Output_section_incremental_inputs::write_symtab): New function.
9428 * incremental.h (Incremental_script_entry): Forward declaration.
9429 (Incremental_object_entry): Forward declaration.
9430 (Incremental_archive_entry): Forward declaration.
9431 (Incremental_inputs): Forward declaration.
9432 (Incremental_inputs_header_data): Remove.
9433 (Incremental_inputs_header): Remove.
9434 (Incremental_inputs_header_write): Remove.
9435 (Incremental_inputs_entry_data): Remove.
9436 (Incremental_inputs_entry): Remove.
9437 (Incremental_inputs_entry_write): Remove.
9438 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9439 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9440 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9441 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9442 Likewise.
9443 (Incremental_input_entry): New class.
9444 (Incremental_script_entry): New class.
9445 (Incremental_object_entry): New class.
9446 (Incremental_archive_entry): New class.
9447 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9448 (Incremental_inputs::report_inputs): Remove.
9449 (Incremental_inputs::report_archive): Remove.
9450 (Incremental_inputs::report_archive_begin): New function.
9451 (Incremental_inputs::report_archive_end): New function.
9452 (Incremental_inputs::report_object): Change prototype.
9453 (Incremental_inputs::report_input_section): New function.
9454 (Incremental_inputs::report_script): Change prototype.
9455 (Incremental_inputs::get_reloc_count): New function.
9456 (Incremental_inputs::set_reloc_count): New function.
9457 (Incremental_inputs::create_data_sections): New function.
9458 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9459 (Incremental_inputs::inputs_section): New function.
9460 (Incremental_inputs::symtab_section): New function.
9461 (Incremental_inputs::relocs_section): New function.
9462 (Incremental_inputs::get_stringpool): Add const.
9463 (Incremental_inputs::command_line): Add const.
9464 (Incremental_inputs::inputs): Remove.
9465 (Incremental_inputs::command_line_key): New function.
9466 (Incremental_inputs::input_file_count): New function.
9467 (Incremental_inputs::input_files): New function.
9468 (Incremental_inputs::relocs_entsize): New function.
9469 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9470 (Incremental_inputs::finalize_inputs): Remove.
9471 (Incremental_inputs::Input_info): Remove.
9472 (Incremental_inputs::lock_): Remove.
9473 (Incremental_inputs::inputs_): Change type.
9474 (Incremental_inputs::inputs_map_): Remove.
9475 (Incremental_inputs::current_object_entry_): New data member.
9476 (Incremental_inputs::inputs_section_): New data member.
9477 (Incremental_inputs::symtab_section_): New data member.
9478 (Incremental_inputs::relocs_section_): New data member.
9479 (Incremental_inputs::reloc_count_): New data member.
9480 (Incremental_inputs_reader): New class.
9481 (Incremental_symtab_reader): New class.
9482 (Incremental_relocs_reader): New class.
9483 * layout.cc (Layout::finalize): Move finalization of incremental info
9484 and creation of incremental info sections to follow finalization of
9485 symbol table. Set offsets for postprocessing sections.
9486 (Layout::create_incremental_info_sections): Call
9487 Incremental_inputs::create_data_sections. Add incremental symtab
9488 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9489 sections to layout after input sections.
9490 * layout.h (struct Timespec): Forward declaration.
9491 (Layout::incremental_inputs): Add const.
9492 (Layout::create_incremental_info_sections): Add parameter.
9493 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9494 * object.cc: Include incremental.h.
9495 (Relobj::finalize_incremental_relocs): New function.
9496 (Sized_relobj::do_layout): Record input sections in incremental info.
9497 * object.h (Object::output_section): New function.
9498 (Object::output_section_offset): Moved from Relobj.
9499 (Object::get_incremental_reloc_base): New function.
9500 (Object::get_incremental_reloc_count): New function.
9501 (Object::do_output_section): New function.
9502 (Object::do_output_section_offset): Moved from Relobj.
9503 (Object::do_get_incremental_reloc_base): New function.
9504 (Object::do_get_incremental_reloc_count): New function.
9505 (Object::Object): Initialize new data members.
9506 (Relobj::output_section): Renamed do_output_section and moved to
9507 protected.
9508 (Relobj::output_section_offset): Moved to Object.
9509 (Relobj::do_get_incremental_reloc_base): New function.
9510 (Relobj::do_get_incremental_reloc_count): New function.
9511 (Relobj::allocate_incremental_reloc_counts): New function.
9512 (Relobj::count_incremental_reloc): New function.
9513 (Relobj::finalize_incremental_relocs): New function.
9514 (Relobj::next_incremental_reloc_index): New function.
9515 (Relobj::reloc_counts_): New data member.
9516 (Relobj::reloc_bases_): New data member.
9517 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9518 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9519 (Sized_relobj::incremental_relocs_scan): New function.
9520 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9521 (Sized_relobj::incremental_relocs_write): New function.
9522 (Sized_relobj::incremental_relocs_write_reltype): New function.
9523 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9524 incremental link.
9525 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9526 archives and object files elsewhere.
9527 (Add_symbols::run): Report object files here.
9528 (Finish_group::run): Report end of archive at end of group.
9529 * reloc.cc: Include layout.h, incremental.h.
9530 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9531 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9532 (Sized_relobj::incremental_relocs_scan): New function.
9533 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9534 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9535 (Sized_relobj::incremental_relocs_write): New function.
9536 (Sized_relobj::incremental_relocs_write_reltype): New function.
9537 * script.cc (read_input_script): Rewrite test for incremental link.
9538 Change call to Incremental_inputs::report_script.
9539 * symtab.h (Symbol_table::first_global_index): New function.
9540 (Symbol_table::output_count): New function.
9541
ce0d1972
DK
95422010-08-12 Doug Kwan <dougkwan@google.com>
9543
9544 * arm.cc (Target_arm::merge_object_attributes): Check command line
9545 options --no-wchar-size-warning and --no-enum-size-warning.
9546 * options.h (General_options): Add ld-compatible options
9547 --no-enum-size-warning and --no-wchar-size-warning.
9548
6e5710ce
ILT
95492010-08-04 Ian Lance Taylor <iant@google.com>
9550
9551 * x86_64.cc (Target_x86_64::Scan::local): Use
9552 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9553 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9554 (Target_x86_64::Scan::global): Likewise.
9555 (Target_x86_64::Relocate::relocate): Likewise.
9556 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9557 Likewise.
9558
fef830db
CC
95592010-08-03 Cary Coutant <ccoutant@google.com>
9560
9561 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9562 to reserve space in merged_strings vector. Keep total input size
9563 for stats.
9564 (Output_merge_string::do_print_merge_stats): Print total input size.
9565 * merge.h (Output_merge_string): Add input_size_ field.
9566 * stringpool.cc (Stringpool_template::string_length): Move
9567 implementations out of Stringpool_template class and place in
9568 stringpool.h.
9569 * stringpool.h (string_length): Move out of Stringpool_template.
9570
1e3811b0
ILT
95712010-08-03 Ian Lance Taylor <iant@google.com>
9572
9573 PR 11712
9574 * layout.cc (relaxation_loop_body): If address of load segment is
9575 set, adjust address to include headers if possible.
9576
7af0c620
ILT
95772010-08-03 Ian Lance Taylor <iant@google.com>
9578
9579 * version.cc (version_string): Bump to 1.10.
9580
22f0da72
ILT
95812010-08-03 Ian Lance Taylor <iant@google.com>
9582
9583 PR 11805
9584 * layout.h (enum Output_section_order): Define.
9585 (class Layout): Update declarations.
9586 * layout.cc (Layout::get_output_section): Add order parameter.
9587 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9588 is_first_non_relro parameters. Change all callers.
9589 (Layout::choose_output_section): Likewise.
9590 (Layout::add_output_section_data): Likewise.
9591 (Layout::make_output_section): Likewise. Set order.
9592 (Layout::default_section_order): New function.
9593 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9594 * output.cc (Output_section::Output_section): Initialize order_.
9595 Don't initialize deleted fields.
9596 (Output_segment::Output_segment): Don't initialize deleted
9597 fields.
9598 (Output_segment::add_output_section_to_load): New function
9599 replacing add_output_section. Change all callers to call this or
9600 add_output_section_to_nonload.
9601 (Output_segment::add_output_section_to_nonload): New function.
9602 (Output_segment::remove_output_section): Rewrite.
9603 (Output_segment::add_initial_output_data): Likewise.
9604 (Output_segment::has_any_data_sections): Likewise.
9605 (Output_segment::is_first_section_relro): Likewise.
9606 (Output_segment::maximum_alignment): Likewise.
9607 (Output_segment::has_dynamic_reloc): New function replacing
9608 dynamic_reloc_count. Change all callers.
9609 (Output_segment::has_dynamic_reloc_list): New function replacing
9610 dynamic_reloc_count_list. Change all callers.
9611 (Output_segment::set_section_addresses): Rewrite.
9612 (Output_segment::set_offset): Rewrite.
9613 (Output_segment::find_first_and_last_list): Remove.
9614 (Output_segment::set_tls_offsets): Rewrite.
9615 (Output_segment::first_section_load_address): Likewise.
9616 (Output_segment::output_section_count): Likewise.
9617 (Output_segment::section_with_lowest_load_address): Likewise.
9618 (Output_segment::write_section_headers): Likewise.
9619 (Output_segment::print_sections_to_map): Likewise.
9620 * output.h (class Output_data): Remove dynamic_reloc_count_
9621 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9622 (Output_data::add_dynamic_reloc): Rewrite.
9623 (Output_data::has_dynamic_reloc): New function.
9624 (Output_data::dynamic_reloc_count): Remove.
9625 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9626 is_last_relro_, is_first_non_relro_, is_interp_,
9627 is_dynamic_linker_section_ fields. Add order and set_order
9628 functions. Remove is_relro_local, set_is_relro_local,
9629 is_last_relro, set_is_last_relro, is_first_non_relro,
9630 set_is_first_non_relro functions, is_interp, set_is_interp,
9631 is_dynamic_linker_section, and set_is_dynamic_linker_section
9632 functions.
9633 (class Output_segment): Change Output_data_list from std::list to
9634 std:;vector. Add output_lists_ field. Remove output_data_ and
9635 output_bss_ fields. Update declarations.
9636
3ff2ccb0
ILT
96372010-08-02 Ian Lance Taylor <iant@google.com>
9638
9639 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9640 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9641 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9642
88a4108b
ILT
96432010-08-02 Ian Lance Taylor <iant@google.com>
9644
9645 PR 11855
9646 * script.cc (Script_options::Script_options): Initialize
9647 symbol_definitions_ and symbol_references_.
9648 (Script_options::add_symbol_assignment): Update
9649 symbol_definitions_ and symbol_references_.
9650 (Script_options::add_symbol_reference): New function.
9651 (script_symbol): New function.
9652 * script.h (class Script_options): Add symbol_definitions_ and
9653 symbol_references_ fields.
9654 (Script_options::referenced_const_iterator): New type.
9655 (Script_options::referenced_begin): New function.
9656 (Script_options::referenced_end): New function.
9657 (Script_options::is_referenced): New function.
9658 (Script_options::any_unreferenced): New function.
9659 * script-c.h (script_symbol): Declare.
9660 * yyscript.y (exp): Call script_symbol.
9661 * symtab.cc: Include "script.h".
9662 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9663 Change all callers. Check symbols referenced by scripts.
9664 (Symbol_table::add_undefined_symbols_from_command_line): Add
9665 layout parameter. Change all callers.
9666 (Symbol_table::do_add_undefined_symbols_from_command_line):
9667 Likewise. Break out loop body. Check symbols referenced by
9668 scripts.
9669 (Symbol_table::add_undefined_symbol_from_command_line): New
9670 function broken out of
9671 do_add_undefined_symbols_from_command_line.
9672 * symtab.h (class Symbol_table): Update declarations.
9673 * archive.cc: Include "layout.h".
9674 (Archive::should_include_member): Add layout parameter. Change
9675 all callers. Check for symbol mentioned in expression.
9676 * archive.h (class Archive): Update declaration.
9677 * object.cc (Sized_relobj::do_should_include_member): Add layout
9678 parameter.
9679 * object.h (Object::should_include_member): Add layout parameter.
9680 Change all callers.
9681 (Object::do_should_include_member): Add layout parameter.
9682 (class Sized_relobj): Update declaration.
9683 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9684 parameter.
9685 * dynobj.h (class Sized_dynobj): Update declaration.
9686 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9687 layout parameter.
9688 * plugin.h (class Sized_pluginobj): Update declaration.
9689
5f1ab67a
ILT
96902010-08-02 Ian Lance Taylor <iant@google.com>
9691
9692 PR 11866
9693 * output.cc (Output_segment::set_offset): Search for the first and
9694 last sections rather than assuming that the list is in order.
9695 (Output_segment::find_first_and_last_list): New function.
9696 * output.h (class Output_segment): Update declarations.
9697 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9698 (relro_strip_test_SOURCES): New variable.
9699 (relro_strip_test_DEPENDENCIES): New variable.
9700 (relro_strip_test_LDFLAGS): New variable.
9701 (relro_strip_test_LDADD): New variable.
9702 (relro_strip_test.so): New target.
9703
a8df5856
ILT
97042010-08-02 Ian Lance Taylor <iant@google.com>
9705
9706 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9707 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9708 (Target_i386::got_tlsdesc_section): New function.
9709 (Target_i386::got_section): Create space for GOT entries for
9710 TLSDESC relocations.
9711 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9712 R_386_TLS_GOTDESC.
9713 (Target_i386::Scan::global): Likewise.
9714 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9715 using TLSDESC GOT.
9716 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9717 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9718 (Target_x86_64::got_tlsdesc_section): New function.
9719 (Target_x86_64::got_section): Create space for GOT entries for
9720 TLSDESC relocations.
9721 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9722 R_386_TLS_GOTDESC.
9723 (Target_x86_64::Scan::global): Likewise.
9724 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9725 using TLSDESC GOT.
9726
0c10a0a6
ILT
97272010-08-02 Ian Lance Taylor <iant@google.com>
9728
9729 * testsuite/final_layout.sh: Use dc to convert from hex to
9730 decimal.
9731
41cbeecc
ST
97322010-07-29 Sriraman Tallam <tmsriram@google.com>
9733
9734 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9735 paramter to the call to gold::gc_process_relocs.
9736 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9737 paramter to the call to gold::gc_process_relocs.
9738 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9739 parameter to the call to gold::gc_process_relocs.
9740 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9741 template parameter to the call to gold::gc_process_relocs.
9742 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9743 paramter to the call to gold::gc_process_relocs.
9744 * gc.h (get_embedded_addend_size): New function.
9745 (gc_process_relocs): Save the size of the reloc for use by ICF.
9746 * icf.cc (get_section_contents): Get the addend from the text section
9747 for SHT_REL relocation sections.
9748 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9749 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9750 * int_encoding.h (read_from_pointer): New overloaded function.
9751 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9752 * testsuite/icf_sht_rel_addend_test.sh: New file.
9753 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9754 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9755
6ea55b82
RW
97562010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9757
9758 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9759 * Makefile.in: Regenerate.
9760 * testsuite/Makefile.in: Regenerate.
9761
9691462b
ILT
97622010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9763
9764 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9765 * gold/testsuite/debug_msg.cc: Likewise.
9766 * gold/testsuite/odr_violation1.cc
9767 * gold/testsuite/odr_violation2.cc
9768
76897331
CC
97692010-07-21 Cary Coutant <ccoutant@google.com>
9770
9771 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9772 string, and length fields.
9773 (Output_merge_string::Merged_strings_list): New type.
9774 (Output_merge_string::Merged_strings_lists): New typedef.
9775 (Output_merge_string): Replace merged_strings_ with
9776 merged_strings_lists_.
9777 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9778 Merged_strings_list per input object and section. Don't store pointer
9779 to the string. Don't store length with each merged string entry.
9780 (Output_merge_string::finalize_merged_data): Loop over list of merged
9781 strings lists. Recompute length of each merged string.
9782
78384e8f
CC
97832010-07-15 Cary Coutant <ccoutant@google.com>
9784
9785 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9786 here.
9787
783659f9
ILT
97882010-07-14 Ian Lance Taylor <iant@google.com>
9789
9790 * descriptors.cc (Descriptors::open): Report correct name in error
9791 message.
9792
131687b4
DK
97932010-07-13 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Arm_input_section::Arm_input_section): For a
9796 SHT_ARM_EXIDX section, always keeps the input sections.
9797 (Arm_input_section::set_exidx_section_link): New method.
9798 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9799 has_errors_ to false.
9800 (Arm_exidx_input_section::has_errors,
9801 Arm_exidx_input_section::set_has_errors): New methods.
9802 (Arm_exidx_input_section::has_errors_): New data member.
9803 (Arm_relobj::get_exidx_shndx_list): New method.
9804 (Arm_output_section::append_text_sections_to_list): Do not skip
9805 section without SHF_EXECINSTR.
9806 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9807 errors.
2e702c99 9808 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9809 section header. Make error messages more verbose. Check for
9810 a non-executable section linked to an EXIDX section.
9811 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9812 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9813 check that there is no deferred EXIDX section if we exit early.
9814 Instead of not making an EXIDX section in case of an error, make one
9815 and set the has_errors flag of it.
9816 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9817 in a relocatable link.
9818 (Target_arm::do_relax): Look for the EXIDX output section instead of
9819 assuming that it is called .ARM.exidx.
2e702c99 9820 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9821 section list. Do not check for SHF_EXECINSTR section flags but
9822 skip any input section with errors.
9823 * output.cc (Output_section::Output_section): Initialize
9824 always_keeps_input_sections_ to false.
9825 (Output_section::add_input_section): Check for
9826 always_keeps_input_sections_.
9827 * output.h (Output_section::always_keeps_input_sections,
9828 Output_section::set_always_keeps_input_sections): New methods.
9829 (Output_section::always_keeps_input_sections): New data member.
9830
69517287
RÁE
98312010-07-13 Rafael Espindola <espindola@google.com>
9832
9833 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9834 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9835
82742395
ILT
98362010-07-13 Philip Herron <herron.philip@googlemail.com>
9837 Ian Lance Taylor <iant@google.com>
9838
9839 * output.h (Output_section_lookup_maps::add_merge_section):
9840 Correct check of whether value was inserted.
9841 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9842 (Output_section_lookup_maps::add_relaxed_input_section):
9843 Likewise.
9844 * arm.cc (Target_arm::got_section): Remove used local os.
9845 * i386.cc (Target_i386::got_section): Likewise.
9846 * x86_64.cc (Target_x86_64::got_section): Likewise.
9847 * sparc.cc (Target_sparc::got_section): Likewise.
9848 (Target_sparc::relocate): Remove unused local have_got_offset.
9849 * powerpc.cc (Target_powerpc::relocate): Likewise.
9850
f2d707b5
ILT
98512010-07-13 Ian Lance Taylor <iant@google.com>
9852
241531d6
ILT
9853 * compressed_output.cc (zlib_decompress): Fix signature in
9854 !HAVE_ZLIB_H case.
9855
f2d707b5
ILT
9856 * archive.cc (Archive::include_member): Unlock an external member
9857 of a thin archive. Don't bother to delete an object we know is
9858 NULL.
9859
a2e47362
CC
98602010-07-12 Cary Coutant <ccoutant@google.com>
9861
9862 * compressed_output.cc (zlib_decompress): New function.
9863 (get_uncompressed_size): New function.
9864 (decompress_input_section): New function.
9865 * compressed_output.h (get_uncompressed_size): New function.
9866 (decompress_input_section): New function.
9867 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9868 Handle compressed debug sections.
9869 * layout.cc (is_compressed_debug_section): New function.
9870 (Layout::output_section_name): Map compressed section names to
9871 canonical names.
9872 * layout.h (is_compressed_debug_section): New function.
9873 (is_debug_info_section): Recognize compressed debug sections.
9874 * merge.cc: Include compressed_output.h.
9875 (Output_merge_data::do_add_input_section): Handle compressed
9876 debug sections.
9877 (Output_merge_string::do_add_input_section): Handle compressed
9878 debug sections.
9879 * object.cc: Include compressed_output.h.
9880 (Sized_relobj::Sized_relobj): Initialize new data members.
9881 (build_compressed_section_map): New function.
9882 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9883 * object.h (Object::section_is_compressed): New method.
9884 (Object::do_section_is_compressed): New method.
9885 (Sized_relobj::Compressed_section_map): New type.
9886 (Sized_relobj::do_section_is_compressed): New method.
9887 (Sized_relobj::compressed_sections_): New data member.
9888 * output.cc (Output_section::add_input_section): Handle compressed
9889 debug sections.
9890 * reloc.cc: Include compressed_output.h.
9891 (Sized_relobj::write_sections): Handle compressed debug sections.
9892
ce279a62
CC
98932010-07-08 Cary Coutant <ccoutant@google.com>
9894
9895 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9896 weak when resolving to a dynamic def.
9897 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9898 for weak undef/dynamic def cases. Adjust callers.
9899 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9900 undef_binding_weak_.
9901 (Symbol_table::sized_write_globals): Adjust symbol binding.
9902 (Symbol_table::sized_write_symbol): Add binding parameter.
9903 * symtab.h (Symbol::set_undef_binding): New method.
9904 (Symbol::is_undef_binding_weak): New method.
9905 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9906 (Symbol_table::should_override): Add new parameter.
9907 (Symbol_table::sized_write_symbol): Add new parameter.
9908
9909 * testsuite/weak_undef_file1.cc: Add new test case.
9910 * testsuite/weak_undef_file2.cc: Fix header comment.
9911 * testsuite/weak_undef_test.cc: Add new test case.
9912
b2286c10
DK
99132010-06-29 Doug Kwan <dougkwan@google.com>
9914
9915 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9916 Initialize USE_SYMBOL_.
9917 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9918 definition.
9919 (Arm_reloc_property::uses_symbol_): New data member declaration.
9920 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9921 uses symbol value and symbol is undefined but not weakly undefined.
9922
4802450a
RÁE
99232010-06-28 Rafael Espindola <espindola@google.com>
9924
9925 * plugin.cc (Plugin::load): Use dlerror.
9926
e5ca47ba
ILT
99272010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9928
9929 * symtab.cc (detect_odr_violations): When reporting an ODR
9930 violation, report an object where the symbol is defined.
9931
8a75a161
DK
99322010-06-25 Doug Kwan <dougkwan@google.com>
9933
9934 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9935 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9936 definition.
9937 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9938 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9939 target hook to detect function points.
9940 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9941 * icf.h (Icf::check_section_for_function_pointers): Change type of
9942 parameter SECTION_NAME to const reference to std::string. Use
9943 target hook to determine if section may have unsafe pointers.
9944 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9945 method definition.
9946
42218b9f
RÁE
99472010-06-21 Rafael Espindola <espindola@google.com>
9948
9949 * fileread.cc (Input_file::find_fie): New
9950 (Input_file::open): Use Input_file::find_fie.
9951 * fileread.h (Input_file::find_fie): New
9952 * plugin.cc (set_extra_library_path): New.
9953 (Plugin::load): Add set_extra_library_path to the transfer vector.
9954 (Plugin_manager::set_extra_library_path): New.
9955 (Plugin_manager::add_input_file): Use the extra search path if set.
9956 (set_extra_library_path(): New.
9957 * plugin.h (Plugin_manager): Add set_extra_library_path and
9958 extra_search_path_.
9959
a0506cca
CC
99602010-06-19 Cary Coutant <ccoutant@google.com>
9961
9962 * layout.cc (gdb_sections): Add .debug_types.
9963 (lines_only_debug_sections): Likewise.
9964
6508b958
RÁE
99652010-06-18 Rafael Espindola <espindola@google.com>
9966
9967 * plugin.cc (add_input_file,add_input_library)
9968 (Plugin_manager::add_input_file): Make filename arguments const.
9969 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9970 const.
9971
3e235302
DK
99722010-06-16 Doug Kwan <dougkwan@google.com>
9973
9974 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9975 .ARM.attributes section if we have not merged any input
9976 attributes sections.
9977
106e8a6c
DK
99782010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9979
9980 * arm.cc: Allow combining objects with no EABI version
9981 information.
9982
91ff43fe
RÁE
99832010-06-15 Rafael Espindola <espindola@google.com>
9984
9985 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9986
68ed838c
ILT
99872010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9988
9989 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9990 (struct iovec): Correct !HAVE_READV definition.
9991
f3a2388f
CC
99922010-06-10 Cary Coutant <ccoutant@google.com>
9993
9994 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9995 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9996 reloc sections.
9997 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9998
9999 PR 11683
10000 * symtab.h (Symbol::is_placeholder): New member function.
10001 * target-reloc.h (relocate_section): Check for placeholder symbols.
10002
10003 * testsuite/Makefile.am (plugin_test_8): New test.
10004 (plugin_test_9): New test.
10005 * testsuite/Makefile.in: Regenerate.
10006
e1df38aa
NC
100072010-06-09 Nick Clifton <nickc@redhat.com>
10008
10009 * yyscript.y (input_list_element): Allow strings prefixed with
10010 the '-' character. Treat these as libraries.
10011 * script.cc (script_add_library): New function. Adds a library
10012 specified by "-l<name>" found in an input script.
10013 * script-c.h: Add prototype for script_add_library.
10014
25bbe950
DK
100152010-06-07 Doug Kwan <dougkwan@google.com>
10016
10017 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10018 Restrict stub-group size to be within long conditional branch
10019 range when working around cortex-A8 erratum.
10020
0f32ea4c
ILT
100212010-06-07 Damien Diederen <dd@crosstwine.com>
10022
10023 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10024 #ifdef typo.
10025
8fe2a369
ST
100262010-06-03 Sriraman Tallam <tmsriram@google.com>
10027
10028 PR gold/11658
10029 * output.cc
10030 (Output_section::Input_section_sort_entry::compare_section_ordering):
10031 Change to return non-zero correctly.
10032 (Output_section::Input_section_sort_section_order_index_compare
10033 ::operator()): Change to fix ambiguity in comparisons.
10034
6e9ba2ca
ST
100352010-06-01 Sriraman Tallam <tmsriram@google.com>
10036
10037 * gold.h (is_wildcard_string): New function.
10038 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10039 (Layout::layout_eh_frame): Ditto.
10040 (Layout::find_section_order_index): New method.
10041 (Layout::read_layout_from_file): New method.
10042 * layout.h (Layout::find_section_order_index): New method.
10043 (Layout::read_layout_from_file): New method.
10044 (Layout::input_section_position_): New private member.
10045 (Layout::input_section_glob_): New private member.
10046 * main.cc (main): Call read_layout_from_file here.
10047 * options.h (--section-ordering-file): New option.
10048 * output.cc (Output_section::input_section_order_specified_): New
10049 member.
10050 (Output_section::Output_section): Initialize new member.
10051 (Output_section::add_input_section): Add new parameter.
10052 Keep input sections when --section-ordering-file is used.
10053 (Output_section::set_final_data_size): Sort input sections when
10054 section ordering file is specified.
10055 (Output_section::Input_section_sort_entry): Add new parameter.
10056 Check sorting type.
10057 (Output_section::Input_section_sort_entry::compare_section_ordering):
10058 New method.
10059 (Output_section::Input_section_sort_compare::operator()): Change to
10060 consider section_order_index.
10061 (Output_section::Input_section_sort_init_fini_compare::operator()):
10062 Change to consider section_order_index.
10063 (Output_section::Input_section_sort_section_order_index_compare
10064 ::operator()): New method.
10065 (Output_section::sort_attached_input_sections): Change to sort
10066 according to section order when specified.
e1df38aa
NC
10067 (Output_section::add_input_section<32, true>): Add new parameter.
10068 (Output_section::add_input_section<64, true>): Add new parameter.
10069 (Output_section::add_input_section<32, false>): Add new parameter.
10070 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10071 * output.h (Output_section::add_input_section): Add new parameter.
10072 (Output_section::input_section_order_specified): New
10073 method.
10074 (Output_section::set_input_section_order_specified): New method.
10075 (Input_section::Input_section): Initialize section_order_index_.
10076 (Input_section::section_order_index): New method.
10077 (Input_section::set_section_order_index): New method.
10078 (Input_section::section_order_index_): New member.
10079 (Input_section::Input_section_sort_section_order_index_compare): New
10080 struct.
10081 (Output_section::input_section_order_specified_): New member.
10082 * script-sections.cc (is_wildcard_string): Delete and move modified
10083 method to gold.h.
10084 (Output_section_element_input::Output_section_element_input): Modify
10085 call to is_wildcard_string.
10086 (Output_section_element_input::Input_section_pattern
10087 ::Input_section_pattern): Ditto.
10088 (Output_section_element_input::Output_section_element_input): Ditto.
10089 * testsuite/Makefile.am (final_layout): New test case.
10090 * testsuite/Makefile.in: Regenerate.
10091 * testsuite/final_layout.cc: New file.
10092 * testsuite/final_layout.sh: New file.
10093
3537c84b
RÁE
100942010-06-01 Rafael Espindola <espindola@google.com>
10095
10096 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10097
105b6afd
RÁE
100982010-06-01 Rafael Espindola <espindola@google.com>
10099
10100 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10101 visibility of symbols.
10102
29e11421
DK
101032010-05-27 Doug Kwan <dougkwan@google.com>
10104
10105 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10106 from start of output section instead of address for a local symbol
10107 in a merged or relaxed section when doing a relocatable link.
10108
5e0f337e
RÁE
101092010-05-26 Rafael Espindola <espindola@google.com>
10110
703d02da 10111 PR 11604
5e0f337e
RÁE
10112 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10113 adding sections the garbage collector removed.
10114 * gold/testsuite/Makefile.am: Add test.
10115 * gold/testsuite/Makefile.in: Regenerate.
10116 * gold/testsuite/plugin_test_7.sh: New.
10117 * gold/testsuite/plugin_test_7_1.c: New.
10118 * gold/testsuite/plugin_test_7_2.c: New.
10119
f4187277
RÁE
101202010-05-26 Rafael Espindola <espindola@google.com>
10121
10122 * script-sections.cc (Output_section_definition::set_section_addresses):
10123 Check for --section-start.
10124
5c388529
DK
101252010-05-26 Doug Kwan <dougkwan@google.com>
10126
10127 * arm.cc (Arm_scan_relocatable_relocs): New class.
10128 (Target_arm::relocate_special_relocatable): New method.
10129 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10130 (Arm_relocate_functions::thumb_branch_common): Same.
10131 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10132 instead of Default_scan_relocatable_relocs.
10133 * target-reloc.h (relocate_for_relocatable): Let target handle
10134 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10135 * target.h (Sized_target::relocate_special_relocatable): New method.
10136
bca1c3ae
ILT
101372010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10138
10139 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10140
0439c796
DK
101412010-05-23 Doug Kwan <dougkwan@google.com>
10142
10143 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10144 instead of a cast.
10145 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10146 with a direct branch, not a conditional branch, to a stub.
10147 * merge.cc (Output_merge_base::record_input_section): New method
10148 defintion.
10149 (Output_merge_data::do_add_input_section): Record input section if
10150 keeps-input-sections flag is set.
10151 (Output_merge_string::do_add_input_section): Ditto.
10152 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10153 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10154 INPUT_SECTIONS_.
10155 (Output_merge_base::keeps_input_sections,
10156 Output_merge_base::set_keeps_input_sections,
10157 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10158 method definitions.
10159 (Output_merge_base::Input_sections): New type declaration.
10160 (Output_merge_base::input_sections_begin,
10161 Output_merge_base::input_sections_end,
10162 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10163 (Output_merge_base::bool keeps_input_sections_,
10164 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10165 Output_merge_base::input_sections_): New data members.
10166 (Output_merge_data::do_set_keeps_input_sections): New method
10167 defintion.
10168 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10169 * output.cc (Output_section::Input_section::relobj): Move method
10170 defintion from class declaration to here and handle merge sections.
10171 (Output_section::Input_section::shndx): Ditto.
10172 (Output_section::Output_section): Remove initializations of removed
10173 data members and initialize new data member LOOKUP_MAPS_.
10174 (Output_section::add_input_section): Set keeps-input-sections flag
10175 for a newly created merge output section as appropriate. Adjust code
10176 to use Output_section_lookup_maps class.
10177 (Output_section::add_relaxed_input_section): Adjst code for lookup
10178 maps code refactoring.
2e702c99 10179 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10180 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10181 class. If adding input section to a newly created merge output
10182 section fails, remove the new merge section.
10183 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10184 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10185 (Output_section::find_merge_section): Ditto.
0439c796 10186 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10187 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10188 Output_section_lookup_maps class.
10189 (Output_section::get_input_sections): Export merge sections. Adjust
10190 code to use Output_section_lookup_maps class.
10191 (Output_section:::add_script_input_section): Adjust code to use
10192 Output_section_lookup_maps class. Update lookup maps for merge
10193 sections also.
10194 (Output_section::discard_states): Use Output_section_lookup_maps.
10195 (Output_section::restore_states): Same.
10196 * output.h (Merge_section_properties): Move class defintion out of
10197 Output_section.
10198 (Output_section_lookup_maps): New class.
10199 (Output_section::Input_section::is_merge_section): New method
10200 defintion.
10201 (Output_section::Input_section::relobj): Move defintion out of class
10202 defintion. Declare method only.
10203 (Output_section::Input_section::shndx): Ditto.
10204 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10205 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10206 (Output_section::Merge_section_by_properties_map,
10207 Output_section::Output_section_data_by_input_section_map,
10208 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10209 Remove types.
2e702c99 10210 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10211 KEEPS_INPUT_SECTIONS.
10212 (Output_section::build_lookup_maps): New method declaration.
10213 (Output_section::merge_section_map_,
10214 Output_section::merge_section_by_properties_map_,
10215 Output_section::relaxed_input_section_map_,
10216 Output_section::is_relaxed_input_section_map_valid_): Remove data
10217 members.
10218 (Output_section::lookup_maps_): New data member.
10219
76295588
L
102202010-05-21 Doug Kwan <dougkwan@google.com>
10221
10222 PR gold/11619
10223 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10224 avoid a compilation error.
10225
d103a984
RÁE
102262010-05-19 Rafael Espindola <espindola@google.com>
10227
10228 * script-sections.cc (Output_section_definition::allocate_to_segment):
10229 Update the phdrs_list even when the output section is NULL.
10230 * testsuite/Makefile.am: Add test.
10231 * testsuite/Makefile.in: Regenerate.
10232 * testsuite/script_test_9.cc: New.
10233 * testsuite/script_test_9.sh: New.
10234 * testsuite/script_test_9.t: New.
10235
6625d24e
DK
102362010-05-19 Doug Kwan <dougkwan@google.com>
10237
10238 * arm.cc (Arm_input_section::original_size): New method.
10239 (Arm_input_section::do_addralign): Add a cast.
10240 (Arm_input_section::do_output_offset): Remove static cast.
10241 (Arm_input_section::original_addralign,
10242 Arm_input_section::original_size_): Change type to uint32_t.
10243 (Arm_input_section::init): Add safe casts for section alignment
10244 and size.
10245 (Arm_input_section::set_final_data_size): Do not set address and
10246 offset of stub table.
10247 (Arm_output_section::fix_exidx_coverage): Change use of of
10248 Output_section::Simple_input_section to that of
10249 Output_section::Input_section.
10250 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10251 except for the first pass.
10252 * output.cc (Output_section::get_input_sections): Change type of
10253 input_sections to std::list<Input_section>.
10254 (Output_section::add_script_input_section): Rename from
10255 Output_section::add_simple_input_section. Change type of SIS
10256 parameter from Simple_input_section to Input_section.
10257 * output.h (Output_section::Simple_input_section): Remove class.
10258 (Output_section::Input_section): Change class visibility to public.
10259 (Output_section::Input_section::addralign): Use stored alignments
10260 for special input sections if set.
10261 (Output_section::Input_section::set_addralign): New method.
10262 (Output_section::get_input_sections): Change parameter type from
10263 list of Simple_input_section to list of Input_section.
10264 (Output_section::add_script_input_section): Rename from
10265 Output_section::add_simple_input_section. Change first parameter's
10266 type from Simple_input_section to Input_section and remove the
10267 second and third parameters.
10268 * script-sections.cc (Input_section::Input_section_list): Change
10269 type to list of Output_section::Input_section/
10270 (Input_section_info::Input_section_info): Change parameter type of
10271 INPUT_SECTION to Output_section::Input_section.
10272 (Input_section_info::input_section): Change return type.
10273 (Input_section_info::input_section_): Change type to
10274 Output_section::Input_section.
10275 (Output_section_element_input::set_section_addresses): Adjust code
10276 to use Output_section::Input_section instead of
10277 Output_section::Simple_input_section. Adjust code for renaming
10278 of Output_section::add_simple_input_section.
10279 (Orphan_output_section::set_section_addresses): Ditto.
10280
e1e82ea4
RW
102812010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10282
10283 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10284 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10285
91e75c8a
RÁE
102862010-05-18 Rafael Espindola <espindola@google.com>
10287
10288 * options.cc (General_options::finalize): Handle -nostdlib.
10289 * options.h (nostdlib): New option.
10290 * script.cc (script_add_search_dir): Handle -nostdlib.
10291
da59ad79
DK
102922010-05-12 Doug Kwan <dougkwan@google.com>
10293
10294 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10295 attributes section only if there no attributes section after merging.
10296 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10297 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10298 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10299 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10300 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10301 and arm_attr_merge_7.stdout.
10302 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10303 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10304 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10305 arm_attr_merge_7b.o): New rules.
10306 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10307 arm_attr_merge_7
10308 * testsuite/Makefile.in: Regenerate.
10309 * testsuite/arm_attr_merge.sh: New file.
10310 * testsuite/arm_attr_merge_[67][ab].s: Same.
10311
3e01a7fd
NC
103122010-05-05 Nick Clifton <nickc@redhat.com>
10313
10314 * po/es.po: Updated Spanish translation.
10315
7ad2014a
L
103162010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10317
10318 * Makefile.am (install-exec-local): Properly install gold as
10319 default cross linker.
10320 * Makefile.in: Regenerated.
10321
4fda8867
NC
103222010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10323 Nick Clifton <nickc@redhat.com>
10324
10325 * configure.ac (install_as_default): Define and set to false
10326 unless --enable-gold or --enable-gold=both/gold has been
10327 specified.
10328 * configure: Regenerate.
10329
10330 * Makefile.am (install-exec-local): Install the executable as
10331 'ld.gold'. If install_as_default is true then also install it as
10332 'ld'.
10333 * Makefile.in: Regenerated.
10334
bd288ea2
ILT
103352010-04-24 Ian Lance Taylor <iant@google.com>
10336
10337 * layout.cc (Layout::layout_reloc): In relocatable link don't
10338 combine reloc sections for grouped sections.
10339
ef38fd8a
ST
103402010-04-23 Sriraman Tallam <tmsriram@google.com>
10341
10342 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10343 sections that are not ordinary to icf.
10344 * icf.cc (get_section_contents): Handle relocation pointing to section
10345 with no object or shndx information.
10346 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10347 * testsuite/Makefile.in: Regenerate.
10348 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10349 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10350
f6973bdc
ILT
103512010-04-22 Ian Lance Taylor <iant@google.com>
10352
10353 * expression.cc (Expression::Expression_eval_info): Add
10354 result_alignment_pointer field.
10355 (Expression::eval_with_dot): Add result_alignment_pointer
10356 parameter. Change all callers.
10357 (Expression::eval_maybe_dot): Likewise.
10358 (class Binary_expression): Add alignment_pointer parameter to
10359 left_value and right_value. Change all callers.
10360 (BINARY_EXPRESSION): Set result alignment.
10361 (class Trinary_expression): Add alignment_pointer parameter to
10362 arg2_value and arg3_value. Change all callers.
10363 (Trinary_cond::value): Set result alignment.
10364 (Max_expression::value, Min_expression::value): Likewise.
10365 (Align_expression::value): Likewise.
10366 * script-sections.cc (class Sections_element): Add dot_alignment
10367 parameter to set_section_addresses virtual function. Update
10368 instantiations.
10369 (class Output_section_element): Likewise.
10370 (Script_sections::create_segments): Add dot_alignment parameter.
10371 Change all callers.
10372 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10373 (Script_sections::set_phdrs_clause_addresses): Likewise.
10374 * script-sections.h: Update declarations.
10375 * script.h: Update declarations.
10376 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10377 min_p_align.
10378 * testsuite/script_test_3.t: Set large alignment.
10379 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10380 segment has expected alignment.
10381
9c9c98a5
NC
103822010-04-22 Nick Clifton <nickc@redhat.com>
10383
10384 * po/gold.pot: Updated by the Translation project.
10385 * po/vi.po: Updated Vietnamese translation.
10386
2253bfba
L
103872010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10388
10389 * testsuite/Makefile.am (check_PROGRAMS): Add
10390 icf_virtual_function_folding_test.
10391 * testsuite/Makefile.in: Regenerated.
10392
85fdf906
AH
103932010-04-15 Andrew Haley <aph@redhat.com>
10394
10395 * options.h (merge_exidx_entries): New option.
10396 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10397 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10398 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10399 (Target_arm::merge_exidx_entries): New function.
10400 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10401 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10402 to Arm_exidx_fixup constructor.
10403 Add new arg, merge_exidx_entries.
10404 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10405 Arm_output_section::fix_exidx_coverage.
10406
ce97fa81
ST
104072010-04-18 Sriraman Tallam <tmsriram@google.com>
10408
10409 * icf.cc (get_section_contents): Check for preemptible functions.
10410 Ignore addend when appropriate.
10411 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10412 section folded.
10413 (add_from_relobj): Check for section folded.
10414 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10415 * symtab.h (should_add_dynsym_entry): Add new parameter.
10416 * target-reloc.h (scan_relocs): Check for section folded.
10417 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10418 Check reloc types for function pointers in shared objects.
10419 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10420 case.
10421 (icf_preemptible_functions_test): New test case.
10422 (icf_string_merge_test): New test case.
10423 * testsuite.Makefile.in: Regenerate.
10424 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10425 bar_glob. Refactor code.
10426 * testsuite/icf_preemptible_functions_test.cc: New file.
10427 * testsuite/icf_preemptible_functions_test.sh: New file.
10428 * testsuite/icf_string_merge_test.cc: New file.
10429 * testsuite/icf_string_merge_test.sh: New file.
10430 * testsuite/icf_virtual_function_folding_test.cc: New file.
10431 * testsuite/icf_virtual_function_folding_test.sh: New file.
10432
04ceb17c
DK
104332010-04-14 Doug Kwan <dougkwan@google.com>
10434
10435 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10436 for local symbol recounting if we remove a section due to ICF.
10437 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10438 there are no regular objects in input.
10439
153e7da4
DK
104402010-04-13 Doug Kwan <dougkwan@google.com>
10441
10442 * arm.cc (Arm_input_section::set_final_data_size): Compute
10443 accurate final data size instead of using current data size.
10444
4dbd9faf
DK
104452010-04-09 Doug Kwan <dougkwan@google.com>
10446
10447 * layout.cc (Layout::choose_output_section): Handle script section
10448 types.
10449 (Layout::make_output_section_for_script): Add section type parameter.
10450 Handle script section types.
10451 * layout.h (Layout::make_output_section_for_script): Add section
10452 type parameter.
10453 * output.cc (Output_section::Output_section): Initialize data member
10454 is_noload_.
10455 (Output_section::do_reset_address_and_file_offset): Do not set address
10456 to 0 if section is a NOLOAD section.
10457 * output.h (Output_section::is_noload): New method.
10458 (Output_section::set_is_noload): Ditto.
10459 (Output_section::is_noload_): New data member.
10460 * script-c.h (Script_section_type): New enum type.
10461 (struct Parser_output_section_header): Add new file section_type.
10462 * script-sections.cc (Sections_element::output_section_name): Add
10463 parameter for returning script section type.
10464 (Output_section_definition::output_section_name): Ditto.
10465 (Output_section_definition::section_type)P; New method.
10466 (Output_section_definiton::script_section_type_name): Ditto.
10467 (Output_section_definition::script_section_type_): New data member.
10468 (Output_section_definition::Output_section_definition): Initialize
10469 data member Output_section_definition::script_section_type_.
10470 (Output_section_definition::create_sections): Pass script section type
10471 to Layout::make_output_section_for_script.
10472 (Output_section_definition::output_section_name): Return script
10473 section type to caller.
10474 (Output_section_definition::set_section_address): Do not advance
10475 dot value and load address if section type is NOLOAD. Set address
10476 of NOLOAD sections regardless of section flags.
10477 (Output_section_definition::print): Print section type if it is
10478 not SCRIPT_SECTION_TYPE_NONE.
10479 (Output_section_definition::section_type): New method.
10480 (Output_section_definition::script_section_type_name): Ditto.
10481 (Script_sections::output_section_name): Add new parameter
10482 PSECTION_TYPE for returning script section type. Pass it to
10483 section elements. Handle discard sections.
10484 (Sort_output_sections::operator()): Handle NOLOAD sections.
10485 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10486 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10487 returning script section type.
10488 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10489 INFO and NOLOAD.
10490 * yyscript.y (union): Add new field SECTION_TYPE.
10491 (COPY, DSECT, INFO, NOLOAD): New tokens.
10492 (opt_address_and_section_type): Change type to output_section_header.
10493 (section_type): New non-terminal
10494 (section_header): Handle section type.
2253bfba 10495 (opt_address_and_section_type): Return section type value.
4dbd9faf 10496
721ea635
L
104972010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10498
10499 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10500 * testsuite/plugin_common_test_2.c (foo): Likewise.
10501
6bf924b0
DK
105022010-04-08 Doug Kwan <dougkwan@google.com>
10503
10504 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10505 Output_merge_data.
10506 * output.cc (Output_section::add_merge_input_section): Simplify
10507 code and return status of Output_merge_base::add_input_section.
e1df38aa 10508 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10509 returns true.
10510
24af6f92
DK
105112010-04-07 Doug Kwan <dougkwan@google.com>
10512
10513 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10514 if section is marked as containing instructions but has no mapping
10515 symbols.
10516 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10517 correct section index.
10518 (Arm_relobj::find_linked_text_section): Ditto.
10519
00698fc5
CC
105202010-04-07 Cary Coutant <ccoutant@google.com>
10521
10522 * archive.cc (include_member): Destroy Read_symbols_data object before
10523 releasing file.
10524 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10525 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10526 (Read_symbols_data::~Read_symbols_data) New destructor.
10527 (Section_relocs::Section_relocs) New constructor.
10528 (Section_relocs::~Section_relocs) New destructor.
10529 (Read_relocs_data::Read_relocs_data) New constructor.
10530 (Read_relocs_data::~Read_relocs_data) New destructor.
10531 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10532 pointers to NULL after deleting.
10533
7296d933
DK
105342010-04-07 Doug Kwan <dougkwan@google.com>
10535
10536 * arm.cc: Replace "endianity" with "endianness" in comments.
10537 (Arm_exidx_cantunwind): Ditto.
10538 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10539 (Arm_relobj::merge_flags_and_attributes): New method.
10540 (Arm_relobj::merge_flags_and_attributes_): New data member.
10541 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10542 (Arm_relobj::scan_sections_for_stubs): Ditto.
10543 (Arm_relobj::do_read_symbols): Check to see if we really want to
10544 merge processor-specific flags and attributes. Exit early if
10545 an object is empty except for section names and the undefined symbol.
10546 (Target_arm::do_finalize_sections): Move check for ELF format to
10547 Arm_relobj::do_read_symbols. Merge processor specific flags and
10548 attributes from a regular object only when we have determined that
10549 it is aapropriate. Do not create an .ARM.attributes section in
10550 output if there is no regular input object.
10551 (Target_arm::merge_processor_specific_flags): Check
10552 --warn-mismatch before printing any error.
10553 (Target_arm::merge_object_attributes): Ditto.
10554 * gold.cc (queue_middle_tasks): Handle the case in which there is
10555 no regular object in input.
10556 * options.cc (General_options::parse_EB): New method.
10557 (General_options::parse_EL): Same.
10558 (General_options::General_options): Initialize endianness_.
10559 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10560 New options.
10561 (General_options::Endianness): New enum.
10562 (General_options::endianness): New method.
10563 (General_options::endianness_): New data member.
10564 * parameters.cc (Parameters::set_options): Check target endianness.
10565 (Parameters::set_target_once): Ditto.
10566 (Parameters::check_target_endianness): New method.
10567 (parameters_force_valid_target): If either -EL or -EB is specified,
10568 use it to define endianness of default target.
10569 * parameters.h (Parameters::check_target_endianness): New method
10570 declaration.
10571 * target.h (class Target): Change "endianity" to "endianness"
10572 in comments.
10573
efc8d4f2
RW
105742010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10575
10576 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10577 * configure: Regenerate.
10578 * Makefile.in: Regenerate.
10579 * testsuite/Makefile.in: Regenerate.
10580
be234d88
CC
105812010-04-06 Cary Coutant <ccoutant@google.com>
10582
10583 gcc PR lto/42757
10584 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10585 prevailing definitions of common symbols.
10586 * testsuite/plugin_test_6.sh: New test case.
10587 * testsuite/plugin_common_test_1.c: New test case.
10588 * testsuite/plugin_common_test_2.c: New test case.
10589 * testsuite/Makefile.am (plugin_test_6): New test case.
10590 * testsuite/Makefile.in: Regenerate.
10591
bd32c6bd
NC
105922010-04-06 Nick Clifton <nickc@redhat.com>
10593
10594 * po/vi.po: New Vietnamese translation.
10595
323c532f
DK
105962010-03-30 Doug Kwan <dougkwan@google.com>
10597
10598 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10599
4fcd97eb
DK
106002010-03-25 Doug Kwan <dougkwan@google.com>
10601
10602 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10603 to avoid a conversion warning on a 32-bit host.
10604
4ebf39db
ILT
106052010-03-24 Ian Lance Taylor <iant@google.com>
10606
10607 * testsuite/script_test_3.t: Add a TLS segment.
10608 * testsuite/Makefile.am (check_PROGRAMS): Add
10609 tls_phdrs_script_test.
10610 (tls_phdrs_script_test_SOURCES): Define.
10611 (tls_phdrs_script_test_DEPENDENCIES): Define.
10612 (tls_phdrs_script_test_LDFLAGS): Define.
10613 (tls_phdrs_script_test_LDADD): Define.
10614 * testsuite/Makefile.in: Rebuild.
10615
4a599bdd
CC
106162010-03-23 Cary Coutant <ccoutant@google.com>
10617
10618 * fileread.cc (find_or_make_view): Fix comment.
10619
6c93b22c
ILT
106202010-03-23 Ian Lance Taylor <iant@google.com>
10621
10622 * script-sections.cc (class Orphan_section_placement): Define
10623 PLACE_TLS and PLACE_TLS_BSS.
10624 (Orphan_section_placement::Orphan_section_placement): Initialize
10625 new places.
10626 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10627 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10628 (tls_script_test_SOURCES): Define.
10629 (tls_script_test_DEPENDENCIES): Define.
10630 (tls_script_test_LDFLAGS): Define.
10631 (tls_script_test_LDADD): Define.
10632 * testsuite/Makefile.in: Rebuild.
10633
a2c7281b
DK
106342010-03-22 Doug Kwan <dougkwan@google.com>
10635
10636 * arm.cc (Arm_relocate_functions::abs8,
10637 Arm_relocate_functions::abs16): Use correct check for overflow
10638 specified in the ARM ELF specs.
10639 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10640 target of a BLX instruction specially.
10641 (Reloc_stub::stub_type_for_reloc): Ditto.
10642 (Relocate::relocate): Use symbolic names instead of numeric relocation
10643 codes to report error.
10644 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10645 workaround.
10646 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10647 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10648 thumb2_blx_out_of_range.stdout
10649 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10650 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10651 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10652 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10653 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10654 thumb2_blx_in_range, thumb2_blx_in_range.o,
10655 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10656 thumb2_blx_out_of_range.o): New rules.
2e702c99 10657 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10658 thumb2_blx_in_range and thumb2_blx_out_of_range.
10659 * testsuite/Makefile.in: Regenerate.
10660 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10661 * testsuite/thumb_blx_in_range.s: New file.
10662 * testsuite/thumb_blx_out_of_range.s: New file.
10663
b0193076
RÁE
106642010-03-22 Rafael Espindola <espindola@google.com>
10665
10666 * archive.cc (Should_include): Move to archive.h.
10667 (should_include_member): Make it a member of Archive.
10668 (Lib_group): New.
10669 (Add_lib_group_symbols): New.
10670 * archive.h: Include options.h.
10671 (Archive_member): Moved from Archive.
10672 (Should_include): Moved from archive.cc.
10673 (Lib_group): New.
10674 (Add_lib_group_symbols): New.
10675 * dynobj.cc (do_should_include_member): New.
10676 * dynobj.h (do_should_include_member): New.
10677 * gold.cc (queue_initial_tasks): Update call to queue.
10678 * main.cc (main): Print lib group stats.
10679 * object.cc (do_should_include_member): New.
10680 * object.h: Include archive.h.
10681 (Object::should_include_member): New.
10682 (Object::do_should_include_member): New.
10683 (Sized_relobj::do_should_include_member): New.
10684 * options.cc (General_options::parse_start_lib): New.
10685 (General_options::parse_end_lib): New.
10686 (Input_arguments::add_file): Handle lib groups.
10687 (Input_arguments::start_group): Check we are not in a lib.
10688 (Input_arguments::start_lib): New.
10689 (Input_arguments::end_lib): New.
10690 * options.h (General_options): Add start_lib and end_lib.
10691 (Input_argument::lib_): New.
10692 (Input_argument::lib): New.
10693 (Input_argument::is_lib): New.
10694 (Input_file_lib): New.
10695 (Input_arguments::in_lib_): New.
10696 (Input_arguments::in_lib): New.
10697 (Input_arguments::start_lib): New.
10698 (Input_arguments::end_lib_): New.
10699 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10700 in unused members as preempted.
10701 (Sized_pluginobj::do_should_include_member): New.
10702 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10703 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10704 return the blocker.
10705 (Read_symbols::do_whole_lib_group): New.
10706 (Read_symbols::do_lib_group): New.
10707 (Read_symbols::do_read_symbols): Handle lib groups.
10708 (Read_symbols::get_name): Handle lib groups.
10709 * readsyms.h (Read_symbols): Add an archive member pointer.
10710 (Read_symbols::do_whole_lib_group): New.
10711 (Read_symbols::do_lib_group): New.
10712 (Read_symbols::member_): New.
10713 * script.cc (read_input_script): Update call to queue_soon.
10714
d099120c
DK
107152010-03-19 Doug Kwan <dougkwan@google.com>
10716
10717 * arm.cc (Stub_table::Stub_table): Initialize new data members
10718 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10719 (Stub_table::add_reloc_stub): Assign stub offset and update
10720 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10721 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10722 New data members.
2e702c99 10723 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10724 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10725 instead of going over all reloc stubs.
2e702c99 10726 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10727 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10728 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10729 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10730 Stringpool_template::offset_.
10731 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10732 Stringpool_template::offset_ to zero.
10733
1aa37384
DK
107342010-03-15 Doug Kwan <dougkwan@google.com>
10735
10736 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10737 offset_.
10738 (Stringpool_template::new_key_offset): New method.
10739 (Stringpool_template::add_string): Assign offsets when adding new
10740 strings.
10741 (Stringpool_template::set_string_offsets): Do not set string offsets
10742 when not optimizing.
10743 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10744 member size_.
2e702c99
RM
10745 (Chunked_vector::clear): Clear size_.
10746 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10747 (Chunked_vector::size): Return size_.
10748 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10749 (Chunked_vector::size_): New data member.
1aa37384
DK
10750 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10751 (Stringpool_template::new_key_offset): New method declaration.
10752 (Stringpool_template::offset_): New data member.
10753
b672b057
RÁE
107542010-03-15 Rafael Espindola <espindola@google.com>
10755
10756 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10757 Add_symbols' constructor.
10758 * readsyms.h (Add_symbols): Remove the input_group member.
10759
b6848d3c
ILT
107602010-03-10 Ian Lance Taylor <iant@google.com>
10761
10762 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10763 target to ask whether a reference to a symbol requires a stack
10764 split.
10765 * target.h (Target::is_call_to_non_split): New function.
10766 (Target::do_is_call_to_non_split): Declare virtual function.
10767 * target.cc: Include "symtab.h".
10768 (Target::do_is_call_to_non_split): New function.
10769 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10770
a2a5469e
CC
107712010-03-10 Cary Coutant <ccoutant@google.com>
10772
10773 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10774 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10775 (File_read::open[2]): Add whole_file_view_ to list of views.
10776 (File_read::make_view): Remove test of whole_file_view_.
10777 (File_read::find_or_make_view): Create whole_file_view_ if
10778 necessary.
10779 (File_read::clear_views): Replace bool parameter with enum;
10780 adjust all callers. Don't delete views with permanent data;
10781 do delete cached views and views from archives if
10782 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10783 if clearing the corresponding view.
10784 * fileread.h (File_read::Clear_views_mode): New enum.
10785 (File_read::View::is_permanent_view): New method.
10786 (File_read::clear_views): Replace bool parameter
10787 with enum; adjust all callers.
10788 * options.h (General_options): Change keep_files_mapped option;
10789 add map_whole_files.
10790 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10791 releasing the file.
10792 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10793 the file.
10794
8861f32b
DM
107952010-03-10 David S. Miller <davem@davemloft.net>
10796
10797 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10798
d62d0f5f
ST
107992010-03-09 Sriraman Tallam <tmsriram@google.com>
10800
10801 * icf.cc (get_section_contents): Add '@' marker after processing the
10802 merge reloc.
10803
9177756d
DK
108042010-03-08 Doug Kwan <dougkwan@google.com>
10805
10806 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10807 due to a conversion warning.
10808 (Arm_relobj::update_output_local_symbol_count): Check for local
10809 symbol with unset output index.
10810
9e9e071b
ILT
108112010-03-05 Ian Lance Taylor <iant@google.com>
10812
10813 * options.h (class General_options): Add --spare-dynamic-tags.
10814 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10815 --spare-dynamic-tags.
10816
a81ee015
ILT
108172010-03-05 Ian Lance Taylor <iant@google.com>
10818
10819 * incremental.cc: Include "libiberty.h".
10820
44ec90b9
RO
108212010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10822
10823 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10824 function, is_info_ member.
10825 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10826 (Versions::Versions): Update caller.
10827 (Versions::define_base_version): Likewise.
10828 (Versions::add_def): Likewise.
10829
0897ed3b
ST
108302010-03-03 Sriraman Tallam <tmsriram@google.com>
10831
10832 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10833 (Scan::possible_function_pointer_reloc): New function.
10834 (Scan::local_reloc_may_be_function_pointer): Change to call
10835 possible_function_pointer_reloc.
10836 (Scan::global_reloc_may_be_function_pointer): Ditto.
10837 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10838 relocations in ".data.rel.ro._ZTV" section.
10839 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10840 * testsuite/icf_safe_so_test.cc: Ditto.
10841 * testsuite/icf_safe_test.cc: Ditto.
10842 * testsuite/icf_safe_test.sh: Ditto.
10843
d3bbad62
ILT
108442010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10845 Ian Lance Taylor <iant@google.com>
10846
10847 * target-reloc.h (relocate_section): Check the symbol table index
10848 for -1U before setting the local symbol index.
10849 (scan_relocatable_relocs): If copying the relocation, record that
10850 the local symbol is required.
10851 * object.h (Symbol_value::is_output_symtab_index_set): New
10852 function.
10853 (Symbol_value::may_be_discarded_from_output_symtab): New
10854 function.
10855 (Symbol_value::has_output_symtab_entry): New function.
10856 (Symbol_value::needs_output_symtab_entry): Remove.
10857 (Symbol_value::output_symtab_index): Make sure the symbol index is
10858 set.
10859 (Symbol_value::set_output_symtab_index): Make sure the symbol
10860 index is not set. Make sure the new index is valid.
10861 (Symbol_value::set_must_have_output_symtab_entry): New function.
10862 (Symbol_value::has_output_dynsym_entry): New function.
10863 (Symbol_value::set_output_dynsym_index): Make sure the new index
10864 is valid.
10865 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10866 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10867 local symbol if permitted.
10868 (Sized_relobj::do_finalize_local_symbols): Call
10869 is_output_symtab_index_set rather than needs_output_symtab_entry.
10870 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10871 rather than needs_output_symtab_entry. Call
10872 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10873 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10874 is_output_symtab_index_set rather than needs_output_symtab_entry.
10875 * testsuite/discard_locals_relocatable_test.c: New file.
10876 * testsuite/discard_locals_test.sh: Test -r.
10877 * testsuite/Makefile.am (check_DATA): Add
10878 discard_locals_relocatable_test1.syms,
10879 discard_local_relocatable_test2.syms.
10880 (MOSTLYCLEANFILES): Likewise. Also add
10881 discard_locals_relocatable_test1.lout and
10882 discard_locals_relocatable_test2.out.
10883 (discard_locals_relocatable_test1.syms): New target.
10884 (discard_locals_relocatable_test.o): New target.
10885 (discard_locals_relocatable_test1.out): New target.
10886 (discard_locals_relocatable_test2.syms): New target.
10887 (discard_locals_relocatable_test2.out): New target.
10888 (various): Add missing ../ld-new dependencies.
10889 * testsuite/Makefile.in: Rebuild.
10890
7e8ccf26
NC
108912010-03-03 Nick Clifton <nickc@redhat.com>
10892
10893 * po/fi.po: New Finnish translation.
10894
2a0ff005
DK
108952010-03-01 Doug Kwan <dougkwan@google.com>
10896
10897 * layout.cc (Layout::Layout): Force section types of .init_array*,
10898 .preinit_array* and .fini_array* sections.
10899 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10900 Fix check of return value of std::string::find.().
10901 (Output_section::Input_section_sort_compare::operator()): Remove
10902 comment about .init_array.
10903 (Output_section::Input_section_sort_init_fini_compare::operator()):
10904 New method.
10905 (Output_section::sort_attached_input_sections): Handle .init_array
10906 and .fini_array specially.
10907 * output.h (Output_section::Inut_section_sort_compare): Update
10908 comment.
10909 (Output_section::Input_section_sort_init_fini_compare): New struct.
10910
c3e4ae29
DK
109112010-02-26 Doug Kwan <dougkwan@google.com>
10912
10913 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10914 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10915 * testsuite/debug_msg.sh: Avoid matching source line number for
10916 use of global variable undef_int.
10917
2fd9ae7a
DK
109182010-02-26 Doug Kwan <dougkwan@google.com>
10919
10920 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10921 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10922 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10923 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10924 * options.cc (General_options::General_options): Initialize member
10925 fix_v4bx_.
10926 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10927 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10928 and rm_no_fix_v4bx.stdout
10929 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10930 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10931 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10932 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10933 and arm_no_fix_v4bx.
10934 * Makefile.in: Regenerate.
10935 * testsuite/arm_fix_v4bx.s: New file.
10936 * testsuite/arm_fix_v4bx.sh: Ditto.
10937
67ec7d0b
DK
109382010-02-24 Doug Kwan <dougkwan@google.com>
10939
10940 * arm.cc (Target_arm::got_section): Make the .got section the first
10941 non RELRO section in the data segment.
10942 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10943 suffixes of section names.
10944
10165461
DK
109452010-02-24 Doug Kwan <dougkwan@google.com>
10946
10947 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10948 flags and attributes merging if an input file is a binary file.
10949 * fileread.cc (Input_file::open): Record format of original file.
10950 * fileread.h (Input_file::Format): New enum type.
2e702c99 10951 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10952 (Input_file::format): New method definition.
10953 (Input_file::format_):: New data member.
10954
4a54abbb
DK
109552010-02-24 Doug Kwan <dougkwan@google.com>
10956
10957 * arm.cc (Arm_output_data_got): New class.
10958 (ARM_TCB_SIZE): New constant
10959 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10960 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10961 If user uses a script with a SECTIONS clause, issue only a warning
10962 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10963 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10964 garbage collection.
10965 (Target_arm::got_mode_index_entry): Handle static linking.
10966 (Target_arm::Scan::local): Ditto.
10967 (Target_arm::Scan::global): Ditto.
10968 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10969 all incorrectly implemented relocations.
e1df38aa 10970 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10971 Arm_output_section::fix_exidx_coverage.
10972 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10973 from ".ARM.exidx." and ".ARM.extab.".
10974
ca419a6f
ILT
109752010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10976
10977 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10978 section if it does not already exist.
10979 * attributes.cc (Attributes_section_data::Attributes_section_data):
10980 Don't crash if size is zero.
10981
135b9c78
ILT
109822010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10983 Ian Lance Taylor <iant@google.com>
10984
10985 * gold.cc (queue_middle_tasks): If no input files were opened,
10986 exit.
10987 * workqueue.h (Task_function::Task_function): Assert that there is
10988 a blocker.
10989
bb0bfe4f
DK
109902010-02-22 Doug Kwan <dougkwan@google.com>
10991
10992 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10993 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10994 types to avoid warnings due to different uint64_t implementations
10995 on different hosts.
10996
2a2b6d42
DK
109972010-02-21 Doug Kwan <dougkwan@google.com>
10998
10999 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11000 handling of the maximum backward branch offset.
2e702c99 11001 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11002 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11003 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11004 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11005 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11006 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11007 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11008 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11009 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11010 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11011 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11012 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11013 thumb2_bl_out_of_range.o): New rules.
11014 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11015 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11016 thumb2_bl_out_of_range
11017 * testsuite/Makefile.in: Regenerate.
11018 * testsuite/arm_bl_in_range.s: New file.
11019 * testsuite/arm_bl_out_of_range.s: Ditto.
11020 * testsuite/arm_branch_in_range.sh: Ditto.
11021 * testsuite/arm_branch_range.t: Ditto.
11022 * testsuite/thumb2_branch_range.t: Ditto.
11023 * testsuite/thumb_bl_in_range.s: Ditto.
11024 * testsuite/thumb_bl_out_of_range.s: Ditto.
11025 * testsuite/thumb_branch_range.t: Ditto.
11026
b487ad64
ST
110272010-02-20 Sriraman Tallam <tmsriram@google.com>
11028
11029 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11030 Add reloc offset information.
11031 * icf.cc (get_section_contents): Change iterators to point to the new
11032 vectors. Add reloc offset information to the contents.
11033 * icf.h (Icf::Sections_reachable_info): New typedef.
11034 (Icf::Sections_reachable_list): New typedef.
11035 (Icf::Offset_info): New typedef.
11036 (Icf::Reloc_info): New struct typedef.
11037 (Icf::Reloc_info_list): New typedef.
11038 (Icf::symbol_reloc_list): Delete method.
11039 (Icf::addend_reloc_list): Delete method.
11040 (Icf::section_reloc_list): Delete method.
11041 (Icf::reloc_info_list): New method.
11042 (Icf::reloc_info_list_): New member.
11043
f96accdf
DK
110442010-02-19 Doug Kwan <dougkwan@google.com>
11045
11046 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11047 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11048 * arm.cc (Arm_relocation_functions): New forward declaration.
11049 (Target_arm::Target_arm): Initialize new data members
11050 got_mod_index_offset_ and tls_base_symbol_defined_.
11051 (Target_arm::Relocate::relocate_tls): New method.
11052 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11053 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11054 New methods.
2e702c99 11055 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11056 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11057 (Target_arm::got_mod_index_offset_,
11058 Target_arm::tls_base_symbol_defined_): New data members.
11059 (Target_arm::Scan::local, Target::Scan::global,
11060 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11061 relocations.
11062
c8761b9a
DK
110632010-02-18 Doug Kwan <dougkwan@google.com>
11064
11065 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11066 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11067 text section as a parameter becuase some broken tools may not set
11068 the link in section header.
11069 (Target_arm::has_got_section): New method.
11070 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11071 without any mapping symbol as data only. Remove warning.
11072 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11073 link in its section header, try to discover the link by inspecting the
11074 REL31 relocation at the beginning of the section.
11075 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11076 in error message.
11077 (Target_arm::Scan::global): Treat any reference to the symbol
11078 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11079
21bb3914
ST
110802010-02-12 Sriraman Tallam <tmsriram@google.com>
11081
11082 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11083 (Scan::global_reloc_may_be_function_pointer): New function.
11084 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11085 (Scan::global_reloc_may_be_function_pointer): New function.
11086 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11087 (Scan::global_reloc_may_be_function_pointer): New function.
11088 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11089 (Scan::global_reloc_may_be_function_pointer): New function.
11090 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11091 (Scan::global_reloc_may_be_function_pointer): New function.
11092 (Scan::possible_function_pointer_reloc): New function.
11093 (Target_x86_64::can_check_for_function_pointers): New function.
11094 * gc.h (gc_process_relocs): Scan relocation types to determine if
11095 function pointers were taken for targets that support it.
11096 * icf.cc (Icf::find_identical_sections): Include functions for
11097 folding in safe ICF whose pointer is not taken.
11098 * icf.h (Secn_fptr_taken_set): New typedef.
11099 (fptr_section_id_): New member.
11100 (section_has_function_pointers): New function.
11101 (set_section_has_function_pointers): New function.
11102 (check_section_for_function_pointers): New function.
11103 * options.h: Fix comment for safe ICF option.
11104 * target.h (can_check_for_function_pointers): New function.
11105 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11106 Modify icf_safe_test for X86-64.
11107 * testsuite/Makefile.in: Regenerate.
11108 * testsuite/icf_safe_so_test.cc: New file.
11109 * testsuite/icf_safe_so_test.sh: New file.
11110 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11111 (main): Change to take pointer to function kept_func_3.
11112 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11113 folding is done correctly for X86-64.
11114
0da6fa6c
DM
111152010-02-12 David S. Miller <davem@davemloft.net>
11116
11117 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11118 is_symbolless parameter.
11119 (Output_reloc<SHT_REL>::is_symbolless): New.
11120 (Output_reloc<SHT_REL>::is_symbolless_): New.
11121 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11122 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11123 (Output_reloc<SHT_RELA>::is_symbolless): New.
11124 (Output_data_reloc::add_global): Handle is_symbolless.
11125 (Output_data_reloc::add_global_relative): Likewise.
11126 (Output_data_reloc::add_local): Likewise.
11127 (Output_data_reloc::add_local_relative): Likewise.
11128 (Output_data_reloc::add_symbolless_global_addend): New.
11129 (Output_data_reloc::add_symbolless_local_addend): New.
11130 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11131 is_symbolless.
11132 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11133 instead of ->is_relative_
11134 (Output_reloc::write): Likewise.
11135 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11136 (Output_reloc::write_rel): Simplify.
11137
11138 * sparc.cc (Target_sparc::Scan::local): Use
11139 ->add_symbolless_local_addend as needed.
11140 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11141 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11142 based upon relocation offset.
11143
e4782e83
DK
111442010-02-11 Doug Kwan <dougkwan@google.com>
11145
11146 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11147 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11148 beginning of function.
11149 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11150 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11151 parameter is_32bit in calls to should_apply_static_reloc.
11152 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11153 (check_DATA): Add arm_abs_global.stdout.
11154 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11155 arm_abs_global.stdout): New rules.
11156 (MOSTLLYCLEANFILES): Add arm_abs_global
11157 * Makefile.in: Regenerate.
11158 * testsuite/arm_abs_global.s: New file.
11159 * testsuite/arm_abs_global.sh: Ditto.
11160 * testsuite/arm_abs_lib.s: Ditto.
11161
93ceb764
ILT
111622010-02-11 Ian Lance Taylor <iant@google.com>
11163
11164 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11165 Read_relocs task.
11166 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11167 Allocate_commons_task first.
11168 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11169 task, rather than symtab_lock_.
11170 (Gc_process_relocs::~Gc_process_relocs): New function.
11171 (Gc_process_relocs::is_runnable): Check this_blocker_.
11172 (Gc_process_relocs::locks): Use next_blocker_ rather than
11173 blocker_.
11174 (Scan_relocs::~Scan_relocs): New function.
11175 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11176 symtab_lock_.
11177 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11178 next_blocker_.
11179 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11180 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11181 constructor accordingly.
11182 (class Gc_process_relocs): Likewise.
11183 (class Scan_relocs): Likewise.
11184 * common.h (class Allocate_commons_task): Remove symtab_lock_
11185 field, and corresponding constructor parameter.
11186 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11187 symtab_lock_.
11188 (Allocate_commons_task::locks): Likewise.
11189
114dfbe1
ILT
111902010-02-11 Ian Lance Taylor <iant@google.com>
11191
11192 * gold-threads.h (class Once): Define.
11193 (class Initialize_lock): Rewrite as child of Once.
11194 * gold-threads.cc (class Once_initialize): Define.
11195 (once_pointer_control): New static variable.
11196 (once_pointer, once_arg): New static variables.
11197 (c_run_once): New static function.
11198 (Once::Once, Once::run_once, Once::internal_run): New functions.
11199 (class Initialize_lock_once): Remove.
11200 (initialize_lock_control): Remove.
11201 (initialize_lock_pointer): Remove.
11202 (initialize_lock_once): Remove.
11203 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11204 (Initialize_lock::initialize): Rewrite.
11205 (Initialize_lock::do_run_once): New function.
11206 * archive.cc (Archive::interpret_header): Only clear name if it is
11207 not already empty.
11208 * fileread.cc: Include "gold-threads.h"
11209 (file_counts_lock): New static variable.
11210 (file_counts_initialize_lock): Likewise.
11211 (File_read::release): Only increment counts when using --stats.
11212 Use a lock around the increment.
11213 * parameters.cc (class Set_parameters_target_once): Define.
11214 (set_parameters_target_once): New static variable.
11215 (Parameters::Parameters): Move here from parameters.h.
11216 (Parameters::set_target): Rewrite.
11217 (Parameters::set_target_once): New function.
11218 (Parameters::clear_target): Move here and rewrite.
11219 * parameters.h (class Parameters): Update declarations. Add
11220 set_parameters_target_once_ field.
11221 (Parameters::Parameters): Move to parameters.cc.
11222 (Parameters::clear_target): Likewise.
11223 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11224 task.
11225 (Start_group::~Start_group): New function.
11226 (Start_group::is_runnable): New function.
11227 (Start_group::locks, Start_group::run): New functions.
11228 (Finish_group::run): Change saw_undefined to size_t.
11229 * readsyms.h (class Start_group): Define.
11230 (class Finish_group): Change saw_undefined_ field to size_t.
11231 (Finish_group::Finish_group): Remove saw_undefined and
11232 this_blocker parameters. Change all callers.
11233 (Finish_group::set_saw_undefined): New function.
11234 (Finish_group::set_blocker): New function.
11235 * symtab.h (class Symbol_table): Change saw_undefined to return
11236 size_t. Change saw_undefined_ field to size_t.
11237 * target-select.cc (Set_target_once::do_run_once): New function.
11238 (Target_selector::Target_selector): Initialize set_target_once_
11239 field. Don't initialize lock_ and initialize_lock_ fields.
11240 (Target_selector::instantiate_target): Rewrite.
11241 (Target_selector::set_target): New function.
11242 * target-select.h (class Set_target_once): Define.
11243 (class Target_selector): Update declarations. Make
11244 Set_target_once a friend. Remove lock_ and initialize_lock_
11245 fields. Add set_target_once_ field.
11246
fa17a3f4
ILT
112472010-02-10 Ian Lance Taylor <iant@google.com>
11248
11249 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11250 queueing any tasks.
11251 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11252 (queue_middle_tasks): Add all blockers before queueing any tasks.
11253 (queue_final_tasks): Likewise.
11254 * token.h (Task_token::add_blockers): New function.
11255 * object.h (Input_objects::number_of_relobjs): New function.
11256
c7177d31
ILT
112572010-02-10 Ian Lance Taylor <iant@google.com>
11258
5de0e392
ILT
11259 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11260 shared, not if not position independent.
11261 * x86_64.cc (Relocate::relocate_tls): Likewise.
11262 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11263 (tls_pie_pic_test): New target.
11264 * testsuite/Makefile.in: Rebuild.
11265
c7177d31
ILT
11266 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11267 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11268 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11269 * testsuite/Makefile.in: Rebuild.
11270
684b268a
DM
112712010-02-09 David S. Miller <davem@davemloft.net>
11272
11273 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11274 R_SPARC_RELATIVE using ->add_local_relative().
11275 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11276
612a8d3d
DM
11277 * output.h (Output_data_dynamic::add_section_size): New method
11278 that takes two Output_data objects.
11279 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11280 entry param. Handle it in initializers.
11281 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11282 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11283 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11284 arg.
11285 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11286 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11287 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11288 for dynrel_includes_plt.
11289 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11290 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11291 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11292 before .rela.plt
11293 (Target_sparc::do_finalize_sections): Update to pass true for
11294 dynrel_includes_plt.
11295 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11296 output before .rela.plt
11297 (Target_powerpc::do_finalize_sections): Update to pass true for
11298 dynrel_includes_plt when 32-bit.
11299
cb1be87e
DK
113002010-02-08 Doug Kwan <dougkwan@google.com>
11301
11302 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11303 method.
11304 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11305 Arm_relobj::scan_section_for_cortex_a8_stubs,
11306 Arm_relobj::do_relocation_section): Instead of calling
11307 Output_section::output_address, use faster
11308 Arm_relobj::simple_input_section_output_address.
11309
705b5121
DM
113102010-02-08 David S. Miller <davem@davemloft.net>
11311
11312 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11313 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11314 relocation helper function.
11315
024c4466
DM
11316 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11317 just like R_SPARC_GOT{10,13,22}.
11318 (Target_sparc::Scan::local): Likewise.
11319 (Target_sparc::Relocate:relocate): Likewise.
11320
9109c078
ILT
113212010-02-06 Ian Lance Taylor <iant@google.com>
11322
11323 * configure.ac: Rewrite targetobjs duplicate removal code to use
11324 only shell constructs.
11325 * configure: Rebuild.
11326
cf846138
DK
113272010-02-05 Doug Kwan <dougkwan@google.com>
11328
11329 PR 11247
11330 * arm.cc (Arm_relobj::section_is_scannable): New method.
11331 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11332 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11333
6cfaf60b
DK
113342010-02-04 Doug Kwan <dougkwan@google.com>
11335
11336 PR 11247
11337 * arm-reloc-property.cc (cstdio): Include.
11338 * configure.ac (targetobjs): Remove duplicates.
11339 * configure: Regenerate.
11340 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11341 big and little endian version for a given address size.
11342
5c57f1be
DK
113432010-02-03 Doug Kwan <dougkwan@google.com>
11344
11345 * arm-reloc-property.cc
11346 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11347 definition.
11348 * arm-reloc-property.h
11349 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11350 New method definition.
11351 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11352 declaration.
11353 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11354 overflow to N.
11355 (GOT_PREL): Change implemented to Y.
11356 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11357 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11358 (Arm_relocate_functions::movw_abs_nc): Remove method.
11359 (Arm_relocate_functions::movt_abs): Ditto.
11360 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11361 (Arm_relocate_functions::thm_movt_abs): Ditto.
11362 (Arm_relocate_functions::movw_rel_nc): Ditto.
11363 (Arm_relocate_functions::movw_rel): Ditto.
11364 (Arm_relocate_functions::movt_rel): Ditto.
11365 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11366 (Arm_relocate_functions:thm_movw_rel): Ditto.
11367 (Arm_relocate_functions:thm_movt_rel): Ditto.
11368 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11369 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11370 New method definitions.
11371 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11372 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11373 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11374 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11375 (Target_arm::Relocate::relocate): Check for non-static or
11376 unimplemented relocation code and exit early. Change calls to
11377 Target_arm::reloc_uses_thumb_bit and
11378 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11379 instead. Refactor code to handle similar relocations to increase
11380 code sharing. Remove check for unsupported relocation code in switch
11381 statement.
11382 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11383 relocation property table to find out size. Change error message to
11384 print out the name of a relocation code instead of the numeric value.
11385 (Target_arm::scan_reloc_for_stub): Use relocation property table
11386 instead of calling Target_arm::reloc_uses_thumb_bit().
11387
218c5831
DK
113882010-02-02 Doug Kwan <dougkwan@google.com>
11389
11390 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11391 types of relaxed input section.
11392
0d31c79d
DK
113932010-02-02 Doug Kwan <dougkwan@google.com>
11394
11395 * Makefile.am (HFILES): Add arm-reloc-property.h.
11396 (DEFFILES): New.
2e702c99
RM
11397 (TARGETSOURCES): Add arm-reloc-property.cc
11398 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11399 (libgold_a_SOURCES): $(DEFFILES)
11400 * Makefile.in: Regenerate.
11401 * arm-reloc-property.cc: New file.
11402 * arm-reloc-property.h: New file.
11403 * arm-reloc.def: New file.
11404 * arm.cc: Update comments.
11405 (arm-reloc-property.h): New included header.
11406 (arm_reloc_property_table): New global variable.
11407 (Target_arm::do_select_as_default_target): New method definition.
11408 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11409 arm-reloc-property to targ_extra_obj.
11410 * parameters.cc (set_parameters_target): Call
11411 Target::select_as_default_target().
11412 * target.h (Target::select_as_default_target): New method definition.
11413 (Target::do_select_as_default_target): Same.
11414
546c7457
DK
114152010-02-01 Doug Kwan <dougkwan@google.com>
11416
11417 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11418 first_output_text_section_.
11419 (Arm_exidx_fixup::first_output_text_section): New method definition.
11420 (Arm_exidx_fixup::first_output_text_section_): New data member.
11421 (Arm_exidx_fixup::process_exidx_section): Record the first text
11422 output section seen.
11423 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11424 and entsize in output section header.
11425
11b861d5
DK
114262010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11427
11428 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11429 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11430 (Arm_relocate_functions::thm_alu11): New Method.
11431 (Arm_relocate_functions::thm_pc8): New Method.
11432 (Arm_relocate_functions::thm_pc12): New Method.
11433 (Target_arm::Scan::local): Handle the relocations.
11434 (Target_arm::Scan::global): Likewise.
11435 (Target_arm::Relocate::relocate): Likewise.
11436 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11437
c9a2c125
DK
114382010-01-29 Doug Kwan <dougkwan@google.com>
11439
11440 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11441 of relocation types as ld.
11442
1521477a
DK
114432010-01-29 Doug Kwan <dougkwan@google.com>
11444
11445 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11446 to public.
11447 (Arm_relocate_functions::thumb_branch_common): Ditto.
11448 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11449 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11450 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11451 Arm_relocate_functions::jump24): Remove.
11452 (Target_arm::Relocate::relocate): Adjust code to call
11453 Arm_relocation_functions::arm_branch_common and
11454 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11455 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11456
e7eca48c
DK
114572010-01-29 Doug Kwan <dougkwan@google.com>
11458
11459 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11460 output_local_symbol_count_needs_update_.
11461 (Arm_relobj::output_local_symbol_count_needs_update,
11462 Arm_relobj::set_output_local_symbol_count_needs_update,
11463 Arm_relobj::update_output_local_symbol_count): New methods.
11464 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11465 member.
11466 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11467 of pointed function as in a R_ARM_PREL31 relocation.
11468 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11469 for output local symbol count updating.
11470 (Target_arm::do_relax): Update output local symbol counts in objects
11471 if necessary.
11472 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11473
02961d7e
ILT
114742010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11475
11476 * arm.cc: Added support for the ARM relocations:
11477 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11478 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11479 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11480 movw_prel_nc).
11481 (Arm_relocate_functions::movw_rel): New method.
11482 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11483 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11484 thm_movw_prel_nc).
11485 (Arm_relocate_functions::thm_movw_rel): New method.
11486 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11487 thm_movt_prel).
11488 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11489 relocations.
11490 (Target_arm::Scan::global): Likewise.
11491 (Target_arm::Relocate::relocate): Likewise.
11492 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11493 Likewise.
11494
b10d2873
ILT
114952010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11496
11497 * arm.cc: Added support for ARM group relocations.
11498 (Target_arm::reloc_needs_sym_origin): New method.
11499 (Arm_relocate_functions::calc_grp_kn): New method.
11500 (Arm_relocate_functions::calc_grp_residual): New method.
11501 (Arm_relocate_functions::calc_grp_gn): New method.
11502 (Arm_relocate_functions::arm_grp_alu): New Method.
11503 (Arm_relocate_functions::arm_grp_ldr): New Method.
11504 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11505 (Arm_relocate_functions::arm_grp_ldc): New Method.
11506 (Target_arm::Scan::local): Handle the ARM group relocations.
11507 (Target_arm::Scan::global): Likewise.
11508 (Target_arm::Relocate::relocate): Likewise.
11509 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11510 Likewise.
11511
2b328d4e
DK
115122010-01-26 Doug Kwan <dougkwan@google.com>
11513
11514 * arm.cc (set): Include.
11515 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11516 pointer type.
2e702c99 11517 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11518 (Arm_output_section::append_text_sections_to_list): New method.
11519 (Arm_output_section::fix_exidx_coverage): Ditto.
11520 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11521 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11522 Relobj::set_section_offset() instead of
11523 Sized_relobj::invalidate_section_offset().
2e702c99 11524 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11525 parameter for section headers. Ignore relocation sections for
11526 unallocated sections and EXIDX sections.
11527 (Target_arm::fix_exidx_coverage): New method.
11528 (Target_arm::output_section_address_less_than): New type.
11529 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11530 linked text section instead of the EXIDX section.
11531 (Arm_output_section::create_stub_group): Add an assertion to check
11532 that this is not an EXIDX output section.
11533 (Arm_output_section::append_text_sections_to_list): New method.
11534 (Arm_output_section::fix_exidx_coverage): Ditto.
11535 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11536 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11537 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11538 first pass.
11539 (Target_arm::fix_exidx_coverage): New method.
11540 * object.h (Relobj::set_output_section): New method.
11541 (Sized_relobj::invalidate_section_offset): Remove method.
11542 (Sized_relobj::do_invalidate_section_offset): Remove method.
11543 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11544
c7f3c371
DK
115452010-01-25 Doug Kwan <dougkwan@google.com>
11546
11547 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11548 Fix warning due to signed and unsigned comparison on a 32-bit host.
11549
8923b24c
DK
115502010-01-22 Doug Kwan <dougkwan@google.com>
11551
11552 * arm.cc (Target_arm::do_relax): Record an output section for section
11553 offset adjustment it contains any stub table that has changed.
11554 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11555 offsets in an output section if necessary.
11556 * output.cc (Output_section::Output_section): Initialize
11557 section_offsets_need_adjustments_.
11558 (Output_section::add_input_section_for_script): Renamed to
11559 Output_section::add_simple_input_section.
11560 (Output_section::save_states): Add a comment.
11561 (Output_section::discard_states): New method defintion.
11562 (Output_section::adjust_section_offsets): Same.
11563 * output.h (Output_section::add_input_section_for_script): Renamed to
11564 Output_section::add_simple_input_section.
11565 (Output_section::discard_states): New method declaration.
11566 (Output_section::adjust_section_offsets): Same.
11567 (Output_section::section_offsets_need_adjustment,
11568 Output_section::set_section_offsets_need_adjustment): New method
11569 definitions.
11570 (Output_section::section_offsets_need_adjustment_): New data member.
11571 * script-sections.cc
11572 (Output_section_element_input::set_section_address): Adjust code for
11573 renaming of Output_section::add_input_section_for_script.
11574 (Orphan_output_section::set_section_address): Same.
11575
9b2fd367
DK
115762010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11577
11578 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11579 Fix_v4bx enum values .
11580 * gold/options.h (General_options): New option definitions.
11581 (General_options::fix_v4bx): New method.
11582 (General_options::Fix_v4bx): New enum.
11583 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11584 (General_options::parse_fix_v4bx_interworking): New method.
11585
80d0d023
DK
115862010-01-22 Doug Kwan <dougkwan@google.com>
11587
11588 * arm.cc (Arm_exidx_fixup): New class.
11589
af2cdeae
DK
115902010-01-21 Doug Kwan <dougkwan@google.com>
11591
11592 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11593 classes.
11594 (Arm_exidx_section_offset_map): New type.
11595
993d07c1
DK
115962010-01-21 Doug Kwan <dougkwan@google.com>
11597
11598 * arm.cc (Arm_exidx_input_section): New class.
11599 (Arm_relobj::exidx_input_section_by_link,
11600 Arm_relobj::exidx_input_section_by_shndx,
11601 Arm_relobj::make_exidx_input_section): New methods.
11602 (read_arm_attributes_section): Remove.
11603 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11604 information about them.
11605 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11606 to here.
11607
5ac169d4
DK
116082010-01-20 Doug Kwan <dougkwan@google.com>
11609
11610 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11611 Input_section_specifier to Section_id.
11612 (Target_arm::new_arm_input_section: Adjust code for change of key
11613 type.
11614 (Target_arm::find_arm_input_section): Ditto.
11615 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11616 (Section_id): Remove.
11617 (Garbage_collection::Section_id_hash): Remove.
11618 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11619 (Section_id): Remove.
11620 (Icf::Section_id_hash): Remove.
11621 * object.h (Section_id, Const_section_id, Section_id_hash,
11622 Const_section_id_hash): New type definitions.
11623 * output.cc (Output_section::add_relaxed_input_section): Change to
11624 use Const_section_id instead of Input_section_specifier as key type.
11625 (Output_section::add_merge_input_section): Ditto.
11626 (Output_section::build_relaxation_map): Change to use Section_id
11627 instead of Input_section_specifier as key type.
2e702c99 11628 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11629 Ditto.
11630 (Output_section::convert_input_sections_to_relaxed_sections): Change
11631 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11632 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11633 (Output_section::find_relaxed_input_section): Ditto.
11634 * output.h (Input_section_specifier): Remove class.
11635 (Output_section::Output_section_data_by_input_section_map): Change
11636 key type to Const_section_id.
11637 (Output_section::Output_relaxed_input_section_by_input_section_map):
11638 Ditto.
11639 (Output_section::Relaxation_map): Change key type to Section_id.
11640
a2162063
ILT
116412010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11642
11643 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11644 (class Arm_v4bx_stub): New class.
11645 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11646 (Stub_factory::make_arm_v4bx_stub): New method.
11647 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11648 (Stub_table::empty): Handle v4bx stubs.
11649 (Stub_table::add_arm_v4bx_stub): New method.
11650 (Stub_table::find_arm_v4bx_stub): New method.
11651 (Arm_relocate_functions::v4bx): New method.
11652 (Target_arm::fix_v4bx): New method.
11653 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11654 (Stub_table::relocate_stubs): Likewise.
11655 (Stub_table::do_write): Likewise.
11656 (Stub_table::update_data_size_and_addralign): Likewise.
11657 (Stub_table::finalize_stubs): Likewise.
11658 (Target_arm::Scan::local): Likewise.
11659 (Target_arm::Scan::global): Likewise.
11660 (Target_arm::do_finalize_sections): Likewise.
11661 (Target_arm::Relocate::relocate): Likewise.
11662 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11663 Likewise.
11664 (Target_arm::scan_reloc_for_stub): Likewise.
11665 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11666
5696ab0b
ILT
116672010-01-19 Ian Lance Taylor <iant@google.com>
11668
11669 * output.cc (Output_section_headers::do_sized_write): Write large
11670 segment count to sh_info field.
11671 (Output_file_header::do_sized_write): For large segment count,
11672 write PN_XNUM to e_phnum field.
11673
800d0f56
ILT
116742010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11675
11676 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11677 (Arm_relocate_functions::thm_jump8): New function.
11678 (Arm_relocate_functions::thm_jump11): New function.
11679 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11680 R_ARM_THM_JUMP11.
11681 (Target_arm::Scan::global): Likewise.
11682 (Target_arm::Relocate::relocate): Likewise.
11683 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11684 Likewise.
11685
41263c05
DK
116862010-01-14 Doug Kwan <dougkwan@google.com>
11687
11688 * arm.cc (map, utility): Include headers.
11689 (Target_arm::apply_cortex_a8_workaround): New method.
11690 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11691 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11692 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11693 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11694 the --[no-]fix-cortex-a8 command line options.
11695 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11696 (Target_arm::relocate_stub): Use addend in instruction template.
11697 * options.h (DEFINE_bool): Set the user-set flag.
11698 (General_options): Add --[no-]-fix-cortex options.
11699 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11700 : Update fast look-up map after conversion.
41263c05 11701
459e9b03
ST
117022010-01-14 Sriraman Tallam <tmsriram@google.com>
11703
11704 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11705 in the first pass of do_layout.
11706
b521dfe4
DK
117072010-01-13 Doug Kwan <dougkwan@google.com>
11708
11709 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11710 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11711 apparent compiler problem of not folding static constant integral
11712 data members of elfcpp::Elf_sizes<32>.
11713
44272192
DK
117142010-01-13 Doug Kwan <dougkwan@google.com>
11715
11716 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11717 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11718 Arm_relobj::scan_section_for_cortex_a8_erratum,
11719 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11720 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11721 sections to scan for relocation stubs into a new method
11722 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11723 relocation and Cortex-A8 stub scanning.
11724 (Target_arm::do_relax): Force stubs to be after stubbed sections
11725 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11726 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11727 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11728
44b71ece
ILT
117292010-01-12 Ian Lance Taylor <iant@google.com>
11730
11731 * target-reloc.h (visibility_error): New inline function.
11732 (relocate_section): Call visibility_error.
11733 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11734 (MOSTLYCLEANFILES): Likewise.
11735 (protected_4_pic.o, protected_3.err): New targets.
11736 * testsuite/protected_4.cc: New file.
11737
a120bc7f
DK
117382010-01-12 Doug Kwan <dougkwan@google.com>
11739
11740 * arm.cc (Cortex_a8_reloc): New class.
11741 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11742 and cortex_a8_relocs_info_.
11743 (Target_arm::fix_cortex_a8): New method definition.
11744 (Target_arm::Cortex_a8_relocs_info): New type.
11745 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11746 New data member declarations.
11747 (Target_arm::scan_reloc_for_stub): Record information about
11748 relocations for THUMB branches that might be exempted from the
11749 Cortex-A8 workaround.
11750 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11751 at the beginning of a relaxation pass.
11752
20138696
DK
117532010-01-12 Doug Kwan <dougkwan@google.com>
11754
11755 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11756 (Arm_relobj::Mapping_symbol_position,
11757 Arm_reloj::Mapping_symbol_position_less,
11758 Arm_relobj::Mapping_symbols_info): New types.
11759 (Target_arm::is_mapping_symbol_name): New method definition.
11760 (Arm_relobj::do_count_local_symbols): Save information about mapping
11761 symbols.
11762
089d69dc
DK
117632010-01-11 Doug Kwan <dougkwan@google.com>
11764
11765 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11766 Arm_relocate_functions::thumb32_branch_upper,
11767 Arm_relocate_functions::thumb32_branch_lower,
11768 Arm_relocate_functions::thumb32_cond_branch_offset,
11769 Arm_relocate_functions::thumb32_cond_branch_upper,
11770 Arm_relocate_functions::thumb32_cond_branch_lower,
11771 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11772 branch offset encoding.
11773 (Arm_relocate_functions::thumb_branch_common): Use new branch
11774 offset encoding methods to avoid code duplication.
11775 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11776 (Stub_addend_reader::operator()): Use new branch encoding method
11777 to avoid code duplication.
11778
99e5bff2
DK
117792010-01-11 Doug Kwan <dougkwan@google.com>
11780
11781 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11782 (Target_arm::do_finalize_sections): Define special EXIDX section
11783 symbols only if referenced.
11784 * gc.h (Garbage_collection::add_reference): New method.
11785 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11786 code duplication.
11787
98e090bd
ILT
117882010-01-11 Ian Lance Taylor <iant@google.com>
11789
d0a91bd8
ILT
11790 * script.cc (Version_script_info::build_expression_list_lookup):
11791 Change complaing about duplicate wildcard match from error to
11792 warning.
11793
98e090bd
ILT
11794 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11795 of 2009-12-30.
11796 (Version_script_info::Version_script_info): Initialize globs_,
11797 default_version_, default_is_global_, and exact_. Don't
11798 initialize globals_ or locals_.
11799 (Version_script_info::build_lookup_tables): Build local symbols
11800 first.
11801 (Version_script_info::unquote): New function.
11802 (Version_script_info::add_exact_match): New function.
11803 (Version_script_info::build_expression_list_lookup): Remove lookup
11804 parameter. Add is_global parameter. Change all callers. Handle
11805 wildcard pattern specially. Unquote pattern. Call
11806 add_exact_match.
11807 (Version_script_info::get_name_to_match): New function.
11808 (Version_script_info::get_symbol_version): New function.
11809 (Version_script_info::get_symbol_version_helper): Remove.
11810 (Version_script_info::check_unmatched_names): Call unquote.
11811 * script.h (class Version_script_info): Change get_symbol_version
11812 to be non-inline and add is_global parameter; change all callers.
11813 Rewrite symbol_is_local. Update declarations. Define struct
11814 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11815 Remove globals_ and locals_ members. Add exact_, globs_,
11816 default_version_, is_global_.
11817 (Version_script_info::Glob): Remove pattern, add expression and
11818 is_global. Update constructor. Change all callers.
11819 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11820 default version.
11821 (Versions::symbol_section_contents): If a symbol is undefined, or
11822 defined in a dynamic object, set the version index to
11823 VER_NDX_LOCAL.
11824 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11825 symbol_is_local.
11826 (Symbol_table::add_from_pluginobj): Likewise.
11827 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11828
d56962d3
DK
118292010-01-11 Doug Kwan <dougkwan@google.com>
11830
11831 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11832 (incremental_dump_LDADD): Add linking option for libintl.
11833 * Makefile.in: Regenerate.
11834
94e6ee91
L
118352010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11836
11837 PR gold/11144
11838 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11839 instead of -Ds.
11840 * testsuite/Makefile.in: Regenerated.
11841
e96c574b
DK
118422010-01-10 Doug Kwan <dougkwan@google.com>
11843
11844 * options.h (DEFINE_var): Use parentheses around argument varname__
11845 in macro body to avoid any unintended subsequent substitutions.
11846
7198066b
ILT
118472010-01-10 Ian Lance Taylor <iant@google.com>
11848
ba4d53bf
ILT
11849 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11850 candidates before doing symbol resolution.
11851
7198066b
ILT
11852 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11853 ODR candidates if only one is weak.
11854
a2beed37
ILT
118552010-01-08 Ian Lance Taylor <iant@google.com>
11856
11857 * script.cc (Version_script_info::build_expression_list_lookup):
11858 Don't warn about ambiguous version, just record the ambiguity.
11859 (Version_script_info::get_symbol_version_helper): Give error if
11860 version is ambiguous.
11861
2fb7225c
DK
118622010-01-08 Doug Kwan <dougkwan@google.com>
11863
11864 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11865 prev_data_size_ and prev_addralign_. Remove initializer for
11866 deleted data member has_been_changed_.
11867 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11868 to determine if the table is empty.
11869 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11870 Remove.
11871 (Stub_table::add_reloc_stub): Define method in class definition
11872 instead of just declaring it there.
11873 (Stub_table::add_cortex_a8_stub): New method definition.
11874 (Stub_table::update_data_size_and_addralign): Ditto.
11875 (Stub_table::finalize_stubs): Ditto.
11876 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11877 (Stub_table::do_addralign_): Return address alignment in the
11878 (Stub_table::do_reset_address_and_file_offset): Define method in
11879 class definition instead of declaring it there. Set current data
11880 size to be the data size of the previous pass.
11881 (Stub_table::set_final_data_size): Use current data size as the
11882 final data size.
11883 (Stub_table::relocate_stub): Change parameter type of stub from
11884 Reloc_stub pointer to Stub pointer.
11885 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11886 (Stub_table::Cortex_a8_stub_list): New typedef.
11887 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11888 Stub_table::prev_addralign_): New data member.
11889 (Arm_relobj::Arm_relobj): Initialize data member
11890 section_has_cortex_a8_workaround_.
11891 (Arm_relobj::section_has_cortex_a8_workaround,
11892 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11893 definitions.
11894 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11895 declarations.
11896 (Target_arm::relocate_stub): Change parameter type of stub from
11897 Reloc_stub pointer to Stub pointer.
11898 (Insn_template::size, Insn_template::alignment): Handle
11899 THUMB16_SPECIAL_TYPE.
11900 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11901 Stub_table::update_data_size_and_addralign,
11902 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11903 definitions.
11904 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11905 (Stub_table::do_write): Ditto.
11906 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11907
880cd20d
ILT
119082010-01-08 Ian Lance Taylor <iant@google.com>
11909
11910 PR 11108
11911 * symtab.h (class Symbol): Remove fields is_target_special_ and
11912 has_plt_offset_. Add field is_defined_in_discarded_section_.
11913 (Symbol::is_defined_in_discarded_section): New function.
11914 (Symbol::set_is_defined_in_discarded_section): New function.
11915 (Symbol::has_plt_offset): Rewrite.
11916 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11917 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11918 Don't initialize is_target_special_ or has_plt_offset_.
11919 Initialize is_defined_in_discarded_section_.
11920 (Symbol_table::add_from_relobj): If appropriate, set
11921 is_defined_in_discarded_section.
11922 * resolve.cc (Symbol::override_base_with_special): Don't test
11923 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11924 * target-reloc.h (relocate_section): Do special handling for
11925 symbols defined in discarded sections for global symbols as well
11926 as local symbols.
11927
2703e3eb
ILT
119282010-01-08 Ian Lance Taylor <iant@google.com>
11929
11930 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11931 the SHT_SYMTAB case.
11932
339d40a3
ILT
119332010-01-08 Ian Lance Taylor <iant@google.com>
11934
11935 * object.cc (Sized_relobj::do_layout): Don't get confused if
11936 layout_eh_frame returns NULL.
11937
abecea76
ILT
119382010-01-08 Ian Lance Taylor <iant@google.com>
11939
11940 PR 11084
11941 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11942 dynamic symbol table, use the normal symbol table.
11943 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11944 symbol table.
11945
6b7dd3f3
ILT
119462010-01-08 Ian Lance Taylor <iant@google.com>
11947
11948 PR 11072
11949 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11950 sections.
11951
36c50e63
L
119522010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11953
11954 * version.cc (print_version): Change to "Copyright 2010".
11955
e291e7b9
ILT
119562010-01-08 Ian Lance Taylor <iant@google.com>
11957
11958 PR 10287
11959 PR 11063
11960 * i386.cc (class Target_i386): Change return type of plt_section
11961 to be non-const.
11962 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11963 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11964 tls_desc_rel_ field.
11965 (Output_data_plt_i386::rel_tls_desc): New function.
11966 (Target_i386::rel_tls_desc_section): New function.
11967 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11968 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11969 R_386_TLS_DESC reloc in rel_tls_desc_section.
11970 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11971 Define struct Tlsdesc_info.
11972 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11973 (Target_x86_64::do_reloc_symbol_index): New function.
11974 (Target_x86_64::add_tlsdesc_info): New function.
11975 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11976 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11977 tlsdesc_rel_ field.
11978 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11979 all callers.
11980 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11981 (Target_x86_64::rela_tlsdesc_section): New function.
11982 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11983 handling.
11984 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11985 (Target_x86_64::do_reloc_addend): New function.
11986 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11987 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11988 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11989 (Output_reloc::type): New function.
11990 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11991 (Output_reloc::is_target_specific): New function.
11992 (Output_reloc::target_arg): New function.
11993 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11994 absolute relocs and target specific relocs.
11995 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11996 add_target_specific.
11997 (class Output_data_reloc) [SHT_RELA]: Likewise.
11998 * output.cc (Output_reloc::Output_reloc): Add four new versions
11999 for absolute relocs and target specific relocs.
12000 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12001 (Output_reloc::get_symbol_index): Likewise.
12002 (Output_reloc::local_section_offset): Check that local_sym_index_
12003 is not TARGET_CODE or 0.
12004 (Output_reloc::symbol_value): Likewise.
12005 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12006 reloc.
12007 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12008 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12009 functions.
12010 * layout.cc (add_target_dynamic_tags): Use output section for
12011 DT_PLTRELSZ and DT_JMPREL.
12012
3a44184e
ILT
120132010-01-07 Ian Lance Taylor <iant@google.com>
12014
12015 PR 11061
12016 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12017 function.
12018 (class Output_data_reloc_generic): Define.
12019 (class Output_data_reloc_base): Change base class to
12020 Output_data_reloc_generic. Change add() method to call
12021 bump_relative_reloc_count for a relative reloc. Remove
12022 sort_relocs_ field.
12023 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12024 to sort_relocs().
12025 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12026 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12027 appropriate.
12028 * layout.h (class Layout): Update declaration.
12029
ea715a34
ILT
120302010-01-07 Ian Lance Taylor <iant@google.com>
12031
12032 * output.h (class Output_data): Add const version of
12033 output_section and do_output_section.
12034 (class Output_section_data): Add const version of
12035 do_output_section.
12036 (class Output_section): Likewise.
12037 * layout.cc (Layout::add_target_dynamic_tags): New function.
12038 * layout.h (class Layout): Update declarations.
12039 * arm.cc (Target_arm::do_finalize_sections): Use
12040 add_target_dynamic_tags.
12041 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12042 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12043 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12044 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12045
659948a4
ILT
120462010-01-07 Ian Lance Taylor <iant@google.com>
12047
12048 PR 11042
12049 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12050 object as needed.
12051
9d3b86f6
ILT
120522010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12053 Ian Lance Taylor <iant@google.com>
12054
12055 PR 11019
12056 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12057 Xindex::read_symtab_xindex.
12058
bb0d3eb0
DK
120592010-01-07 Doug Kwan <dougkwan@google.com>
12060
12061 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12062 (Insn_template::thumb16_bcond_insn): New method declaration.
12063 (Insn_template): Fix spelling.
12064 (Stub::thumb16_special): New method declaration.
12065 (Stub::do_write): Define virtual method which was previously pure
12066 virtual.
12067 (Stub::do_thumb16_special): New method declaration.
12068 (Stub::do_fixed_endian_write): New template member.
12069 (Reloc_stub::do_write): Remove.
12070 (Reloc_stub::do_fixed_endian_write): Remove.
12071 (Cortex_a8_stub): New class definition.
12072 (Stub_factory::make_cortex_a8_stub): New method definition.
12073 (Stub_factory::Stub_factory): Add missing static storage class
12074 qualifier for elf32_arm_stub_a8_veneer_blx.
12075
ffeef7df
ILT
120762010-01-07 Ian Lance Taylor <iant@google.com>
12077
dc3f80fe
ILT
12078 PR 10980
12079 * options.h (class General_options): Add --warn-unresolved-symbols
12080 and --error-unresolved-symbols.
12081 * errors.cc (Errors::undefined_symbol): Implement
12082 --warn-unresolved-symbols.
12083
ffeef7df
ILT
12084 * options.h (class General_options): Add -z text and -z textoff.
12085 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12086
f1ec9ded
ST
120872010-01-06 Sriraman Tallam <tmsriram@google.com>
12088
12089 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12090 (Garbage_collection::cident_sections): New function.
12091 (Garbage_collection::add_cident_section): New function.
12092 (Garbage_collection::cident_sections_): New member.
12093 (gc_process_relocs): Add references to sections whose names are C
12094 identifiers.
12095 * gold.h (cident_section_start_prefix): New constant.
12096 (cident_section_stop_prefix): New constant.
12097 (is_cident): New function.
12098 * layout.cc (Layout::define_section_symbols): Replace string constants
12099 with the newly defined constants.
12100 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12101 C identifiers.
12102 * testsuite/Makefile.am: Add gc_orphan_section_test.
12103 * testsuite/Makefile.in: Regenerate.
12104 * testsuite/gc_orphan_section_test.cc: New file.
12105 * testsuite/gc_orphan_section_test.sh: New file.
12106
6eda8c29
ILT
121072010-01-06 Ian Lance Taylor <iant@google.com>
12108
b9674e17
ILT
12109 PR 10980
12110 * options.h (class General_options): Add --warn-shared-textrel.
12111 * layout.cc (Layout::finish_dynamic_section): Implement
12112 --warn-shared-textrel.
12113
6eda8c29
ILT
12114 PR 10980
12115 * options.h (class General_options): Add --warn-multiple-gp.
12116
32dcd44e
ILT
121172010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12118
12119 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12120 $(THREADSLIB) and $(LIBDL).
12121 * Makefile.in: Rebuild.
12122
a192ba05
ILT
121232010-01-06 Ian Lance Taylor <iant@google.com>
12124
12125 PR 10980
12126 * options.cc (General_options::parse_section_start): New function.
12127 (General_options::section_start): New function.
12128 (General_options::General_options): Initialize all members.
12129 * options.h: Include <map>
12130 (class General_options): Add --section-start. Add section_starts_
12131 member.
12132 * layout.cc (Layout::attach_allocated_section_to_segment): If
12133 --section-start was used, set the address of the segment. Remove
12134 local sort_sections.
12135 (Layout::relaxation_loop_body): If the address of the load segment
12136 has been set by --section-start, don't use it.
12137 * output.h (Output_segment::update_flags_for_output_section): New
12138 function.
12139 * output.cc (Output_segment::add_output_section): Call
12140 update_flags_for_output_section.
12141
dde3f402
ILT
121422010-01-05 Ian Lance Taylor <iant@google.com>
12143
62dfdd4d
ILT
12144 PR 10980
12145 * options.h (class General_options): Add --undefined-version.
12146 * script.cc (struct Version_expression): Add was_matched_by_symbol
12147 field.
12148 (Version_script_info::matched_symbol): New function.
12149 (Version_script_info::get_symbol_version_helper): Call
12150 matched_symbol.
12151 (Version_script_info::check_unmatched_names): New function.
12152 * script.h (class Version_script_info): Update declarations.
12153 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12154
9c4ae156
ILT
12155 * options.h (class General_options): Use DEFINE_bool_alias for
12156 allow_multiple_definition.
12157 * resolve.cc (Symbol_table::should_override): Don't test
12158 allow_multiple_definition.
12159
dde3f402
ILT
12160 PR 10980
12161 * options.h (class General_options): Add --cref.
12162 * main.cc (main): Print cref table if --cref. Don't close mapfile
12163 until after printing cref table.
12164 * cref.cc: Include "symtab.h".
12165 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12166 (Cref_table_compare::operator()): New function.
12167 (Cref_inputs::gather_cref): New function.
12168 (filecol): New static const.
12169 (Cref_inputs::print_cref): New function.
12170 (Cref::print_cref): New function.
12171 * cref.h: Include <cstdio>.
12172 (class Cref): Update declarations.
12173 * mapfile.h (Mapfile::file): New function.
12174 * object.h (class Object): Define Symbols. Declare virtual
12175 do_get_global_symbols.
12176 (Object::get_global_symbols): New function.
12177 * object.cc (Input_objects::add_object): Pass object to cref_ if
12178 --cref.
12179 (Input_objects::archive_start): Likewise.
12180 (Input_objects::archive_stop): Likewise.
12181 (Input_objects::print_cref): New function.
12182 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12183 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12184 --cref.
12185 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12186 function.
12187 * plugin.h (class Sized_pluginobj): Update declarations.
12188
8781f709
ILT
121892010-01-05 Ian Lance Taylor <iant@google.com>
12190
12191 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12192 to is_default_version. Rename insdef to insdefault.
12193 (Symbol_table::add_from_relobj): Rename def to is_default_version
12194 and local to is_forced_local.
12195 (Symbol_table::add_from_pluginobj): Likewise.
12196 (Symbol_table::add_from_dynobj): Likewise.
12197 (Symbol_table::define_special_symbol): Rename insdef to
12198 insdefault.
12199
fe35d28d
ILT
122002010-01-04 Ian Lance Taylor <iant@google.com>
12201
30bc8c46
ILT
12202 PR 10980
12203 * options.h (class General_options): Add
12204 --allow-multiple-definition and -z muldefs.
12205 * resolve.cc (Symbol_table::should_override): Don't warn about a
12206 multiple symbol definition if --allow-multiple-definition or -z
12207 muldefs.
12208
7eaea549
ILT
12209 PR 10980
12210 * options.h (class General_options): Add --add-needed and
12211 --copy-dt-needed-entries. Tweak --as-needed help entry.
12212 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12213 error if --copy-dt-needed-entries aka --add-needed is used and
12214 would cause a change in behaviour.
12215
fe35d28d
ILT
12216 PR 10980
12217 * options.h (class General_options): Add -G as a short version of
12218 --shared. Add no-op options -assert, -g, and -i.
12219
55a2bb35
ST
122202010-01-04 Sriraman Tallam <tmsriram@google.com>
12221
12222 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12223 check for .text or .gnu.linkonce.t sections.
12224 * icf.cc (Icf::find_identical_sections): Ditto.
12225 Change the detection for mangled function name within the section
12226 name.
12227 * icf.h (is_section_foldable_candidate): New function.
12228
719328e1
ILT
122292009-12-30 Ian Lance Taylor <iant@google.com>
12230
12231 PR 10980
12232 * options.h (class General_options): Permit two dashes with
12233 --retain-symbols-file.
12234
d7bb5745
ILT
122352009-12-30 Ian Lance Taylor <iant@google.com>
12236
403a15dd
ILT
12237 PR 10979
12238 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12239 don't put the file header and segment headers in the text
12240 segment.
12241
eda294df
ILT
12242 PR 10979
12243 * common.cc (Sort_commons::operator()): Stabilize sort when both
12244 entries are NULL.
12245 (Symbol_table::do_allocate_commons_list): When allocating common
12246 symbols, skip a symbol which is no longer common.
12247 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12248 an object before checking its type.
12249 * testsuite/common_test_2.c: New file.
12250 * testsuite/common_test_3.c: New file.
12251 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12252 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12253 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12254 (common_test_2_pic.o, common_test_2.so): New targets.
12255 (common_test_3_pic.o, common_test_3.so): New targets.
12256 * testsuite/Makefile.in: Rebuild.
12257
d7bb5745
ILT
12258 PR 10979
12259 * script.cc (read_input_script): If we see a new SECTIONS clause,
12260 and we have added an input section, give an error.
12261 * layout.h (class Layout): Add have_added_input_section function.
12262 Add have_added_input_section_ field.
12263 * layout.cc (Layout::Layout): Initialize
12264 have_added_input_section_.
12265 (Layout::layout): Set have_added_input_section_.
12266 (Layout::layout_eh_frame): Likewise.
12267
fc59c572
ILT
122682009-12-30 Ian Lance Taylor <iant@google.com>
12269
12270 PR 10931
12271 * options.h (class General_options): Add --sort-common option.
12272 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12273 * common.cc (Sort_common): Add sort_order parameter to
12274 constructor. Add sort_order_ field.
12275 (Sort_commons::operator): Check sort_order_.
12276 (Symbol_table::allocate_commons): Determine the sort order.
12277 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12278 Change all callers.
12279 (Symbol_table::do_allocate_commons_list): Likewise.
12280
1c74fab0
ILT
122812009-12-30 Ian Lance Taylor <iant@google.com>
12282
12283 PR 10916
12284 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12285 symbols from this object, don't change the visibility of an
12286 undefined symbol.
12287 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12288
6affe781
ILT
122892009-12-30 Ian Lance Taylor <iant@google.com>
12290
12291 PR 10861
12292 * script.h (class Version_script_info): Define Language enum.
12293 Update declarations. Define Glob, Exact, and Lookup types. Add
12294 new fields globals_, locals_, and is_finalized_.
12295 * script.cc: Various formatting fixes.
12296 (class Parser_closure): Change language_stack_ from a vector of
12297 std::string to one of Version_script_info::Language. Adjust all
12298 uses accordingly.
12299 (class Lazy_demangler): Remove.
12300 (struct Version_expression): Change language from std::string to
12301 Version_script_info::Language.
12302 (Version_script_info::Version_script_info): New function.
12303 (Version_script_info::~Version_script_info): Don't call clear.
12304 (Version_script_info::finalize): New function.
12305 (Version_script_info::build_lookup_tables): New function.
12306 (Version_script_info::build_expression_list_lookup): New
12307 function.
12308 (Version_script_info::get_symbol_version_helper): Rewrite to use
12309 lookup tables.
12310 (Version_script_info::print_expression_list): Adjust to use
12311 Version_script_info::Language.
12312 (script_push_lex_into_version_mode): Check that the version script
12313 has not been finalized.
12314 (version_script_push_lang): Change language string to
12315 Version_script_info::Language.
12316 * options.cc (Command_line::version_script): New function.
12317 * options.h (class General_options): Add finalize_dynamic_list
12318 function. Change version_script from declaration to definition.
12319 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12320 * testsuite/version_script.map: Remove duplicate def of foo.
12321 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12322 version_script.map.
12323 * testsuite/Makefile.in: Rebuild.
12324
818bf354
ILT
123252009-12-30 Ian Lance Taylor <iant@google.com>
12326
12327 PR 10843
12328 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12329 if the input symbol index is 0, make the output symbol index 0.
12330
ebcc8304
ILT
123312009-12-30 Ian Lance Taylor <iant@google.com>
12332
12333 PR 10670
12334 * options.h (class General_options): Add -x/--discard-all.
12335 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12336 --discard-all. If the local symbol needs a dynamic entry, check
12337 that before handling --discard-locals.
12338
176fe33f
ILT
123392009-12-30 Ian Lance Taylor <iant@google.com>
12340
bb321bb1
ILT
12341 PR 10450
12342 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12343 flags to PF_R.
12344 (Output_segment::add_output_section): Don't change the flags if
12345 the type is PT_TLS.
12346
176fe33f
ILT
12347 PR 10450
12348 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12349 GNU hash table if they need a dynamic value. Otherwise, don't add
12350 them if they are defined in a dynamic object or are forced local.
12351
e8cd95c7
ILT
123522009-12-29 Ian Lance Taylor <iant@google.com>
12353
1b81fb71
ILT
12354 PR 10450
12355 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12356 .gnu.hash table for a 32-bit target.
12357
8d6d383d
ILT
12358 PR 10450
12359 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12360 regular and a dynamic object only needs a dynamic symbol table
12361 entry if it is externally visible.
12362
e785ec03
ILT
12363 PR 10450
12364 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12365 constructor. Add global_offset_table_ field.
12366 (Target_i386::got_section): Set global_offset_table_.
12367 (Target_i386::do_finalize_sections): Set global_offset_table_
12368 size.
12369 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12370 in constructor. Add global_offset_table_ field.
12371 (Target_x86_64::got_section): Set global_offset_table_.
12372 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12373 size.
12374
1a2dff53
ILT
12375 * layout.cc (Layout::Layout): Initialize increase_relro_.
12376 (Layout::get_output_section): Add is_relro, is_last_relro, and
12377 is_first_non_relro parameters. Change all callers.
12378 (Layout::choose_output_section): Likewise.
12379 (Layout::add_output_section_data): Likewise.
12380 (Layout::make_output_section): Likewise.
12381 (Layout::set_segment_offsets): Clear increase_relro when using a
12382 linker script.
12383 * layout.h (class Layout): Add increase_relro method. Add
12384 increase_relro_ field. Update declarations.
12385 * output.cc (Output_section::Output_section): Initialize
12386 is_last_relro_ and is_first_non_relro_.
12387 (Output_segment::add_output_section): Group relro sections is
12388 do_sort is true. Handle is_last_relro and is_first_non_relro.
12389 (Output_segment::maximum_alignment): Remove relro handling.
12390 (Output_segment::set_section_addresses): Add increase_relro
12391 parameter. Change all callers. Add initial alignment to align
12392 relro sections on separate page. Remove old relro handling.
12393 (Output_segment::set_section_list_addresses): Remove in_relro
12394 parameter. Change all callers.
12395 (Output_segment::set_offset): Add increase parameter. Change all
12396 callers. Remove old relro handling.
12397 * output.h (class Output_section): Add new methods: is_last_relro,
12398 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12399 Add is_last_relro_ and is_first_non_relro_ fields.
12400 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12401 Create separate .got.plt section. Call increase_relro.
12402 * x86_64.cc (Target_x86_64::got_section): Likewise.
12403 * testsuite/relro_script_test.t: Add .got.plt.
12404
f0ba79e2
ILT
12405 PR 10450
12406 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12407 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12408 (Layout::finalize): Call set_dynamic_symbol_size.
12409 (Layout::set_dynamic_symbol_size): New function.
12410 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12411 set_dynamic_symbol_size.
12412
e8cd95c7
ILT
12413 PR 10450
12414 * output.h (class Output_section): Add is_entsize_zero_ field.
12415 * output.cc (Output_section::Output_section): Initialize
12416 is_entsize_zero_.
12417 (Output_section::set_entsize): If two different entsizes are
12418 requested, force it to zero.
12419 (Output_section::add_input_section): Set flags for .debug_str
12420 before updating section flags. Set entsize.
12421 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12422 and SHF_STRING if all input sections have those flags.
12423
3e1b9a8a
RÁE
124242009-12-29 Rafael Espindola <espindola@google.com>
12425
12426 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12427 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12428 reporting.
3e1b9a8a 12429
3dcad376
ST
124302009-12-29 Sriraman Tallam <tmsriram@google.com>
12431
12432 * options.cc (General_options::parse_version): Allow -v to exit
12433 without an error if there is nothing to link.
12434
084e2665
ILT
124352009-12-29 Ian Lance Taylor <iant@google.com>
12436
12437 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12438 using a version of gcc before 4.1.
12439 * configure: Rebuild.
12440
250acde3
CD
124412009-12-28 Chris Demetriou <cgd@google.com>
12442
12443 * attributes.cc (Output_attributes_section_data::do_write): Use
12444 std::vector::front rather than std::vector::data.
12445
99fff23b
ILT
124462009-12-28 Ian Lance Taylor <iant@google.com>
12447
12448 * symtab.h (class Symbol_table): Add enum Defined.
12449 * resolve.cc (Symbol_table::should_override): Add defined
12450 parameter. Change all callers. Test whether object is NULL
12451 before calling a method on it.
12452 (Symbol_table::report_resolve_problem): Add defined parameter.
12453 Change all callers.
12454 (Symbol_table::should_override_with_special): Likewise.
12455 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12456 parameter. Change all callers.
12457 (Symbol_table::do_define_in_output_data): Likewise.
12458 (Symbol_table::define_in_output_segment): Likewise.
12459 (Symbol_table::do_define_in_output_segment): Likewise.
12460 (Symbol_table::define_as_constant): Likewise.
12461 (Symbol_table::do_define_as_constant): Likewise.
12462 * script.h (class Symbol_assignment): Add is_defsym parameter to
12463 constructor; change all callers.
12464 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12465 parameter. Change all callers. Add is_defsym_ field.
12466 (class Parser_closure): Add parsing_defsym parameter to
12467 constructor; change all callers. Add parsing_defsym accessor
12468 function. Add parsing_defsym_ field.
12469
556bd683
ILT
124702009-12-28 Ian Lance Taylor <iant@google.com>
12471
12472 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12473 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12474
1782c879
ILT
124752009-12-23 Ian Lance Taylor <iant@google.com>
12476
12477 * i386.cc (Target_i386::do_calls_non_split): Recognize
12478 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12479 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12480 -fsplit-stack prologue when using %r11.
1782c879 12481
329ca2b1
ST
124822009-12-21 Sriraman Tallam <tmsriram@google.com>
12483
12484 * options.cc (General_options::parse_version): Make -v continue and do
12485 the link like GNU ld does.
12486
d675ff46
RÁE
124872009-12-17 Rafael Avila de Espindola <espindola@google.com>
12488
12489 * Makefile.am (CCFILES): Add timer.cc.
12490 (HFILES): Add timer.h.
12491 * configure.ac: Check for sysconf and times.
12492 * main.cc: include timer.h.
12493 (main): Use Timer instead of get_run_time.
12494 * timer.cc: New.
12495 * timer.h: New.
12496 * workqueue.cc: include timer.h.
12497 (Workqueue::find_and_run_task):
12498 Report user, sys and wall time.
12499 * Makefile.in: Regenerate.
12500 * config.in: Regenerate.
12501 * configure: Regenerate.
12502
d6344fb5
DK
125032009-12-16 Doug Kwan <dougkwan@google.com>
12504
12505 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12506 sections.
12507 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12508 relaxed input sections.
12509 * output.cc (Output_section::find_relaxed_input_section): Change
12510 return type to Output_relaxed_input_section pointer. Adjust code
12511 for new type of relaxed_input_section_map_.
12512 * output.h (Output_section::find_relaxed_input_section): Change
12513 return type to Output_relaxed_input_section pointer.
12514 (Output_section::Output_relaxed_input_section_by_input_section_map):
12515 New type.
12516 (Output_section::relaxed_input_section_map_): Change type to
12517 Output_section::Output_relaxed_input_section_by_input_section_map.
12518 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12519 input section.
12520
0e0d5469
ILT
125212009-12-15 Ian Lance Taylor <iant@google.com>
12522
12523 * layout.cc (Layout::create_shstrtab): Only write out after input
12524 sections if we are compressing debug sections.
12525
0649a889
ILT
125262009-12-15 Ian Lance Taylor <iant@google.com>
12527
12528 * archive.cc (Archive::add_symbols): Only look up a symbol without
12529 a version if there is, in fact, a version.
12530
2ea97941
ILT
125312009-12-14 Ian Lance Taylor <iant@google.com>
12532
12533 Revert -Wshadow changes, all changes from:
12534 2009-12-11 Doug Kwan <dougkwan@google.com>
12535 2009-12-11 Nick Clifton <nickc@redhat.com>
12536 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12537
b0eec2cc
DK
125382009-12-11 Doug Kwan <dougkwan@google.com>
12539
12540 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12541 due to -Wshadow.
12542 * attributes.cc (Object_attribute::size): Ditto.
12543 (Attributes_section_data::size): Ditto.
12544 (Attributes_section_data::Attributes_section_data): Ditto.
12545 (Output_attributes_section_data::do_write): Ditto.
12546 * attributes.h (Object_attribute::set_type): Ditto.
12547 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12548
91d6fa6a
NC
125492009-12-11 Nick Clifton <nickc@redhat.com>
12550
12551 * archive.cc: Fix shadowed variable warnings.
12552 * arm.cc: Likewise.
12553 * compressed_output.cc: Likewise.
12554 * compressed_output.h: Likewise.
12555 * configure: Likewise.
12556 * dwarf_reader.cc: Likewise.
12557 * dynobj.cc: Likewise.
12558 * dynobj.h: Likewise.
12559 * ehframe.cc: Likewise.
12560 * ehframe.h: Likewise.
12561 * errors.cc: Likewise.
12562 * expression.cc: Likewise.
12563 * fileread.cc: Likewise.
12564 * fileread.h: Likewise.
12565 * freebsd.h: Likewise.
12566 * i386.cc: Likewise.
12567 * icf.cc: Likewise.
12568 * incremental.h: Likewise.
12569 * layout.cc: Likewise.
12570 * layout.h: Likewise.
12571 * mapfile.cc: Likewise.
12572 * merge.cc: Likewise.
12573 * merge.h: Likewise.
12574 * object.cc: Likewise.
12575 * object.h: Likewise.
12576 * options.h: Likewise.
12577 * output.cc: Likewise.
12578 * output.h: Likewise.
12579 * parameters.cc: Likewise.
12580 * plugin.cc: Likewise.
12581 * powerpc.cc: Likewise.
12582 * reduced_debug_output.cc: Likewise.
12583 * reduced_debug_output.h: Likewise.
12584 * reloc.cc: Likewise.
12585 * reloc.h: Likewise.
12586 * resolve.cc: Likewise.
12587 * script-sections.cc: Likewise.
12588 * script.cc: Likewise.
12589 * script.h: Likewise.
12590 * sparc.cc: Likewise.
12591 * symtab.cc: Likewise.
12592 * symtab.h: Likewise.
12593 * target-select.cc: Likewise.
12594 * target-select.h: Likewise.
12595 * token.h: Likewise.
12596 * workqueue.cc: Likewise.
12597 * workqueue.h: Likewise.
12598 * x86_64.cc: Likewise.
12599
a0351a69
DK
126002009-12-10 Doug Kwan <dougkwan@google.com>
12601
12602 * arm.cc (attributes.h): New include.
12603 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12604 (Arm_relobj::~Arm_relobj): Delete object pointed by
12605 attributes_section_data_.
12606 (Arm_relobj::attributes_section_data): New method definition.
12607 (Arm_relobj::attributes_section_data_): New data member declaration.
12608 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12609 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12610 attributes_section_data_.
12611 (Arm_dynobj::attributes_section_data): New method definition.
12612 (Arm_dynobj::attributes_section_data_): New data member declaration.
12613 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12614 initialization value of may_use_blx_ to false.
2e702c99 12615 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12616 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12617 object attributes to compute results instead of hard-coding.
12618 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12619 Target_arm::get_secondary_compatible_arch,
12620 Target_arm::set_secondary_compatible_arch
12621 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12622 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12623 New method declarations.
12624 (Target_arm::get_aeabi_object_attribute): New method definition.
12625 (Target_arm::attributes_section_data_): New data member declaration.
12626 (read_arm_attributes_section): New template definition.
12627 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12628 (Arm_dynobj::do_read_symbols): Ditto.
12629 (Target_arm::do_finalize_sections): Merge attributes sections from
12630 input. Check for BLX use after attributes section merging.
12631 Fix __exidx_start and __exidx_end visibility. Create an
12632 .ARM.attributes section if necessary.
12633 (Target_arm::get_secondary_compatible_arch,
12634 Target_arm::set_secondary_compatible_arch,
12635 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12636 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12637 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12638 New method definitions.
12639
b59befec
ILT
126402009-12-09 Ian Lance Taylor <iant@google.com>
12641
12642 * plugin.cc (Plugin::load): Don't cast from void* to a function
12643 pointer.
12644
1276bc89
ILT
126452009-12-09 Ian Lance Taylor <iant@google.com>
12646
12647 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12648 information fields.
12649
2f2de248
L
126502009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12651
12652 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12653 Replace two_file_shared_1.so with two_file_shared_2.so.
12654 * testsuite/Makefile.in: Regenerated.
12655
4f787271
DK
126562009-12-08 Doug Kwan <dougkwan@google.com>
12657
12658 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12659 (HFILES): Add attributes.h and int_encoding.h.
12660 * Makefile.in: Regenerate.
12661 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12662 function definitions to int_encoding.cc
12663 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12664 prototypes to int_encoding.h
12665 * reduced_debug_output.cc (int_encoding.h): New include.
12666 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12667 function definitions to int_encoding.cc
12668 (insert_into_vector, read_from_pointer): Move template definitions to
12669 int_encoding.h
12670 * attributes.cc: New file.
12671 * attributes.h: New file.
12672 * int_encoding.cc: New file.
12673 * int_encoding.h: New file.
12674
20b52f1a
RÁE
126752009-12-07 Rafael Avila de Espindola <espindola@google.com>
12676
12677 PR gold/11055
12678 * incremental-dump.cc (dump_incremental_inputs): New.
12679 (main): Use dump_incremental_inputs.
12680
53d7974c
L
126812009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12682
12683 PR gold/10893
12684 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12685 checking elfcpp::STT_FUNC.
12686 (Target_i386::Relocate::relocate): Likewise.
12687 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12688
12689 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12690 symbols from shared libraries into normal FUNC symbols.
12691
12692 * symtab.h (Symbol): Add is_func and use it.
12693
05a352e6
DK
126942009-12-05 Doug Kwan <dougkwan@google.com>
12695
12696 * arm.cc (Target_arm::arm_info): Initialize new fields
12697 attributes_section and attributes_vendor.
12698 * i386.cc (Target_i386::i386_info): Same.
12699 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12700 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12701 fields attributes_section and attributes_vendor.
53d7974c 12702 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12703 * target.h (Target::attributes_section, Target::attributes_vendor,
12704 Target::is_attributes_section, Target::attribute_arg_type,
12705 Target::attributes_order): New method definitions.
12706 (Target::Target_info::attributes_section,
12707 Target::Target_info::attributes_vendor): New fields.
12708 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12709 virtual method definitions.
12710 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12711 attributes_section and attributes_vendor.
12712 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12713
f4e5969c
DK
127142009-12-05 Doug Kwan <dougkwan@google.com>
12715
12716 * arm.cc: Update comments about interworking and stub generation.
12717 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12718 considered as non-PIC.
12719 (Arm_relocate_functions::base_abs): Fix formatting.
12720 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12721 of function to use GOT entry address instead of offset.
12722 (Target_arm::Scan::global): Issue an error if a symbol would need a
12723 PLT does not get one because it is untyped. Remove code to create
12724 dynamic symbols for relative branches.
12725 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12726 takes unsigned integer instead of boolean.
12727
1abce4a6
L
127282009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12729
12730 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12731 (two_file_test_LDADD): Likewise.
12732 (common_test_1_LDADD): Likewise.
12733 (exception_test_LDADD) Likewise.
12734 (weak_test_LDADD): Likewise.
12735 (many_sections_test_LDADD): Likewise.
12736 (initpri1_LDADD): Likewise.
12737 (script_test_1_LDADD): Likewise.
12738 (script_test_2_LDADD): Likewise.
12739 (justsyms_LDADD): Likewise.
12740 (binary_test_LDADD): Likewise.
12741 (large_LDADD): Likewise.
12742 * testsuite/Makefile.in: Regenerated.
12743
adcf2816 127442009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12745
adcf2816
L
12746 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12747 (Symbol_table::override_with_special): Likewise.
12748 (Symbol_table::add_from_object): Likewise.
12749
28e67f5d
RÁE
127502009-12-04 Rafael Avila de Espindola <espindola@google.com>
12751
12752 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12753 Don't set the data_offset twice.
12754
ae10a101
RÁE
127552009-12-04 Rafael Avila de Espindola <espindola@google.com>
12756
12757 * testsuite/Makefile.in: Regenerate.
12758
f59f41f3
DK
127592009-12-03 Doug Kwan <dougkwan@google.com>
12760
12761 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12762 (Target_arm::do_finalize_sections): Add parameter for symbol table
12763 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12764 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12765 parameter for symbol table pointer.
12766 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12767 an additional parameter for a pointer to symbol table.
12768 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12769 parameter for a symbol table pointer.
12770 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12771 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12772 Ditto.
12773 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12774 parameter for a symbol table pointer.
12775
ca55d848
RÁE
127762009-12-03 Rafael Avila de Espindola <espindola@google.com>
12777
12778 * incremental.cc (Incremental_inputs_header)
12779 (Incremental_inputs_header_write, Incremental_inputs_entry)
12780 (Incremental_inputs_entry_write): Move ...
12781 * incremental.h (Incremental_inputs_header)
12782 (Incremental_inputs_header_write, Incremental_inputs_entry)
12783 (Incremental_inputs_entry_write): here.
12784
3aec4f9c
RÁE
127852009-12-02 Rafael Avila de Espindola <espindola@google.com>
12786
12787 * incremental.cc (make_sized_incremental_binary): Set the target.
12788 Error if it is incompatible.
12789 * output.h (Output_file): Add filename method.
12790
9c0ae74d
RÁE
127912009-12-02 Rafael Avila de Espindola <espindola@google.com>
12792
12793 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12794 from the get_* methods.
12795
a45500ae
RÁE
127962009-12-02 Rafael Avila de Espindola <espindola@google.com>
12797
12798 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12799 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12800 Write 0 for the data_offset of scripts.
12801
325e6408
RÁE
128022009-12-02 Rafael Avila de Espindola <espindola@google.com>
12803
12804 * testsuite/Makefile.am: Add the incremental_test.sh test.
12805 * testsuite/incremental_test.sh: New.
12806 * testsuite/incremental_test_1.c: New.
12807 * testsuite/incremental_test_2.c: New.
12808
954c3e2e
RÁE
128092009-12-01 Rafael Avila de Espindola <espindola@google.com>
12810
703d02da 12811 * incremental-dump.cc (main): Fix typos.
954c3e2e 12812
f8086623
RÁE
128132009-11-27 Rafael Avila de Espindola <espindola@google.com>
12814
12815 PR gold/11025
12816 * incremental-dump.cc (main): Use llu to print 64 bit values.
12817
3b0dd6ac
L
128182009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12819 H.J. Lu <hongjiu.lu@intel.com>
12820
12821 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12822 $(LIBDL).
12823 (incremental_dump_LDADD): Likewise.
12824 * Makefile.in: Regenerated.
12825
a6d1ef57 128262009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12827
a6d1ef57
DK
12828 Revert:
12829
12830 2009-11-25 Doug Kwan <dougkwan@google.com>
12831
12832 * arm.cc (Target_arm::Target_arm): Move method definition
12833 outside of class definition. Add code to handle
12834 --target1-rel, --target1-abs and --target2= options.
12835 (Target_arm::get_reloc_reloc_type): Change method to be
12836 non-static and const.
12837 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12838 New data member declaration.
12839 (Target_arm::Scan::local, Target_arm::Scan::global,
12840 Target_arm::Relocate::relocate,
12841 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12842 Adjust call to Target_arm::get_real_reloc_type.
12843 (Target_arm::get_real_reloc_type): Use command line options
12844 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12845 * options.h (--target1-rel, --target1-abs, --target2): New
12846 ARM-only options.
12847
50aeb7d4
DK
128482009-11-25 Doug Kwan <dougkwan@google.com>
12849
12850 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12851 class definition. Add code to handle --target1-rel, --target1-abs
12852 and --target2= options.
12853 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12854 and const.
12855 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12856 member declaration.
12857 (Target_arm::Scan::local, Target_arm::Scan::global,
12858 Target_arm::Relocate::relocate,
12859 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12860 call to Target_arm::get_real_reloc_type.
12861 (Target_arm::get_real_reloc_type): Use command line options to
12862 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12863 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12864 options.
12865
51938283
DK
128662009-11-25 Doug Kwan <dougkwan@google.com>
12867
12868 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12869 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12870 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12871 formatting.
12872 (Arm_relocate_functions::thm_call): Replace body with a call to
12873 Arm_relocate_functions::thumb_branch_common.
12874 (Arm_relocate_functions::thm_jump24,
12875 Arm_relocate_functions::thm_xpc22): New method definitions.
12876 (Arm_relocate_functions::thumb_branch_common): New method definition.
12877 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12878 operator.
12879 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12880 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12881
e2b8f3c4
RÁE
128822009-11-24 Rafael Avila de Espindola <espindola@google.com>
12883
12884 * Makefile.am: Build incremental-dump
12885 * Makefile.in: Regenerate.
12886 * incremental-dump.cc: New.
12887 * incremental.cc (Incremental_inputs_header_data,
12888 Incremental_inputs_entry_data): Move to incremental.h
12889 * incremental.h: (Incremental_inputs_header_data,
12890 Incremental_inputs_entry_data): Move from incremental.cc
12891
bcba9aec
RÁE
128922009-11-24 Rafael Avila de Espindola <espindola@google.com>
12893
12894 * incremental.cc (Incremental_inputs_header,
12895 Incremental_inputs_header_write, Incremental_inputs_entry,
12896 Incremental_inputs_entry_write): Add a typedef with the data type.
12897
7c3afe08
RÁE
128982009-11-24 Rafael Avila de Espindola <espindola@google.com>
12899
12900 * incremental.cc (Incremental_inputs_header,
12901 Incremental_inputs_header_write, Incremental_inputs_entry,
12902 Incremental_inputs_entry_write): Update comment about which
12903 type has the filed descriptions.
12904
d204b6e9
DK
129052009-11-15 Doug Kwan <dougkwan@google.com>
12906
12907 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12908 (Arm_relocate_functions::arm_branch_common): Change method defintion
12909 in class definition to a method declaration and update list of formal
12910 parameters.
12911 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12912 Arm_relocation_functions::jump24): Adjust call to
12913 Arm_relocate_functions::arm_branch_common. Update list of formal
12914 parameters.
12915 (Arm_relocate_functions::xpc25): New method definition.
12916 (Arm_relocate_functions::arm_branch_common): Move method defintion
12917 out from class definition. Use stubs for mode-switching and extending
12918 branch ranges.
12919 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12920 specially. Change code to enable use of stubs in ARM branches.
12921
43d12afe
DK
129222009-11-10 Doug Kwan <dougkwan@google.com>
12923
12924 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12925 in method declaration.
12926 (Target_arm::relocate_stub): New method declaration.
12927 (Target_arm::default_target): Change to return a pointer instead of
12928 a const reference.
12929 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12930 Target_arm::default_target.
12931 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12932 method definition.
12933 (Target_arm::relocate_section): Adjust view.
12934 (Target_arm::relocate_stub): New method definition.
12935
ac33a407
DK
129362009-11-10 Doug Kwan <dougkwan@google.com>
12937
12938 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12939 a format warning.
12940 * incremental.cc (open_incremental_binary): Initialized local
12941 variables to avoid warnings.
12942 * object.cc (make_elf_object): Ditto.
12943 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12944 a format warning.
e1df38aa 12945
88ee28e9
L
12946009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12947
12948 PR gold/10930
12949 * testsuite/plugin_test.c: Include "config.h".
12950
2daedcd6
DK
129512009-11-09 Doug Kwan <dougkwan@google.com>
12952
12953 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12954 (arm_symbol_value): Remove.
12955 (Arm_relocate_functions::arm_branch_common,
12956 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12957 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12958 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12959 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12960 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12961 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12962 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12963 Arm_relocate_functions::thm_mobw_abs_nc,
12964 Arm_relocate_functions::thm_mov_abs,
12965 Arm_relocate_functions::movw_prel_nc,
12966 Arm_relocate_functions::thm_movt_abs,
12967 Arm_relocate_functions::movt_prel,
12968 Arm_relocate_functions::thm_movw_prel_nc,
12969 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12970 (Target_arm::Relocate::relocate): Only decompose address into two
12971 parts if relocation type uses the thumb-bit and pass the actual
12972 bit instead of a flag indicating that the thumb-bit is used. Adjust
12973 calls to methods in Arm_relocate_functions for this change.
12974
1276bc89 129752009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12976
12977 PR 10925
12978 * reloc.cc: Instantiate
12979 Sized_relobj::initialize_input_to_output_maps and
12980 Sized_relobj:free_input_to_output_maps.
12981
e53ad1b5
ILT
129822009-11-06 Ian Lance Taylor <iant@google.com>
12983
12984 PR 10876
12985 * defstd.cc (in_segment): Set only_if_ref true for "end".
12986
eb44217c
DK
129872009-11-06 Doug Kwan <dougkwan@google.com>
12988
12989 * arm.cc (class Reloc_stub): Correct a comment.
12990 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12991 (Target_arm::scan_section_for_stubs): New method declaration.
12992 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12993 Change methods from private to protected.
12994 (Target_arm::do_may_relax): New method definition.
12995 (Target_arm::do_relax, Target_arm::group_sections,
12996 Target_arm::scan_reloc_for_stub,
12997 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12998 (Target_arm::arm_input_section_map_): New data member declaration.
12999 (Target_arm::scan_reloc_for_stub,
13000 Target_arm::scan_reloc_section_for_stubs,
13001 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13002 Target_arm::do_relax): New method definitions.
13003
5d329b7d
ILT
130042009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13005
13006 * configure.ac: Check for (struct stat)::st_mtim
13007 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13008 * config.in: Regenerate.
13009 * configure: Regenerate.
13010
96a0d71b
ILT
130112009-11-05 Ian Lance Taylor <iant@google.com>
13012
13013 PR 10910
13014 * output.cc (Output_segment::add_output_section): Add missing
13015 return statement.
13016
594c8e5e
ILT
130172009-11-04 Ian Lance Taylor <iant@google.com>
13018
13019 PR 10880
13020 * object.h (class Object): Add is_needed and set_is_needed
13021 methods. Add is_needed_ field. Make bool fields into bitfields.
13022 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13023 defined in a dynamic object and referenced by a regular object,
13024 set is_needed for the dynamic object.
13025 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13026 if the file is marked with as_needed and it is not needed.
13027
22b127cc
ILT
130282009-11-04 Ian Lance Taylor <iant@google.com>
13029
13030 PR 10887
13031 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13032 tags if data is discarded by linker script.
13033 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13034 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13035 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13036 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13037
f5c870d2
ILT
130382009-11-04 Ian Lance Taylor <iant@google.com>
13039
13040 * layout.cc (Layout::get_output_section): Add is_interp and
13041 is_dynamic_linker_section parameters. Change all callers.
13042 (Layout::choose_output_section): Likewise.
13043 (Layout::make_output_section): Likewise.
13044 (Layout::add_output_section_data): Add is_dynamic_linker_section
13045 parameter. Change all callers.
13046 * layout.h (class Layout): Update declarations.
13047 * output.h (class Output_section): Add is_interp, set_is_interp,
13048 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13049 Add is_interp_, is_dynamic_linker_section_ fields. Change
13050 generate_code_fills_at_write_ to a bitfield.
13051 * output.cc (Output_section::Output_sections): Initialize new
13052 fields.
13053 (Output_segment::add_output_section): Add do_sort parameter.
13054 Change all callers.
13055
1ae4d23b
ILT
130562009-11-03 Ian Lance Taylor <iant@google.com>
13057
13058 PR 10860
13059 * options.h (class General_options): Add --warn-common.
13060 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13061 merging two common symbols.
13062 (Symbol_table::should_override): Handle --warn-common when merging
13063 a common symbol with a defined symbol. Use report_resolve_problem
13064 for multiple definitions.
13065 (Symbol_table::report_resolve_problem): New function.
13066 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13067
55da9579
DK
130682009-11-03 Doug Kwan <dougkwan@google.com>
13069
13070 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13071 stub_factory_.
13072 (Target_arm::stub_factory): New method definition.
13073 (Target_arm::new_arm_input_section,
13074 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13075 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13076 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13077 New type definitions.
13078 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13079 member declarations.
13080 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13081 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13082 New method definitions.
13083
37a9ac43
ILT
130842009-11-03 Ian Lance Taylor <iant@google.com>
13085
13086 * options.h (class General_options): Add --warn_constructors.
13087
b3d6a3d4
ILT
130882009-11-03 Ian Lance Taylor <iant@google.com>
13089
13090 PR 10893
13091 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13092 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13093
934b01dd
ILT
130942009-11-03 Ian Lance Taylor <iant@google.com>
13095
13096 PR 10895
13097 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13098 --msgid-bugs-address.
13099 (install-pdf): New target.
13100 (install-data_yes): Look up one directory to find mkinstalldirs.
13101
03c1939b
L
131022009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13103
13104 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13105 tree.
13106
ebd95253
DK
131072009-10-30 Doug Kwan <dougkwan@google.com>
13108
13109 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13110
e9bbb538
DK
131112009-10-30 Doug Kwan <dougkwan@google.com>
13112
13113 * arm.cc (Stub_addend_reader): New struct template definition
13114 and partial specializations.
13115 (Stub_addend_reader::operator()): New method definition for a
13116 partially specialized template.
13117
d5b40221
DK
131182009-10-30 Doug Kwan <dougkwan@google.com>
13119
13120 * arm.cc (Arm_relobj::processor_specific_flags): New method
13121 definition.
13122 (Arm_relobj::do_read_symbols): New method declaration.
13123 (Arm_relobj::processor_specific_flags_): New data member declaration.
13124 (Arm_dynobj): New class definition.
13125 (Target_arm::do_finalize_sections): Add input_objects parameter.
13126 (Target_arm::do_adjust_elf_header): New method declaration.
13127 (Target_arm::are_eabi_versions_compatible,
13128 (Target_arm::merge_processor_specific_flags): New method declaration.
13129 (Target_arm::do_make_elf_object): New overloaded method definitions
13130 and declaration.
13131 (Arm_relobj::do_read_symbols): New method definition.
13132 (Arm_dynobj::do_read_symbols): Ditto.
13133 (Target_arm::do_finalize_sections): Add input_objects parameters.
13134 Merge processor-specific flags from all input objects.
13135 (Target_arm::are_eabi_versions_compatible,
13136 Target_arm::merge_processor_specific_flags,
13137 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13138 New method definitions.
13139 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13140 Input_objects pointer type parameter.
13141 * layout.cc (Layout::finalize): Pass input objects to target's.
13142 finalize_sections function.
13143 * output.cc (Output_file_header::do_sized_write): Set ELF file
13144 header's processor-specific flags.
13145 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13146 Input_objects pointer type parameter.
13147 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13148 * target.h (Input_objects): New forward class declaration.
13149 (Target::processor_specific_flags,
13150 Target::are_processor_specific_flags_sect): New method definitions.
13151 (Target::finalize_sections): Add input_objects parameter.
13152 (Target::Target): Initialize processor_specific_flags_ and
13153 are_processor_specific_flags_set_.
13154 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13155 parameter.
13156 (Target::set_processor_specific_flags): New method definition.
13157 (Target::processor_specific_flags_,
13158 Target::are_processor_specific_flags_set_): New data member
13159 declarations.
13160 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13161 Input_objects pointer type parameter.
13162
ebabffbd
DK
131632009-10-30 Doug Kwan <dougkwan@google.com>
13164
13165 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13166
ad0f2072
ILT
131672009-10-28 Ian Lance Taylor <iant@google.com>
13168
13169 * object.h (class Relobj): Drop options parameter from
13170 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13171 do_scan_relocs, do_relocate. Change all callers.
13172 (class Sized_relobj): Drop options parameters from
13173 do_gc_process_relocs, do_scan_relocs, do_relocate,
13174 do_relocate_sections, relocate_sections, emit_relocs_scan,
13175 emit_relocs_scan_reltype. Change all callers.
13176 (struct Relocate_info): Remove options field and all references to
13177 it.
13178 * reloc.h (class Read_relocs): Remove options constructor
13179 parameter and options_ field. Change all callers.
13180 (class Gc_process_relocs, class Scan_relocs): Likewise.
13181 (class Relocate_task): Likewise.
13182 * target-reloc.h (scan_relocs): Remove options parameter. Change
13183 all callers.
13184 (scan_relocatable_relocs): Likewise.
13185 * target.h (class Sized_target): Remove options parameter from
13186 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13187 all callers.
13188 * gc.h (gc_process_relocs): Remove options parameter. Change all
13189 callers.
13190 * arm.cc: Update functions to remove options parameters.
13191 * i386.cc: Likewise.
13192 * powerpc.cc: Likewise.
13193 * sparc.cc: Likewise.
13194 * x86_64.cc: Likewise.
13195 * testsuite/testfile.cc: Likewise.
13196
8ffa3667
DK
131972009-10-28 Doug Kwan <dougkwan@google.com>
13198
13199 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13200 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13201 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13202 New method definitions.
13203
40f36857
CC
132042009-10-28 Cary Coutant <ccoutant@google.com>
13205
13206 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13207 (Plugin::cleanup_done_): New member.
13208 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13209 (Plugin_manager::cleanup_done_): Remove.
13210 (Plugin_manager::add_input_file): Edit error message.
13211 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13212 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13213
2c849493
ILT
132142009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13215
13216 * fileread.cc: (File_read::View::~View): Use the new
13217 data_ownership_ filed.
13218 (File_read::~File_read): Dispose the new whole_file_view_.
13219 (File_read::open): Mmap the whole file if needed.
13220 (File_read::open): Use whole_file_view_ instead of contents_.
13221 (File_read::find_view): Use whole_file_view_ if applicable.
13222 (File_read::do_read): Use whole_file_view_ instead of contents_.
13223 (File_read::make_view): Use whole_file_view_ instead of contents_,
13224 update File_read::View::View call.
13225 (File_read::find_or_make_view): Update File_read::View::View
13226 call.
13227 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13228 remove contents_
13229 (File_read::View::Data_ownership): New enum.
13230 (File_read::View::View): Replace bool mapped_ with Data_ownership
13231 argument.
13232 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13233 (File_read::View::data_ownership_): New field.
13234 (File_read::contents_): Remove (replaced by whole_file_view_).
13235 (File_read::whole_file_view_): New field.
13236 * options.h (class General_options): Add --keep-files-mapped.
13237
24998053
CC
132382009-10-27 Cary Coutant <ccoutant@google.com>
13239
13240 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13241 * testsuite/Makefile.am (plugin_test_5): New test case.
13242 * testsuite/Makefile.in: Regenerate.
13243
72adc4fa
DK
132442009-10-25 Doug Kwan <dougkwan@google.com>
13245
13246 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13247 from private to protected to allow access by child class.
13248 (Sized_relobj::do_relocate_sections): New method declaration.
13249 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13250 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13251 Sized_relobj::relocate_sections. Instantiate template explicitly
13252 for different target sizes and endianity.
13253
07f508a2
DK
132542009-10-24 Doug Kwan <dougkwan@google.com>
13255
13256 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13257 (Arm_input_section::as_arm_input_section): New method.
13258 (Arm_output_section): New class definition.
13259 (Arm_output_section::create_stub_group,
13260 Arm_output_section::group_sections): New method definitions.
13261
10ad9fe5
DK
132622009-10-22 Doug Kwan <dougkwan@google.com>
13263
13264 * arm.cc (Arm_input_section): New class definition.
13265 (Arm_input_section::init, Arm_input_section:do_write,
13266 Arm_input_section::set_final_data_size,
13267 Arm_input_section::do_reset_address_and_file_offset): New method
13268 definitions.
13269
56ee5e00
DK
132702009-10-21 Doug Kwan <dougkwan@google.com>
13271
13272 * arm.cc (Stub_table, Arm_input_section): New forward class
13273 declarations.
13274 (Stub_table): New class defintion.
13275 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13276 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13277 New method definition.
13278
b569affa
DK
132792009-10-21 Doug Kwan <dougkwan@google.com>
13280
13281 * arm.cc: Update copyright comments.
13282 (Target_arm): New forward class template declaration.
13283 (Arm_address): New type.
13284 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13285 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13286 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13287 constants.
13288 (Insn_template): Same.
13289 (DEF_STUBS): New macro.
13290 (Stub_type): New enum type.
13291 (Stub_template): New class definition.
13292 (Stub): Same.
13293 (Reloc_stub): Same.
13294 (Stub_factory): Same.
13295 (Target_arm::Target_arm): Initialize may_use_blx_ and
13296 should_force_pic_veneer_.
13297 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13298 Target_arm::should_force_pic_veneer,
13299 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13300 Target_arm::using_thumb_only, Target_arm:;default_target): New
13301 method defintions.
13302 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13303 New data member declarations.
13304 (Insn_template::size, Insn_template::alignment): New method defintions.
13305 (Stub_template::Stub_template): New method definition.
13306 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13307 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13308 (Stub_factory::Stub_factory): New method definition.
13309 * gold.h (string_hash): New template.
13310 * output.h (Input_section_specifier::hash_value): Use
13311 gold::string_hash.
13312 (Input_section_specifier::string_hash): Remove.
13313 * stringpool.cc (Stringpool_template::string_hash): Use
13314 gold::string_hash.
13315
6c172549
DK
133162009-10-20 Doug Kwan <dougkwan@google.com>
13317
13318 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13319 symbols of relaxed input sections.
13320 * output.h (Output_section::find_relaxed_input_section): Make
13321 method public.
13322
c5617f2f
DK
133232009-10-16 Doug Kwan <dougkwan@google.com>
13324
13325 * dynobj.cc (Versions::Versions): Initialize version_script_.
13326 Only insert base version symbol definition for a shared object
13327 if version script defines any version versions.
13328 (Versions::define_base_version): New method definition.
13329 (Versions::add_def): Check that base version is not needed.
13330 (Versions::add_need): Define base version lazily.
13331 * dynobj.h (Versions::define_base_version): New method declaration.
13332 (Versions::needs_base_version_): New data member declaration.
13333 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13334 (check_DATA): Add no_version_test.stdout.
13335 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13336 New make rules.
13337 * testsuite/Makefile.in: Regenerate.
13338 * testsuite/no_version_test.c: New file.
13339 * testsuite/no_version_test.sh: Ditto.
13340
3c12dcdb
DK
133412009-10-16 Doug Kwan <dougkwan@google.com>
13342
13343 * expression.cc (class Segment_start_expression): New class definition.
13344 (Segment_start_expression::value): New method definition.
13345 (script_exp_function_segment_start): Return a new
13346 Segment_start_expression.
13347 * gold/script-c.h (script_saw_segment_start_expression): New function
13348 prototype.
13349 * script-sections.cc (Script_sections::Script_sections): Initialize
13350 SAW_SEGMENT_START_EXPRESSION_ to false.
13351 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13352 and -Tbbs options to specify section addresses if given in
13353 command line and no SEGMENT_START expression is seen in a script.
13354 * script-sections.h (Script_sections::saw_segment_start_expression,
13355 Script_sections::set_saw_segment_start_expression): New method
13356 definition.
13357 (Script_sections::saw_segment_start_expression_): New data member
13358 declaration.
13359 * script.cc (script_saw_segment_start_expression): New function.
13360 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13361 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13362 script_test_7.sh and script_test_8.sh.
13363 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13364 script_test_8.stdout.
13365 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13366 (script_test_6, script_test_6.stdout, script_test_7,
13367 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13368 * Makefile.in: Regenerate.
13369 * testsuite/script_test_6.sh: New file.
13370 * testsuite/script_test_6.t: Same.
13371 * testsuite/script_test_7.sh: Same.
13372 * testsuite/script_test_7.t: Same.
13373 * testsuite/script_test_8.sh: Same.
13374
64b1ae37
DK
133752009-10-16 Doug Kwan <dougkwan@google.com>
13376
13377 * output.cc (Output_segment::set_section_list_address): Cast
13378 expressions to unsigned long long type to avoid format warnings.
13379
661be1e2
ILT
133802009-10-15 Ian Lance Taylor <iant@google.com>
13381
12edd763 13382 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13383 dot assignment to script_sections_.
12edd763
ILT
13384 * script-sections.cc (Script_sections::add_dot_assignment):
13385 Initialize if necessary.
13386
68b6574b
ILT
13387 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13388 program headers with no load segment if there is a linker script.
13389
661be1e2
ILT
13390 * layout.cc (Layout::set_segment_offsets): Align the file offset
13391 to the segment aligment for -N or -n with no load segment.
13392 * output.cc (Output_segment::add_output_section): Don't crash if
13393 the first section is a TLS section.
13394 (Output_segment::set_section_list_addresses): Print an error
13395 message if the address moves backward in a linker script.
13396 * script-sections.cc
13397 (Output_section_element_input::set_section_addresses): Don't
13398 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13399 (Orphan_output_section::set_section_addresses): Likewise.
13400
f15f61a7
DK
134012009-10-15 Doug Kwan <dougkwan@google.com>
13402
13403 * layout.cc (Layout::finish_dynamic_section): Generate tags
13404 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13405 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13406 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13407
82bb573a
ILT
134082009-10-14 Ian Lance Taylor <iant@google.com>
13409
13410 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13411 fields.
13412 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13413 data_shdr fields of relinfo.
13414 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13415 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13416 R_386_TLS_LDO_32, adjust based on section flags.
13417 (Target_i386::Relocate::fix_up_ldo): Remove.
13418
374ad285
ILT
134192009-10-13 Ian Lance Taylor <iant@google.com>
13420
13421 Add support for -pie.
13422 * options.h (class General_options): Add -pie and
13423 --pic-executable.
13424 (General_options::output_is_position_independent): Test -pie.
13425 (General_options::output_is_executable): Return true if not shared
13426 and not relocatable.
13427 (General_options::output_is_pie): Remove.
13428 * options.cc (General_options::finalize): Reject incompatible uses
13429 of -pie.
13430 * gold.cc (queue_middle_tasks): A -pie link is not static.
13431 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13432 * symtab.cc (Symbol::final_value_is_known): Return false if
13433 output_is_position_independent.
13434 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13435 output_is_position_independent.
13436 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13437 output_is_position_independent.
13438 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13439 output_is_position_independent.
13440 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13441 two_file_pie_test.
13442 (basic_pie_test.o, basic_pie_test): New targets.
13443 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13444 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13445 (two_file_pie_test): New target.
13446 * testsuite/Makefile.in: Rebuild.
13447 * README: Remove note saying that -pie is not supported.
13448
c6585162
ILT
134492009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13450
13451 * options.h (class General_options): Add -init and -fini.
13452 * layout.cc (Layout::finish_dynamic_section): Emit
13453 given init and fini functions.
13454
032ce4e9
ST
134552009-10-13 Sriraman Tallam <tmsriram@google.com>
13456
13457 * gc.h (gc_process_relocs): Check if icf is enabled using new
13458 function.
13459 * gold.cc (queue_initial_tasks): Likewise.
13460 (queue_middle_tasks): Likewise.
13461 * object.cc (do_layout): Likewise.
13462 * symtab.cc (is_section_folded): Likewise.
13463 * main.cc (main): Likewise.
13464 * reloc.cc (Read_relocs::run): Likewise.
13465 (Sized_relobj::do_scan_relocs): Likewise.
13466 * icf.cc (is_function_ctor_or_dtor): New function.
13467 (Icf::find_identical_sections): Check if function is ctor or dtor when
13468 safe icf is chosen.
13469 * options.h (General_options::icf): Change option to be an enum.
13470 (Icf_status): New enum.
13471 (icf_enabled): New method.
13472 (icf_safe_folding): New method.
13473 (set_icf_status): New method.
13474 (icf_status_): New variable.
13475 * (options.cc) (General_options::finalize): Set icf_status_.
13476 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13477 icf_test and icf_keep_unique_test to use the --icf enum flag.
13478 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13479 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13480
f345227a
ST
134812009-10-12 Sriraman Tallam <tmsriram@google.com>
13482
13483 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13484 includes to gc.h and icf.h.
13485 * arm.cc: Include gc.h.
13486 * gold.cc: Likewise.
13487 * i386.cc: Likewise.
13488 * powerpc.cc: Likewise.
13489 * sparc.cc: Likewise.
13490 * x86_64.cc: Likewise.
13491 * gc.h: Include icf.h.
13492
1c7814ed
ILT
134932009-10-11 Ian Lance Taylor <iant@google.com>
13494
13495 * plugin.cc: Include "gold.h" before other header files.
13496
ae3b5189
CD
134972009-10-10 Chris Demetriou <cgd@google.com>
13498
13499 * options.h (Input_file_argument::Input_file_type): New enum.
13500 (Input_file_argument::is_lib_): Replace with...
13501 (Input_file_argument::type_): New member.
13502 (Input_file_argument::Input_file_argument): Take Input_file_type
13503 'type' rather than boolean 'is_lib' as second argument.
13504 (Input_file_argument::is_lib): Use type_.
13505 (Input_file_argument::is_searched_file): New function.
13506 (Input_file_argument::may_need_search): Handle is_searched_file.
13507 * options.cc (General_options::parse_library): Support -l:filename.
13508 (General_options::parse_just_symbols): Update for Input_file_argument
13509 changes.
13510 (Command_line::process): Likewise.
13511 * archive.cc (Archive::get_file_and_offset): Likewise.
13512 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13513 * script.cc (read_script_file, script_add_file): Likewise.
13514 * fileread.cc (Input_file::Input_file): Likewise.
13515 (Input_file::will_search_for): Handle is_searched_file.
13516 (Input_file::open): Likewise.
13517 * readsyms.cc (Read_symbols::get_name): Likewise.
13518 * testsuite/Makefile.am (searched_file_test): New test.
13519 * testsuite/Makefile.in: Regenerate.
13520 * testsuite/searched_file_test.cc: New file.
13521 * testsuite/searched_file_test_lib.cc: New file.
13522
f3048a1d
ILT
135232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13524 Ian Lance Taylor <iant@google.com>
13525
13526 * descriptor.cc: Include <cstdio> and "binary-io.h".
13527 (Descriptors::open): Open the files in binary mode always.
13528 * script.cc (Lex::get_token): Treat \r as whitespace.
13529
d4780e57
ILT
135302009-10-09 Ian Lance Taylor <iant@google.com>
13531
13532 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13533
d9a893b8
ILT
135342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13535 Ian Lance Taylor <iant@google.com>
13536
13537 * configure.ac: Check for readv function also.
13538 * fileread.cc (readv): Define if not HAVE_READV.
13539 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13540 does not exist.
13541 * config.in: Regenerate.
13542 * configure: Regenerate.
13543
c0a62865
DK
135442009-10-09 Doug Kwan <dougkwan@google.com>
13545
13546 * layout.cc (Layout::make_output_section): Call target hook to make
13547 ordinary output section.
13548 (Layout::finalize): Adjust parameter list of call the
13549 Target::may_relax().
13550 * layout.h (class Layout::section_list): New method.
13551 * merge.h (Output_merge_base::entsize): Change visibility to public.
13552 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13553 New methods.
13554 (Output_merge_string::do_is_string): New method.
13555 * object.cc (Sized_relobj::do_setup): renamed from
13556 Sized_relobj::set_up.
13557 * object.h (Sized_relobj::adjust_shndx,
13558 Sized_relobj::initializ_input_to_output_maps,
13559 Sized_relobj::free_input_to_output_maps): Change visibilities to
13560 protected.
13561 (Sized_relobj::setup): Virtualize.
13562 (Sized_relobj::do_setup): New method declaration.
13563 (Sized_relobj::invalidate_section_offset,
13564 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13565 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13566 * options.cc (parse_int): New function.
13567 * options.h (parse_int): New declaration.
13568 (DEFINE_int): New macro.
13569 (stub_group_size): New option.
13570 * output.cc (Output_section::Output_section): Initialize memebers
13571 merge_section_map_, merge_section_by_properties_map_,
13572 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13573 (Output_section::add_input_section): Handled deferred code-fill
13574 generation and remove an old comment.
13575 (Output_section::add_relaxed_input_section): New method definition.
13576 (Output_section::add_merge_input_section): Use merge section by
13577 properties map to speed to search. Update merge section maps
13578 as appropriate.
13579 (Output_section::build_relaxation_map): New method definition.
13580 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13581 Same.
13582 (Output_section::relax_input_section): Renamed to
13583 Output_section::convert_input_sections_to_relaxed_sections and change
13584 interface to take a vector of pointers to relaxed sections.
13585 (Output_section::find_merge_section,
13586 Output_section::find_relaxed_input_section): New method definitions.
13587 (Output_section::is_input_address_mapped,
13588 Output_section::output_offset, Output_section::output_address):
13589 Use output section data maps to speed up searching.
13590 (Output_section::find_starting_output_address): Add comments.
13591 (Output_section::do_write,
13592 Output_section::write_to_postprocessing_buffer): Do code-fill
13593 generation as appropriate.
13594 (Output_section::get_input_sections): Invalidate relaxed input section
13595 map.
13596 (Output_section::restore_states): Adjust type of checkpoint .
13597 Invalidate relaxed input section map.
13598 * output.h (Output_merge_base): New class declaration.
13599 (Input_section_specifier): New class defintion.
13600 (class Output_relaxed_input_section) Change base class to
13601 Output_section_data_build.
13602 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13603 base class initializer.
13604 (Output_section::add_relaxed_input_section): New method declaration.
13605 (Output_section::Input_section): Change visibility to protected.
2e702c99 13606 (Output_section::Input_section::relobj,
c0a62865
DK
13607 Output_section::Input_section::shndx): Handle relaxed input sections.
13608 Output_section::input_sections) Change visibility to protected. Also
13609 define overload to return a non-const pointer.
13610 (Output_section::Merge_section_properties): New class defintion.
13611 (Output_section::Merge_section_by_properties_map,
13612 Output_section::Output_section_data_by_input_section_map,
13613 Output_section::Relaxation_map): New types.
13614 (Output_section::relax_input_section): Rename method to
13615 Output_section::convert_input_sections_to_relaxed_sections and change
13616 interface to take a vector of relaxed section pointers.
13617 (Output_section::find_merge_section,
13618 Output_section::find_relaxed_input_section,
13619 Output_section::build_relaxation_map,
13620 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13621 New method declarations.
13622 (Output_section::merge_section_map_
13623 Output_section::merge_section_by_properties_map_,
13624 Output_section::relaxed_input_section_map_,
13625 Output_section::is_relaxed_input_section_map_valid_,
13626 Output_section::generate_code_fills_at_write_): New data members.
13627 * script-sections.cc
13628 (Output_section_element_input::set_section_addresses): Call
13629 current_data_size and addralign methods of relaxed input sections.
13630 (Orphan_output_section::set_section_addresses): Call current_data_size
13631 and addralign methods of relaxed input sections.
13632 * symtab.cc (Symbol_table::compute_final_value): Extract template
13633 from the body of Symbol_table::sized_finalize_symbol.
13634 (Symbol_table::sized_finalized_symbol): Call
13635 Symbol_table::compute_final_value.
13636 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13637 (Symbol_table::compute_final_value): New templated method declaration.
13638 * target.cc (Target::do_make_output_section): New method defintion.
13639 * target.h (Target::make_output_section): New method declaration.
13640 (Target::relax): Add more parameters for input objects, symbol table
13641 and layout. Adjust call to do_relax.
13642 (Target::do_make_output_section): New method declaration.
13643 (Target::do_relax): Add parameters for input objects, symbol table
13644 and layout.
13645
d446d6c4
ILT
136462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13647
13648 * pread.c: Include stdio.h.
13649
bc06c745
ILT
136502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13651
13652 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13653 defined.
13654
75aea3d0
ILT
136552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13656
13657 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13658 Change read_shndx type to unsigned int.
13659 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13660 int.
13661 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13662 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13663 Change read_shndx type to unsigned int.
13664 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13665 int.
13666 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13667 * layout.cc (Layout::create_symtab_sections): Cast the result of
13668 local_symcount * symsize to off_t in the gold_assert.
13669
be8fcb75
ILT
136702009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13671
13672 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13673 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13674 R_ARM_BASE_ABS.
13675 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13676 (Arm_relocate_functions::thm_abs5): New function.
13677 (Arm_relocate_functions::abs12): New function.
13678 (Arm_relocate_functions::abs16): New function.
13679 (Arm_relocate_functions::base_abs): New function.
13680 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13681 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13682 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13683 R_ARM_BASE_ABS.
13684 (Scan::global): Likewise.
13685 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13686 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13687 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13688 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13689 R_ARM_BASE_ABS.
13690
c2a122b6
ILT
136912009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13692
13693 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13694 (Arm_relocate_functions::movt_prel): New function.
13695 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13696 (Arm_relocate_functions::thm_movt_prel): New function.
13697 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13698 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13699 (Scan::global, Relocate::relocate): Likewise.
13700 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13701
c4aa1e2d
ILT
137022009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13703
13704 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13705 Incremental_checker.
13706 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13707 unsigned int.
13708 (class Incremental_inputs_header): New class.
13709 (Incremental_inputs_header_writer): Edit comment.
13710 (Incremental_inputs_entry): New class.
13711 (Incremental_inputs_entry_writer): Edit comment.
13712 (Sized_incremental_binary::do_find_incremental_inputs_section):
13713 Add *strtab_shndx parameter, fill it.
13714 (Sized_incremental_binary::do_check_inputs): New method.
13715 (Incremental_checker::can_incrementally_link_output_file): Use
13716 Sized_incremental_binary::check_inputs.
13717 (Incremental_inputs::report_command_line): Save command line in
13718 command_line_.
13719 * incremental.h:
13720 (Incremental_binary::find_incremental_inputs_section): New
13721 method.
13722 (Incremental_binary::do_find_incremental_inputs_section): Add
13723 strtab_shndx parameter.
13724 (Incremental_binary::do_check_inputs): New pure virtual method.
13725 (Sized_incremental_binary::do_check_inputs): Declare.
13726 (Incremental_checker::Incremental_checker): Add incremental_inputs
13727 parameter, use it to initialize incremental_inputs_.
13728 (Incremental_checker::incremental_inputs_): New field.
13729 (Incremental_checker::command_line): New method.
13730 (Incremental_checker::inputs): New method.
13731 (Incremental_checker::command_line_): New field.
13732
c549a694
ILT
137332009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13734
13735 * incremental.cc: Include <cstdarg> and "target-select.h".
13736 (vexplain_no_incremental): New function.
13737 (explain_no_incremental): New function.
13738 (Incremental_binary::error): New method.
13739 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13740 method.
13741 (make_sized_incremental_binary): New function.
13742 (open_incremental_binary): New function.
13743 (can_incrementally_link_file): Add checks if output is ELF and has
13744 inputs section.
13745 * incremental.h: Include "elfcpp_file.h" and "output.h".
13746 (Incremental_binary): New class.
13747 (Sized_incremental_binary): New class.
13748 (open_incremental_binary): Declare.
13749 * object.cc (is_elf_object): Use
13750 elfcpp::Elf_recognizer::is_elf_file.
13751 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13752 * output.h (Output_file::filesize): New method.
13753
fd3c5f0b
ILT
137542009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13755
13756 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13757 New function.
13758 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13759 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13760 function.
13761 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13762 function.
13763 (Arm_relocate_functions::movw_abs_nc): New function.
13764 (Arm_relocate_functions::movt_abs): New function.
13765 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13766 (Arm_relocate_functions::thm_movt_abs): New function.
13767 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13768 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13769 (Scan::global): Likewise.
13770 (Relocate::relocate): Likewise.
13771 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13772
7f5309a5
ILT
137732009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13774
13775 * arm.cc (Arm_relocate_functions::got_prel) New function.
13776 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13777 (Relocate::relocate): Likewise.
13778 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13779
364c7fa5
ILT
137802009-10-06 Ian Lance Taylor <iant@google.com>
13781
13782 * options.h (class General_options): Define
13783 split_stack_adjust_size parameter.
13784 * object.h (class Object): Add uses_split_stack_ and
13785 has_no_split_stack_ fields. Add uses_split_stack and
13786 has_no_split_stack accessor functions. Declare
13787 handle_split_stack_section.
13788 (class Reloc_symbol_changes): Define.
13789 (class Sized_relobj): Define Function_offsets. Declare
13790 split_stack_adjust, split_stack_adjust_reltype, and
13791 find_functions.
13792 * object.cc (Object::handle_split_stack_section): New function.
13793 (Sized_relobj::do_layout): Call handle_split_stack_section.
13794 * dynobj.cc (Sized_dynobj::do_layout): Call
13795 handle_split_stack_section.
13796 * reloc.cc (Sized_relobj::relocate_sections): Call
13797 split_stack_adjust for executable sections in split_stack
13798 objects. Pass reloc_map to relocate_section.
13799 (Sized_relobj::split_stack_adjust): New function.
13800 (Sized_relobj::split_stack_adjust_reltype): New function.
13801 (Sized_relobj::find_functions): New function.
13802 * target-reloc.h: Include "object.h".
13803 (relocate_section): Add reloc_symbol_changes parameter. Change
13804 all callers.
13805 * target.h (class Target): Add calls_non_split method. Declare
13806 do_calls_non_split virtual method. Declare match_view and
13807 set_view_to_nop.
13808 * target.cc: Include "elfcpp.h".
13809 (Target::do_calls_non_split): New function.
13810 (Target::match_view): New function.
13811 (Target::set_view_to_nop): New function.
13812 * gold.cc (queue_middle_tasks): Give an error if mixing
13813 split-stack and non-split-stack objects with -r.
13814 * i386.cc (Target_i386::relocate_section): Add
13815 reloc_symbol_changes parameter.
13816 (Target_i386::do_calls_non_split): New function.
13817 * x86_64.cc (Target_x86_64::relocate_section): Add
13818 reloc_symbol_changes parameter.
13819 (Target_x86_64::do_calls_non_split): New function.
13820 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13821 parameter.
13822 * powerpc.cc (Target_powerpc::relocate_section): Add
13823 reloc_symbol_changes parameter.
13824 * sparc.cc (Target_sparc::relocate_section): Add
13825 reloc_symbol_changes parameter.
13826 * configure.ac: Call AM_CONDITIONAL for the default target.
13827 * configure: Rebuild.
13828 * testsuite/Makefile.am (TEST_AS): New variable.
13829 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13830 (check_DATA): Add split_i386 and split_x86_64 files.
13831 (SPLIT_DEFSYMS): Define.
13832 (split_i386_[1234n].o): New targets.
13833 (split_i386_[124]): New targets.
13834 (split_i386_[1234r].stdout): New targets.
13835 (split_x86_64_[1234n].o): New targets.
13836 (split_x86_64_[124]): New targets.
13837 (split_x86_64_[1234r].stdout): New targets.
13838 (MOSTLYCLEANFILES): Add new executables.
13839 * testsuite/split_i386.sh: New file.
13840 * testsuite/split_x86_64.sh: New file.
13841 * testsuite/split_i386_1.s: New file.
13842 * testsuite/split_i386_2.s: New file.
13843 * testsuite/split_i386_3.s: New file.
13844 * testsuite/split_i386_4.s: New file.
13845 * testsuite/split_i386_n.s: New file.
13846 * testsuite/split_x86_64_1.s: New file.
13847 * testsuite/split_x86_64_2.s: New file.
13848 * testsuite/split_x86_64_3.s: New file.
13849 * testsuite/split_x86_64_4.s: New file.
13850 * testsuite/split_x86_64_n.s: New file.
13851 * testsuite/testfile.cc (Target_test): Update relocation_section
13852 function.
13853 * testsuite/Makefile.in: Rebuild.
13854
e8a9fcda
ILT
138552009-10-06 Ian Lance Taylor <iant@google.com>
13856
13857 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13858 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13859 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13860 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13861 the address on ldo_addrs_.
13862 (Target_i386::Relocate::fix_up_ldo): New function.
13863
e99daf92
ILT
138642009-10-06 Rafael Espindola <espindola@google.com>
13865
13866 * plugin.cc (add_input_library): New.
13867 (Plugin::load): Add add_input_library to tv.
13868 (Plugin_manager::add_input_file): Add the is_lib argument.
13869 (add_input_file): Update call to Plugin_manager::add_input_file.
13870 (add_input_library): New.
13871 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13872
966d4097
DK
138732009-09-30 Doug Kwan <dougkwan@google.com>
13874
13875 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13876 symbol and call Symbol::may_need_copy_reloc to determine if
13877 a copy reloc is needed.
13878 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13879 nocopyreloc is given in command line.
13880 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13881 given in command line.
13882 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13883 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13884 of the removed Target_i386::may_need_copy_reloc.
13885 * options.h (copyreloc): New option with default value false.
13886 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13887 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13888 instead of the removed Target_powerpc::may_need_copy_reloc.
13889 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13890 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13891 instead of the removed Target_sparc::may_need_copy_reloc.
13892 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13893 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13894 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13895 instead of the removed Target_x86_64::may_need_copy_reloc.
13896
029ba973
ILT
138972009-09-30 Ian Lance Taylor <iant@google.com>
13898
13899 * object.h (class Object): Remove target_ field, and target,
13900 sized_target, and set_target methods.
13901 (Object::sized_target): Remove.
13902 (class Sized_relobj): Update declarations. Remove sized_target.
13903 * object.cc (Sized_relobj::setup): Remove target parameter.
13904 Change all callers.
13905 (Input_objects::add_object): Don't do anything with the target.
13906 (make_elf_sized_object): Add punconfigured parameter. Change all
13907 callers. Set or test parameter target.
13908 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13909 Change all callers.
13910 * parameters.cc (Parameters::set_target): Change parameter type to
13911 be non-const.
13912 (Parameters::default_target): Remove.
13913 (set_parameters_target): Change parameter type to be non-const.
13914 (parameters_force_valid_target): New function.
13915 (parameters_clear_target): New function.
13916 * parameters.h (class Parameters): Update declarations. Remove
13917 default_target method. Add sized_target and clear_target
13918 methods. Change target_ to be non-const.
13919 (set_parameters_target): Update declaration.
13920 (parameters_force_valid_target): Declare.
13921 (parameters_clear_target): Declare.
13922 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13923 as NULL if we aren't searching.
13924 (Add_symbols::run): Don't check for compatible target.
13925 * fileread.cc (Input_file::open_binary): Call
13926 parameters_force_valid_target.
13927 * gold.cc (queue_middle_tasks): Likewise.
13928 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13929 set_target on object.
13930 * dynobj.h (class Sized_dynobj): Update declarations.
13931 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13932 make_elf_object returns NULL.
13933 (Archive::include_member): Don't check whether object target is
13934 compatible.
13935 * output.cc (Output_section::add_input_section): Get target from
13936 parameters.
13937 (Output_section::relax_input_section): Likewise.
13938 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13939 parameters.
13940 (Sized_relobj::do_scan_relocs): Likewise.
13941 (Sized_relobj::relocate_sections): Likewise.
13942 * resolve.cc (Symbol_table::resolve): Likewise.
13943 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13944 parameter. Change all callers.
13945 (Symbol_table::add_from_object): Get target from parameters.
13946 (Symbol_table::add_from_relobj): Don't check object target.
13947 (Symbol_table::add_from_dynobj): Likewise.
13948 (Symbol_table::define_special_symbol): Get target from
13949 parameters.
13950 * symtab.h (class Symbol_table): Update declaration.
13951 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13952 parameter. Change all callers. Clear parameter target.
13953 (Binary_test): Test target here.
13954 * testsuite/object_unittest.cc (gold_testsuite): Remove
13955 target_test_pointer parameter. Change all callers.
13956 (Object_test): Test target here.
13957
a6a22b83
ILT
139582009-09-26 Ian Lance Taylor <iant@google.com>
13959
13960 * testsuite/initpri1.c: Don't try to use constructor priorities if
13961 compiling with gcc before 4.3.
13962
6a8f49fe
ILT
139632009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13964
13965 * testsuite/retain_symbols_file_test.sh (check_present): Change
13966 output file name to retain_symbols_file_test.stdout.
13967 (check_absent): Likewise.
13968
8c604651
CS
139692009-09-18 Craig Silverstein <csilvers@google.com>
13970
13971 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13972 * options.cc: Include <cerrno> and <fstream>.
13973 (General_options::finalize): Parse -retain-symbols-file tag.
13974 * options.h: New flag.
13975 (General_options): New method should_retain_symbol, new
13976 variable symbols_to_retain.
13977 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13978 should_retain_symbol map.
13979 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13980 * testsuite/Makefile.in: Regenerate.
13981 * testsuite/retain_symbols_file_test.sh: New file.
13982
ca58b19f
NC
139832009-09-18 Nick Clifton <nickc@redhat.com>
13984
13985 * po/es.po: Updated Spanish translation.
13986
20e6d0d6
DK
139872009-09-17 Doug Kwan <dougkwan@google.com>
13988
13989 * debug.h (DEBUG_RELAXATION): New constant.
13990 (DEBUG_ALL): Add DEBUG_RELAXATION.
13991 (debug_string_to_enum): Add relaxation debug option.
13992 * layout.cc
13993 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13994 Layout::Relaxation_debug_check::read_sections,
13995 Layout::Relaxation_debug_check::read_sections): New method definitions.
13996 (Layout::Layout): Initialize data members
13997 record_output_section_data_from_scrips_,
13998 script_output_section_data_list_ and relaxation_debug_check_.
13999 (Layout::save_segments, Layout::restore_segments,
14000 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14001 Layout::relaxation_loop_body): New method definitions.
14002 (Layout::finalize): Support relaxation. Move section layout code to
14003 Layout::relaxation_loop_body.
14004 (Layout::set_asection_address_from_script): Move code for orphan
14005 section placement out.
14006 (Layout::place_orphan_sections_in_script): New method definition.
14007 * layout.h (Output_segment_headers, Output_file_header):
14008 New forward class declarations.
14009 (Layout::~Layout): Define.
14010 (Layout::new_output_section_data_from_script): New method definition.
14011 (Layout::place_orphan_sections_in_script): New method declaration.
14012 (Layout::Segment_states): New type declaration.
14013 (Layout::save_segments, Layout::restore_segments,
14014 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14015 Layout::relaxation_loop_body): New method declarations.
14016 (Layout::Output_section_data_list): New type declaration.
14017 (Layout::Relaxation_debug_check): New class definition.
14018 (Layout::record_output_section_data_from_script_,
14019 Layout::script_output_section_data_list_, Layout::segment_states_,
14020 Layout::relaxation_debug_check_): New data members.
14021 * output.cc: (Output_section_headers::do_size): New method definition.
14022 (Output_section_headers::Output_section_headers): Move size
14023 computation to Output_section_headers::do_size.
14024 (Output_segment_headers::do_size): New method definition.
e1df38aa 14025 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14026 Output_file_header::do_size and call it.
14027 (Output_file_header::do_size): New method definition.
14028 (Output_data_group::Output_data_group): Adjust call to
14029 Output_section_data.
14030 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14031 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14032 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14033 RELAXED_INPUT_SECTION_CODE.
14034 (Output_section::Output_section): Initialize data member checkpoint_.
14035 (Output_section::~Output_section): Delete checkpoint object pointed
14036 by checkpoint_.
14037 (Output_section::add_input_section): Always add an Input_section if
14038 relaxing.
14039 (Output_section::add_merge_input_section): Add assert.
14040 (Output_section::relax_input_section): New method definition.
14041 (Output_section::set_final_data_size): Set load address to zero for
14042 an unallocated section.
14043 (Output_section::do_address_and_file_offset_have_reset_values):
14044 New method definition.
14045 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14046 Handle relaxed input section.
14047 (Output_section::sort_attached_input_sections): Checkpoint input
14048 section list lazily.
14049 (Output_section::get_input_sections): Change type of input_sections to
14050 list of Simple_input_section pointers. Checkpoint input section list
14051 lazily. Also handle relaxed input sections.
14052 (Output_section::add_input_section_for_script): Take a reference to
14053 a Simple_input_section object instead of Relobj pointer and section
14054 index as parameter. Handle relaxed input sections.
14055 (Output_section::save_states, Output_section::restore_states): New
14056 method definitions.
14057 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14058 (Output_data::is_data_size_fixed): New method definition.
14059 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14060 if it is fixed.
14061 (Output_data::address_and_file_offset_have_reset_values): New method
14062 definition.
14063 (Output_data::do_address_and_file_offset_have_reset_values): New method
14064 definition.
14065 (Output_data::set_data_size): Check that data size is not fixed.
14066 (Output_data::fix_data_size): New method definition.
14067 (Output_data::is_data_size_fixed_): New data member.
14068 (Output_section_headers::set_final_data_size): New method definition.
14069 (Output_section_headers::do_size): New method declaration.
14070 (Output_segment_headers::set_final_data_size): New method definition.
14071 (Output_segment_headers::do_size): New method declaration.
14072 (Output_file_header::set_final_data_size)::New method definition.
14073 (Output_file_header::do_size)::New method declaration.
14074 (Output_section_data::Output_section_data): Add new parameter
14075 is_data_size_fixed and use it to fix data size.
14076 (Output_data_const::Output_data_const): Adjust call to base class
14077 constructor and fix data size.
14078 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14079 base class constructor and fix data size.
14080 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14081 base class constructor and fix data size.
14082 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14083 class constructor and fix data size.
14084 (Output_data_group::set_final_data_size): New method definition.
14085 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14086 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14087 class constructor and fix data size.
14088 (Output_relaxed_input_section): New class definition.
14089 (Output_section::Simple_input_section): New class definition.
14090 (Output_section::get_input_sections): Adjust parameter list.
14091 (Output_section::add_input_section_for_script): Same.
14092 (Output_section::save_states, Output_section::restore_states,
14093 Output_section::do_address_and_file_offset_have_reset_values,
14094 (Output_section::Input_section::Input_section): Handle
14095 RELAXED_INPUT_SECTION_CODE. Add new overload for
14096 Output_relaxed_input_section.
14097 (Output_section::Input_section::is_input_section,
14098 Output_section::Input_section::set_output_section): Handle relaxed
14099 input section.
14100 (Output_section::Input_section::is_relaxed_input_section,
14101 Output_section::Input_section::output_section_data,
14102 Output_section::Input_section::relaxed_input_section): New method
14103 definitions.
14104 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14105 value.
14106 (Output_section::Input_section::u1_): Update comments.
14107 (Output_section::Input_section::u2_): Add new union member poris.
14108 (Output_section::Checkpoint_output_section): New classs definition.
14109 (Output_section::relax_input_section): New method declaration.
14110 (Output_section::checkpoint_): New data member.
14111 (Output_segment): Update comments.
14112 (Output_segment::Output_segment): Un-privatize copy constructor.
14113 (Output_segment::operator=): Un-privatize.
14114 * script-sections.cc (Output_section_element::Input_section_list):
14115 Change element type to Output_section::Simple_input_section.
14116 (Output_section_element_dot_assignment::set_section_addresses):
14117 Register output section data for relaxation clean up.
14118 (Output_data_exression::Output_data_expression): Adjust call to base
14119 constructor to fix data size.
14120 (Output_section_element_data::set_section_addresses): Register
14121 Output_data_expression object for relaxation clean up.
14122 (struct Input_section_info): Replace Relobj pointer and section index
14123 pair with Output_section::Simple_input_section and Convert struct to a
14124 class.
14125 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14126 Input_section_info data member to use accessors.
20e6d0d6
DK
14127 (Output_section_element_input::set_section_addresses): Use layout
14128 parameter. Adjust code to use Output_section::Simple_input_section
14129 and Input_secction_info classes. Register filler for relaxation
14130 clean up.
14131 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14132 and section index pair with Output_section::Simple_input_section
14133 class. Adjust code accordingly.
14134 (Phdrs_element::release_segment): New method definition.
14135 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14136 segment list.
14137 (Script_sections::release_segments): New method definition.
14138 * gold/script-sections.h (Script_sections::release_segments): New
14139 method declaration.
14140 * gold/target.h (Target::may_relax, Target::relax,
14141 Target::do_may_relax, Target::do_relax): New method definitions.
14142
5e445df6
ILT
141432009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14144
14145 * arm.cc (has_signed_unsigned_overflow): New function.
14146 (Arm_relocate_functions::abs8): New function.
14147 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14148 (Target_arm::Scan::global): Likewise.
14149 (Target_arm::relocate::relocate): Likewise.
14150 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14151 Likewise.
14152
8c604651 141532009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14154
14155 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14156 * testsuite/Makefile.in: Regenerate.
14157
1e9cc1c2
NC
141582009-09-11 Nick Clifton <nickc@redhat.com>
14159
14160 * po/gold.pot: Updated by the Translation project.
14161
6a89f575
CC
141622009-09-08 Cary Coutant <ccoutant@google.com>
14163
14164 * output.cc (Output_file::open): Add execute permission to empty file.
14165 * testsuite/Makefile.am (permission_test): New test.
14166 * testsuite/Makefile.in: Regenerate.
14167
fdcac5af
ILT
141682009-09-02 Ian Lance Taylor <iant@google.com>
14169
14170 * output.cc (Output_file::resize): Call map_no_anonymous rather
14171 than map.
14172
44453f85
ILT
141732009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14174
14175 * gold.cc: Include "incremental.h".
14176 (queue_initial_tasks): Call Incremental_checker methods.
14177 * incremental.cc: Include "output.h".
14178 (Incremental_checker::can_incrementally_link_output_file): New
14179 method.
14180 * incremental.h (Incremental_checker): New class.
14181
14182 * output.cc (Output_file::open_for_modification): New method.
14183 (Output_file::map_anonymous): Changed return type to bool. Record
14184 map in base_ field.
14185 (Output_file::map_no_anonymous): New method, broken out of map.
14186 (Output_file::map): Use map_no_anonymous and map_anonymous.
14187 * output.h (class Output_file): Update declarations.
14188
293c1386
CC
141892009-08-24 Cary Coutant <ccoutant@google.com>
14190
14191 * options.h (Command_line::Pre_options): New class.
14192 (Command_line::pre_options): New member.
14193 * options.cc (gold::options::ready_to_register): New variable.
14194 (One_option::register_option): Do nothing if not registering options.
14195 Assert if same short option registered twice.
14196 (General_options::General_options): Turn off option registration when
14197 done constructing.
14198 (Command_line::Pre_options::Pre_options): New constructor.
14199
f773f3d2
CC
142002009-08-24 Cary Coutant <ccoutant@google.com>
14201
06a73cfe
CC
14202 * options.h (General_options::no_keep_memory): Remove incorrect
14203 short option.
f773f3d2 14204
a15af8e2
RW
142052009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14206
14207 * Makefile.am (am__skiplex, am__skipyacc): New.
14208 * Makefile.in: Regenerate.
14209
c462b41b
RW
142102009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14211
14ec8efd
RW
14212 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14213 (INCLUDES): ... this.
14214 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14215 (AM_CPPFLAGS): Renamed from ...
14216 (INCLUDE): ... this.
14217 * Makefile.in, testsuite/Makefile.in: Regenerate.
14218
81ecdfbb
RW
14219 * Makefile.in: Regenerate.
14220 * aclocal.m4: Likewise.
14221 * config.in: Likewise.
14222 * configure: Likewise.
14223 * testsuite/Makefile.in: Likewise.
14224
c462b41b
RW
14225 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14226 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14227 * Makefile.in: Regenerate.
14228 * testsuite/Makefile.in: Regenerate.
14229
2da73f13
CC
142302009-08-19 Cary Coutant <ccoutant@google.com>
14231
14232 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14233 symbols in shared libraries overridden by hidden or internal symbols
14234 in the main program.
14235
2db70501
CD
142362009-08-19 Chris Demetriou <cgd@google.com>
14237
14238 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14239 checking source file names in error messages.
14240
f733487b
DK
142412009-08-18 Doug Kwan <dougkwan@google.com>
14242
14243 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14244 an elcpp::Ehdr as parameter. Adjust call to set_target.
14245 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14246 an elfcpp::Ehdr as parameter.
14247 * object.cc (Object::set_target): Remove the version that looks up
14248 a target and sets it.
14249 (Sized_relobj::setup): Take a Target object instead of
14250 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14251 (make_elf_sized_object): Find target and ask target to
14252 make an ELF object.
14253 * object.h: (Object::set_target): Remove the version that looks up
14254 a target and sets it.
14255 (Sized_relobj::setup): Take a Target object instead of
14256 an elfcpp:Ehdr as parameter.
14257 * target.cc: Include dynobj.h.
14258 (Target::do_make_elf_object_implementation): New.
2e702c99 14259 (Target::do_make_elf_object): New.
f733487b
DK
14260 * target.h (Target::make_elf_object): New template declaration.
14261 (Target::do_make_elf_object): New method declarations.
14262 (Target::do_make_elf_object_implementation): New template declaration.
14263
cc70f101
ILT
142642009-08-14 Ian Lance Taylor <iant@google.com>
14265
14266 * gold.h (FUNCTION_NAME): Define.
14267 (gold_unreachable): Use FUNCTION_NAME.
14268
ef5e0cb1
ST
142692009-08-12 Sriraman Tallam <tmsriram@google.com>
14270
14271 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14272 symbol in the --keep-unique list is not found.
14273
48c187ce
ST
142742009-08-12 Sriraman Tallam <tmsriram@google.com>
14275
14276 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14277 been maked as --keep-unique.
14278 (Icf::unfold_section): New function.
14279 * icf.h (Icf::unfold_section): New function.
14280 * options.h (General_options::keep_unique): New option.
14281 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14282 * testsuite/Makefile.in: Regenerate.
14283 * testsuite/icf_keep_unique_test.sh: New file.
14284 * testsuite/icf_keep_unique_test.cc: New file.
14285
645afe0c
CC
142862009-08-12 Cary Coutant <ccoutant@google.com>
14287
14288 PR 10471
14289 * resolve.cc (Symbol_table::resolve): Check for references from
14290 dynamic objects to hidden and internal symbols.
14291 * testsuite/Makefile.am (hidden_test.sh): New test.
14292 * testsuite/Makefile.in: Regenerate.
14293 * testsuite/hidden_test.sh: New script.
14294 * testsuite/hidden_test_1.c: New test source.
14295 * testsuite/hidden_test_main.c: New test source.
14296
11af873f
DK
142972009-08-11 Doug Kwan <dougkwan@google.com>
14298
14299 * arm.cc: Update comments.
14300 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14301 segment to locate the .ARM.exidx section if present.
14302
b9f7d72d
DK
143032009-08-09 Doug Kwan <dougkwan@google.com>
14304
14305 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14306 patch.
14307
ddd3c53c
ST
143082009-08-07 Sriraman Tallam <tmsriram@google.com>
14309 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14310 compiler warnings.
14311
27721062
ST
143122009-08-06 Sriraman Tallam <tmsriram@google.com>
14313
14314 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14315 valid tls_segment only for non-debug-section relocations.
14316 * testsuite/Makefile.am: Add gc_tls_test.
14317 * testsuite/Makefile.in: Regenerate.
14318 * testsuite/gc_tls_test.cc: New file.
14319 * testsuite/gc_tls_test.sh: New file.
14320
ef15dade 143212009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14322
ef15dade
ST
14323 * icf.cc: New file.
14324 * icf.h: New file.
14325 * Makefile.am (CCFILES): Add icf.cc.
14326 (HFILES): Add icf.h
14327 * Makefile.in: Regenerate.
14328 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14329 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14330 section, symbol and addend information for the relocs.
14331 * gold.cc (queue_middle_tasks): Call identical code folding.
14332 * gold.h: Add defines for multimap.
14333 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14334 to the call of finalize_local_symbols.
14335 * main.cc (main): Create object of class Icf.
14336 * object.cc (Sized_relobj::do_layout): Allow this function to be
14337 called twice during icf.
14338 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14339 to sections marked as identical by icf.
14340 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14341 when available.
14342 (Sized_relobj::do_section_entsize): New function.
14343 * object.h (Object::section_entsize): New function.
14344 (Object::do_section_entsize): New pure virtual function.
14345 (Relobj::finalize_local_symbols): Add new parameter.
14346 (Relobj::do_section_entsize): New function.
14347 * options.h (General_options::icf): New option.
14348 (General_options::icf_iterations): New option.
14349 (General_options::print_icf_sections): New option.
14350 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14351 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14352 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14353 icf.
14354 * symtab.cc (Symbol_table::is_section_folded): New function.
14355 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14356 to sections marked as identical by icf.
14357 * symtab.h (Symbol_table::set_icf): New function.
14358 (Symbol_table::icf): New function.
14359 (Symbol_table::is_section_folded): New function.
14360 (Symbol_table::icf_): New data member.
14361 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14362 * testsuite/Makefile.am: Add commands to build icf_test.
14363 * testsuite/Makefile.in: Regenerate.
14364 * testsuite/icf_test.sh: New file.
14365 * testsuite/icf_test.cc: New file.
14366
c3b65ac4
CD
143672009-07-24 Chris Demetriou <cgd@google.com>
14368
14369 * layout.cc (is_compressible_debug_section): Fix incorrect
14370 comment about compressed section names.
14371
1caf2c51
ILT
143722009-07-20 Ian Lance Taylor <ian@airs.com>
14373
14374 PR 10419
14375 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14376
1ef4d87f
ILT
143772009-07-16 Ian Lance Taylor <iant@google.com>
14378
14379 PR 10400
14380 * layout.h: #include <map>.
14381 (class Kept_section): Change from struct to class. Add accessors
14382 and setters. Add section size to Comdat_group mapping. Change
14383 Comdat_group to std::map. Add is_comdat_ field. Add
14384 linkonce_size field in union.
14385 (class Layout): Update declaration of find_or_add_kept_section.
14386 Don't declare find_kept_object.
14387 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14388 parameter. Add object, shndx, is_comdat, and is_group_name
14389 parameters. Change all callers. Adjust for new Kept_section.
14390 (Layout::find_kept_object): Remove.
14391 * object.cc (Sized_relobj::include_section_group): Update use of
14392 Kept_section. Rename secnum to shndx. Only record
14393 Kept_comdat_section if sections are the same size.
14394 (Sized_relobj::include_linkonce_section): Update use of
14395 Kept_section. Only record Kept_comdat_section if sections are the
14396 same size. Set size of linkonce section.
14397 (Sized_relobj::map_to_kept_section): Update call to
14398 get_kept_comdat_section.
14399 * object.h (class Sized_relobj): Rename fields in
14400 Kept_comdat_section to drop trailing underscores; change object
14401 field to Relobj*. Change Kept_comdat_section_table to store
14402 struct rather than pointer.
14403 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14404 Add kept_object and kept_shndx parameters. Change all callers.
14405 (Sized_relobj::get_kept_comdat_section): Change return type to
14406 bool. Add kept_object and kept_shndx parameters. Change all
14407 callers.
14408 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14409 Layout::find_or_add_kept_section.
14410
37c3b7b0
ILT
144112009-07-09 Ian Lance Taylor <iant@google.com>
14412
14413 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14414 Reserve space in the hash table.
14415
98fa85cb
ILT
144162009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14417
14418 * fileread.cc (File_read::get_mtime): New method.
14419 * fileread.h (Timespec): New structure.
14420 (File_read::get_mtime): New method.
14421 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14422 Renamed from timestamp_nsec.
14423 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14424 Elf_Xword.
e1df38aa 14425 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14426 timestamp_nsec.
e1df38aa 14427 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14428 (Incremental_inputs::report_obejct): Save mtime; style fix.
14429 (Incremental_inputs::report_script): Save mtime; style fix.
14430 (Incremental_inputs::finalize_inputs): Style fix.
14431 (Incremental_inputs::finalize): Style fix.
14432 (Incremental_inputs::create_input_section_data): Store inputs
14433 mtime.
14434 * incremental.h (Incremental_inputs::report_script): Add mtime
14435 argument.
14436 (Incremental_inputs::Input_info::Input_info): Intialize only one
14437 union member.
14438 (Incremental_inputs::Input_info::archive): Move to nameless
14439 union.
14440 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14441 (Incremental_inputs::Input_info::script): Move to nameless union.
14442 (Incremental_inputs::mtime): New field.
14443 * script.cc (read_input_script): Pass file mtime to
14444 Incremental_input.
14445 * script.h (Script_info::inputs): Style fix.
14446
c9d70757
ILT
144472009-07-01 Ian Lance Taylor <ian@airs.com>
14448
14449 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14450 instead of 32.
14451
9c547ec3
ILT
144522009-06-24 Ian Lance Taylor <iant@google.com>
14453
14454 PR 10156
14455 * layout.cc (Layout::choose_output_section): If we find an
14456 existing section, update the flags.
14457 (Layout::create_notes): New function, broken out of
14458 Layout::finalize.
14459 (Layout::finalize): Don't create note sections.
14460 (Layout::create_note): Don't crash if linker script discards
14461 section.
14462 (Layout::create_gold_note): Likewise.
14463 (Layout::create_build_id): Likewise. Don't set
14464 after_input_sections on the section.
14465 (Layout::create_executable_stack_info): Remove target parameter.
14466 Change caller.
14467 * layout.h (class Layout): Declare create_notes. Update
14468 declaration of create_executable_stack_info.
14469 * gold.cc (queue_middle_tasks): Call create_notes.
14470 * output.cc (Output_section::update_flags_for_input_section): Move
14471 here from output.h. If SHF_ALLOC flag is newly set, mark address
14472 invalid.
14473 * output.h (Output_data::mark_address_invalid): New function.
14474 (class Output_section): Only declare, not define,
14475 update_flags_for_input_section. Remove set_flags.
14476
55458500
ILT
144772009-06-24 Ian Lance Taylor <iant@google.com>
14478
14479 * script-sections.cc (Output_section_definition::
14480 set_section_addresses): Rename shadowing local load_address to
14481 laddr.
14482
1307d6cd
ILT
144832009-06-24 Ian Lance Taylor <iant@google.com>
14484
14485 PR 10244
14486 * reloc.cc (relocate_sections): Skip empty relocation sections.
14487
ec3f783e
ILT
144882009-06-23 Ian Lance Taylor <iant@google.com>
14489
14490 PR 10156
14491 * layout.cc (Layout::create_note): Use choose_output_section
14492 rather than make_output_section.
14493
459c9f1c
ILT
144942009-06-23 Ian Lance Taylor <iant@google.com>
14495
14496 PR 10237
14497 * options.cc (General_options::parse_V): Set printed_version_.
14498 (General_options::General_options): Initialize printed_version_.
14499 * options.h (class General_options): Add printed_version_ field.
14500 * gold.cc (queue_initial_tasks): If there are no input files,
14501 don't give a fatal error if we printed the version information.
14502 (queue_middle_tasks): If using -r with a shared object, give a
14503 fatal error rather than an ordinary error.
14504
1518dc8f
ILT
145052009-06-23 Ian Lance Taylor <iant@google.com>
14506
14507 PR 10219
14508 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14509 (Layout::make_output_section): Set have_stabstr_section_ if we see
14510 a .stab*str section.
14511 (Layout::finalize): Call link_stabs_sections.
14512 (Layout::link_stabs_sections): New file.
14513 * layout.h (class Layout): Add have_stabstr_section_ field.
14514 Declare link_stabs_sections.
14515
3d857b98
DK
145162009-06-23 Doug Kwan <dougkwan@google.com>
14517
14518 * Makefile.am (libgold_a_LIBADD): New.
14519 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14520 * Makefile.in: Regenerate.
3d857b98
DK
14521 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14522 * configure: Regenerate.
14523 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14524 * fileread.cc: Include sys/state.h
14525 * gold.h: Declare memmem and strndup if found missing.
14526 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14527
0639a6f6
ILT
145282009-06-23 Ian Lance Taylor <iant@google.com>
14529
14530 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14531 * configure: Rebuild.
14532
8d63875c
ILT
145332009-06-23 Ian Lance Taylor <iant@google.com>
14534
14535 PR 10147
14536 * object.cc (Object::section_contents): Don't try to get a view if
14537 the section has length zero.
14538 (Object::handle_gnu_warning_section): If the section is empty, use
14539 the name of the section as the warning.
14540
f7c8a183
ILT
145412009-06-23 Ian Lance Taylor <iant@google.com>
14542
14543 PR 10133
14544 * stringpool.h (class Stringpool_template): Add optimize_ field.
14545 (Stringpool_template::set_optimize): New function.
14546 * stringpool.cc (Stringpool_template::Stringpool_template):
14547 Initialize optimize_ field.
14548 (Stringpool_template::set_string_offsets): Test local optimize
14549 fild rather than parameter.
14550 * layout.cc (Layout::Layout): Call set_optimize on the section
14551 name stringpool.
14552
e6a307ba
ILT
145532009-06-22 Ian Lance Taylor <iant@google.com>
14554
14555 PR 10030
14556 * yyscript.y: Parse TARGET.
14557 * script.cc (script_set_target): New function.
14558 * script-c.h (script_set_target): Declare.
14559 * options.cc (General_options::string_to_object_format): Rename
14560 from string_to_object_format in anonymous namespace. Change
14561 callers.
14562 * options.h (class General_options): Declare
14563 string_to_object_format.
14564
3ee173de
ILT
145652009-06-22 Ian Lance Taylor <iant@google.com>
14566
14567 * script-sections.cc (Script_sections::create_segments): Don't put
14568 program headers in a PT_LOAD segment if -n or -N.
14569
145702009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14571
14572 PR 10141
14573 * options.h (class General_options): Add -z lazy and -z now. Sort
14574 -z options into alphabetical order.
14575 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14576
cd6739a1 145772009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14578
14579 * layout.cc (Layout::make_output_section): Call
14580 Target::new_output_section.
14581 (Layout::attach_allocated_section_to_segment): Put large section
14582 sections in a separate load segment with the large segment flag
14583 set.
14584 (Layout::segment_precedes): Sort large data segments after other
14585 load segments.
14586 (align_file_offset): New static function.
14587 (Layout::set_segment_offsets): Use align_file_offset.
14588 * output.h (class Output_section): Add is_small_section_ and
14589 is_large_section_ fields.
14590 (Output_section::is_small_section): New function.
14591 (Output_section::set_is_small_section): New function.
14592 (Output_section::is_large_section): New function.
14593 (Output_section::set_is_large_section): New function.
14594 (Output_section::is_large_data_section): New function.
14595 (class Output_segment): Add is_large_data_segment_ field.
14596 (Output_segment::is_large_data_segment): New function.
14597 (Output_segment::set_is_large_data_segment): New function.
14598 * output.cc (Output_section::Output_section): Initialize new
14599 fields.
14600 (Output_segment::Output_segment): Likewise.
14601 (Output_segment::add_output_section): Add assertion that large
14602 data sections always go in large data segments. Force small data
14603 sections to the end of the list of data sections. Force small BSS
14604 sections to the start of the list of BSS sections. For large BSS
14605 sections to the end of the list of BSS sections.
14606 * symtab.h (class Symbol): Declare is_common_shndx.
14607 (Symbol::is_defined): Check Symbol::is_common_shndx.
14608 (Symbol::is_common): Likewise.
14609 (class Symbol_table): Define enum Commons_section_type. Update
14610 declarations. Add small_commons_ and large_commons_ fields.
14611 * symtab.cc (Symbol::is_common_shndx): New function.
14612 (Symbol_table::Symbol_table): Initialize new fields.
14613 (Symbol_table::add_from_object): Put small and large common
14614 symbols in the right list.
14615 (Symbol_table::sized_finalized_symbol): Check
14616 Symbol::is_common_shndx.
14617 (Symbol_table::sized_write_globals): Likewise.
14618 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14619 common symbol lists. Don't call do_allocate_commons_list if the
14620 list is empty.
14621 (Symbol_table::do_allocate_commons_list): Remove is_tls
14622 parameter. Add comons_section_type parameter. Change all
14623 callers. Handle small and large common symbols.
14624 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14625 Symbol::is_common_shndx.
14626 * resolve.cc (symbol_to_bits): Likewise.
14627 * target.h (Target::small_common_shndx): New function.
14628 (Target::small_common_section_flags): New function.
14629 (Target::large_common_shndx): New function.
14630 (Target::large_common_section_flags): New function.
14631 (Target::new_output_section): New function.
14632 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14633 small_common_section_flags, and large_common_section_flags
14634 fields.
14635 (Target::do_new_output_section): New virtual function.
14636 * arm.cc (Target_arm::arm_info): Initialize new fields.
14637 * i386.cc (Target_i386::i386_info): Likewise.
14638 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14639 Likewise.
14640 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14641 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14642 (Target_x86_64::do_new_output_section): New function.
14643 * configure.ac: Define conditional MCMODEL_MEDIUM.
14644 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14645 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14646 (large_LDFLAGS): Define.
14647 * testsuite/large.c: New file.
14648 * testsuite/testfile.cc (Target_test::test_target_info):
14649 Initialize new fields.
14650 * configure, testsuite/Makefile.in: Rebuild.
14651
bb04269c
DK
146522009-06-05 Doug Kwan <dougkwan@google.com>
14653
14654 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14655 * Makefile.in: Regenerate.
bb04269c
DK
14656 * i386.cc (class Target_i386): Define new virtual method to
14657 override do_is_local_label_name in parent.
14658 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14659 local symbols if --discard-locals or -X is given.
14660 * options.h (class General_options): Declare new options
14661 '--discard-locals' and '-X' for discarding locals.
14662 * target.h (class Target): Define new methods is_local_label_name.
14663 Declare new virtual method do_is_local_label_name.
14664 * target.cc: New file.
14665 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14666 (check_SCRIPTS): Add discard_locals_test.sh.
14667 (check_DATA): Add discard_local_tests.syms.
14668 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14669 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14670 * testsuite/Makefile.in: Regenerate.
14671 * testsuite/discard_locals_test.c: New file.
14672 * testsuite/discard_locals_test.sh: Same.
14673
805bb01c
DK
146742009-06-05 Doug Kwan <dougkwan@google.com>
14675
14676 * object.cc (Sized_relobj::Sized_relobj): Initialize
14677 discarded_eh_frame_shndx_ to -1U.
14678 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14679 section.
14680 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14681 a discarded .eh_frame section.
14682 (Sized_relobj::do_finalize_local_symbols): Ditto.
14683 * object.h (class Sized_relobj): Declare new member
14684 discarded_eh_frame_shndx_.
14685 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14686 (local_labels_test.o, local_labels_test): New rules.
14687 * testsuite/Makefile.in: Regenerate.
14688
1dcd334d
DK
146892009-06-04 Doug Kwan <dougkwan@google.com>
14690
14691 * layout.cc (Layout::section_name_mapping): Add mapping for
14692 special ARM sections.
14693
96d49306
DK
146942009-06-03 Doug Kwan <dougkwan@google.com>
14695
14696 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14697 (utils::has_overflow): Same.
14698
dff16297
ILT
146992009-06-03 Ian Lance Taylor <iant@google.com>
14700
14701 * layout.cc (Layout::section_name_mapping): New array, replacing
14702 Layout::linkonce_mapping.
14703 (Layout::section_name_mapping_count): New variable, replacing
14704 Layout::linkonce_mapping_count.
14705 (Layout::linkonce_output_name): Remove.
14706 (Layout::output_section_name): Rewrite.
14707 * layout.h (class Layout): Rename Linkonce_mapping to
14708 Section_name_mapping, linkonce_mapping to section_name_mapping,
14709 linkonce_mapping_count to section_name_mapping_count. Don't
14710 declare linkonce_output_name.
14711
c121c671
DK
147122009-06-03 Doug Kwan <dougkwan@google.com>
14713
14714 * gold/arm.cc (namespace utils): New.
14715 (Target_arm::reloc_is_non_pic): Define new method.
14716 (class Arm_relocate_functions): New.
14717 (Target_arm::Relocate::relocate): Handle relocation types used by
14718 Android.
14719
07800fab
ILT
147202009-06-03 Ian Lance Taylor <iant@google.com>
14721
14722 * arm.cc (Target_arm::scan::global): Use || instead of |.
14723
c121c671
DK
147242009-06-02 Doug Kwan <dougkwan@google.com>
14725
14726 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14727 issued_non_pic_error_.
14728 (class Target_arm::Scan): Declare new method check_non_pic.
14729 Define new method symbol_needs_plt_entry.
14730 Declare new data member issued_non_pic_error_.
14731 (class Target_arm::Relocate): Declare new method
14732 should_apply_static_reloc.
14733 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14734 (Target_arm::Scan::check_non_pic): Define new method.
14735 (Target_arm::Scan::local): Handle a small subset of reloc types used
14736 by Android.
14737 (Target_arm::Scan::local): Same.
14738 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14739
b19b0c6d
ILT
147402009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14741
14742 * incremental.cc (Incremental_inputs::report_command_line): Filter
14743 out --incremental-* options.
14744
94cdfcff
DK
147452009-05-29 Doug Kwan <dougkwan@google.com>
14746
14747 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14748 template class.
14749 (class Target_arm): Update comment.
14750 (Target_arm::Target_arm): Initialize new data members GOT_,
14751 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14752 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14753 and Target_arm::rel_dyn_section.
14754 Declare new_enum Target_arm::Got_type.
14755 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14756 and DYNBSS_.
14757 Update commments for member do_dynsym_value.
14758 (Target_arm::got_size, Target_arm::plt_section,
14759 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14760 new methods inside class defintion.
14761 (Target_arm::got_section): Define new method.
14762 (Target_arm::rel_dyn_section): Same.
14763 (Output_data_plt_arm): New template class.
14764 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14765 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14766 (Output_data_plt_arm::add_entry): Same.
14767 (Output_data_plt_arm::first_plt_entry): Define new
14768 static data member for PLT instruction template.
14769 (Output_data_plt_arm::plt_entry): Same.
14770 (Output_data_plt_arm::do_write): Define new method.
14771 (Target_arm::make_plt_entry): Same.
14772 (Target_arm::do_finalize_sections): Same.
14773 (Target_arm::do_dynsym_value): Same.
14774
4a657b0d
DK
147752009-05-28 Doug Kwan <dougkwan@google.com>
14776
14777 * Makefile.am (TARGETSOURCES): Add arm.cc.
14778 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14779 * Makefile.in: Regenerate.
14780 * arm.cc: New file.
14781 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14782
e7ae8c36
DK
147832009-05-26 Doug Kwan <dougkwan@google.com>
14784
14785 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14786 (General_options::check_excluded_libs): Strip off directories in
14787 archive name before matching like GNU ld does.
14788 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14789 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14790 (exclude_libs_test_LDFLAGS): Add linker option
14791 -Wl,--exclude-libs,libexclude_libs_test_3
14792 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14793 an explicit archive without using -l.
14794 (alt/libexclude_libs_test_3.a): New make rule.
14795 * testsuite/Makefile.in: Regenerate.
14796 * testsuite/exclude_libs_test.c : Declare lib3_default().
14797 (main): Call it.
14798 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14799 * exclude_libs_test_3.c: New file.
14800
f12e7348
NC
148012009-05-26 Nick Clifton <nickc@redhat.com>
14802
14803 * po/id.po: New Indonesian translation.
14804 * po/gold.pot: Updated template file.
14805
4daadc0d
ST
148062009-05-22 Sriraman Tallam <tmsriram@google.com>
14807
e1df38aa 14808 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14809 gc_comdat_test files. Add -Wl,--gc-sections to build
14810 gc_comdat_test.
14811 * testsuite/Makefile.in: Regenerate.
14812 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14813
531813ad
ST
148142009-05-21 Sriraman Tallam <tmsriram@google.com>
14815
14816 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14817 kept comdat section was garbage collected.
14818 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14819 * testsuite/Makefile.in: Regenerate.
14820 * testsuite/gc_comdat_test.sh: New file.
14821 * testsuite/gc_comdat_test_1.cc: New file.
14822 * testsuite/gc_comdat_test_2.cc: New file.
14823
65514900
CC
148242009-05-19 Doug Kwan <dougkwan@google.com>
14825
14826 * archive.cc (Archive::Archive): Move constructor from archive.h
14827 to here. Initialize no_export_.
14828 (Archive::get_elf_object_for_member): Set no_export flag of object.
14829 * archive.h (Archive::Archive): Move constructor body to
14830 archive.cc.
14831 (Archive::no_export): New method.
14832 (Archive::no_export_): New field.
14833 * object.h (Object::Object): Initialize no_export_ to false.
14834 (Object::no_export, Object::set_no_export): New methods.
14835 (Object::no_export_): New field.
14836 * options.cc (General_options::parse_exclude_libs): New method.
14837 (General_options::check_excluded_libs) Same.
14838 * options.h (exclude_libs): New option.
14839 (General_options::check_excluded_libs): New method declaration.
14840 (General_options::excluded_libs_): New field.
14841 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14842 default or protected visibility if an object has no-export flag set.
14843 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14844 (check_SCRIPTS): Add exclude_libs_test.sh.
14845 (check_DATA): Add exclude_libs_test.syms.
14846 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14847 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14848 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14849 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14850 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14851 libexclude_libs_test_2.a): New rules.
14852 * testsuite/Makefile.in: Regenerate.
14853 * testsuite/exclude_libs_test.c: New file.
14854 * testsuite/exclude_libs_test.sh: Ditto.
14855 * testsuite/exclude_libs_test_1.c: Ditto.
14856 * testsuite/exclude_libs_test_2.c: Ditto.
14857
1b77ea50
ILT
148582009-05-15 Ian Lance Taylor <iant@google.com>
14859
14860 * configure.ac: Check for declarations for cases where libiberty.h
14861 checks HAVE_DECL_xxx.
14862 * configure, config.in: Rebuild.
14863
072fe7ce
ILT
148642009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14865
14866 * gold.h (Incremental_argument_list): Remove (invalid) forward
14867 declaration.
14868 * incremental.cc (Incremental_inputs::report_achive): New method.
14869 (Incremental_inputs::report_object): New method.
14870 (Incremental_inputs::report_script): New method.
14871 (Incremental_inputs::finalize_inputs): New method.
14872 (Incremental_inputs::finalize): Call finalize_inputs().
14873 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14874 Create inputs entries.
14875 * incremental.h (Incremental_input_type): New enum.
14876 (Incremental_inputs::Incremental_input): Initialize new fields.
14877 (Incremental_inputs::report_inputs): New method.
14878 (Incremental_inputs::report_achive): New method.
14879 (Incremental_inputs::report_object): New method.
14880 (Incremental_inputs::report_script): New method.
14881 (Incremental_inputs::finalize_inputs): New method.
14882 (Incremental_inputs::Input_info): New struct.
14883 (Incremental_inputs::Input_info_map): New typedef.
14884 (Incremental_inputs::lock_): New field.
14885 (Incremental_inputs::Inputs_): New field.
14886 (Incremental_inputs::Inputs_map): New field.
14887 * main.cc (main): Call Incremental_input::report_inputs.
14888 * options.h (Input_argument_list): Typedef moved from
14889 Input_arguments.
14890 (Input_file_group::Files): Remove, use ::Input_argument_list.
14891 (Input_file_group::Input_argument_list): Remove, use
14892 ::Input_argument_list.
14893 * plugin.cc (Plugin_manager::add_input_file): Add error in
14894 incremental build.
14895 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14896 functions.
14897 * script.cc (read_input_script): Call
14898 Incremental_input::report_script.
14899 * script.h (Script_info): New class.
14900
b0481b0b
ILT
149012009-04-27 Ian Lance Taylor <iant@google.com>
14902
14903 * x86_64.cc (do_adjust_output_section): Set entsize to
14904 plt_entry_size.
14905
b22a5a41 149062009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14907
14908 * output.cc (Output_file::close): After short writes, continue
14909 writing from the correct offset in the buffer being written.
14910
40fde488
CD
149112009-04-23 Chris Demetriou <cgd@google.com>
14912
14913 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14914 * configure: Regenerate.
14915 * config.in: Regenerate.
14916 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14917 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14918
3ce2c28e
ILT
149192009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14920
14921 * incremental.cc (Incremental_inputs_header_data): Renamed from
14922 Incremental_input_header_data.
14923 (Incremental_inputs_header_data::data_size): New field.
14924 (Incremental_inputs_header_data::put_input_file_count): Renamed
14925 from input_file_count.
14926 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14927 from command_line_offset.
14928 (Incremental_inputs_header_data::put_reserved): Renamed from
14929 put_reserved.
14930 (Incremental_inputs_entry_data): Renamed from
14931 Incremental_input_entry_data.
14932 (Incremental_inputs_entry_data::data_size): New field.
14933 (Incremental_inputs::report_command_line): New method.
14934 (Incremental_inputs::finalize): New method.
14935 (Incremental_inputs::create_incremental_inputs_data): New method.
14936 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14937 * incremental.h: New file.
14938 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14939 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14940 incremental builds.
703d02da 14941 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14942 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14943 (Layout::create_incremental_info_sections): New method.
14944 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14945 * main.cc (main): Notify Incremental_input of the command line.
14946
e55bde5e
ILT
149472009-04-01 Ian Lance Taylor <iant@google.com>
14948 Mikolaj Zalewski <mikolajz@google.com>
14949
14950 * gold.h (reserve_unordered_map): Define, three versions, one for
14951 each version of Unordered_map.
14952 * layout.cc (Layout::Layout): Remove options parameter. Add
14953 number_of_input_files parameter. Don't initialize options_.
14954 Initialize number_of_input_files_ and resized_signatures_. Move
14955 sections_are_attached_.
14956 (Layout::layout_group): Reserve space for group_signatures_.
14957 (Layout::find_or_add_kept_section): Change name parameter to be a
14958 reference. Resize signatures_ map when it gets large enough.
14959 (Layout::layout_eh_frame): Use parameters->options() instead of
14960 this->options_.
14961 (Layout::make_output_section): Likewise.
14962 (Layout::attach_allocated_section_to_segment): Likewise.
14963 (Layout::finalize, Layout::create_executable_stack): Likewise.
14964 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14965 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14966 * layout.h (class Layout): Update declarations. Remove options_
14967 field. Add number_of_input_files_ and resized_signatures_
14968 fields. Move sections_are_attached_ field.
14969 * main.cc (main): Pass number of input files to Layout
14970 constructor. Don't pass options.
14971
154b857c
ILT
149722009-03-30 Ian Lance Taylor <iant@google.com>
14973
14974 * ffsll.c (ffsll): Correct implementation.
14975
2f35ab9b
ILT
149762009-03-27 Ian Lance Taylor <iant@google.com>
14977
fd03461a
ILT
14978 * ffsll.c: New file.
14979 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14980 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14981 * ftruncate.c (ftruncate): Declare before definition.
14982 * mremap.c (mremap): Likewise.
14983 * pread.c (pread): Likewise.
14984 * configure, Makefile.in, config.in: Rebuild.
14985
2f35ab9b
ILT
14986 * mremap.c: New file.
14987 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14988 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14989 (mremap): Declare if HAVE_MREMAP is not defined.
14990 * configure, Makefile.in, config.in: Rebuild.
14991
33aea2fd
CC
149922009-03-27 Cary Coutant <ccoutant@google.com>
14993
14994 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14995 position independent.
14996 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14997 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14998
6d479619
CC
149992009-03-24 Cary Coutant <ccoutant@google.com>
15000
15001 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15002 an executable.
15003 (needs_dynamic_reloc): Likewise.
15004
afc06bb8
ILT
150052009-03-24 Ian Lance Taylor <iant@google.com>
15006
15007 * yyscript.y (file_cmd): Recognize EXTERN.
15008 (extern_name_list, extern_name_list_body): New nonterminals.
15009 * script.cc (script_add_extern): Define.
15010 * script-c.h (script_add_extern): Declare.
15011
f6060a4d
ILT
150122009-03-24 Rafael Avila de Espindola <espindola@google.com>
15013
15014 * object.cc (is_elf_object): Define.
15015 * object.h (is_elf_object): Declare.
15016 * archive.cc (Archive::get_elf_object_for_member): Call
15017 is_elf_object.
33aea2fd 15018 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15019
26736d8e
ILT
150202009-03-24 Elliott Hughes <enh@google.com>
15021
15022 * output.cc (Output_file::map_anonymous): Define.
15023 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15024 try an anonymous one. Report the size if the mmap fails.
15025 * output.h (class Output_file): Declare map_anonymous.
15026
22fd9730
ILT
150272009-03-24 Ian Lance Taylor <iant@google.com>
15028
15029 * target-select.cc (instantiate_target): Don't acquire the lock if
15030 the instantiated_target_ field has already been set.
15031
cb010894
ILT
150322009-03-23 Ian Lance Taylor <iant@google.com>
15033
7f055c20
ILT
15034 * gold-threads.h (class Initialize_lock): Define.
15035 * gold-threads.cc (class Initialize_lock_once): Define.
15036 (initialize_lock_control): New static variable.
15037 (initialize_lock_pointer): New static variable.
15038 (initialize_lock_once): New static function.
15039 (Initialize_lock::Initialize_lock): Define.
15040 (Initialize_lock::initialize): Define.
15041 * target-select.h: Include "gold-threads.h".
15042 (class Target_selector): Add lock_ and initialize_lock_ fields.
15043 Don't define instantiate_target, just declare it.
15044 * target-select.cc (Target_selector::Target_selector): Initialize
15045 new fields.
15046 (Target_selector::instantiate_target): Define.
15047 * descriptors.h: Include "gold-threads.h".
15048 (class Descriptors): Add initialize_lock_ field.
15049 * descriptors.cc (Descriptors::Descriptors): Initialize new
15050 field.
15051 (Descriptors::open): Use initialize_lock_ field
15052 * errors.h (class Errors): Add initialize_lock_ field.
15053 * errors.cc (Errors::Errors): Initialize new field.
15054 (Errors::initialize_lock): Use initialize_lock_ field.
15055 * powerpc.cc (class Target_selector_powerpc): Remove
15056 instantiated_target_ field. In do_recognize call
15057 instantiate_target rather than do_instantiate_target. In
15058 do_instantiate_target just allocate a new target.
15059 * sparc.cc (class Target_selector_sparc): Likewise.
15060
36959681
ILT
15061 * freebsd.h: New file.
15062 * i386.cc: Include "freebsd.h".
15063 (Target_i386): Derive from Target_freebsd rather than
15064 Sized_target.
15065 (Target_selector_i386): Derive from Target_selector_freebsd rather
15066 than Target_selector.
15067 * x86_64.cc: Include "freebsd.h".
15068 (Target_x86_64): Derive from Target_freebsd rather than
15069 Sized_target.
15070 (Target_selector_x86_64): Derive from Target_selector_freebsd
15071 rather than Target_selector.
15072 * target.h (class Target): Add adjust_elf_header and
15073 do_adjust_elf_header.
15074 * output.cc (Output_file_header:: do_sized_write): Call target
15075 adjust_elf_header routine.
15076 * configure.tgt: Set targ_osabi.
15077 * configure.ac: Define GOLD_DEFAULT_OSABI.
15078 * parameters.cc (Parameters::default_target): Pass
15079 GOLD_DEFAULT_OSABI to select_target.
15080 * target-select.h (class Target_selector): Make instantiate_target
15081 protected rather than private.
15082 * Makefile.am (HFILES): Add freebsd.h.
15083 * configure, Makefile.in, config.in: Rebuild.
15084
cb010894
ILT
15085 * merge.cc (do_add_input_section): Correct pend value. Change
15086 message about last entry not being null terminated from error to
15087 warning.
15088
0e879927
ILT
150892009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15090
15091 * incremental.cc: New file.
15092 * Makefile.am (CCFILES): Add incremental.cc.
15093 * Makefile.in: Rebuild.
15094
41105937
PP
150952009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15096
15097 * layout.cc (Layout::output_section_name): Preserve names
15098 of '.note.' sections.
e1df38aa 15099
60439920
ILT
151002009-03-19 Ian Lance Taylor <iant@google.com>
15101
15102 * descriptors.cc (Descriptors::open): Check that the options are
15103 valid before using them.
15104
0d371ad3
ILT
151052009-03-18 Ian Lance Taylor <iant@google.com>
15106
15107 * script-sections.h: Include <list>.
15108 (class Script_sections): Change Sections_elements from std::vector
15109 to std::list. Typedef public Elements_iterator. Add
15110 orphan_section_placement_, data_segment_align_start_, and
15111 saw_data_segment_align_ fields. Remove data_segment_align_index_
15112 field.
15113 * script-sections.cc (class Orphan_section_placement): New class.
15114 (class Sections_element): Add virtual functions is_relro and
15115 orphan_section_init. Remove virtual function place_orphan_here.
15116 (class Output_section_definition): Add is_relro and
15117 orphan_section_init. Remove place_orphan_here.
15118 (class Orphan_output_section): Likewise.
15119 (Script_sections::Script_sections): Update for field changes.
15120 (Script_sections::data_segment_align): Set saw_data_segment_align_
15121 and data_segment_align_start_, not data_segment_align_index.
15122 (Script_sections::data_segment_relro_end): Check
15123 saw_data_segment_align_. Use data_segment_align_start_ rather
15124 than data_segment_align_index_.
15125 (Script_sections::place_orphan): Rewrite to use
15126 Orphan_section_placement.
15127
9201d894
ILT
151282009-03-17 Ian Lance Taylor <iant@google.com>
15129
9c5b8369
ILT
15130 * archive.cc (Archive::add_symbols): Check for a version attached
15131 to the symbol name in the archive map.
15132 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15133 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15134 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15135 (ver_test_11.a): New target.
15136 * testsuite/Makefile.in: Rebuild.
15137
9201d894
ILT
15138 * configure.ac: Check for chsize and posix_fallocate. Replace
15139 ftruncate.
15140 * ftruncate.c: New file, from gnulib.
15141 * output.cc (posix_fallocate): Define dummy version if not
15142 HAVE_POSIX_FALLOCATE.
15143 (Output_file::map): Call posix_fallocate rather than lseek and
15144 write.
15145 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15146 * configure, Makefile.in, config.in: Rebuild.
15147
ef4ab7a8 151482009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15149
ef4ab7a8
PP
15150 * layout.h (Layout::create_note): Add section_name parameter.
15151 * layout.cc (Layout::create_note): Likewise.
15152 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15153
8c500701
ILT
151542009-03-17 Ian Lance Taylor <iant@google.com>
15155
e85b18e1
ILT
15156 * descriptors.cc: Include "options.h".
15157 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15158 (Descriptors::open): Always use O_CLOEXEC when opening a new
15159 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15160 then set FD_CLOEXEC.
15161
9efe6174
ILT
15162 * sparc.cc (class Target_sparc): Add has_got_section.
15163 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15164 make sure we have a GOT section.
15165
15166 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15167 (Target_sparc::Scan::local): Likewise.
15168 (Target_sparc::Scan::global): Likewise.
15169 (Target_sparc::Relocate::relocate): Likewise.
15170 (Target_sparc::Relocate::relocate_tls): Likewise.
15171
8c500701
ILT
15172 * symtab.cc (Symbol_table::define_default_version): New function,
15173 broken out of add_from_object.
15174 (Symbol_table::add_from_object): Call define_default_version.
15175 (Symbol_table::define_special_symbol): Add resolve_oldsym
15176 parameter. Change all callers. If the version for a symbol comes
15177 from a version script, resolve it with the symbol with the same
15178 name with no version. Also add the symbol without a version if
15179 appropriate.
15180 (do_define_in_output_data): If resolving with oldsym, don't delete
15181 sym.
15182 (do_define_in_output_segment): Likewise.
15183 (do_define_as_constant): Likewise.
15184 * symtab.h (class Symbol_table): Update declarations.
15185
f1ed28fb
ILT
151862009-03-13 Ian Lance Taylor <iant@google.com>
15187
15f8229b
ILT
15188 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15189 (Read_symbols::requeue): New function.
15190 (Read_symbols::do_read_symbols): If make_elf_object fails because
15191 the target type is not configured, and the file was searched for,
15192 issue a warning and retry with the next directory.
15193 (Add_symbols::run): If the file has an incompatible format, and
15194 it was searched for, requeue the Read_symbols task. On error,
15195 release the object.
15196 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15197 dirindex parameter to constructor. Change all callers. Declare
15198 incompatible_warning and requeue.
15199 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15200 input_argument_ and input_group_ fields. Add them to
15201 constructor. Change all callers.
15202 (class Read_script): Add dirindex_ field. Add it to constructor.
15203 Change all callers.
15204 * archive.cc (Archive::setup): Remove input_objects parameter.
15205 Change all callers.
15206 (Archive::get_file_and_offset): Likewise.
15207 (Archive::read_all_symbols): Likewise.
15208 (Archive::read_symbols): Likewise.
15209 (Archive::get_elf_object_for_member): Remove input_objects
15210 parameter. Add punconfigured parameter. Change all callers.
15211 (Archive::add_symbols): Change return type to bool. Check return
15212 value of include_member.
15213 (Archive::include_all_members): Likewise.
15214 (Archive::include_member): Change return type to bool. Return
15215 false if first included object has incompatible target. Set
15216 included_member_ field.
15217 (Add_archive_symbols::run): If add_symbols returns false, requeue
15218 Read_symbols task.
15219 * archive.h (class Archive): Add included_member_ field.
15220 Initialize it in constructor. Add input_file and searched_for
15221 methods. Update declarations.
15222 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15223 input_argument_ fields. Add them to constructor. Change all
15224 callers.
15225 * script.cc: Include "target-select.h".
15226 (class Parser_closure): Add skip_on_incompatible_target_ and
15227 found_incompatible_target_ fields. Add
15228 skip_on_incompatible_target parameter to constructor. Change all
15229 callers. Add methods skip_on_incompatible_target,
15230 clear_skip_on_incompatible_target, found_incompatible_target, and
15231 set_found_incompatible_target.
15232 (read_input_script): Add dirindex parameter. Change all callers.
15233 If parser finds an incompatible target, requeue Read_symbols
15234 task.
15235 (script_set_symbol): Clear skip_on_incompatible_target in
15236 closure.
15237 (script_add_assertion, script_parse_option): Likewise.
15238 (script_start_sections, script_add_phdr): Likewise.
15239 (script_check_output_format): New function.
15240 * script.h (read_input_script): Update declaration.
15241 * script-c.h (script_check_output_format): Declare.
15242 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15243 (ignore_cmd): Remove OUTPUT_FORMAT.
15244 * fileread.cc (Input_file::Input_file): Add explicit this.
15245 (Input_file::will_search_for): New function.
15246 (Input_file::open): Add pindex parameter. Change all callers.
15247 * fileread.h (class Input_file): Add input_file_argument method.
15248 Declare will_search_for. Update declarations.
15249 * object.cc (make_elf_object): Add punconfigured parameter.
15250 Change all callers.
15251 * object.h (class Object): Make input_file public. Add
15252 searched_for method.
15253 (make_elf_object): Update declaration.
15254 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15255 restart search.
15256 * dirsearch.h (class Dirsearch): Update declaration.
15257 * options.h (class General_options): Add --warn-search-mismatch.
15258 * parameters.cc (Parameters::is_compatible_target): New function.
15259 * parameters.h (class Parameters): Declare is_compatible_target.
15260 * workqueue.cc (Workqueue::add_blocker): New function.
15261 * workqueue.h (class Workqueue): Declare add_blocker.
15262
f1ed28fb
ILT
15263 * fileread.cc (Input_file::open): Remove options parameter.
15264 Change all callers.
15265 (Input_file::open_binary): Likewise.
15266 * script.cc (read_input_script): Likewise.
15267 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15268 options parameter from constructor. Change all callers.
15269 (class Read_script): Likewise.
15270 * fileread.h (class Input_file): Update declarations.
15271 * script.h (read_input_script): Update declaration.
15272
34dd024a
NC
152732009-03-10 Nick Clifton <nickc@redhat.com>
15274
15275 * po/es.po: New Spanish translation.
15276
6d71b17c
CC
152772009-03-06 Cary Coutant <ccoutant@google.com>
15278
15279 * options.cc (parse_short_option): Keep dash_z from registering itself.
15280
031cdbed
ILT
152812009-03-03 Ian Lance Taylor <iant@google.com>
15282
15283 PR 9918
15284 * target-reloc.h (relocate_section): Pass output_section to
15285 relocate.
15286 * i386.cc (Target_i386::should_apply_static_reloc): Add
15287 output_section parameter. Change all callers.
15288 (Target_i386::Relocate::relocate): Add output_section parameter.
15289 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15290 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15291 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15292 * testsuite/two_file_shared.sh: New script.
15293 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15294 (check_DATA): Add two_file_shared.dbg.
15295 (two_file_shared.dbg): New target.
15296 * testsuite/Makefile.in: Rebuild.
15297
15d5fa16
ILT
152982009-03-01 Ian Lance Taylor <iant@google.com>
15299
15300 * configure.ac: Check for byteswap.h.
15301 * configure: Rebuild.
15302 * config.in: Rebuild.
15303
8a4c0b0d
ILT
153042009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15305
15306 * layout.cc (Layout::find_or_add_kept_section): New function.
15307 (Layout::add_comdat): Removed.
15308 * layout.h (struct Kept_section): Move out of class Layout.
15309 Remove trailing underscores from field names. Add group_sections
15310 field. Rename group_ field to is_group. Change all uses.
15311 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15312 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15313 comdat_groups_ field.
15314 (Sized_relobj::include_section_group): Use
15315 find_or_add_kept_section and Kept_section::group_sections.
15316 (Sized_relobj::include_linkonce_section): Likewise.
15317 * object.cc (class Sized_relobj): Don't define Comdat_group or
15318 Comdat_group_table. Remove find_comdat_group and
15319 add_comdat_group. Remove comdat_groups_ field.
15320 * plugin.cc (include_comdat_group): Use
15321 Layout::find_or_add_kept_section.
15322
b4ecf66b
ILT
153232009-02-28 Ian Lance Taylor <iant@google.com>
15324
14359ca0
ILT
15325 * README: --gc-sections and map files are now supported. Document
15326 some build requirements.
15327
b4ecf66b
ILT
15328 PR 6992
15329 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15330 relocatable link set the value of the section symbol to zero.
15331 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15332 relocatable link don't include the section address in the local
15333 symbol value.
15334
0602e05a
ILT
153352009-02-27 Ian Lance Taylor <iant@google.com>
15336
fd9d194f
ILT
15337 PR 6811
15338 * options.h (class Search_directory): Add is_system_directory.
15339 (class General_options): Declare is_in_system_directory.
15340 * options.cc (get_relative_sysroot): Make static.
15341 (get_default_sysroot): Make static.
15342 (General_optoins::is_in_system_directory): New function.
15343 * fileread.cc (Input_file::is_in_system_directory): New function.
15344 * fileread.h (class Input_file): Declare is_in_system_directory.
15345 * object.h (class Object): Add is_in_system_directory.
15346 (class Input_objects): Remove system_library_directory_ field.
15347 * object.cc (Input_objects::add_object): Don't set
15348 system_library_directory_.
15349 (input_objects::found_in_system_library_directory): Remove.
15350 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15351 parameter. Change all callers.
15352 (Symbol_table::sized_write_globals): Likewise.
15353 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15354 Call Object::is_in_system_directory.
15355 * symtab.h (class Symbol_table): Update declarations.
15356
61edd21f
ILT
15357 PR 5990
15358 * descriptors.h (Open_descriptor): Add is_on_stack field.
15359 * descriptors.cc (Descriptors::open): If the descriptor is on the
15360 top of the stack, remove it. Initialize is_on_stack field.
15361 (Descriptors::release): Only add pod to stack if it is not on the
15362 stack already.
15363 (Descriptors::close_some_descriptor): Clear stack_next and
15364 is_on_stack fields.
15365
e29e076a
ILT
15366 PR 7091
15367 * output.cc (Output_section::find_starting_output_address): Rename
15368 from starting_output_address; add PADDR parameter; change return
15369 type.
15370 * output.h (class Output_section): Declare
15371 find_starting_output_address instead of starting_output_address.
15372 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15373 section symbol for which we can't find a merge section.
15374
0602e05a
ILT
15375 PR 9836
15376 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15377 hidden or internal, force the symbol to be local.
15378 * resolve.cc (Symbol::override_visibility): Define.
15379 (Symbol::override_base): Use override_visibility.
15380 (Symbol_table::resolve): Likewise.
15381 (Symbol::override_base_with_special): Likewise.
15382 (Symbol_table::override_with_special): If the visibility is hidden
15383 or internal, force the symbol to be local.
15384 * symtab.h (class Symbol): Add set_visibility and
15385 override_visibility.
15386 * testsuite/ver_test_1.sh: New file.
15387 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15388 (check_DATA): Add ver_test_1.syms.
15389 (ver_test_1.syms): New target.
15390 * testsuite/Makefile.in: Rebuild.
15391
401a9a73
CC
153922009-02-25 Cary Coutant <ccoutant@google.com>
15393
15394 * layout.cc (Layout::choose_output_section): Don't rename sections
15395 when using a linker script that has a SECTIONS clause.
15396 * Makefile.in: Regenerate.
15397
15398 * testsuite/Makefile.am (script_test_5.sh): New test case.
15399 * testsuite/Makefile.in: Regenerate.
15400 * testsuite/script_test_5.cc: New file.
15401 * testsuite/script_test_5.sh: New file.
15402 * testsuite/script_test_5.t: New file.
15403
f488e4b0
CC
154042009-02-13 Rafael Avila de Espindola <espindola@google.com>
15405
15406 * archive.cc (Archive::include_member): Update calls to add_symbols.
15407 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15408 the Layout argument.
15409 * dynobj.h (do_add_symbols): Add the Layout argument.
15410 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15411 Layout argument.
15412 * object.h (Object::add_symbols): Add the Layout argument.
15413 (Object::do_add_symbols): Add the Layout argument.
15414 (Sized_relobj::do_add_symbols): Add the Layout argument.
15415 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15416 Unify the two versions.
15417 (Add_plugin_symbols): Remove.
15418 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15419 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15420 (Add_plugin_symbols): Remove.
15421 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15422 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15423 (Add_symbols::run): Make it work with Pulginobj.
15424
89dd1680
ILT
154252009-02-06 Ian Lance Taylor <iant@google.com>
15426
15427 * object.cc (Sized_relobj::do_layout): Make info message start
15428 with lower case letter.
15429
266d0a74
ILT
154302009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15431
602b464e
ILT
15432 * binary.cc: Fix file comment.
15433
266d0a74
ILT
15434 * options.h (enum Incremental_disposition): Define.
15435 (class General_options): Add new options: --incremental,
15436 --incremental_changed, --incremental_unchanged,
15437 --incremental_unknown. Add incremental_disposition_ and
15438 implicit_incremental_ fields.
15439 (General_options::incremental_disposition): New function.
15440 (class Position_dependent_options): Add incremental_disposition
15441 option.
15442 (Position_dependent_options::copy_from_options): Set incremental
15443 dispositions.
15444 * options.cc (General_options::parse_incremental_changed): New
15445 function.
2e702c99
RM
15446 (General_options::parse_incremental_unchanged): New function.
15447 (General_options::parse_incremental_unknown): New function.
15448 (General_options::General_options): Initialize new fields
266d0a74 15449 incremental_disposition_ and implicit_incremental_.
2e702c99 15450 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15451 without --incremental.
15452
f073bbf7
CD
154532009-02-06 Chris Demetriou <cgd@google.com>
15454
15455 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15456 pointer and to report location as the file name associated with
15457 the symbol.
15458 (gold_undefined_symbol_at_location): New function to replace the
15459 old gold_undefined_symbol functionality.
15460 * target-reloc.h (relocate_section): Update to use
15461 gold_undefined_symbol_at_location.
15462 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15463 Call gold_undefined_symbol function rather than gold_error.
15464 * errors.h (Errors::undefined_symbol): Take location as a
15465 string, rather than calculating it from a relocation.
15466 * errors.cc (Errors::fatal): Print "fatal error:" before the
15467 formatted message.
15468 (Errors::error, Errors::error_at_location): Print "error: "
15469 before the formatted message.
15470 (Errors::undefined_symbol): Take location as a string, rather
15471 than calculating it from a relocation.
15472 (gold_undefined_symbol_at_location): New function akin to
15473 old gold_undefined_symbol, calculates location from relocation.
15474 (gold_undefined_symbol): Change to take only a Symbol pointer
15475 and to report location as the file name associated with the symbol.
15476 * testsuite/debug_msg.sh: Update for changed error messages.
15477 * testsuite/undef_symbol.sh: Likewise.
15478
8e94a90c
ILT
154792009-02-04 Duncan Sands <baldrick@free.fr>
15480
15481 PR 9812
15482 * reduced_debug_output.h
15483 (Output_reduced_debug_abbrev_section::failed): Use format for
15484 gold_warning.
15485 (Output_reduced_debug_info_section::faild): Likewise.
15486
88a0e15b
ILT
154872009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15488
15489 * script.cc (Lazy_demangler): New class.
2e702c99 15490 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15491 symbol only once.
15492
5efc7cd2
CC
154932009-01-29 Cary Coutant <ccoutant@google.com>
15494
15495 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15496 to __tls_get_addr.
15497 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15498
e0ebcf42
ILT
154992009-01-28 Ian Lance Taylor <iant@google.com>
15500
5efc7cd2 15501 * version.cc (version_string): Bump to 1.9.
75fe7426 15502
e0ebcf42
ILT
15503 * gold.h: Include <cstring> and <stdint.h>.
15504 * version.cc: Include <cstdio>.
15505 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15506 warning.
15507 * reduced_debug_output.cc (insert_into_vector): Rename from
15508 Insert_into_vector; change all callers. Use Swap_unaligned to
15509 avoid aliasing issue; remove union since it is unnecessary.
15510
8e2813be 155112009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15512
15513 * Makefile.am (CCFILES): Add gc.cc.
15514 (HFILES): Add gc.h.
15515 * Makefile.in: Regenerate.
15516 * gold.cc (Gc_runner): New class.
15517 (queue_initial_tasks): Call garbage collection related tasks
15518 when corresponding options are invoked.
15519 (queue_middle_gc_tasks): New function.
15520 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15521 processed early before laying out sections during garbage collection.
15522 * gold.h (queue_middle_gc_tasks): New function.
15523 (is_prefix_of): Move from "layout.cc".
15524 * i386.cc (Target_i386::gc_process_relocs): New function.
15525 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15526 * main.cc (main): Create object of class "Garbage_collection".
15527 * object.cc (Relobj::copy_symbols_data): New function.
15528 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15529 (Sized_relobj::do_layout): Allow this function to be called twice
15530 during garbage collection and defer layout of section during the
6d03d481
ST
15531 first call.
15532 * object.h (Relobj::get_symbols_data): New function.
15533 (Relobj::is_section_name_included): New function.
15534 (Relobj::copy_symbols_data): New function.
15535 (Relobj::set_symbols_data): New function.
15536 (Relobj::get_relocs_data): New function.
15537 (Relobj::set_relocs_data): New function.
15538 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15539 (Relobj::gc_process_relocs): New function.
15540 (Relobj::do_gc_process_relocs): New pure virtual function.
15541 (Relobj::sd_): New data member.
15542 (Sized_relobj::is_output_section_offset_invalid): New function.
15543 (Sized_relobj::do_gc_process_relocs): New function.
15544 * options.h (General_options::gc_sections): Modify to not be a no-op.
15545 (General_options::print_gc_sections): New option.
15546 * plugin.cc (Plugin_finish::run): Remove function call to
15547 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15548 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15549 * reloc.cc (Read_relocs::run): Add task to process relocs and
15550 determine unreferenced sections when doing garbage collection.
15551 (Gc_process_relocs): New class.
15552 (Sized_relobj::do_gc_process_relocs): New function.
15553 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15554 sections that are garbage collected.
15555 * reloc.h (Gc_process_relocs): New class.
15556 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15557 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15558 symbols whose corresponding sections are garbage collected.
15559 (Symbol_table::Symbol_table): Add new parameter for the garbage
15560 collection object.
15561 (Symbol_table::gc_mark_undef_symbols): New function.
15562 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15563 (Symbol_table::gc_mark_dyn_syms): New function.
15564 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15565 as garbage.
15566 (Symbol_table::add_from_object): Likewise.
15567 (Symbol_table::add_from_relobj): When building shared objects, do not
15568 treat externally visible symbols as garbage.
15569 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15570 table information for static and relocatable links.
15571 * symtab.h (Symbol_table::set_gc): New function.
15572 (Symbol_table::gc): New function.
15573 (Symbol_table::gc_mark_undef_symbols): New function.
15574 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15575 (Symbol_table::gc_mark_dyn_syms): New function.
15576 (Symbol_table::gc_): New data member.
e1df38aa 15577 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15578 function.
15579 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15580 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15581
3b293544
CF
155822009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15583
15584 * options.h (General_options::gc_sections): Define as a no-op for now.
15585 (General_options::no_keep_memory): Ditto.
15586 (General_options::Bshareable): Define.
15587 * options.cc (General_options::finalize): Honor -Bshareable.
15588
83d22aa8
AS
155892009-01-20 Andreas Schwab <schwab@suse.de>
15590
15591 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15592 read the value in the contents, since we don't use it. Use the
15593 template endianness when writing.
15594 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15595
cd536b21
AS
155962009-01-19 Andreas Schwab <schwab@suse.de>
15597
15598 * configure.tgt (powerpc64-*): Fix targ_obj.
15599
99e9a495
ILT
156002009-01-15 Ian Lance Taylor <iant@google.com>
15601
15602 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15603 local symbols when stripping all symbols.
15604
bbbfea06
CC
156052009-01-14 Cary Coutant <ccoutant@google.com>
15606
99e9a495 15607 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15608
0f7c0701
CC
156092009-01-14 Cary Coutant <ccoutant@google.com>
15610
15611 * archive.cc (Archive::get_elf_object_for_member): Remove call
15612 to File_read::claim_for_plugin.
15613 * descriptors.cc (Descriptors::open): Remove reference to
15614 is_claimed.
15615 (Descriptors::claim_for_plugin): Remove.
15616 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15617 (Descriptors::is_claimed): Remove.
15618 (claim_descriptor_for_plugin): Remove.
15619 * fileread.cc (File_read::claim_for_plugin): Remove.
15620 * fileread.h (File_read::claim_for_plugin): Remove.
15621 (File_read::descriptor): Reopen descriptor if necessary.
15622 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15623 (Plugin_manager::all_symbols_read): Add task parameter. Change
15624 all callers.
15625 (Plugin_manager::get_input_file): New function.
15626 (Plugin_manager::release_input_file): New function.
15627 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15628 corresponding data member.
15629 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15630 and pass to base constructor. Change all callers.
15631 (get_input_file, release_input_file): New functions.
15632 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15633 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15634 (Plugin_manager::all_symbols_read): Add task parameter.
15635 (Plugin_manager::get_input_file): New function.
15636 (Plugin_manager::release_input_file): New function.
15637 (Plugin_manager::task_): New data member.
15638 (Pluginobj::Pluginobj): Add filesize parameter.
15639 (Pluginobj::filename): New function.
15640 (Pluginobj::descriptor): New function.
15641 (Pluginobj::filesize): New function.
15642 (Pluginobj::filesize_): New data member.
15643 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15644 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15645 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15646
15647 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15648 with archive libraries.
15649 * testsuite/Makefile.in: Regenerate.
15650 * testsuite/plugin_test.c (struct sym_info): New type.
15651 (get_input_file, release_input_file): New static variables.
15652 (onload): Capture new transfer vector entries.
15653 (claim_file_hook): Stop reading at end of file according to filesize.
15654 Factor out parsing of readelf output into separate function.
15655 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15656 APIs and get the source file name from the symbol table. Convert
15657 source file name to corresponding object file name. Print info
15658 message when adding new input files.
15659 (parse_readelf_line): New function.
15660 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15661 * testsuite/plugin_test_2.sh: Likewise.
15662 * testsuite/plugin_test_3.sh: Likewise.
15663 * testsuite/plugin_test_4.sh: New test case.
15664
62a6d109
ILT
156652009-01-07 Ian Lance Taylor <iant@google.com>
15666
15667 * version.cc (version_string): Bump to 1.8.
15668
483620e8
CC
156692008-12-23 Cary Coutant <ccoutant@google.com>
15670
15671 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15672 * plugin.cc (Plugin_manager::finish): Rename as
15673 layout_deferred_objects. Move cleanup to separate function.
15674 (Plugin_manager::cleanup): New function.
15675 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15676 separately.
15677 * plugin.h (Plugin_manager::finish): Rename as
15678 layout_deferred_objects.
15679 (Plugin_manager::cleanup): New function.
15680 (Plugin_manager::cleanup_done): New field.
15681
d66a9eb3
CC
156822008-12-23 Cary Coutant <ccoutant@google.com>
15683
15684 * plugin.cc (is_visible_from_outside): New function.
15685 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15686 so we don't return "IR only" status for exported symbols or -r links.
15687
15688 * testsuite/Makefile.am (plugin_test_3): New test case.
15689 * testsuite/Makefile.in: Regenerate.
15690 * testsuite/plugin_test_3.sh: New file.
15691
5995b570
CC
156922008-12-22 Cary Coutant <ccoutant@google.com>
15693
15694 * object.cc (Sized_relobj::layout_section): New function.
15695 (Sized_relobj::do_layout): Defer layout of input sections until after
15696 plugin has provided replacement files.
15697 (Sized_relobj::do_layout_deferred_sections): New function.
15698 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15699 (Relobj::layout_deferred_sections): New function.
15700 (Relobj::do_layout_deferred_sections): New function.
15701 (Sized_relobj::do_layout_deferred_sections): New function.
15702 (Sized_relobj::layout_section): New function.
15703 (Sized_relobj::Deferred_layout): New structure.
15704 (Sized_relobj::deferred_layout_): New field.
15705 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15706 Change all callers. Layout deferred sections.
15707 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15708 references.
15709 (Plugin_hook::run): Move code from do_plugin_hook inline.
15710 (Plugin_hook::do_plugin_hook): Remove.
15711 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15712 (Plugin_manager::finish): Renamed, was cleanup.
15713 (Plugin_manager::should_defer_layout): New function.
15714 (Plugin_manager::add_deferred_layout_object): New function.
15715 (Plugin_manager::Deferred_layout_list): New type.
15716 (Plugin_manager::deferred_layout_objects_): New field.
15717 (Plugin_hook::do_plugin_hook): Remove.
15718
ee769c88
ILT
157192008-12-17 Ian Lance Taylor <iant@google.com>
15720
15721 * options.h (class General_options): Add --no case for
15722 --export-dynamic.
15723
abc8dcba
CC
157242008-12-16 Cary Coutant <ccoutant@google.com>
15725
15726 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15727 vector.
15728 (Plugin_manager::claim_file): Create plugin object even if
15729 plugin did not call the add_symbols callback.
15730 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15731 asking for more symbols than were added.
15732 * testsuite/Makefile.am (plugin_test_1): Add test case with
15733 no global symbols.
15734 (empty.syms): New target.
15735 * testsuite/Makefile.in: Regenerate.
15736 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15737 message. Don't call add_symbols if no globals.
15738 (all_symbols_read_hook): Don't provide replacement for empty
15739 claimed file.
15740
b0074644
ILT
157412008-12-12 Ian Lance Taylor <iant@google.com>
15742
68943102
ILT
15743 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15744 r_type == 0 for a local symbol with r_sym == 0.
15745 (scan_relocatable_relocs): Pass r_sym to
15746 local_non_section_strategy.
15747 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15748 r_sym parameter.
15749
b0074644
ILT
15750 * configure.ac: Update test for TLS descriptors: they are
15751 supported as of glibc 2.9.
15752 * configure: Rebuild.
15753
c2508178
ILT
157542008-12-11 Ian Lance Taylor <iant@google.com>
15755
15756 PR 7091
15757 * target-reloc.h (Default_scan_relocatable_relocs): For each
15758 function, map r_type == 0 to RELOC_DISCARD.
15759
2756a258
CC
157602008-12-10 Cary Coutant <ccoutant@google.com>
15761
15762 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15763 object to override a kept COMDAT group from a plugin object.
15764
bb6f53d3
ILT
157652008-12-09 Ian Lance Taylor <iant@google.com>
15766
fbc558e1
ILT
15767 PR 7088
15768 * yyscript.y (file_cmd): Handle INPUT.
15769
bb6f53d3
ILT
15770 * testsuite/initpri1.c: Change all declarations to be full
15771 prototypes by adding void, to avoid compiler warnings.
15772
4674ecfc
CC
157732008-12-05 Rafael Avila de Espindola <espindola@google.com>
15774
15775 * options.cc (General_options::parse_plugin_opt): New.
15776 (General_options::add_plugin): The argument now is just the filename.
15777 (General_options::add_plugin_option): New.
15778 * options.h (plugin_opt): New.
15779 (add_plugin): Change argument name.
15780 (add_plugin_option): New.
15781 * plugin.cc (Plugin::load): Don't parse the plugin option.
15782 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15783 (Plugin::add_option): New.
15784 (Plugin::args_): Change type.
15785 (Plugin::filename_): New.
15786 (Plugin_manager::add_plugin_option): New.
15787 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15788 * testsuite/Makefile.in: Regenerate.
15789
fd06b4aa
CC
157902008-12-05 Cary Coutant <ccoutant@google.com>
15791
15792 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15793 Handle --strip-lto-sections option.
15794 * options.h (strip_lto_sections): New option.
15795
6c52134c
CC
157962008-12-01 Cary Coutant <ccoutant@google.com>
15797
15798 * plugin.cc (ld_plugin_message): Change format parameter to const.
15799 Fix mismatch between new[] and delete.
15800
a45248e0
CC
158012008-11-14 Cary Coutant <ccoutant@google.com>
15802
15803 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15804 instead of -1U.
15805
c82fbeee
CS
158062008-11-05 Craig Silverstein <csilvers@google.com>
15807
15808 * options.cc (General_options::parse_dynamic_list): New function.
15809 * options.h (General_options): New flags dynamic_list,
15810 dynamic_list_data, dynamic_list_cpp_new, and
15811 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15812 (General_options::in_dynamic_list): New function.
15813 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15814 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15815 (Lex::can_continue_name): Likewise.
15816 (yylex): Likewise.
15817 (read_script_file): New parameter script_options.
15818 (read_dynamic_list): New function.
15819 (Script_options::define_dynamic_list): New function.
15820 (dynamic_list_keyword_parsecodes): New variable.
15821 (dynamic_list_keywords): New variable.
15822 * script.h (Script_options::define_dynamic_list): New function
15823 prototype.
15824 (read_dynamic_list): New function prototype.
15825 * symtab.cc (strprefix): New macro.
15826 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15827 dynamic_list_data, dynamic_list_cpp_new, and
15828 dynamic_list_cpp_typeinfo.
15829 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15830 (dynamic_list_expr): New rule.
15831 (dynamic_list_nodes): Likewise.
15832 (dynamic_list_node): Likewise.
15833 * testsuite/Makefile.am (dynamic_list): New test.
15834 * testsuite/Makefile.in: Regenerated.
15835 * testsuite/dynamic_list.t: New file.
15836 * testsuite/dynamic_list.sh: New file.
15837
e0bb29a5
CS
158382008-11-05 Craig Silverstein <csilvers@google.com>
15839
15840 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15841 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15842 (t11_last): Likewise.
15843 * testsuite/ver_test_6.c (main): Likewise.
15844
4e1e25e0
CC
158452008-10-07 Cary Coutant <ccoutant@google.com>
15846
15847 * options.c (General_options::finalize): Add check for -static and
15848 -shared.
15849 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15850 is not empty.
15851
92f03fcb
CC
158522008-10-02 Cary Coutant <ccoutant@google.com>
15853
15854 * plugin.cc (make_sized_plugin_object): Fix conditional
15855 compilation to work when not all targets are enabled.
15856
fbd8a257
CC
158572008-09-29 Cary Coutant <ccoutant@google.com>
15858
15859 * archive.cc (Archive::get_file_and_offset): Use filename instead
15860 of name to get library path.
15861 (Archive::include_member): Unlock external member of a thin archive.
15862
15863 * testsuite/Makefile.am (TEST_AR): New variable.
15864 (thin_archive_test_1): New test.
15865 (thin_archive_test_2): New test.
81636b3f
CC
15866 * testsuite/Makefile.in: Regenerate.
15867 * testsuite/thin_archive_main.cc: New file.
15868 * testsuite/thin_archive_test_1.cc: New file.
15869 * testsuite/thin_archive_test_2.cc: New file.
15870 * testsuite/thin_archive_test_3.cc: New file.
15871 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15872
eff45813
CC
158732008-09-29 Cary Coutant <ccoutant@google.com>
15874
15875 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15876 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15877 instead of -1U.
15878 (Sized_relobj::do_finalize_local_symbols): Likewise.
15879 (Sized_relobj::map_to_kept_section): Likewise.
15880 * object.h (Sized_relobj::invalid_address): New constant.
15881 (Sized_relobj::do_output_section_offset): Check for invalid_address
15882 and return -1ULL.
15883 * output.cc (Output_reloc::local_section_offset): Use constant
15884 invalid_address instead of -1U.
15885 (Output_reloc::get_address): Likewise.
15886 (Output_section::output_address): Change -1U to -1ULL.
15887 * output.h (Output_reloc::invalid_address): New constant.
15888 * reloc.cc (Sized_relobj::write_sections): Use constant
15889 invalid_address instead of -1U.
15890 (Sized_relobj::relocate_sections): Likewise.
15891 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15892 values for merge sections.
15893 * target-reloc.h (relocate_for_relocatable): Use constant
15894 invalid_address instead of -1U.
15895
89fc3421
CC
158962008-09-19 Cary Coutant <ccoutant@google.com>
15897
15898 Add plugin functionality for link-time optimization (LTO).
15899 * configure.ac (plugins): Add --enable-plugins option.
15900 * configure: Regenerate.
15901 * config.in: Regenerate.
15902 * Makefile.am (LIBDL): New variable.
15903 (CCFILES): Add plugin.cc.
15904 (HFILES): Add plugin.h.
15905 (ldadd_var): Add LIBDL.
15906 * Makefile.in: Regenerate.
15907
15908 * archive.cc: Include "plugin.h".
15909 (Archive::setup): Don't preread archive symbols when using a plugin.
15910 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15911 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15912 files.
15913 (Archive::include_member): Add symbols from plugin objects.
15914 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15915 * descriptors.cc (Descriptors::open): Check for file descriptors
15916 abandoned by plugins.
15917 (Descriptors::claim_for_plugin): New function.
15918 * descriptors.h (Descriptors::claim_for_plugin): New function.
15919 (Open_descriptor::is_claimed): New field.
15920 (claim_descriptor_for_plugin): New function.
15921 * fileread.cc (File_read::claim_for_plugin): New function.
15922 * fileread.h (File_read::claim_for_plugin): New function.
15923 (File_read::descriptor): New function.
15924 * gold.cc: Include "plugin.h".
15925 (queue_initial_tasks): Add task to call plugin hooks for generating
15926 new object files.
15927 * main.cc: Include "plugin.h".
15928 (main): Load plugin libraries.
15929 * object.h (Pluginobj): Declare.
15930 (Object::pluginobj): New function.
15931 (Object::do_pluginobj): New function.
15932 (Object::set_target): New function.
15933 * options.cc: Include "plugin.h".
15934 (General_options::parse_plugin): New function.
15935 (General_options::General_options): Initialize plugins_ field.
15936 (General_options::add_plugin): New function.
15937 * options.h (Plugin_manager): Declare.
15938 (General_options): Add --plugin option.
15939 (General_options::has_plugins): New function.
15940 (General_options::plugins): New function.
15941 (General_options::add_plugin): New function.
15942 (General_options::plugins_): New field.
15943 * plugin.cc: New file.
15944 * plugin.h: New file.
15945 * readsyms.cc: Include "plugin.h".
15946 (Read_symbols::do_read_symbols): Check for archive before checking
15947 for ELF file. Call plugin hooks to claim files.
15948 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15949 from a real object file; force override when processing replacement
15950 files.
15951 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15952 (Symbol::init_base_object): Likewise.
15953 (Symbol::init_base_output_data): Likewise.
15954 (Symbol::init_base_output_segment): Likewise.
15955 (Symbol::init_base_constant): Likewise.
15956 (Symbol::init_base_undefined): Likewise.
15957 (Symbol::output_section): Assert that object is not a plugin.
15958 (Symbol_table::add_from_pluginobj): New function.
15959 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15960 undefined.
15961 (Symbol_table::sized_write_globals): Likewise.
15962 (Symbol_table::add_from_pluginobj): Instantiate template.
15963 * symtab.h (Sized_pluginobj): Declare.
15964 (Symbol::in_real_elf): New function.
15965 (Symbol::set_in_real_elf): New function.
15966 (Symbol::in_real_elf_): New field.
15967 (Symbol_table::add_from_pluginobj): New function.
15968
15969 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15970 (LIBDL): New variable.
15971 (LDADD): Add LIBDL.
15972 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15973 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15974 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15975 (MOSTLYCLEANFILES): Likewise.
15976 * testsuite/Makefile.in: Regenerate.
15977 * testsuite/plugin_test.c: New file.
15978 * testsuite/plugin_test_1.sh: New file.
15979 * testsuite/plugin_test_2.sh: New file.
15980
de31bda5
ILT
159812008-09-16 Ian Lance Taylor <iant@google.com>
15982
9c2d0ef9
ILT
15983 * target-reloc.h (relocate_section): Check whether a symbol is
15984 defined by the ABI before reporting an undefined symbol error.
15985 * target.h (Target::is_defined_by_abi): Make parameter const.
15986 (Target::do_is_defined_by_abi): Likewise.
15987 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15988 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15989 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15990 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15991 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15992 * testsuite/Makefile.in: Rebuild.
15993
de31bda5
ILT
15994 * fileread.cc (make_view): Add casts to avoid warning.
15995
9fa33bee
AO
159962008-09-16 Alexandre Oliva <aoliva@redhat.com>
15997
15998 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15999 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16000
183fd0e3
AO
160012008-09-16 Alexandre Oliva <aoliva@redhat.com>
16002
16003 * options.h (General_options::output_is_executable): New.
16004 (General_options::output_is_pie): New.
16005 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16006 for shared libraries.
16007 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16008
7be8330a
CD
160092008-09-11 Chris Demetriou <cgd@google.com>
16010
16011 * options.h (origin): New -z option.
16012 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16013 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16014 in DT_FLAGS_1.
16015
a9caad02
CC
160162008-09-05 Cary Coutant <ccoutant@google.com>
16017
16018 * fileread.cc (File_read::make_view): Add check for attempt to map
16019 beyond end of file.
16020
ae6dce4d
CC
160212008-09-05 Cary Coutant <ccoutant@google.com>
16022
16023 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16024 explicit instantiations.
16025
d7ab2a47
KVH
160262008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16027
16028 PR gold/6858
16029 * options.cc (General_options::finalize): Allow undefined symbols
16030 in shlibs if linking -shared.
16031
16032 PR gold/6859
16033 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16034 symbols as not needing a dynsym entry.
16035
1e52a9c1
CS
160362008-08-20 Craig Silverstein <csilvers@google.com>
16037
16038 * fileread.cc (File_read::open): Do not lock the file unless it
16039 was successfully opened.
16040
d85c80a3
CC
160412008-08-14 Cary Coutant <ccoutant@google.com>
16042
16043 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16044 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16045 * testsuite/tls_test.cc (struct int128): 128-bit struct
16046 for testing TLS relocs with non-zero addend.
16047 (v12): New TLS variable.
16048 (t12): New test.
16049 (t_last): Add check for v12.
16050 * testsuite/tls_test.h (t12): New function.
16051 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16052
2d924fd9
ILT
160532008-08-13 Ian Lance Taylor <iant@google.com>
16054
16055 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16056 set tls_segment_ or relro_segment_.
16057 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16058 when appropriate.
16059 * output.h (Output_section::clear_is_relro): New function.
16060 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16061 sections specially even when output_data_ is empty.
16062 (Output_segment::maximum_alignment): When first section is relro,
16063 only force alignment for PT_LOAD segments.
16064 * script.cc (script_data_segment_align): New function.
16065 (script_data_segment_relro_end): New function.
16066 * script-c.h (script_data_segment_align): Declare.
16067 (script_data_segment_relro_end): Declare.
16068 * script-sections.h (class Script_sections): Declare
16069 data_segment_align and data_segment_relro_end. Add fields
16070 segment_align_index_ and saw_relro_end_.
16071 * script-sections.cc (class Sections_element): Add set_is_relro
16072 virtual function. Add new bool* parameter to place_orphan_here.
16073 Add get_output_section virtual function.
16074 (class Output_section_definition): Add set_is_relro. Add new
16075 bool* parameter to place_orphan_here. Add get_output_section.
16076 Add is_relro_ field.
16077 (Output_section_definition::Output_section_definition): Initialize
16078 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16079 and is_relro_ fields.
16080 (Output_section_definition::place_orphan_here): Add is_relro
16081 parameter.
16082 (Output_section_definition::set_section_addresses): Set relro for
16083 output section.
16084 (Output_section_definition::alternate_constraint): Likewise.
16085 (class Orphan_output_section): Add new bool* parameter to
16086 place_orphan_here. Add get_output_section.
16087 (Orphan_output_section::place_orphan_here): Add is_relro
16088 parameter.
16089 (Script_sections::Script_sections): Initialize
16090 data_segment_align_index_ and saw_relro_end_.
16091 (Script_sections::data_segment_align): New function.
16092 (Script_sections::data_segment_relro_end): New function.
16093 (Script_sections::place_orphan): Set or clear is_relro.
16094 (Script_sections::set_section_addresses): Force alignment of first
16095 TLS section.
16096 * yyscript.y (exp): Call script_data_segment_align and
16097 script_data_segment_relro_end.
16098 * testsuite/relro_script_test.t: New file.
16099 * testsuite/relro_test.cc (using_script): Declare.
16100 (t1, t2): Test using_script.
16101 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16102 (relro_script_test_SOURCES): Define.
16103 (relro_script_test_DEPENDENCIES): Define.
16104 (relro_script_test_LDFLAGS): Define.
16105 (relro_script_test_LDADD): Define.
16106 (relro_script_test.so): New target.
16107 * testsuite/Makefile.in: Rebuild.
16108
f827c9a9
CC
161092008-08-06 Cary Coutant <ccoutant@google.com>
16110
16111 * archive.cc (Archive::total_archives, Archive::total_members)
16112 (Archive::total_members_loaded): New variables.
16113 (Archive::setup): Add parameter. Add option to preread
16114 archive symbols.
16115 (Archive::read_armap): Add counter.
16116 (Archive::get_file_and_offset): New function.
16117 (Archive::get_elf_object_for_member): New function.
16118 (Archive::read_all_symbols): New function.
16119 (Archive::read_symbols): New function.
16120 (Archive::add_symbols): Add counters.
16121 (Archive::include_all_members): Use armap to find members if it's
16122 already built.
16123 (Archive::include_member): Skip reading symbols if already read.
16124 Factored code into Archive::get_file_and_offset and
16125 Archive::get_elf_object_for_member. Changed call to
16126 Mapfile::report_include_archive_member.
16127 (Archive::print_stats): New function.
16128 * archive.h: Declare Object and Read_symbols_data classes.
16129 (Archive::Archive): Add initializers for new members.
16130 (Archive::setup): Add parameter.
16131 (Archive::print_stats): New function.
16132 (Archive::total_archives, Archive::total_members)
16133 (Archive::total_members_loaded): New variables.
16134 (Archive::get_file_and_offset): New function.
16135 (Archive::get_elf_object_for_member): New function.
16136 (Archive::read_all_symbols): New function.
16137 (Archive::read_symbols): New function.
16138 (Archive::Archive_member): New class.
16139 (Archive::members_): New member.
16140 (Archive::num_members_): New member.
16141 * main.cc: Include archive.h.
16142 (main): Call Archive::print_stats.
16143 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16144 archive parameter; member_name is now the fully-decorated name.
16145 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16146 * options.h: (General_options): Add --preread-archive-symbols option.
16147 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16148 Archive::setup.
16149
de4c45bd
ILT
161502008-08-04 Ian Lance Taylor <iant@google.com>
16151
16152 * symtab.h (Symbol::use_plt_offset): New function.
16153 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16154 * powerpc.cc (Relocate::relocate): Likewise.
16155 * sparc.cc (Relocate::relocate): Likewise.
16156 * x86_64.cc (Relocate::relocate): Likewise.
16157 * testsuite/weak_plt.sh: New test.
16158 * testsuite/weak_plt_main.cc: New test.
16159 * testsuite/weak_plt_shared.cc: New test.
16160 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16161 (check_PROGRAMS): Add weak_plt.
16162 (check_DATA): Add weak_plt_shared.so.
16163 (weak_plt_main_pic.o, weak_plt): New targets.
16164 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16165 * testsuite/Makefile.in: Rebuild.
16166
16167 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16168 gcctestdir/ld.
16169 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16170 * testsuite/Makefile.in: Rebuild.
16171
323ee3f4
AM
161722008-08-04 Alan Modra <amodra@bigpond.net.au>
16173
16174 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16175 * Makefile.in: Regenerate.
16176 * po/POTFILES.in: Regenerate.
16177
7c07ecec
ILT
161782008-07-29 Ian Lance Taylor <iant@google.com>
16179
16180 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16181 symbols before other symbols.
16182 * testsuite/script_test_2.cc (test_addr): Declare.
16183 (test_addr_alias): Declare.
16184 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16185 values.
7c07ecec
ILT
16186 * testsuite/script_test_2.t: Define test_addr_alias and
16187 test_addr.
16188
5778530e
ILT
161892008-07-24 Ian Lance Taylor <iant@google.com>
16190
2a00e4fb
ILT
16191 PR 5990
16192 * descriptors.cc: New file.
16193 * descriptors.h: New file.
16194 * gold-threads.h (class Hold_optional_lock): New class.
16195 * fileread.cc: Include "descriptors.h".
16196 (File_read::~File_read): Release descriptor rather than closing
16197 it.
16198 (File_read::open) [file]: Call open_descriptor rather than open.
16199 Set is_descriptor_opened_.
16200 (File_read::open) [memory]: Assert that descriptor is not open.
16201 (File_read::reopen_descriptor): New function.
16202 (File_read::release): Release descriptor.
16203 (File_read::do_read): Make non-const. Reopen descriptor.
16204 (File_read::read): Make non-const.
16205 (File_read::make_view): Reopen descriptor.
16206 (File_read::do_readv): Likewise.
16207 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16208 Update declarations.
16209 * layout.cc: Include "descriptors.h".
16210 (Layout::create_build_id): Use open_descriptor rather than open.
16211 * output.cc: Include "descriptors.h".
16212 (Output_file::open): Use open_descriptor rather than open.
16213 * archive.cc (Archive::const_iterator): Change Archive to be
16214 non-const.
16215 (Archive::begin, Archive::end): Make non-const.
16216 (Archive::count_members): Likewise.
16217 * archive.h (class Archive): Update declarations.
16218 * object.h (Object::read): Make non-const.
16219 * Makefile.am (CCFILES): Add descriptors.cc.
16220 (HFILES): Add descriptors.h.
16221 * Makefile.in: Rebuild.
16222
801647d1
ILT
16223 PR 6716
16224 * gold.h: Always include <clocale>. Add Solaris workarounds
16225 following code in binutils/sysdep.h.
16226
5edd166e
ILT
16227 PR 6048
16228 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16229 this->eh_frame_hdr_ is NULL before using it.
16230
c89ad728
ILT
16231 * dynobj.cc (Versions::Versions): Update comment.
16232
aa86f06b
ILT
16233 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16234 the base version name.
16235
5778530e
ILT
16236 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16237 array size plus one.
16238 (Stringpool_template::set_string_offsets): Subtract one from key
16239 before using it as an array index.
16240 (Stringpool_template::get_offset_with_length): Likewise.
16241 (Stringpool_template::write_to_buffer): Likewise.
16242 * stringpool.h (Stringpool_template::get_offset_from_key):
16243 Likewise.
16244
057ead22
ILT
162452008-07-23 Ian Lance Taylor <iant@google.com>
16246
7f649c59
ILT
16247 PR 6658
16248 * object.h (Merged_symbol_value::value): Do our best to handle a
16249 negative addend.
16250
057ead22
ILT
16251 PR 6647
16252 * script.cc (Version_script_info::get_versions): Don't add empty
16253 version tag to return value.
16254 (Version_script_info::get_symbol_version_helper): Change return
16255 type to bool. Add pversion parameter. Change all callers.
16256 (script_register_vers_node): Don't require a non-NULL tag.
16257 * script.h (class Version_script_info): Update declarations.
16258 (Version_script_info::get_symbol_version): Change return type to
16259 bool. Add version parameter. Change all callers.
16260 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16261 handling. Handle an empty version from a version script.
16262 (Symbol_table::define_special_symbol): Likewise.
16263 * testsuite/ver_test_10.script: New file.
16264 * testsuite/ver_test_10.sh: New file.
16265 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16266 (check_DATA): Add ver_test_10.syms.
16267 (ver_test_10.syms, ver_test_10.so): New target.
16268 * testsuite/Makefile.in: Rebuild.
16269
58e54ac2
CD
162702008-07-23 Simon Baldwin <simonb@google.com>
16271
16272 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16273 to zero for undefined symbols from dynamic libraries.
16274
95d14cd3
ILT
162752008-07-23 Ian Lance Taylor <iant@google.com>
16276
16277 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16278 Change all callers.
16279 * symtab.h (class Symbol_table): Update declaration.
16280 * testsuite/ver_test_9.cc: New file.
16281 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16282 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16283 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16284 (ver_test_9.so, ver_test_9.o): New targets.
16285 * testsuite/Makefile.in: Rebuild.
16286
92de84a6
ILT
162872008-07-22 Ian Lance Taylor <iant@google.com>
16288
34810851
ILT
16289 * options.h (class General_options): Define --check-sections.
16290 * layout.cc (Layout::set_segment_offsets): Handle
16291 --check-sections.
16292
af6156ef
ILT
16293 * options.h (class General_options): Define -n/--nmagic and
16294 -N/--omagic.
16295 * options.cc (General_options::finalize): For -n/--nmagic or
16296 -N/--omagic, set -static.
16297 * layout.cc (Layout::attach_allocated_section_to_segment): If
16298 -N/--omagic, don't put read-only and read-write sections in
16299 different segments.
16300 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16301 finding a read-only segment.
16302 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16303 don't set the minimum segment alignment to the common page size,
16304 and don't set the file offset to the address modulo the page size.
16305 * script-sections.cc (Script_sections::create_segments): If
16306 -n/--omagic, don't put read-only and read-write sections in
16307 different segments.
16308
92de84a6
ILT
16309 * cref.cc: New file.
16310 * cref.h: New file.
16311 * options.h (class General_options): Add --print-symbol-counts.
16312 * main.cc (main): Issue defined symbol report if requested.
16313 * archive.cc (Archive::interpret_header): Make into a const member
16314 function.
16315 (Archive::add_symbols): Call Input_objects::archive_start and
16316 archive_stop.
16317 (Archive::const_iterator): Define new class.
16318 (Archive::begin, Archive::end): New functions.
16319 (Archive::include_all_members): Rewrite to use iterator.
16320 (Archive::count_members): New function.
16321 * archive.h (class Archive): Update declarations.
16322 (Archive::filename): New function.
16323 * object.cc: Include "cref.h".
16324 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16325 (Sized_relobj::do_get_global_symbol_counts): New function.
16326 (Input_objects::add_object): Add object to cross-referencer.
16327 (Input_objects::archive_start): New function.
16328 (Input_objects::archive_stop): New function.
16329 (Input_objects::print_symbol_counts): New function.
16330 * object.h: Declare Cref and Archive.
16331 (Object::get_global_symbol_counts): New function.
16332 (Object::do_get_global_symbol_counts): New pure virtual function.
16333 (class Sized_relobj): Add defined_count_ field. Update
16334 declarations.
16335 (class Input_objects): Add cref_ field. Update constructor.
16336 Update declarations.
16337 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16338 defined_count_.
16339 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16340 symbol counts.
16341 (Sized_dynobj::do_get_global_symbol_counts): New function.
16342 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16343 defined_count_. Update declarations. Define Symbols typedef.
16344 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16345 parameter. Change all callers.
16346 (Symbol_table::add_from_dynobj): Add sympointers and defined
16347 parameters. Change all callers.
16348 * symtab.h (class Symbol_table): Update declarations.
16349 * Makefile.am (CCFILES): Add cref.cc.
16350 (HFILES): Add cref.h.
16351 * Makefile.in: Rebuild.
16352
3f7c5e1d
CD
163532008-07-22 Simon Baldwin <simonb@google.com>
16354
16355 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16356 to zero when writing undefined symbols.
16357
e0b64032
ILT
163582008-07-22 Ian Lance Taylor <iant@google.com>
16359
16360 * output.cc (Output_section::add_input_section): Don't try to
16361 merge empty merge sections.
16362
096b02cf
CS
163632008-07-21 Craig Silverstein <csilvers@google.com>
16364
16365 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16366 Include symbol version in error message.
cd536b21 16367
1d1f116d
CD
163682008-07-20 Chris Demetriou <cgd@google.com>
16369
cd536b21 16370 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16371 (RANDOM_SEED_CFLAGS): New substituted variable.
16372 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16373 * configure: Rebuild.
16374 * Makefile.in: Likewise.
16375 * testsuite/Makefile.in: Likewise.
16376
a18f591e
ILT
163772008-07-18 Ian Lance Taylor <iant@google.com>
16378
16379 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16380 where we see NAME/NULL and NAME/VERSION as separate symbols.
16381 * testsuite/ver_test_main.cc (main): Call t4.
16382 (t4, t4_2a): Define.
16383 * testsuite/ver_test_2.cc (t4_2): Define.
16384 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16385 * testsuite/ver_test_4.cc (t4_2a): Define.
16386 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16387 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16388
c6e3f6ed
ILT
163892008-07-17 Ian Lance Taylor <iant@google.com>
16390
16391 * dynobj.cc (Versions::add_def): If we give an error about a
16392 missing version, go ahead and create the version anyhow.
16393
ef9beddf
ILT
163942008-07-10 Ian Lance Taylor <iant@google.com>
16395
16396 Handle output sections with more than 0x7fffffff bytes.
16397 * object.h (class Relobj): Change map_to_output_ to
16398 output_sections_, and just keep a section pointer. Change all
16399 uses. Move comdat group support to Sized_relobj.
16400 (Relobj::is_section_specially_mapped): Remove.
16401 (Relobj::output_section): Remove poff parameter. Change all
16402 callers.
16403 (Relobj::output_section_offset): New function.
16404 (Relobj::set_section_offset): Rewrite.
16405 (Relobj::map_to_output): Remove.
16406 (Relobj::output_sections): New function.
16407 (Relobj::do_output_section_offset): New pure virtual function.
16408 (Relobj::do_set_section_offset): Likewise.
16409 (class Sized_relobj): Add section_offsets_ field. Add comdat
16410 group support from Relobj. Update declarations.
16411 (Sized_relobj::get_output_section_offset): New function.
16412 (Sized_relobj::do_output_section_offset): New function.
16413 (Sized_relobj::do_set_section_offset): New function.
16414 * object.cc (Relobj::output_section_address): Remove.
16415 (Sized_relobj::Sized_relobj): Initialize new fields.
16416 (Sized_relobj::include_section_group): Cast find_kept_object to
16417 Sized_relobj.
16418 (Sized_relobj::include_linkonce_section): Likewise.
16419 (Sized_relobj::do_layout): Use separate arrays for output section
16420 and output offset.
16421 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16422 output_sections.
16423 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16424 output_sections and section_offsets.
16425 (Sized_relobj::write_local_symbols): Likewise.
16426 (map_to_kept_section): Compute output address directly.
16427 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16428 output_sections and section_offsets.
16429 (Sized_relobj::write_sections): Likewise.
16430 (Sized_relobj::relocate_sections): Likewise.
16431 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16432 * output.h (class Output_reloc): Update declarations. Change
16433 u2_.relobj to Sized_relobj*.
16434 (class Output_data_reloc): Change add functions to use
16435 Sized_relobj*.
16436 * output.cc (Output_reloc::Output_reloc): Change relobj to
16437 Sized_relobj*.
16438 (Output_reloc::local_section_offset): Change return type to
16439 Elf_Addr. Use get_output_section_offset.
16440 (Output_reloc::get_address): Likewise.
16441 (Output_section::is_input_address_mapped): Don't call
16442 is_section_specially_mapped.
16443 (Output_section::output_offset): Likewise.
16444 (Output_section::output_address): Likewise.
16445 (Output_section::starting_output_address): Likewise.
16446 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16447 parameter to Sized_relobj*.
16448 (Copy_relocs::need_copy_reloc): Likewise.
16449 (Copy_relocs::save): Likewise.
16450 * copy-relocs.h (class Copy_relocs): Update declarations.
16451 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16452 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16453 * target-reloc.h (relocate_for_relocatable): Change
16454 offset_in_output_section type to Elf_Addr. Change code that uses
16455 it as well.
16456 * layout.cc (Layout::layout): Always set *off.
16457 * mapfile.cc (Mapfile::print_input_section): Use
16458 output_section_offset.
16459 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16460 Sized_relobj*.
16461 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16462 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16463 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16464
5cb66f97
ILT
164652008-07-03 Ian Lance Taylor <iant@google.com>
16466
16467 * layout.cc (Layout::include_section): Do not discard unrecognized
16468 SHT_STRTAB sections.
16469
afe47622
CS
164702008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16471
16472 * script.cc (Lex::can_continue_name): Make '?' allowable in
16473 version-script names.
16474 * testsuite/version_script.map: Change glob pattern to use '?'
16475
5adf9721
ILT
164762008-06-30 Manish Singh <yosh@gimp.org>
16477
16478 PR 6585
16479 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16480 Correct typo.
16481
e6fde208
ILT
164822008-06-30 Ian Lance Taylor <iant@google.com>
16483
16484 PR 6660
16485 PR 6682
16486 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16487 versions]: Don't try to read the value in the contents, since we
16488 don't use it. Use the template endianness when writing.
16489
3f2e6a2d
CC
164902008-06-25 Cary Coutant <ccoutant@google.com>
16491
16492 * fileread.cc (File_read::make_view): Assert on zero-length view.
16493 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16494 symbol table when there are no symbols to read.
16495
c43d3a48
CS
164962008-06-23 Craig Silverstein <csilvers@google.com>
16497
16498 * version.cc (version_string): Bump to 1.7
16499
5f494ea0
CS
165002008-06-18 Craig Silverstein <csilvers@google.com>
16501
16502 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16503 constant 0xFFFF to type Valtype.
16504 (Powerpc_relocate_functions::rel16_ha): Likewise.
16505
c42e122e
ILT
165062008-06-17 Ian Lance Taylor <iant@google.com>
16507
f34787f8
ILT
16508 * output.h (Output_section::Input_section): Initialize p2align_ to
16509 zero for Output_section_data constructors.
16510 (Output_section::Input_section::addralign): If not an input
16511 section, return the alignment of the Output_section_data.
16512 * testsuite/copy_test.cc: New file.
16513 * testsuite/copy_test_1.cc: New file.
16514 * testsuite/copy_test_2.cc: New file.
16515 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16516 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16517 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16518 (copy_test_1_pic.o, copy_test_1.so): New targets.
16519 (copy_test_2_pic.o, copy_test_2.so): New targets.
16520 * testsuite/Makefile.in: Rebuild.
16521
c42e122e
ILT
16522 * script-sections.cc (Script_sections::place_orphan): Initialize
16523 local variable exact.
16524
ce3ac18a
DE
165252008-06-13 David Edelsohn <edelsohn@gnu.org>
16526
16527 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16528
42cacb20
DE
165292008-06-12 David Edelsohn <edelsohn@gnu.org>
16530 David S. Miller <davem@davemloft.net>
16531
16532 * powerpc.cc: New file.
16533 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16534 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16535 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16536 * Makefile.in: Rebuild.
16537
7b308235
ILT
165382008-06-09 Ian Lance Taylor <iant@google.com>
16539
16540 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16541 <exception>.
16542 (throwing, orig_terminate): New static variables.
16543 (terminate_handler): New static function.
16544 (t2): Set terminate handler.
16545
f0b886e3
ILT
165462008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16547
16548 PR 6584
cd536b21 16549 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16550 alignment.
16551
3e90f135
CC
165522008-05-30 Cary Coutant <ccoutant@google.com>
16553
16554 * archive.cc (Archive::include_all_members) Correct to step
16555 over symbol table and extended name table in thin archives.
16556
e09ad04a
ILT
165572008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16558
16559 PR 6407
16560 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16561 calculation.
16562
62b01cb5
ILT
165632008-05-28 Caleb Howe <cshowe@google.com>
16564
16565 * reduced_debug_output.cc: New file.
16566 * reduced_debug_output.h: New file.
92de84a6 16567 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16568 * options.cc (General_options::finalize): Add strip_debug_non_line
16569 to the strip heirarchy.
16570 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16571 fields.
16572 * layout.cc: Include "reduced_debug_output.h".
16573 (Layout::Layout): Initialize new fields.
16574 (line_only_debug_sections): New static array.
16575 (is_lines_only_debug_sections): New static inline function.
16576 (Layout::include_section): Handle --strip-debug-non-line.
16577 (Layout::make_output_section): If --strip-debug-non-line, build
16578 new output sections for .debug_abbrev and .debug_info.
16579 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16580 gold. Warn about possible overflow.
16581 (read_signed_LEB_128): Likewise.
16582 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16583 (read_signed_LEB_128): Declare.
16584 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16585 (HFILES): Add reduced_debug_output.h.
16586 * Makefile.in: Rebuild.
16587
7d9e3d98
ILT
165882008-05-21 Ian Lance Taylor <iant@google.com>
16589
16590 * mapfile.cc: New file.
16591 * mapfile.h: New file.
16592 * options.h (class General_options): Add -M/--print-map and -Map.
16593 * options.cc (General_options::finalize): Make -M equivalent to
16594 -Map -.
16595 * main.cc: Include <cstdio> and "mapfile.h".
16596 (main): Open mapfile if requested.
16597 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16598 constructor. Change caller.
16599 (queue_initial_tasks): Add mapfile parameter. Change caller.
16600 (queue_middle_tasks): Likewise.
16601 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16602 declarations.
16603 * archive.cc: Include "mapfile.h".
16604 (Archive::add_symbols): Add mapfile parameter. Change all
16605 callers. Pass mapfile, symbol, and reason to include_member.
16606 (Archive::include_all_members): Add mapfile parameter. Change all
16607 callers.
16608 (Archive::include_member): Add mapfile, sym, and why parameters.
16609 Change all callers. Report inclusion to map file.
16610 * archive.h: Include "fileread.h".
16611 (class Archive): Update declarations.
16612 (Archive::file): New const method.
16613 (class Add_archive_symbols): Add mapfile_ field. Update
16614 constructor. Change all callers.
16615 * readsyms.h (class Read_symbols): Likewise.
16616 (class Finish_group): Likewise.
16617 (class Read_script): Likewise.
16618 * common.cc: Include "mapfile.h".
16619 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16620 all callers.
16621 (Symbol_table::do_allocate_commons): Likewise.
16622 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16623 symbol allocation to mapfile.
16624 * common.h (class Allocate_commons_task): Add mapfile_ field.
16625 Update constructor. Change all callers.
16626 * symtab.h (class Symbol_table): Update declarations.
16627 * layout.cc: Include "mapfile.h".
16628 (Layout_task_runner::run): Print information to mapfile.
16629 (Layout::create_gold_note): Change Output_data_fixed_space to
16630 Output_data_zero_fill.
16631 (Layout::create_build_id): Likewise.
16632 (Layout::print_to_mapfile): New function.
16633 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16634 constructor. Change caller.
16635 (class Layout): Declare print_to_mapfile.
16636 * output.cc (Output_section::Input_section::print_to_mapfile): New
16637 function.
16638 (Output_section::add_input_section): If producing a map, always
16639 add to input_sections_ list.
16640 (Output_section::do_print_to_mapfile): New function.
16641 (Output_segment::print_sections_to_mapfile): New function.
16642 (Output_segment::print_section_list_to_mapfile): New function.
16643 * output.h: Include "mapfile.h".
16644 (Output_data::print_to_mapfile): New function.
16645 (Output_data::do_print_to_mapfile): New virtual function.
16646 (Output_segment_headers::do_print_to_mapfile): New function.
16647 (Output_file_header::do_print_to_mapfile): New function.
16648 (Output_data_const::do_print_to_mapfile): New function.
16649 (class Output_data_const_buffer): Add map_name_ field. Update
16650 constructor. Change all callers. Add do_print_to_mapfile
16651 function.
16652 (class Output_data_fixed_space): Likewise.
16653 (class Output_data_space): Likewise.
16654 (class Output_data_zero_fill): New class.
16655 (Output_data_strtab::do_print_to_mapfile): New function.
16656 (Output_data_reloc_base::do_print_to_mapfile): New function.
16657 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16658 (Output_data_group::do_print_to_mapfile): New function.
16659 (Output_data_got::do_print_to_mapfile): New function.
16660 (Output_data_dynamic::do_print_to_mapfile): New function.
16661 (Output_symtab_xindex::do_print_to_mapfile): New function.
16662 (class Output_section): Declare do_print_to_mapflie. Declare
16663 print_to_mapfile in Input_section.
16664 (class Output_segment): Declare new functions.
16665 * object.h (Sized_relobj::symbol_count): New function.
16666 * script-sections.cc
16667 (Output_section_element_dot_assignment::set_section_addresses):
16668 Change Output_data_fixed_space to Output_data_zero_fill.
16669 (Output_data_expression::do_print_to_mapfile): New function.
16670 * script.cc (read_input_script): Add mapfile parameter. Change
16671 all callers.
16672 * script.h (read_input_script): Update declaration.
16673 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16674 (Eh_frame::do_print_to_mapfile): New function.
16675 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16676 (Output_merge_string::do_print_to_mapfile): New function.
16677 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16678 function.
16679 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16680 function.
16681 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16682 function.
16683 * Makefile.am (CCFILES): Add mapfile.cc.
16684 (HFILES): Add mapfile.h.
16685 * Makefile.in: Rebuild.
16686
9f1d377b
ILT
166872008-05-19 Ian Lance Taylor <iant@google.com>
16688
16689 * options.h (class General_options): Add -z relro.
16690 * layout.cc (Layout::Layout): Initialize relro_segment_.
16691 (Layout::add_output_section_data): Return the output section.
16692 (Layout::make_output_section): Rcognize relro sections and mark
16693 them appropriately.
16694 (Layout::attach_allocated_section_to_segment): Put relro sections
16695 in a PT_GNU_RELRO segment.
16696 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16697 section as relro.
16698 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16699 PT_TLS segments.
16700 (Layout::linkonce_mapping): Map d.rel.ro.local to
16701 .data.rel.ro.local.
16702 (Layout::output_section_name): Us .data.rel.ro.local for any
16703 section which begins with that.
16704 * layout.h (class Layout): Update add_output_section_data
16705 declaration. Add relro_segment_ field.
16706 * output.cc (Output_section::Output_section): Initialize is_relro_
16707 and is_relro_local_ fields.
16708 (Output_segment::add_output_section): Group relro sections.
16709 (Output_segment::is_first_section_relro): New function.
16710 (Output_segment::maximum_alignment): If there is a relro section,
16711 align the segment to the common page size.
16712 (Output_segment::set_section_addresses): Track whether we are
16713 looking at relro sections. If the last section is a relro
16714 section, align to the common page size.
16715 (Output_segment::set_section_list_addresses): Add in_relro
16716 parameter. Change all callers. Align to the page size when
16717 moving from relro to non-relro section.
16718 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16719 segment.
16720 * output.h (class Output_section): Add is_relro_ and
16721 is_relro_local_ fields.
16722 (Output_section::is_relro): New function.
16723 (Output_section::set_is_relro): New function.
16724 (Output_section::is_relro_local): New function.
16725 (Output_section::set_is_relro_local): New function.
16726 (class Output_segment): Update declarations.
16727 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16728 * sparc.cc (Target_sparc::got_section): Likewise.
16729 * x86_64.cc (Target_x86_64::got_section): Likewise.
16730 * testsuite/relro_test_main.cc: New file.
16731 * testsuite/relro_test.cc: New file.
16732 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16733 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16734 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16735 (relro_test.so, relro_test_pic.o): New targets.
16736 * testsuite/Makefile.in: Rebuild.
16737
a984ee1d
ILT
167382008-05-16 Ian Lance Taylor <iant@google.com>
16739
01676dcd
ILT
16740 * output.cc (Output_segment::add_output_section): Remove front
16741 parameter.
16742 * output.h (class Output_segment): Remove
16743 add_initial_output_section and overloaded add_output_section.
16744 Update declaration of remaining add_output_section.
16745 * layout.cc (Layout::create_interp): Call add_output_section
16746 rather than add_initial_output_section.
16747 (Layout::finish_dynamic_section): Likewise.
16748
497897f9
ILT
16749 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16750 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16751 know the dynamic type.
16752 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16753 field. Initialize it in constructor.
16754 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16755 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16756 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16757 reloc.
16758
a984ee1d
ILT
16759 * output.cc (Output_reloc::get_address): Change return type to
16760 Elf_Addr.
16761 * output.h (class Output_reloc): Update get_address declaration.
16762 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16763 for section addresses.
16764
55ba0940
ILT
167652008-05-09 Ian Lance Taylor <iant@google.com>
16766
16767 PR 6493
16768 * gold.cc (gold_nomem): Use return value of write.
16769
75517b77
ILT
167702008-05-08 Ian Lance Taylor <iant@google.com>
16771
16772 * symtab.c (Symbol::init_base_output_data): Add version
16773 parameter. Change all callers.
16774 (Symbol::init_base_output_segment): Likewise.
16775 (Symbol::init_base_constant): Likewise.
16776 (Symbol::init_base_undefined): Likewise.
16777 (Sized_symbol::init_output_data): Likewise.
16778 (Sized_symbol::init_output_segment): Likewise.
16779 (Sized_symbol::init_constant): Likewise.
16780 (Sized_symbol::init_undefined): Likewise.
16781 (Symbol_table::do_define_in_output_data): If the new symbol has a
16782 version, mark it as the default.
16783 (Symbol_table::do_define_in_output_segment): Likewise.
16784 (Symbol_table::do_define_as_constant): Likewise.
16785 * symtab.h (class Symbol): Update declarations.
16786 (class Sized_symbol): Likewise.
16787 * resolve.cc (Symbol::override_version): New function.
c42e122e 16788 (Symbol::override_base): Call override_version.
75517b77
ILT
16789 (Symbol::override_base_with_special): Likewise.
16790 * testsuite/ver_script_8.script: New file.
16791 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16792 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16793 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16794 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16795
f1f70eae
ILT
167962008-05-06 Ian Lance Taylor <iant@google.com>
16797
f3e9c5c5
ILT
16798 PR 6049
16799 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16800 functions.
16801 (class General_options): Remove existing --undefined, and add
16802 --no-undefined instead. Add new --undefined as synonym for -u.
16803 * archive.cc (Archive::add_symbols): Check whether symbol was
16804 named with -u.
16805 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16806 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16807 all uses. Add IS_UNDEFINED. Update declarations to split
16808 different versions of init_base. Declare init_base_undefined.
16809 (Symbol::is_defined): Handle IS_UNDEFINED.
16810 (Symbol::is_undefined): Likewise.
16811 (Symbol::is_weak_undefined): Call is_undefined.
16812 (Symbol::is_absolute): Handle IS_CONSTANT.
16813 (class Sized_symbol): Update declarations to split different
16814 versions of init. Declare init_undefined.
16815 (class Symbol_table): Declare new functions.
16816 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16817 Change all callers.
16818 (Symbol::init_base_output_data): Likewise.
16819 (Symbol::init_base_output_segment): Likewise.
16820 (Symbol::init_base_constant): Likewise.
16821 (Symbol::init_base_undefined): New function.
16822 (Sized_symbol::init_object): Rename from init. Change all
16823 callers.
16824 (Sized_symbol::init_output_data): Likewise.
16825 (Sized_symbol::init_output_segment): Likewise.
16826 (Sized_symbol::init_constant): Likewise.
16827 (Sized_symbol::init_undefined): New function.
16828 (Symbol_table::add_undefined_symbols_from_command_line): New
16829 function.
16830 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16831 function.
16832 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16833 (Symbol::output_section): Likewise.
16834 (Symbol::set_output_section): Likewise.
16835 (Symbol_table::sized_finalize_symbol): Likewise.
16836 (Symbol_table::sized_write_globals): Likewise.
16837 * resolve.cc (Symbol_table::should_override): Likewise.
16838 (Symbol::override_base_with_special): Likewise.
16839
8bdcdf2c
ILT
16840 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16841 symbol, change it to have default visibility.
16842 * testsuite/protected_1.cc: New file.
16843 * testsuite/protected_2.cc: New file.
16844 * testsuite/protected_3.cc: New file.
16845 * testsuite/protected_main_1.cc: New file.
16846 * testsuite/protected_main_2.cc: New file.
16847 * testsuite/protected_main_3.cc: New file.
16848 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16849 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16850 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16851 (protected_1.so): New target.
16852 (protected_1_pic.o, protected_2_pic.o): New targets.
16853 (protected_3_pic.o): New target.
16854 (check_PROGRAMS): Add protected_2.
16855 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16856 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16857 * testsuite/Makefile.in: Rebuild.
16858
2b706932
ILT
16859 * options.h (DEFINE_var): Add set_user_set_##varname__.
16860 (DEFINE_bool_alias): New macro.
16861 (class General_options): Define -Bstatic using DEFINE_bool_alias
16862 rather than DEFINE_special. Add --undefined as an alias for -z
16863 defs.
16864 * options.cc (General_options::parse_Bstatic): Remove.
16865
d82a5bcc
ILT
16866 * options.h (class General_options): Add --fatal-warnings.
16867 * main.cc (main): Implement --fatal-warnings.
16868 * errors.h (Errors::warning_count): New function.
16869
f1f70eae
ILT
16870 * options.h (class General_options): Add -Bsymbolic-functions.
16871 * symtab.h (Symbol::is_preemptible): Check for
16872 -Bsymbolic-functions.
16873
8825ac63
ILT
168742008-05-05 Ian Lance Taylor <iant@google.com>
16875
d98bc257
ILT
16876 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16877 as noVARNAME rather than no-VARNAME.
16878 (class General_options): Add option -z combreloc.
16879 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16880 get_address.
16881 (Output_reloc::sort_before) [SHT_REL]: New function.
16882 (Output_reloc::sort_before) [SHT_RELA]: New function.
16883 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16884 Sort_relocs_comparison.
16885 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16886 parameter. Change all callers.
16887 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16888 sort_relocs parameter. Change all callers.
16889 * output.cc (Output_reloc::get_address): New function, broken out
16890 of write_rel.
16891 (Output_reloc::write_rel): Call it.
16892 (Output_reloc::compare): New function.
16893 (Output_data_reloc_base::do_write): Optionally sort relocs.
16894
60b2b4e7
ILT
16895 * configure.ac: If targ_extra_obj is set, link it in.
16896 * configure.tgt: Initialize all variables.
16897 (x86_64*): Set targ_extra_obj and targ_extra_size.
16898 * configure: Rebuild.
16899
8825ac63
ILT
16900 * object.cc (Sized_relobj::include_section_group): Adjust section
16901 indexes read from group data. Build vector to pass to
16902 layout_group.
16903 * layout.cc (Layout::layout_group): Add flags and shndxes
16904 parameters. Remove contents parameter. Change caller. Update
16905 explicit instantiations.
16906 * layout.h (class Layout): Update layout_group declaration.
16907 * output.cc (Output_data_group::Output_data_group): Add flags and
16908 input_shndxes parameters. Remove contents parameter. Change
16909 caller.
16910 (Output_data_group::do_write): Change input_sections_ to
16911 input_shndxes_.
16912 * output.h (class Output_data_group): Update constructor
16913 declaration. Rename input_sections_ to input_shndxes_.
16914 * testsuite/many_sections_test.cc: Add template.
16915
e94cf127
CC
169162008-04-30 Cary Coutant <ccoutant@google.com>
16917
4418b2d5
CC
16918 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16919
e94cf127
CC
16920 * layout.cc (Layout::include_section): Refactored check for debug
16921 info section.
16922 (Layout::add_comdat): Add new parameters. Change type
16923 of signature parameter. Add object and shndx to signatures table.
16924 (Layout::find_kept_object): New function.
16925 * layout.h: Include <cstring>.
16926 (Layout::is_debug_info_section): New function.
16927 (Layout::add_comdat): Add new parameters.
16928 (Layout::find_kept_object): New function.
16929 (Layout::Kept_section): New struct.
16930 (Layout::Signatures): Change type of map range.
16931 * object.cc (Relobj::output_section_address): New function.
16932 (Sized_relobj::include_section_group): Add new parameters. Change
16933 calls to Layout::add_comdat. Change to build table of kept comdat
16934 groups and table mapping discarded sections to kept sections.
16935 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16936 (Sized_relobj::do_layout): Change calls to include_section_group and
16937 include_linkonce_section.
16938 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16939 value to zero when section is discarded.
16940 (Sized_relobj::map_to_kept_section): New function.
16941 * object.h (Relobj::output_section_address): New function.
16942 (Relobj::Comdat_group): New type.
16943 (Relobj::find_comdat_group): New function.
16944 (Relobj::Comdat_group_table): New type.
16945 (Relobj::Kept_comdat_section): New type.
16946 (Relobj::Kept_comdat_section_table): New type.
16947 (Relobj::add_comdat_group): New function.
16948 (Relobj::set_kept_comdat_section): New function.
16949 (Relobj::get_kept_comdat_section): New function.
16950 (Relobj::comdat_groups_): New field.
16951 (Relobj::kept_comdat_sections_): New field.
16952 (Symbol_value::input_value): Update comment.
16953 (Sized_relobj::map_to_kept_section) New function.
16954 (Sized_relobj::include_linkonce_section): Add new parameter.
16955 * target-reloc.h (Comdat_behavior): New type.
16956 (get_comdat_behavior): New function.
16957 (relocate_section): Add code to map a discarded section to the
16958 corresponding kept section when applying a relocation.
16959
e4e5049b
CS
169602008-04-30 Craig Silverstein <csilvers@google.com>
16961
16962 * dwarf_reader.cc (next_generation_count): New static var.
16963 (Addr2line_cache_entry): New struct.
16964 (addr2line_cache): New static var.
16965 (Dwarf_line_info::one_addr2line): Added caching.
16966 (Dwarf_line_info::clear_addr2line_cache): New function.
16967 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16968 cache-size parameter.
16969 (Dwarf_line_info::one_addr2line_cache): New function.
16970 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16971 new cache-size argument to one_addr2line(), and clear cache.
16972
d09e9154
CC
169732008-04-28 Cary Coutant <ccoutant@google.com>
16974
16975 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16976 R_386_PC8 relocations.
16977
7ef73768
ILT
169782008-04-23 Ian Lance Taylor <iant@google.com>
16979
55438702
ILT
16980 * object.cc (Sized_relobj::include_section_group): Check for
16981 invalid section group.
16982
c165fb93
ILT
16983 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16984 header size.
16985
7ef73768
ILT
16986 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16987 than read for file header.
16988 * archive.cc (Archive::include_member): Likewise.
16989
6194aaab
L
169902008-04-23 Paolo Bonzini <bonzini@gnu.org>
16991
16992 * aclocal.m4: Regenerate.
16993 * configure: Regenerate.
16994
d491d34e
ILT
169952008-04-19 Ian Lance Taylor <iant@google.com>
16996
5ea2bac6
ILT
16997 * version.cc (version_string): Bump to 1.6.
16998
7bc3e21a
ILT
16999 * testsuite/Makefile.am (many_sections_r_test): New target.
17000 (many_sections_r_test_SOURCES): Remove.
17001 (many_sections_r_test_DEPENDENCIES): Remove.
17002 (many_sections_r_test_LDFLAGS): Remove.
17003 (many_sections_r_test_LDADD): Remove.
17004
7fcd3aa9
ILT
17005 * object.cc (Sized_relobj::do_add_symbols): Always pass
17006 local_symbol_count_ to add_from_relobj.
17007
4c94d6ae
ILT
17008 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17009 every thousand variables.
17010 * testsuite/Makefile.in: Rebuild.
17011
d491d34e
ILT
17012 * object.cc (Xindex::initialize_symtab_xindex): New function.
17013 (Xindex::read_symtab_xindex): New function.
17014 (Xindex::sym_xindex_to_shndx): New function.
17015 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17016 available.
17017 (Sized_relobj::do_initialize_xindex): New function.
17018 (Sized_relobj::do_read_symbols): Adjust section links.
17019 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17020 parameter. Change all callers.
17021 (Sized_relobj::include_section_group): Adjust section links and
17022 symbol section indexes.
17023 (Sized_relobj::do_layout): Adjust section links.
17024 (Sized_relobj::do_count_local_symbols): Adjust section links and
17025 symbol section indexes.
17026 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17027 ordinary and special symbols.
17028 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17029 dynsym_xindex parameters. Change all callers. Adjust section
17030 links. Use SHN_XINDEX when needed.
17031 (Sized_relobj::get_symbol_location_info): Adjust section links.
17032 Don't get fooled by special symbols.
17033 * object.h (class Xindex): Define.
17034 (class Object): Add xindex_ parameter. Declare virtual functoin
17035 do_initialize_xindex.
17036 (Object::adjust_sym_shndx): New function.
17037 (Object::set_xindex): New protected function.
17038 (class Symbol_value): Add is_ordinary_shndx_ field.
17039 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17040 (Symbol_value::value): Assert ordinary section.
17041 (Symbol_value::initialize_input_to_output_map): Likewise.
17042 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17043 Change all callers.
17044 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17045 all callers.
17046 (class Sized_relobj): Update declarations.
17047 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17048 parameter. Change all callers.
17049 (Sized_relobj::adjust_shndx): New function.
17050 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17051 field.
17052 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17053 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17054 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17055 (Sized_dynobj::read_dynsym_section): Adjust section links.
17056 (Sized_dynobj::read_dynamic): Likewise.
17057 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17058 section links.
17059 (Sized_dynobj::do_initialize_xindex): New function.
17060 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17061 do_initialize_xindex.
17062 (Sized_dynobj::adjust_shndx): New function.
17063 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17064 dynsym_xindex_ fields.
17065 (Layout::finalize): Add a call to set_section_indexes before
17066 creating the symtab sections.
17067 (Layout::set_section_indexes): Don't do anything if the section
17068 already has a section index.
17069 (Layout::create_symtab_sections): Add shnum parameter. Change
17070 caller. Create .symtab_shndx section if needed.
17071 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17072 caller.
17073 (Layout::allocated_output_section_count): New function.
17074 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17075 needed.
17076 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17077 fields. Update declarations.
17078 (Layout::symtab_xindex): New function.
17079 (Layout::dynsym_xindex): New function.
17080 (class Write_symbols_task): Add layout_ field.
17081 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17082 Change caller.
17083 * output.cc (Output_section_headers::Output_section_headers): Add
17084 shstrtab_section parameter. Change all callers.
17085 (Output_section_headers::do_sized_write): Store overflow values
17086 for section count and section string table section index in
17087 section header zero.
17088 (Output_file_header::do_sized_write): Check for overflow of
17089 section count and section string table section index.
17090 (Output_symtab_xindex::do_write): New function.
17091 (Output_symtab_xindex::endian_do_write): New function.
17092 * output.h (class Output_section_headers): Add shstrtab_section_.
17093 Update declarations.
17094 (class Output_symtab_xindex): Define.
17095 (Output_section::has_out_shndx): New function.
17096 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17097 field.
17098 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17099 Change all callers.
17100 (Sized_symbol::init): Likewise.
17101 (Symbol::output_section): Check for ordinary symbol.
17102 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17103 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17104 callers.
17105 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17106 Change all callers. Simplify handling of symbols from sections
17107 not included in the link.
17108 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17109 distinction.
17110 (Weak_alias_sorter::operator()): Assert that symbols are
17111 ordinary.
17112 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17113 distinction.
17114 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17115 parameters. Change all callers.
17116 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17117 symbol distinction. Use SHN_XINDEX when needed.
17118 (Symbol_table::write_section_symbol): Add symtab_xindex
17119 parameter. Change all callers.
17120 (Symbol_table::sized_write_section_symbol): Likewise. Use
17121 SHN_XINDEX when needed.
17122 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17123 declarations.
17124 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17125 (Symbol::is_defined): Check is_ordinary.
17126 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17127 (Symbol::is_absolute, Symbol::is_common): Likewise.
17128 (class Sized_symbol): Update declarations.
17129 (class Symbol_table): Update declarations.
17130 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17131 parameters. Change all callers.
17132 (Sized_symbol::override): Likewise.
17133 (Symbol_table::override): Likewise.
17134 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17135 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17136 is_ordinary, and orig_st_shndx parameters. Change all callers.
17137 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17138 to be in an ordinary section.
17139 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17140 object and is_ordinary parameters. Change all callers.
17141 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17142 Change all callers. Don't add undefined or non-ordinary symbols
17143 to reloc_map_.
17144 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17145 Change all callers.
17146 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17147 declarations.
17148 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17149 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17150 (Sized_relobj::relocate_sections): Likewise.
17151 * target-reloc.h (scan_relocs): Adjust section symbol index.
17152 (scan_relocatable_relocs): Likewise.
17153 * i386.cc (Scan::local): Check for ordinary symbols.
17154 * sparc.cc (Scan::local): Likewise.
17155 * x86_64.cc (Scan::local): Likewise.
17156 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17157 to symbol_section_and_value.
17158 * testsuite/many_sections_test.cc: New file.
17159 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17160 (check_PROGRAMS): Add many_sections_test.
17161 (many_sections_test_SOURCES): Define.
17162 (many_sections_test_DEPENDENCIES): Define.
17163 (many_sections_test_LDFLAGS): Define.
17164 (BUILT_SOURCES): Add many_sections_define.h.
17165 (many_sections_define.h): New target.
17166 (BUILT_SOURCES): Add many_sections_check.h.
17167 (many_sections_check.h): New target.
17168 (check_PROGRAMS): Add many_sections_r_test.
17169 (many_sections_r_test_SOURCES): Define.
17170 (many_sections_r_test_DEPENDENCIES): Define.
17171 (many_sections_r_test_LDFLAGS): Define.
17172 (many_sections_r_test_LDADD): Define.
17173 (many_sections_r_test.o): New target.
17174 * testsuite/Makefile.in: Rebuild.
17175
c5818ff1
CC
171762008-04-17 Cary Coutant <ccoutant@google.com>
17177
17178 * errors.cc (Errors::info): New function.
17179 (gold_info): New function.
17180 * errors.h (Errors::info): New function.
17181 * gold.h (gold_info): New function.
17182 * object.cc (Input_objects::add_object): Print trace output.
17183 * options.cc (options::parse_set): New function.
17184 (General_options::parse_wrap): Deleted.
17185 (General_options::General_options): Deleted initializer.
17186 * options.h (options::String_set): New typedef.
17187 (options::parse_set): New function.
17188 (DEFINE_set): New macro.
17189 (General_options::wrap): Changed to use DEFINE_set. Changed
17190 callers of any_wrap_symbols and is_wrap_symbol.
17191 (General_options::trace, General_options::trace_symbol):
17192 New options.
17193 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17194 (General_options::wrap_symbols_): Deleted.
17195 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17196
b5be4a7c
DM
171972008-04-17 David S. Miller <davem@davemloft.net>
17198
17199 * options.cc (General_options::parse_V): New function.
17200 * options.h: Add entries for -V and -Qy.
17201
155a0dd7
ILT
172022008-04-17 Ian Lance Taylor <iant@google.com>
17203
17204 * common.cc (Symbol_table::allocate_commons): Remove options
17205 parameter. Change caller.
17206 (Symbol_table::do_allocate_commons): Remove options parameter.
17207 Change caller. Just call do_allocate_commons_list twice.
17208 (Symbol_table::do_allocate_commons_list): New function, broken out
17209 of do_allocate_commons.
17210 * common.h (class Allocate_commons_task): Remove options_ field.
17211 Update constructor.
17212 * symtab.cc (Symbol_table::Symbol_table): Initialize
17213 tls_commons_.
17214 (Symbol_table::add_from_object): Put TLS common symbols on
17215 tls_commons_ list.
17216 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17217 which are IN_OUTPUT_DATA.
17218 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17219 allocate_commons and do_allocate_commons declarations. Declare
17220 do_allocate_commons_list.
17221 * gold.cc (queue_middle_tasks): Update creation of
17222 Allocate_commons_task to not pass options.
17223 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17224 (TLS_TEST_C_FLAGS): New variable.
17225 (tls_test_c_pic.o): New target.
17226 (tls_test_shared.so): Link in tls_test_c_pic.o.
17227 (tls_test_c_pic_ie.o): New target.
17228 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17229 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17230 (tls_test_c.o): New target.
17231 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17232 (tls_pic_test_LDADD): Likewise.
17233 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17234 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17235 (tls_test_c_gnu2.o): New target.
17236 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17237 tls_test_c_gnu2.o.
17238 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17239 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17240 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17241 * testsuite/tls_test.cc: Include "config.h".
17242 (t_last): Call t11_last.
17243 * testsuite/tls_test.h (t11, t11_last): Declare.
17244 * testsuite/tls_test_c.c: New file.
17245 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17246 * configure.ac: Check for OpenMP support.
17247 * configure, config.in, Makefile.in: Rebuild.
17248 * testsuite/Makefile.in: Rebuild.
17249
edfbb029
CC
172502008-04-16 Cary Coutant <ccoutant@google.com>
17251
17252 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17253 (Target_i386::tls_base_symbol_defined_): New field.
17254 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17255 (Target_i386::Scan::global): Likewise.
17256 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17257 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17258 (Target_x86_64::tls_base_symbol_defined_): New field.
17259 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17260 (Target_x86_64::Scan::global): Likewise.
17261
f3c69fca
CC
172622008-04-16 Cary Coutant <ccoutant@google.com>
17263
17264 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17265 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17266 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17267 building shared libraries.
17268 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17269 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17270 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17271 * testsuite/Makefile.in: Rebuild.
17272 * testsuite/weak_undef.h: New file.
17273 * testsuite/weak_undef_file1.cc: Add extra test cases.
17274 * testsuite/weak_undef_file2.cc: Likewise.
17275 * testsuite/weak_undef_test.cc: Likewise.
17276
7c414435
DM
172772008-04-16 David S. Miller <davem@davemloft.net>
17278
32b769e1
DM
17279 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17280 Add issued_non_pic_error_ field. Declare check_non_pic.
17281 (Target_sparc::Scan::check_non_pic): New function.
17282 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17283 (Target_sparc::Scan::global): Likewise.
17284
11936fb1
DM
17285 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17286 * configure: Rebuild.
17287
7c414435
DM
17288 * options.h (DEFINE_enable): New macro.
17289 (new_dtags): New enable option.
17290 (initfirst, interpose, loadfltr, nodefaultlib,
17291 nodelete, nodlopen, nodump): New -z options.
17292 * layout.cc (Layout:finish_dynamic_section): If new
17293 dtags enabled, emit DT_RUNPATH. Also, emit a
17294 DT_FLAGS_1 containing any specified -z flags.
17295
85c7bf8b
ILT
172962008-04-16 Ian Lance Taylor <iant@google.com>
17297
12c0daef
ILT
17298 * copy-relocs.cc: New file.
17299 * copy-relocs.h: New file.
17300 * reloc.cc: Remove Copy_relocs code.
17301 * reloc.h: Likewise.
17302 * reloc-types.h (struct Reloc_types) [both versions]: Add
17303 get_reloc_addend_noerror.
17304 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17305 variants of add_global which take an addend which must be zero.
17306 * i386.cc: Include "copy-relocs.h".
17307 (class Target_i386): Change type of copy_relocs_ to variable,
17308 update initializer.
17309 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17310 Change all callers.
17311 (Target_i386::do_finalize_sections): Change handling of
17312 copy_relocs_.
17313 * sparc.cc: Include "copy-relocs.h".
17314 (class Target_sparc): Change type of copy_relocs_ to variable,
17315 update initializer.
17316 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17317 Change all callers.
17318 (Target_sparc::do_finalize_sections): Change handling of
17319 copy_relocs_.
17320 * x86_64.cc: Include "copy-relocs.h".
17321 (class Target_x86_64): Change type of copy_relocs_ to variable,
17322 update initializer.
17323 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17324 class. Change all callers.
17325 (Target_x86_64::do_finalize_sections): Change handling of
17326 copy_relocs_.
17327 * Makefile.am (CCFILES): Add copy-relocs.cc.
17328 (HFILES): Add copy-relocs.h.
17329
4f4995b6
ILT
17330 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17331
85c7bf8b
ILT
17332 * testsuite/script_test_4.sh: Permit leading zeroes.
17333
4f2a9edd
ILT
173342008-04-15 Ian Lance Taylor <iant@google.com>
17335
e6188289
ILT
17336 * script-sections.cc (Script_sections::create_segments): Use
17337 header_size_adjustment even when there is enough room for the
17338 headers.
17339 * testsuite/script_test_4.sh: New file.
17340 * testsuite/script_test_4.t: New file.
17341 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17342 (check_DATA): Add script_test_4.stdout.
17343 (MOSTLYCLEANFILES): Likewise.
17344 (script_test_4): New target.
17345 (script_test_4.stdout): New target.
17346 * testsuite/Makefile.in: Rebuild.
17347
4f2a9edd
ILT
17348 * sparc.cc: Add definitions for Output_data_plt_sparc class
17349 constants.
17350
f5314dd5
DM
173512008-04-14 David S. Miller <davem@davemloft.net>
17352
17353 * sparc.cc: New file.
17354 * Makefile.am (TARGETSOURCES): Add sparc.cc
17355 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17356 * configure.tgt: Document targ_extra_size and
17357 targ_extra_big_endian. Add entries for sparc-* and
17358 sparc64-*.
17359 * configure.ac: Handle targ_extra_size and
17360 targ_extra_big_endian.
17361 * Makefile.in: Rebuild.
17362 * configure: Likewise.
17363 * po/POTFILES.in: Likewise.
17364 * po/gold.pot: Likewise.
17365
154e0e9a
ILT
173662008-04-14 Ian Lance Taylor <iant@google.com>
17367
17368 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17369 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17370 in the name/type/flags to section mapping. Don't call
17371 allocate_output_section.
17372 (Layout::choose_output_section): Change parameter from adjust_name
17373 to is_input_section. Don't permit input sections after sections
17374 are attached to segments. Don't call allocate_output_section.
17375 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17376 not write_enable_output_section.
17377 (Layout::make_output_section): Don't push to
17378 unattached_section_list_ nor call attach_to_segment. Call
17379 attach_section_to_segment if sections are attached.
17380 (Layout::attach_sections_to_segments): New function.
17381 (Layout::attach_section_to_segment): New function.
17382 (Layout::attach_allocated_section_to_segment): Rename from
17383 attach_to_segment. Remove flags parameter.
17384 (Layout::allocate_output_section): Remove function.
17385 (Layout::write_enable_output_section): Remove function.
17386 * layout.h (class Layout): Update for above changes. Add new
17387 field sections_are_attached_.
17388 * output.h (Output_section::update_flags_for_input_section): New
17389 function.
17390 * output.cc (Output_section::add_input_section): Call
17391 update_flags_for_input_section.
17392 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17393
009a67a2
CC
173942008-04-11 Cary Coutant <ccoutant@google.com>
17395
17396 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17397 thought unnecessary.
17398 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17399
759b1a24
ILT
174002008-04-11 Ian Lance Taylor <iant@google.com>
17401
17402 * output.h (class Output_section_data): Remove inline definition
17403 of set_addralign.
17404 * output.cc (Output_section_data::set_addralign): New function.
17405
c2b45e22
CC
174062008-04-11 Cary Coutant <ccoutant@google.com>
17407
17408 Add support for TLS descriptors for i386 and x86_64.
17409 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17410 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17411 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17412 GOT_TYPE_TLS_DESC.
17413 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17414 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17415 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17416 relocations.
17417 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17418 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17419 Fix problem with initial-exec relocations.
17420 (Target_i386::Relocate::relocate_tls): Likewise.
17421 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17422 relaxation.
17423 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17424 support for section-plus-offset dynamic table entries.
17425 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17426 (Output_data_dynamic::Dynamic_entry): Add support for
17427 section-plus-offset dynamic table entries.
17428 (Output_data_dynamic::Classification): Likewise.
17429 (Output_data_dynamic::classification_): Renamed offset_.
17430 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17431 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17432 (Target_x86_64::make_plt_section): New function.
17433 (Target_x86_64::reserve_tlsdesc_entries): New function.
17434 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17435 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17436 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17437 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17438 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17439 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17440 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17441 add extra PLT entry for TLS descriptors.
17442 (Output_data_plt_x86_64::got_): New field.
17443 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17444 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17445 fields.
17446 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17447 descriptors.
17448 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17449 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17450 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17451 R_386_TLS_DESC_CALL relocations.
17452 (Target_x86_64::Scan::global): Likewise.
17453 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17454 for TLS descriptors.
17455 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17456 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17457 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17458 GD-to-IE relaxation.
17459 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17460 and TLS_DESCRIPTORS.
17461 * Makefile.in: Rebuild.
17462 * configure: Rebuild.
17463 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17464 (tls_test_shared2.so): New target.
17465 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17466 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17467 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17468 (tls_shared_gd_to_ie_test_LDADD): New variable.
17469 (tls_shared_gnu2_gd_to_ie_test): New target.
17470 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17471 New targets.
17472 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17473 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17474 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17475 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17476 (tls_shared_gnu2_test): New target.
17477 (tls_test_gnu2_shared.so): New target.
17478 (tls_shared_gnu2_test_SOURCES): New variable.
17479 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17480 (tls_shared_gnu2_test_LDFLAGS): New variable.
17481 (tls_shared_gnu2_test_LDADD): New variable.
17482 * testsuite/Makefile.in: Rebuild.
17483 * testsuite/Makefile.
17484
83bfb6b7
ILT
174852008-04-11 Ian Lance Taylor <iant@google.com>
17486
17487 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17488 justsyms.t.
17489 * testsuite/Makefile.in: Rebuild.
17490
17491 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17492 long.
17493 * testsuite/script_test_2.cc (main): Adjust test.
17494
706e1f5e
ILT
174952008-04-11 David S. Miller <davem@davemloft.net>
17496 Ian Lance Taylor <iant@google.com>
17497
17498 * options.h (General_options): Add entries for '-Y' and
17499 '-relax'.
17500 * options.cc (General_options:finalize): If -Y was used, add those
17501 entries to the library path instead of the default "/lib" and
17502 "/usr/lib".
17503
7c98e6bb
DM
175042008-04-11 David S. Miller <davem@davemloft.net>
17505
17506 * testsuite/justsyms.t: Start at 0x100.
17507 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17508 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17509 long.
17510 * testsuite/script_test_2.cc: Adjust string and section length
17511 checks.
7c98e6bb 17512
99a37bfd
ILT
175132008-04-09 Ian Lance Taylor <iant@google.com>
17514
2cefc357
ILT
17515 PR gold/5996
17516 * script-sections.cc (Sections_element::allocate_to_segment): Add
17517 orphan parameter.
17518 (Output_section_definition::allocate_to_segment): Likewise.
17519 (Orphan_output_section::allocate_to_segment): Likewise.
17520 (Script_sections::attach_sections_using_phdrs_clause): Don't
17521 propagate non-PT_LOAD segments to orphan sections.
17522 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17523 readelf rather than objdump.
17524 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17525 .interp section and PT_INTERP segment are the same size.
17526 * testsuite/Makefile.in: Rebuild.
17527
99a37bfd
ILT
17528 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17529 aliases for symbols defined in the same object.
17530 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17531 (weak_alias_test_SOURCES): New variable.
17532 (weak_alias_test_DEPENDENCIES): New variable.
17533 (weak_alias_test_LDFLAGS): New variable.
17534 (weak_alias_test_LDADD): New variable.
17535 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17536 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17537 (weak_alias_test_3.o): New target.
17538 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17539 * testsuite/weak_alias_test_main.cc: New file.
17540 * testsuite/weak_alias_test_1.cc: New file.
17541 * testsuite/weak_alias_test_2.cc: New file.
17542 * testsuite/weak_alias_test_3.cc: New file.
17543
780e49c5
ILT
175442008-04-08 Ian Lance Taylor <iant@google.com>
17545
cdb0b8f5
ILT
17546 * options.h (class General_options): Add --noinhibit-exec option.
17547 * main.cc (main): Check --noinhibit-exec.
17548
0864d551
ILT
17549 * options.h (class General_options): Define --wrap as a special
17550 option. Add wrap_symbols_ field.
17551 (General_options::any_wrap_symbols): New function.
17552 (General_options::is_wrap_symbol): New function.
17553 * options.cc (General_options::parse_wrap): New function.
17554 (General_options::General_options): Initialize wrap_symbols_.
17555 * symtab.cc (Symbol_table::wrap_symbol): New function.
17556 (Symbol_table::add_from_object): Handle --wrap.
17557 * symtab.h (class Symbol_table): Declare wrap_symbol.
17558 * target.h (Target::wrap_char): New function.
17559 (Target::Target_info): Add wrap_char field.
17560 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17561 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17562 * testsuite/testfile.cc (Target_test::test_target_info):
17563 Likewise.
17564
789aa6de
ILT
17565 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17566 there is one.
17567
2c38906f
ILT
17568 * layout.h (class Layout): Add added_eh_frame_data_ field.
17569 * layout.cc (Layout::Layout): Initialize new field.
17570 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17571 output section until we find a section we merged successfully.
17572 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17573 that the size be non-zero.
17574
780e49c5
ILT
17575 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17576 qualifier.
17577
7fcd0256
ILT
175782008-04-08 Craig Silverstein <csilvers@google.com>
17579
17580 * configure.ac: Export new conditional variable HAVE_ZLIB.
17581 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17582 on HAVE_ZLIB.
17583 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17585
6835af53
ILT
175862008-04-07 Ian Lance Taylor <iant@google.com>
17587
e24f324c
ILT
17588 * version.cc (version_string): Set to "1.5".
17589
a036edd8
ILT
17590 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17591 Add issued_non_pic_error_ field. Declare check_non_pic.
17592 (Target_x86_64::Scan::check_non_pic): New function.
17593 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17594 (Target_x86_64::Scan::global): Likewise.
17595
624f8810
ILT
17596 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17597 addend parameter. Change caller. Handle merge sections.
17598 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17599 Address to Addend. Don't add in the result of
17600 local_section_offset, pass down the addend and use the returned
17601 value.
17602 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17603 Update declarations of local_section_offset and symbol_value.
17604 * testsuite/two_file_test_1.cc (t18): New function.
17605 * testsuite/two_file_test_2.cc (f18): New function.
17606 * testsuite/two_file_test_main.cc (main): Call t18.
17607 * testsuite/two_file_test.h (t18, f18): Declare.
17608
6835af53
ILT
17609 * configure.ac: Don't test for objdump, c++filt, or readelf.
17610 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17611 conditionals.
17612 (TEST_READELF): New variable.
17613 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17614 (check_PROGRAMS): Add two_file_strip_test.
17615 (two_file_strip_test): New target.
17616 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17617 (two_file_same_shared_strip_test_SOURCES): New variable.
17618 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17619 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17620 (two_file_same_shared_strip_test_LDADD): New variable.
17621 (two_file_shared_strip.so): New target.
17622 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17623 (ver_test_5.syms, ver_test_7.syms): Likewise.
17624 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17625 (strip_test_3.stdout): Use TEST_OBJDUMP.
17626 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17627
86925eef
CC
176282008-04-04 Cary Coutant <ccoutant@google.com>
17629
17630 * symtab.h (Symbol::is_weak_undefined): New function.
17631 (Symbol::is_strong_undefined): New function.
17632 (Symbol::is_absolute): New function.
17633 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17634 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17635 absolute symbols.
17636 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17637 (weak_undef_test): New target.
17638 * testsuite/Makefile.in: Rebuild.
17639 * testsuite/weak_undef_file1.cc: New file.
17640 * testsuite/weak_undef_file2.cc: New file.
17641 * testsuite/weak_undef_test.cc: New file.
17642
126f3ece
ILT
176432008-04-03 Craig Silverstein <csilvers@google.com>
17644
17645 * compressed_output.h (class Output_compressed_section): Use
17646 unsigned buffer.
17647 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17648 add zlib header.
17649 (zlib_compressed_suffix): Removed.
17650 (Output_compressed_section::set_final_data_size): Use unsigned
17651 buffers.
17652 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17653 Fix linker invocation.
17654 (flagstest_o_specialfile_and_compress_debug_sections):
17655 Likewise.
17656 * testsuite/Makefile.in: Regenerated.
17657
deae2a14
DM
176582008-04-02 David S. Miller <davem@davemloft.net>
17659
17660 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17661 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17662
70752818
ILT
176632008-04-02 Craig Silverstein <csilvers@google.com>
17664
17665 * TODO: New file.
17666
39d0cb0e
ILT
176672008-04-02 Ian Lance Taylor <iant@google.com>
17668
17669 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17670 parameters. Update for new key type to views_. Change all
17671 callers.
17672 (File_read::read): Adjust for byteshift in returned view.
17673 (File_read::add_view): New function, broken out of
17674 find_and_make_view.
17675 (File_read::make_view): New function, broken out of
17676 find_and_make_view.
17677 (File_read::find_or_make_view): Add offset and aligned
17678 parameters. Rewrite accordingly. Change all callers.
17679 (File_read::get_view): Add offset and aligned parameters. Adjust
17680 for byteshift in return value.
17681 (File_read::get_lasting_view): Likewise.
17682 * fileread.h (class File_read): Update declarations.
17683 (class File_read::View): Add byteshift_ field. Add byteshift to
17684 constructor. Add byteshift method.
17685 * archive.h (Archive::clear_uncached_views): New function.
17686 (Archive::get_view): Add aligned parameter. Change all callers.
17687 * object.h (Object::get_view): Add aligned parameter. Change all
17688 callers.
17689 (Object::get_lasting_view): Likewise.
17690
17691 * fileread.cc (File_read::release): Don't call clear_views if
17692 there are multiple objects.
17693 * fileread.h (File_read::clear_uncached_views): New function.
17694 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17695 on the archive.
17696
a1207466
CC
176972008-03-31 Cary Coutant <ccoutant@google.com>
17698
17699 Add thin archive support.
17700 * archive.cc (Archive::armagt): New const.
17701 (Archive::setup): Remove task parameter and calls to unlock.
17702 (Archive::unlock_nested_archives): New function.
17703 (Archive::read_header): Add nested_off parameter. Change
17704 all callers.
17705 (Archive::interpret_header): Likewise.
17706 (Archive::include_all_members): Change to handle thin
17707 archives.
17708 (Archive::include_member): Likewise.
17709 * archive.h (Archive::Archive): Add new parameters and
17710 initializers.
17711 (Archive::armagt): New const.
17712 (Archive::setup): Remove task parameter.
17713 (Archive::unlock_nested_archives): New function.
17714 (Archive::read_header): Add nested_off parameter.
17715 (Archive::interpret_header): Likewise.
17716 (Archive::Nested_archive_table): New typedef.
17717 (Archive::is_thin_archive_): New field.
17718 (Archive::nested_archives_): New field.
17719 (Archive::options_): New field.
17720 (Archive::dirpath_): New field.
17721 (Archive::task_): New field.
17722 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17723 for thin archives. Pass additional parameters to
17724 Archive::Archive. Unlock the archive file after calling
17725 Archive::setup.
cd536b21 17726
479f6503
ILT
177272008-03-29 Ian Lance Taylor <iant@google.com>
17728
686c8caf
ILT
17729 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17730 version symbol to be local.
17731 * testsuite/ver_test_4.sh: New file.
17732 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17733 (check_DATA): Add ver_test_4.syms.
17734 (ver_test_4.syms): New target.
17735 * testsuite/Makefile.in: Rebuild.
17736
ab794b6b
ILT
17737 * output.cc
17738 (Output_section::Input_section_sort_entry::has_priority): New
17739 function.
17740 (Output_section::Input_section_sort_entry::match_file_name): New
17741 function.
17742 (Output_section::Input_section_sort_entry::match_section_name):
17743 Remove.
17744 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17745 Remove.
17746 (Output_section::Input_section_sort_entry::match_section_file):
17747 Remove.
17748 (Output_section::Input_section_sort_compare::operator()): Rewrite
17749 using new Input_section_sort_entry functions. Sort crtbegin and
17750 crtend first. Sort sections with no priority before sections with
17751 a priority.
17752 * testsuite/initpri1.c (d3): Check j != 4.
17753 (cd5): New constructor/destructor function.
17754 (main): Check j != 2.
17755
479f6503
ILT
17756 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17757 new symbol when resolving, don't call set_is_default.
17758 * testsuite/ver_test_7.cc: New file.
17759 * testsuite/ver_test_7.sh: New file.
17760 * testsuite/Makefile.am (ver_test_7.so): New target.
17761 (ver_test_7.o): New target.
17762 (check_SCRIPTS): Add ver_test_7.sh.
17763 (check_DATA): Add ver_test_7.syms.
17764 (ver_test_7.syms): New target.
17765
2fd32231
ILT
177662008-03-28 Ian Lance Taylor <iant@google.com>
17767
17768 * layout.cc (Layout::layout): If we see an input section with a
17769 name that needs sorting, set the must_sort flag for the output
17770 section.
17771 (Layout::make_output_section): If the name of the output section
17772 indicates that it might require sorting, set the may_sort flag.
17773 * output.h (Output_section::may_sort_attached_input_sections): New
17774 function.
17775 (Output_section::set_may_sort_attached_input_sections): New
17776 function.
17777 (Output_section::must_sort_attached_input_sections): New
17778 function.
17779 (Output_section::set_must_sort_attached_input_sections): New
17780 function.
17781 (class Output_section): Declare Input_section_sort_entry. Define
17782 Input_section_sort_compare. Declare
17783 sort_attached_input_sections. Add new fields:
17784 may_sort_attached_input_sections_,
17785 must_sort_attached_input_sections_,
17786 attached_input_sections_are_sorted_.
17787 * output.cc (Output_section::Output_section): Initialize new
17788 fields.
17789 (Output_section::add_input_section): Add an entry to
17790 input_sections_ if may_sort or must_sort are true.
17791 (Output_section::set_final_data_size): Call
17792 sort_attached_input_sections if necessary.
17793 (Output_section::Input_section_sort_entry): Define new class.
17794 (Output_section::Input_section_sort_compare::operator()): New
17795 function.
17796 (Output_section::sort_attached_input_sections): New function.
17797 * configure.ac: Check whether the compiler supports constructor
17798 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17799 * testsuite/initpri1.c: New file.
17800 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17801 CONSTRUCTOR_PRIORITY.
17802 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17803 (initpri1_LDFLAGS): New variable.
17804 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17805
18e6b24e
ILT
178062008-03-27 Ian Lance Taylor <iant@google.com>
17807
49bdd526
ILT
17808 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17809 * testsuite/common_test_1.c: New file.
17810 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17811 (common_test_1_SOURCES): New variable.
17812 (common_test_1_DEPENDENCIES): New variable.
17813 (common_test_1_LDFLAGS): New variable.
17814
18e6b24e
ILT
17815 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17816 and commons_ correctly when NAME/VERSION does not override
17817 NAME/NULL.
17818 * testsuite/ver_test_6.c: New file.
17819 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17820 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17821 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17822
04bf7072
ILT
178232008-03-26 Ian Lance Taylor <iant@google.com>
17824
5871526f
ILT
17825 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17826 of an undefined symbol from a version script.
17827 * testsuite/Makefile.am (ver_test_5.so): New target.
17828 (ver_test_5.o): New target.
17829 (check_SCRIPTS): Add ver_test_5.sh.
17830 (check_DATA): Add ver_test_5.syms.
17831 (ver_test_5.syms): New target.
17832 * testsuite/ver_test_5.cc: New file.
17833 * testsuite/ver_test_5.script: New file.
17834 * testsuite/ver_test_5.sh: New file.
17835 * Makefile.in, testsuite/Makefile.in: Rebuild.
17836
04bf7072
ILT
17837 PR gold/5986
17838 Fix problems building gold with gcc 4.3.0.
17839 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17840 (gold_error_at_location, gold_warning_at_location): Use it.
17841 * configure.ac: Check whether we can compile and use a template
17842 function with a printf attribute.
17843 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17844 when jumping over bytes.
17845 * object.cc: Instantiate Object::read_section_data.
17846 * debug.h: Include <cstring>
17847 * dwarf_reader.cc: Include <algorithm>
17848 * main.cc: Include <cstring>.
17849 * options.cc: Include <cstring>.
17850 * output.cc: Include <cstring>.
17851 * script.cc: Include <cstring>.
17852 * script.h: Include <string>.
17853 * symtab.cc: Include <cstring> and <algorithm>.
17854 * target-select.cc: Include <cstring>.
17855 * version.cc: Include <string>.
17856 * testsuite/testmain.cc: Include <cstdlib>.
17857 * configure, config.in: Rebuild.
17858
874c5b28
ILT
178592008-03-25 Ian Lance Taylor <iant@google.com>
17860
819d6c3a
ILT
17861 * options.cc: Include "../bfd/bfdver.h".
17862 (options::help): Print bug reporting address.
17863
f4b2c6f5
ILT
17864 * version.cc (print_version): Adjust output for current value of
17865 BFD_VERSION_STRING.
17866
17867 * NEWS: New file.
17868
e96caa79
ILT
17869 * options.cc (options::help): Print list of supported targets.
17870 * target-select.h: Include <vector>.
17871 (class Target_selector): Make machine_, size_, and is_big_endian_
17872 fields const. Add bfd_name_ and instantiated_target_ fields.
17873 (Target_selector::Target_selector): Add bfd_name parameter.
17874 (Target_selector::recognize): Make non-virtual, call
17875 do_recognize.
17876 (Target_selector::recognize_by_name): Make non-virtual, call
17877 do_recognize_by_name.
17878 (Target_selector::supported_names): New function.
17879 (Target_selector::bfd_name): New function.
17880 (Target_selector::do_instantiate_target): New pure virtual
17881 function.
17882 (Target_selector::do_recognize): New virtual function.
17883 (Target_selector::do_recognize_by_name): New virtual function.
17884 (Target_selector::instantiate_target): New private function.
17885 (supported_target_names): Declare.
17886 * target-select.cc (Target_selector::Target_selector): Update for
17887 new parameter and fields.
17888 (select_target_by_name): Check that the name matches before
17889 calling recognize_by_name.
17890 (supported_target_names): New function.
17891 * i386.cc (class Target_selector_i386): Update Target_selector
17892 constructor call. Remove recognize and recognize_by_name. Add
17893 do_instantiate_target.
17894 * x86_64.cc (class Target_selector_x86_64): Likewise.
17895 * testsuite/testfile.cc (class Target_selector_test): Update for
17896 changes to Target_selector.
17897
874c5b28
ILT
17898 * README: Rewrite, with some notes on unsupported features.
17899
0a65a3a7
CC
179002008-03-24 Cary Coutant <ccoutant@google.com>
17901
17902 * i386.cc (Target_i386::Got_type): New enum declaration.
17903 (Target_i386::Scan::local): Updated callers of Output_data_got
17904 member functions.
17905 (Target_i386::Scan::global): Likewise.
17906 (Target_i386::Relocate::relocate): Likewise.
17907 (Target_i386::Relocate::relocate_tls): Likewise.
17908 * object.h (Got_offset_list): New class.
17909 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17910 (Sized_relobj::local_got_offset): Likewise.
17911 (Sized_relobj::set_local_got_offset): Likewise.
17912 (Sized_relobj::local_has_tls_got_offset): Removed.
17913 (Sized_relobj::local_tls_got_offset): Removed.
17914 (Sized_relobj::set_local_tls_got_offset): Removed.
17915 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17916 * output.cc (Output_data_got::add_global): Added got_type parameter.
17917 (Output_data_got::add_global_with_rel): Likewise.
17918 (Output_data_got::add_global_with_rela): Likewise.
17919 (Output_data_got::add_global_pair_with_rel): New function.
17920 (Output_data_got::add_global_pair_with_rela): New function.
17921 (Output_data_got::add_local): Added got_type parameter.
17922 (Output_data_got::add_local_with_rel): Likewise.
17923 (Output_data_got::add_local_with_rela): Likewise.
17924 (Output_data_got::add_local_pair_with_rel): New function.
17925 (Output_data_got::add_local_pair_with_rela): New function.
17926 (Output_data_got::add_global_tls): Removed.
17927 (Output_data_got::add_global_tls_with_rel): Removed.
17928 (Output_data_got::add_global_tls_with_rela): Removed.
17929 (Output_data_got::add_local_tls): Removed.
17930 (Output_data_got::add_local_tls_with_rel): Removed.
17931 (Output_data_got::add_local_tls_with_rela): Removed.
17932 * output.h (Output_data_got::add_global): Added got_type parameter.
17933 (Output_data_got::add_global_with_rel): Likewise.
17934 (Output_data_got::add_global_with_rela): Likewise.
17935 (Output_data_got::add_global_pair_with_rel): New function.
17936 (Output_data_got::add_global_pair_with_rela): New function.
17937 (Output_data_got::add_local): Added got_type parameter.
17938 (Output_data_got::add_local_with_rel): Likewise.
17939 (Output_data_got::add_local_with_rela): Likewise.
17940 (Output_data_got::add_local_pair_with_rel): New function.
17941 (Output_data_got::add_local_pair_with_rela): New function.
17942 (Output_data_got::add_global_tls): Removed.
17943 (Output_data_got::add_global_tls_with_rel): Removed.
17944 (Output_data_got::add_global_tls_with_rela): Removed.
17945 (Output_data_got::add_local_tls): Removed.
17946 (Output_data_got::add_local_tls_with_rel): Removed.
17947 (Output_data_got::add_local_tls_with_rela): Removed.
17948 * resolve.cc (Symbol::override_base_with_special): Removed
17949 reference to has_got_offset_ field.
17950 * symtab.cc (Symbol::init_fields): Replaced initialization
17951 of got_offset_ with got_offsets_. Removed initialization
17952 of has_got_offset_
53fcba31 17953 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17954 (Symbol::got_offset): Likewise.
17955 (Symbol::set_got_offset): Likewise.
17956 (Symbol::has_tls_got_offset): Removed.
17957 (Symbol::tls_got_offset): Removed.
17958 (Symbol::set_tls_got_offset): Removed.
17959 (Symbol::got_offset_): Removed.
17960 (Symbol::tls_mod_got_offset_): Removed.
17961 (Symbol::tls_pair_got_offset_): Removed.
17962 (Symbol::got_offsets_): New field.
17963 (Symbol::has_got_offset): Removed.
17964 (Symbol::has_tls_mod_got_offset): Removed.
17965 (Symbol::has_tls_pair_got_offset): Removed.
17966 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17967 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17968 member functions.
17969 (Target_x86_64::Scan::global): Likewise.
17970 (Target_x86_64::Relocate::relocate): Likewise.
17971 (Target_x86_64::Relocate::relocate_tls): Likewise.
17972
bd52eafb
BE
179732008-03-25 Ben Elliston <bje@au.ibm.com>
17974
17975 * yyscript.y: Fix spelling error in comment.
17976
8b105e34
ILT
179772008-03-24 Ian Lance Taylor <iant@google.com>
17978
8ed814a9
ILT
17979 * options.h (class General_options): Define build_id option.
17980 * layout.h (class Layout): Declare write_build_id, create_note,
17981 create_build_id. Add build_id_note_ member.
17982 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17983 "libiberty.h", "md5.h", "sha1.h".
17984 (Layout::Layout): Initialize eh_frame_data_,
17985 eh_frame_hdr_section_, and build_id_note_.
17986 (Layout::finalize): Call create_build_id.
17987 (Layout::create_note): New function, broken out of
17988 Layout::create_gold_note.
17989 (Layout::create_gold_note): Call create_note.
17990 (Layout::create_build_id): New function.
17991 (Layout::write_build_id): New function.
17992 (Close_task_runner::run): Call write_build_id.
17993
8b105e34
ILT
17994 * x86_64.cc: Correct license to GPLv3.
17995
086a1841
ILT
179962008-03-23 Ian Lance Taylor <iant@google.com>
17997
17998 * options.cc: Include "demangle.h".
17999 (parse_optional_string): New function.
18000 (parse_long_option): Handle takes_optional_argument.
18001 (parse_short_option): Update dash_z initializer. Handle
18002 takes_optional_argument.
18003 (General_options::General_options): Initialize do_demangle_.
18004 (General_options::finalize): Set do_demangle_. Handle demangling
18005 style.
18006 * options.h (parse_optional_string): Declare.
18007 (struct One_option): Add optional_arg field. Update constructor.
18008 Update call constructor calls. Add takes_optional_argument
18009 function.
18010 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18011 (DEFINE_optional_string): Define.
18012 (General_options::demangle): Change from DEFINE_bool to
18013 DEFINE_optional_string.
18014 (General_options::no_demangle): New function.
18015 (General_options::do_demangle): New function.
18016 (General_options::set_do_demangle): New function.
18017 (General_options::execstack_status_): Move definition to end of
18018 class definition.
18019 (General_options::static_): Likewise.
18020 (General_options::do_demangle_): New field.
18021 * object.cc (big_endian>::get_symbol_location_info): Call
18022 Options::do_demangle, not Options::demangle.
18023 * symtab.cc (demangle): Likewise.
18024
cbb93e63
ILT
180252008-03-22 Ian Lance Taylor <iant@google.com>
18026
18027 * gold.h: Include <cstddef> and <sys/types.h>
18028 * options.h: Include <cstring>.
18029
ec531623
ILT
180302008-03-21 Ian Lance Taylor <iant@google.com>
18031
18032 * Added source code to GNU binutils.
752937aa 18033\f
b90efa5b 18034Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18035
18036Copying and distribution of this file, with or without modification,
18037are permitted in any medium without royalty provided the copyright
18038notice and this notice are preserved.
18039
18040Local Variables:
18041mode: change-log
18042left-margin: 8
18043fill-column: 74
18044version-control: never
18045End:
This page took 1.21647 seconds and 4 git commands to generate.