Remove gdb.base/coremaker2.c
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bebf4942
L
12015-12-10 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/19317
4 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
5 plugin needed to handle slim lto object for relocatable link.
6
dcfc7dd4
AM
72015-12-09 Alan Modra <amodra@gmail.com>
8
9 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
10 d_offset. Use throughout.
11 (Target_powerpc::relocate_relocs): Likewise.
12
e3a7574e
AM
132015-12-09 Alan Modra <amodra@gmail.com>
14
15 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
16 entry code.
17 (Target_powerpc::relocate_relocs): Edit relocs to suit.
18
91a65d2f
AM
192015-12-09 Alan Modra <amodra@gmail.com>
20
21 * object.h (struct Relocate_info): Add "rr".
22 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
23 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
24 relinfo.rr for relocate_section and relocate_relocs.
25 * powerpc.cc (relocate): Add rel_type and preloc parameters.
26 Delete rela and r_type params, instead recalculate these from
27 preloc.
28 (relocate_relocs): Delete Relocatable_relocs* param, instead
29 use relinfo->rr.
30 * aarch64.cc: Likewise.
31 * arm.cc: Likewise.
32 * i386.cc: Likewise.
33 * mips.cc: Likewise.
34 * s390.cc: Likewise.
35 * sparc.cc: Likewise.
36 * target.h: Likewise.
37 * tilegx.cc: Likewise.
38 * x86_64.cc: Likewise.
39 * testsuite/testfile.cc: Likewise.
40 * target-reloc.h (relocate_section): Adjust to suit.
41 (apply_relocation, relocate_relocs): Likewise.
42
549dba71
AM
432015-12-07 Alan Modra <amodra@gmail.com>
44
45 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
46 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
47 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
48
7ef8ae7c
VR
492015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
50
51 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
52 Local_got_entry_key for searching in local_got_offsets_.
53 * object.h (class Local_got_entry_key): New class.
54 (Relobj::local_has_got_offset): New overloaded method.
55 (Relobj::local_got_offset): Likewise.
56 (Relobj::set_local_got_offset): Likewise.
57 (Relobj::do_local_has_got_offset): Add addend argument.
58 (Relobj::do_local_got_offset): Likewise.
59 (Relobj::do_set_local_got_offset): Likewise.
60 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
61 Local_got_entry_key for searching through local_got_offsets_.
62 (Sized_relobj::do_local_got_offset): Likewise.
63 (Sized_relobj::do_set_local_got_offset): Likewise.
64 (Sized_relobj::Local_got_offsets): Change type of the key from
65 unsigned int to Local_got_entry_key, and add hash and equal_to.
66 * output.cc (Got_entry::write): Take addend into account for
67 calculating value of the local symbol for GOT.
68 (Output_data_got::add_local): New definition of overloaded method.
69 (Output_data_got::add_local_with_rel): Likewise.
70 (Output_data_got::add_local_pair_with_rel): Likewise.
71 * output.h (Output_data_got::add_local): New declaration of overloaded
72 method.
73
74b03b91
CC
742015-11-25 Cary Coutant <ccoutant@gmail.com>
75
76 PR gold/19291
77 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
78 subtract section address from symbol value.
79
751e4d66
AM
802015-11-25 Alan Modra <amodra@gmail.com>
81
82 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
83 to 256 byte boundary.
84
32d849b3
AM
852015-11-19 Alan Modra <amodra@gmail.com>
86
87 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
88 GOT16 and TOC16 relocs to RELATIVE_REF.
89
db1ff028
CC
902015-11-14 Cary Coutant <ccoutant@gmail.com>
91
92 PR gold/19244
93 PR gold/18548
94 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
95 local symbols only for predefined symbols.
96
a680de9a
PB
972015-11-11 Alan Modra <amodra@gmail.com>
98 Peter Bergner <bergner@vnet.ibm.com>
99
100 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
101 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
102 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
103 (Target_powerpc::Scan::global): Likewise.
104 (Target_powerpc::Relocate::relocate): Likewise.
105
cc203475
VR
1062015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
107
108 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
109 sections.
110
859d7987
CC
1112015-11-09 Cary Coutant <ccoutant@gmail.com>
112 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
113
114 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
115 with type, offset, addend.
116 (Copy_relocs::save): Likewise.
117 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
118 (Copy_relocs::save): Likewise.
119 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
120 and r_addend to Copy_relocs::copy_reloc.
121 * arm.cc (Target_arm::copy_reloc): Likewise.
122 * i386.cc (Target_i386::copy_reloc): Likewise.
123 * mips.cc (Target_mips::copy_reloc): Likewise.
124 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
125 * s390.cc (Target_s390::copy_reloc): Likewise.
126 * sparc.cc (Target_sparc::copy_reloc): Likewise.
127 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
128 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
129
96f9814d
CC
1302015-11-05 Cary Coutant <ccoutant@gmail.com>
131
132 PR gold/19119
133 PR gold/19172
134 PR gold/19197
135 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
136 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
137 * options.h (General_options): Remove "obsolete" from -m.
138 * parameters.cc (set_parameters_target): Check if input target
139 is compatible with output emulation set by "-m emulation".
140
0eccf19f
CC
1412015-11-05 Cary Coutant <ccoutant@gmail.com>
142
143 PR gold/19163
144 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
145 certain relocations if --no-apply-dynamic-relocs is set.
146 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
147
c1e7d6a8
AM
1482015-11-03 Alan Modra <amodra@gmail.com>
149
150 * po/POTFILES.in: Regenerate.
151
26f187cd
NC
1522015-10-30 Nick Clifton <nickc@redhat.com>
153
154 * po/zh_CN.po: New (simplified) Chinese translation.
155
41e83f2b
L
1562015-10-29 H.J. Lu <hongjiu.lu@intel.com>
157
158 PR gold/19184
159 * incremental.cc (Got_plt_view_info): Add got_entry_size.
160 (Local_got_offset_visitor::visit): Replace got_entry_size_
161 with info_.got_entry_size.
162 (Local_got_offset_visitor::got_entry_size_): Removed.
163 (Global_got_offset_visitor::visit): Replace got_entry_size_
164 with info_.got_entry_size.
165 (Global_got_offset_visitor::got_entry_size_): Removed.
166 (Output_section_incremental_inputs::write_got_plt): Initialize
167 view_info.got_entry_size.
168 * target.h (Sized_target::got_entry_size): New virtual function.
169 * x86_64.cc (Target_x86_64::got_entry_size): New function.
170
238830c6
MK
1712015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
172
173 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
174 * testsuite/script_test_12a.c: Likewise.
175 * testsuite/script_test_1a.cc: Likewise.
176 * testsuite/script_test_2.cc: Likewise.
177
bd890911
MK
1782015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
179
180 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
181
a817ff49
MK
1822015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
183
184 PR gold/18959
185 * stringpool.cc (Stringpool_template::new_key_offset): Align all
186 strings, even zero-length.
187 (Stringpool_template::set_string_offsets): Likewise.
188
e79a4bad
MK
1892015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
190
191 * s390.cc: New file.
192 * Makefile.am (TARGETSOURCES): Add s390.cc.
193 (ALL_TARGETOBJS): Add s390.o.
194 * Makefile.in: Regenerate.
195 * configure.ac: Add s390 support.
196 * configure: Regenerate.
197 * configure.tgt: Add s390-*-* and s390x-*-*.
198 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
199 support.
200
6f97897d
MK
2012015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
202
203 * archive.cc (Archive::sym64name): New const.
204 (Archive::setup): Add support for SYM64 armap.
205 (Archive::read_armap): Likewise.
206 (Archive::interpret_header): Likewise.
207 (Archive::const_iterator::read_next_header): Likewise.
208 * archive.h (Archive::sym64name): New const.
209 (Archive::read_armap): Add mapsize template parameter.
210
8d9743bd
MK
2112015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
212
213 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
214 target-specific entry size.
215 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
216 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
217 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
218 hash_entry_size.
219 * target.h (Target::hash_entry_size): New method.
220 (Target::Target_info::hash_entry_size): New data member.
221
222 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
223 * arm.cc (Target_arm::arm_info): Likewise.
224 (Target_arm_nacl::arm_nacl_info): Likewise.
225 * i386.cc (Target_i386::i386_info): Likewise.
226 (Target_i386_nacl::i386_nacl_info): Likewise.
227 (Target_iamcu::iamcu_info): Likewise.
228 * mips.cc (Target_mips::mips_info): Likewise.
229 (Target_mips_nacl::mips_nacl_info): Likewise.
230 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
231 * sparc.cc (Target_sparc::sparc_info): Likewise.
232 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
233 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
234 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
235 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
236
3043c1ab
L
2372015-10-28 H.J. Lu <hongjiu.lu@intel.com>
238
239 PR gold/19177
240 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
241 and R_386_GOT32X relocations without base register.
242
4d2f5d58
HS
2432015-10.27 Han Shen <shenhan@google.com>
244
245 PR gold/19042 - unsupported reloc 311/312.
246
247 * aarch64.cc (Target_aarch64::Scan::local): Add support for
248 reloc 311/312.
249
2891b491
L
2502015-10-22 H.J. Lu <hongjiu.lu@intel.com>
251
252 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
253 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
254 as R_X86_64_GOTPCREL.
255 (Target_x86_64<size>::Scan::local): Likewise.
256 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
257 Likewise.
258 (Target_x86_64<size>::Scan::global): Likewise.
259 (Target_x86_64<size>::Relocate::relocate): Likewise.
260 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
261 Likewise.
262
493d4b48
L
2632015-10-22 H.J. Lu <hongjiu.lu@intel.com>
264
265 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
266 R_386_GOT32X the same as R_386_GOT32.
267 (Target_i386::Scan::local): Likewise.
268 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
269 (Target_i386::Scan::global): Likewise.
270 (Target_i386::Relocate::relocate): Likewise.
271 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
272 Likewise.
273
0fd15345
L
2742015-10-20 H.J. Lu <hongjiu.lu@intel.com>
275
276 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
277 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
278 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
279 x86_64_mov_to_lea1.o.
280 * testsuite/Makefile.in: Regenerated.
281
64571972
L
2822015-10-16 H.J. Lu <hongjiu.lu@intel.com>
283
284 PR gold/19119
285 * options.h (General_options): Remove "obsolete" from -m.
286 * parameters.cc (set_parameters_target): Check if input target
287 is compatible with output emulation set by "-m emulation".
288
01f573ad
L
2892015-10-13 H.J. Lu <hongjiu.lu@intel.com>
290
291 PR gold/19118
292 * i386.cc (Target_iamcu): New class.
293 (Target_selector_iamcu): Likewise.
294 (Target_iamcu::iamcu_info): New variable.
295 (target_selector_iamcu): Likewise.
296
3b0357da
AS
2972015-10-07 Andreas Schwab <schwab@suse.de>
298
299 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
300
9eacb935
CC
3012015-10-06 Cary Coutant <ccoutant@gmail.com>
302
303 PR gold/18855
304 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
305 parameter.
306 (Sparc_relocate_functions::gdop_lox10): Likewise.
307 (Target_sparc::Relocate::relocate): Use addend when computing
308 symbol value for R_SPARC_GOTDATA_OP*.
309
3d4fde69
CC
3102015-09-07 Cary Coutant <ccoutant@gmail.com>
311
312 PR gold/18930
313 PR gold/18886
314 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
315 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
316
358de988
L
3172015-09-02 H.J. Lu <hongjiu.lu@intel.com>
318
319 PR gold/18886
320 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
321 shared libraries into normal FUNC symbols.
322 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
323 symbols aren't from shared libraries.
324
d49044c7
AM
3252015-09-02 Alan Modra <amodra@gmail.com>
326
327 PR 18878
328 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
329 (Target_powerpc::Branch_info::make_stub): Determine whether long
330 branch stub is for save/restore function.
331 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
332 (Stub_table): Add need_save_res_.
333 (Stub_table:clear_stubs): Clear need_save_res_.
334 (Stub_table:set_address_and_size): Add save/restore section size.
335 (Stub_table::add_long_branch_entry): Add save_res param. Set
336 need_save_res_, but don't add space for save/restore stubs.
337 (Stub_table::find_long_branch_entry): Return offset to local copy
338 of save/restore func.
339 (Stub_table::do_write): Don't output save/restore stubs. Instead
340 copy the save/restore functions.
341 (Output_data_save_res:contents): New accessor.
342 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
343
7c61d651
CC
3442015-08-25 Cary Coutant <ccoutant@gmail.com>
345
346 PR gold/18847
347 * script-sections.cc (Memory_region::set_address): New method.
348 (Script_sections::find_memory_region): Add explicit_only parameter.
349 (Output_section_definition::set_section_addresses): Handle case where
350 script specifies both address and vma region.
351 * script-sections.h (Script_sections::find_memory_region): Add
352 explicit_only parameter.
353
4bfacfd3
CC
3542015-08-25 Cary Coutant <ccoutant@gmail.com>
355
356 PR gold/18859
357 * object.cc (Input_objects::add_object): Store objects in a map,
358 indexed by soname; update as-needed flag when necessary.
359 * object.h (Object::clear_as_needed): New method.
360 (Input_objects::so_names_): Change from set to map.
361
1757d35c
CC
3622015-08-25 Cary Coutant <ccoutant@gmail.com>
363
364 PR gold/14746
365 * expression.cc (Expression::Expression_eval_info): Add
366 is_valid_pointer field.
367 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
368 Adjust all callers.
369 (Addr_expression::value_from_output_section): Check whether address
370 is valid.
371 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
372 if evaluation failed due to address that is not yet valid.
373 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
374 parameter.
375
3ac0a36c
CC
3762015-08-25 Cary Coutant <ccoutant@gmail.com>
377
378 PR gold/18866
379 PR gold/18703
380 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
381
9215b98b
AM
3822015-08-20 Alan Modra <amodra@gmail.com>
383
384 PR gold/18846
385 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
386 Subtract os->address() from addend.
387 * powerpc.cc (relocate_relocs): Likewise.
388
40fc1451
SD
3892015-08-12 Simon Dardis <simon.dardis@imgtec.com>
390
391 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
392 lazy_stub_normal_1, lazy_stub_normal_1_n64,
393 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
394 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
395 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
396 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
397 of 'addu/daddu'.
398
37a42ee9
L
3992015-07-27 H.J. Lu <hongjiu.lu@intel.com>
400
401 * configure: Regenerated.
402
ab3b14b0
DK
4032015-07-26 Doug Kwan <dougkwan@google.com>
404
405 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
406 disassembler output format.
407
cdb06167
HS
4082015-07-23 Ian Coolidge <icoolidge@google.com>
409 Plumb --pic-veneer option for gold.
410
411 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
412 generation.
413 * options.h (General_options): Add --pic-veneer option.
414
5b2af7dd
L
4152015-07-22 H.J. Lu <hongjiu.lu@intel.com>
416
417 PR gold/18663
418 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
419 script_test_1a.cc script_test_1b.cc.
420 (script_test_11_r.o): Replace script_test_11.o with
421 script_test_11a.o script_test_11b.o.
422 (script_test_11.o): Removed.
423 (script_test_11a.o): New.
424 (script_test_11b.o): Likewise.
425 * testsuite/Makefile.in: Regenerated.
426 * testsuite/script_test_1.h: New file.
427 * testsuite/script_test_1b.cc: Likewise.
428 * testsuite/script_test_11.h: Likewise.
429 * testsuite/script_test_11b.c: Likewise.
430 * testsuite/script_test_1.cc: Renamed to ...
431 * testsuite/script_test_1a.cc: This.
432 Include "script_test_1.h".
433 (main): Call check_int and check_ptr.
434 * testsuite/script_test_11.c: Renamed to ...
435 * testsuite/script_test_11a.c: This.
436 Include "script_test_11.h".
437 (main): Call ptr_equal.
438
cd78ea77
L
4392015-07-22 H.J. Lu <hongjiu.lu@intel.com>
440
441 PR gold/18628
442 * testsuite/ifuncdep2.c (global): Change protected to hidden.
443 * testsuite/ifuncmod1.c (global): Likewise.
444 * testsuite/ifuncmod5.c (global): Likewise.
445
f945ba50
AM
4462015-07-22 Alan Modra <amodra@gmail.com>
447
448 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
449
5417c94d
CC
4502015-07-21 Cary Coutant <ccoutant@gmail.com>
451
452 PR gold/18548
453 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
454 forced local symbol even when oldsym != NULL.
455 (Symbol_table::do_define_in_output_segment): Likewise.
456 (Symbol_table::do_define_as_constant): Likewise.
457
cb5cf5e2
CC
4582015-07-21 Cary Coutant <ccoutant@gmail.com>
459
b8c6c5ef 460 PR gold/18698
cb5cf5e2
CC
461 * archive.cc (Library_base::should_include_member): Don't use entry
462 point for relocatable links, or if target is not yet valid.
463 * parameters.cc (Parameters::entry): Check target_valid().
464
0ef3814f
HS
4652015-07-20 Han Shen <shenhan@google.com>
466
467 Optimize erratum 843419 fix.
468
469 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
470 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
471 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
472 (E843419_stub): New sub-class of Erratum_stub.
473 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
474 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
475 (AArch64_relobj::create_erratum_stub): Add 1 argument.
476 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
477
2bca0377
HS
4782015-07-20 Han Shen <shenhan@google.com>
479
480 Fix arm elf header flags wrt hardfp bit.
481
482 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
483
f54f5e31
L
4842015-07-20 H.J. Lu <hongjiu.lu@intel.com>
485
486 PR gold/18689
487 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
488 from input group section for relocatable link.
489 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
490 (check_DATA): Add pr18689.stdout.
491 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
492 (pr18689.stdout): New rule.
493 (pr18689a.o): Likewise.
494 (pr18689b.o): Likewise.
495 (pr18689.o): Likewise.
496 * testsuite/pr18689.c: New file.
497 * testsuite/pr18689.sh: Likewise.
498 * testsuite/Makefile.in: Regenerated.
499
c20ceeb2
YW
5002015-07-20 Yiran Wang <yiran@google.com>
501 Cary Coutant <ccoutant@gmail.com>
502
503 PR gold/15574
504 * resolve.cc (Symbol_table): Remove warning about references
505 from shared objects to hidden symbols.
506 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
507 * testsuite/Makefile.in: Regenerate.
508 * testsuite/hidden_test.sh: Check dynamic symbol table; update
509 expected error messages.
510
19a7fe52
L
5112015-07-14 H.J. Lu <hongjiu.lu@intel.com>
512
513 * compressed_output.cc (Output_compressed_section::set_final_data_size):
514 Make --compress-debug-sections=zlib the same as
515 --compress-debug-sections=zlib-gabi.
516 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
517 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
518 ".zdebug_".
519 * testsuite/Makefile.in: Regenerated.
520
fb8b9dbc
L
5212015-07-12 H.J. Lu <hongjiu.lu@intel.com>
522
523 PR gold/18322
524 * compressed_output.cc (zlib_compress): Add argument for
525 compression header size. Set header size to compression header
526 size if it isn't 0. Don't write out the zlib header here.
527 (Output_compressed_section::set_final_data_size): Support
528 zlib-gnu and zlib-gabi compressions. Pass compression header
529 size to zlib_compress and write out compression header. Set
530 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
531 clear the SHF_COMPRESSED bit
532 * options.h (compress_debug_sections): Add zlib-gnu and
533 zlib-gabi.
534 * output.h (Output_section::set_flags): New.
535 * testsuite/Makefile.am (check_PROGRAMS): Add
536 flagstest_compress_debug_sections_none,
537 flagstest_compress_debug_sections_gnu and
538 flagstest_compress_debug_sections_gabi.
539 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
540 flagstest_compress_debug_sections.stdout,
541 flagstest_compress_debug_sections.cmp,
542 flagstest_compress_debug_sections.check,
543 flagstest_compress_debug_sections_gnu.stdout,
544 flagstest_compress_debug_sections_gnu.cmp,
545 flagstest_compress_debug_sections_gnu.check,
546 flagstest_compress_debug_sections_gabi.stdout,
547 flagstest_compress_debug_sections_gabi.cmp and
548 flagstest_compress_debug_sections_gabi.check.
549 (flagstest_compress_debug_sections_none): New.
550 (flagstest_compress_debug_sections_none.stdout): Likewise.
551 (flagstest_compress_debug_sections.stdout): Likewise.
552 (flagstest_compress_debug_sections.check): Likewise.
553 (flagstest_compress_debug_sections.cmp): Likewise.
554 (flagstest_compress_debug_sections_gnu): Likewise.
555 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
556 (flagstest_compress_debug_sections_gnu.check): Likewise.
557 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
558 (flagstest_compress_debug_sections_gabi): Likewise.
559 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
560 (flagstest_compress_debug_sections_gnu.check): Likewise.
561 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
562 * testsuite/Makefile.in: Regenerated.
563
48058663
L
5642015-07-12 H.J. Lu <hongjiu.lu@intel.com>
565
566 PR gold/18321
567 * compressed_output.h (decompress_input_section): Add arguments
568 for ELF class, big endian and sh_flags.
569 * compressed_output.cc (decompress_input_section): Likewise.
570 Support the SHF_COMPRESSED section.
571 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
572 functions.
573 * plugin.h (Pluginobj): Likewise.
574 * layout.cc (Layout::get_output_section_flags): Also clear the
575 SHF_COMPRESSED bit.
576 * object.h (Compressed_section_info): Add flag to store sh_flags.
577 (Object): Add pure virtual elfsize and is_big_endian member
578 functions.
579 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
580 prefix here.
581 (build_compressed_section_map): Check SHF_COMPRESSED for
582 uncompressed size. Store sh_flags in Compressed_section_info.
583 Pass size, big_endian and sh_flags to decompress_input_section.
584 Skip the ".debug"/".zdebug" prefix when passing section name to
585 need_decompressed_section.
586 (Sized_relobj_file<size, big_endian>::do_find_special_section):
587 Don't check ".zdebug_*" sections.
588 (Object::decompressed_section_contents): Pass ELF class, big
589 endian and sh_flags to decompress_input_section.
590 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
591 Likewise.
592 * testsuite/Makefile.am (check_DATA): Add
593 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
594 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
595 gdb_index_test_2_gabi.stdout.
596 (debug_msg_cdebug_gabi.o): New.
597 (odr_violation1_cdebug_gabi.o): Likewise.
598 (odr_violation2_cdebug_gabi.o): Likewise.
599 (debug_msg_cdebug_gabi.err): Likewise.
600 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
601 (gdb_index_test_cdebug_gabi.o): Likewise.
602 (gdb_index_test_2_gabi): Likewise.
603 (gdb_index_test_2_gabi.stdout): Likewise.
604 * testsuite/gdb_index_test_2_gabi.sh: New file.
605 * testsuite/Makefile.in: Regenerated.
606
73854cdd
HS
6072015-07-09 Han Shen <shenhan@google.com>
608
609 Use "gold_info" instead of "gold_warning" for erratum fix.
610
611 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
612 'gold_info'.
613 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
614
61163dfa
HS
6152015-07-09 Han Shen <shenhan@google.com>
616
617 Drop missing symbol warning for arm/aarch64.
618
619 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
620 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
621 symbol warning.
622
b91deca9
HS
6232015-07-07 Han Shen <shenhan@google.com>
624
625 Make gold aarch64 accept long form of mapping symbols.
626
627 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
628 of mapping symbols.
629
15162bef
DK
6302015-06-29 Doug Kwan <dougkwan@google.com>
631
632 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
633 at address expected by test.
634 * testsuite/arm_cortex_a8_b.s: Ditto.
635 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
636 * testsuite/arm_cortex_a8_bl.s: Ditto.
637 * testsuite/arm_cortex_a8_blx.s: Ditto.
638 * testsuite/arm_cortex_a8_local.s: Ditto.
639 * testsuite/arm_fix_v4bx.s: Ditto.
640 * testsuite/arm_unaligned_reloc.s: Ditto.
641 * testsuite/thumb_bl_out_of_range.s: Ditto.
642 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
643 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 644
56b06706
HS
6452015-06-29 Han Shen <shenhan@google.com>
646
647 Patch for erratum 843419 internal error.
648
72f4393d
L
649 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
650 (Erratum_stub::update_erratum_insn): New method.
651 (Stub_table::relocate_stubs): Modified to place relocated insn.
652 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 653
2f0c79aa
HS
6542015-06-12 Han Shen <shenhan@google.com>
655
656 Fix erratum 835769.
657
72f4393d
L
658 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
659 defintion outside class definition.
660 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
661 (AArch64_insn_utilities::aarch64_op31): New member.
662 (AArch64_insn_utilities::aarch64_ra): New member.
663 (AArch64_insn_utilities::aarch64_mac): New member.
664 (AArch64_insn_utilities::aarch64_mlxl): New member.
665 (ST_E_835769): New global enum member.
666 (Stub_table::relocate_stubs): Add 835769 handler.
667 (Stub_template_repertoire::Stub_template_repertoire): Install new
668 stub type.
669 (AArch64_relobj::scan_errata): This func is renamed from
670 scan_erratum_843419.
671 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
672 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
673 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
674 (Target_aarch64::scan_erratum_835769_span): New method.
675 (Target_aarch64::create_erratum_stub): New method.
676 (Target_aarch64::is_erratum_835769_sequence): New method.
677 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
678 code into create_erratum_stub.
679 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 680
5d7908e0
CC
6812015-06-11 Cary Coutant <ccoutant@gmail.com>
682
683 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
684 outside class body.
685 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
686
dd68f8fa
CC
6872015-06-11 Cary Coutant <ccoutant@gmail.com>
688
689 PR gold/17731
690 * layout.cc (corresponding_uncompressed_section_name): New function.
691 (Layout::choose_output_section): Call it.
692 * layout.h (corresponding_uncompressed_section_name): New function.
693 * script-sections.cc (Input_section_info::set_section_name): Check
694 for compressed debug section (.zdebug style).
695
a3a0c391
JY
6962015-06-11 Jing Yu <jingyu@google.com>
697
698 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
699 * testsuite/Makefile.in: Regenerate.
700
970cdef2
DI
7012015-06-11 Davide Italiano <dccitaliano@gmail.com>
702
703 * gold.h (is_cident): Correct typo.
704
a48d0c12
HS
7052015-06-10 Han Shen <shenhan@google.com>
706 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
707
708 Now fixing for 843419 is fully functional.
709
710 The first part of the erratum fix CL is here -
711 https://sourceware.org/ml/binutils/2015-04/msg00229.html
712
713 * aarch64.cc(global enum): New constants representing stub types.
714 (Stub_template): New POD struct.
715 (Stub_template_repertoire): New class.
716 (Stub_base): New class.
717 (Erratum_stub): New class.
718 (Reloc_stub): Refactored to be a subclass of Stub_base.
719 (Reloc_stub::Stub_type): Removed.
720 (Reloc_stub::offset): Moved to Stub_base.
721 (Reloc_stub::set_offset): Moved to Stub_base.
722 (Reloc_stub::destination_address): Moved to Stub_base.
723 (Reloc_stub::set_destination_address): Moved to Stub_base.
724 (Reloc_stub::reset_destination_address): Moved to Stub_base.
725 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
726 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
727 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
728 (Reloc_stub::write): Moved to Stub_base.
729 (Reloc_stub::invalid_offset): Moved to Stub_base.
730 (Reloc_stub::invalid_address): Moved to Stub_base.
731 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
732 (Reloc_stub::stub_insns_): Moved to Stub_base.
733 (Reloc_stub::offset_): Moved to Stub_base.
734 (Reloc_stub::destination_address_): Moved to Stub_base.
735 (Stub_table::The_aarch64_relobj): New typedef.
736 (Stub_table::The_erratum_stub): New typedef.
737 (Stub_table::The_erratum_stub_less): New typedef.
738 (Stub_table::The_erratum_stub_set): New typedef.
739 (Stub_table::The_erratum_stub_set_iter): New typedef.
740 (Stub_table::empty): Added emptiness testing for erratum stubs.
741 (Stub_table::add_erratum_stub): New method to add an erratum stub.
742 (Stub_table::find_erratum_stub): New method.
743 (Stub_table::find_erratum_stubs_for_input_section): New method.
744 (Stub_table::erratum_stub_address): New method.
745 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
746 (Stub_table::do_addralign): Modified to handle erratum stubs.
747 (Stub_table::erratum_stubs_): New member.
748 (Stub_table::erratum_stub_size_): New member.
749 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
750 (Stub_table::do_write): Modified to handle erratum stubs.
751 (AArch64_relobj::The_erratum_stub): New typedef.
752 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
753 (AArch64_relobj::fix_errata): New method.
754 (Target_aarch64::The_reloc_stub_type): Removed.
755 (Target_aarch64::The_erratum_stub): New typede.
756 (AArch64_relocate_functions::construct_b): New method.
757
1e1b2efc
NC
7582015-06-08 Nick Clifton <nickc@redhat.com>
759
760 * po/fr.po: New French Translation.
761
b8cf5075
CC
7622015-06-07 Cary Coutant <ccoutant@gmail.com>
763
764 PR gold/18288
765 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
766 callers. Don't use STT_COMMON to check for common symbols.
767 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
768 symbol that's not in a common section.
769 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
770 common symbols.
771
bdd2d2b7
CC
7722015-06-04 Cary Coutant <ccoutant@gmail.com>
773
774 PR gold/18200
775 * Makefile.am (diststuff): Add target.
776 * Makefile.in: Regenerate.
777
cd3c333f
CC
7782015-06-04 Cary Coutant <ccoutant@gmail.com>
779
780 PR gold/17498
781 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
782 temporary locals in merge sections.
783 * options.cc (General_options::parse_discard_all): New method.
784 (General_options::parse_discard_locals): New method.
785 (General_options::parse_discard_none): New method.
786 (General_options::General_options): Initialize discard_locals_.
787 * options.h (--discard-all): Convert to special option.
788 (--discard-locals): Likewise.
789 (--discard-none): New option.
790 (General_options::discard_all): New method.
791 (General_options::discard_locals): New method.
792 (General_options::discard_sec_merge): New method.
793 (General_options::Discard_locals): New enum.
794 (General_options::discard_locals_): New data member.
795
8086551f
CC
7962015-06-03 Cary Coutant <cary@google.com>
797
798 * script-sections.cc (Script_sections::Script_sections): Initialize
799 segments_created_.
800 (Script_sections::create_note_and_tls_segments): Set flag when
801 segments are created.
802 (Script_sections::expected_segment_count): Count PT_INTERP.
803 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
804 segments are created.
805 * script-sections.h (Script_sections::segments_created_): New data
806 member.
807
374082df
CC
8082015-06-03 Cary Coutant <ccoutant@gmail.com>
809
810 PR gold/15370
811 * script-sections.cc
812 (Output_section_element_input::set_section_addresses): When there
813 are several patterns with no sort spec, put all sections in the same
814 bin.
815 * testsuite/Makefile.am (script_test_12): New testcase.
816 (script_test_12i): New testcase.
817 * testsuite/Makefile.in: Regenerate.
818 * testsuite/script_test_12.t: New test linker script.
819 * testsuite/script_test_12i.t: New test linker script.
820 * testsuite/script_test_12a.c: New test source file.
821 * testsuite/script_test_12b.c: New test source file.
822
775ed62e
CC
8232015-06-02 Cary Coutant <ccoutant@gmail.com>
824
825 * nacl.h (Sniff_file): Switch parameters to get_view to get an
826 aligned view.
827
9c7fe3c5
CC
8282015-06-03 Cary Coutant <ccoutant@gmail.com>
829
72f4393d
L
830 PR gold/17819
831 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
832 separate task to schedule the build id computation.
833 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
834 add Output_file and offset.
835 (Hash_task::run): Get and release the input views.
836 (Hash_task::is_runnable): Always return NULL (always runnable).
837 (Layout::queue_build_id_tasks): Remove.
838 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
839 parameters; use them instead of class members.
840 (Build_id_task_runner::run): New function.
841 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
842 to write_build_id.
843 * layout.h (Layout::queue_build_id_tasks): Remove.
844 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
845 parameters.
846 (Layout::array_of_hashes_): Remove.
847 (Layout::size_of_array_of_hashes_): Remove.
848 (Layout::input_view_): Remove.
849 (Build_id_task_runner): New class.
850 (Close_task_runner::Close_task_runner): Add array_of_hashes and
851 size_of_hashes parameters.
852 (Close_task_runner::array_of_hashes_): New data member.
853 (Close_task_runner::size_of_hashes_): New data member.
854 * testsuite/Makefile.am
855 (flagstest_compress_debug_sections_and_build_id_tree): New test.
856 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 857
400f8944
RÁE
8582015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
859
860 * merge.cc (get_input_merge_map): Update for data structure change.
861 (get_or_make_input_merge_map): Update for data structure change.
862 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
863 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
864
bbec1a5d
AM
8652015-05-16 Alan Modra <amodra@gmail.com>
866
867 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
868 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
869 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
870 (lis_0): Rename from lis_0_0.
871
efc6fa12
CC
8722015-04-29 Cary Coutant <cary@google.com>
873 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
874
875 * gc.h (Garbage_collection::is_section_garbage): Change Object*
876 to Relobj*.
877 (Garbage_collection::add_reference): Likewise.
878 (Garbage_collection::gc_process_relocs): Likewise. Don't push
879 object/shndx pair onto *secvec for dynamic objects. Don't follow
880 relocations pointing to dynamic objects for GC.
881 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
882 (Icf::unfold_section): Likewise.
883 (Icf::is_section_folded): Likewise.
884 (Icf::get_folded_section): Likewise.
885 * icf.h: (Icf::get_folded_section): Likewise.
886 (Icf::unfold_section): Likewise.
887 (Icf::is_section_folded): Likewise.
888 (Icf::section_has_function_pointers): Likewise.
889 (Icf::set_section_has_function_pointers): Likewise.
890 * object.h (Section_id): Likewise.
891 (Const_section_id): Likewise.
892 * output.cc (Output_section::update_section_layout): Likewise.
893 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
894 Likewise.
895 * plugin.cc (update_section_order): Likewise.
896 (unique_segment_for_sections): Likewise.
897 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
898 (Target_powerpc::do_gc_add_reference): Likewise.
899 (Target_powerpc::gc_process_relocs): Likewise.
900 (Target_powerpc::do_gc_add_reference): Likewise.
901 * symtab.cc (Symbol_table::is_section_folded): Likewise.
902 (Symbol_table::gc_mark_symbol): Likewise.
903 * symtab.h: (Symbol_table::is_section_folded): Likewise.
904 * target.h: (Sized_target::gc_add_reference): Likewise.
905 (Sized_target::do_gc_add_reference): Likewise.
906
f9d3ecaa
NC
9072015-04-29 Nick Clifton <nickc@redhat.com>
908
909 * po/fi.po: Updated Finnish translation.
910
faa2211d
AM
9112015-04-28 Alan Modra <amodra@gmail.com>
912
913 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
914 than unsigned int for find_global_entry result temp. Compare
915 against invalid_address.
916 (Target_powerpc::do_plt_address_for_global): Likewise.
917 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
918 on plt call stub existence for debug info. Do assert for plt
919 and global entry stub existence if an alloc section.
920
6ec65f28
AM
9212015-04-28 Alan Modra <amodra@gmail.com>
922
923 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
924 on missing global entry stub due to bogus debug info.
925
7a2a1c79
HS
9262015-04-27 Han Shen <shenhan@google.com>
927
928 * options.h (--fix-cortex-a53-843419): Rename option.
929 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
930 option.
931 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
932
cfbf0e3c
RÁE
9332015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
934
935 PR gold/18327
936 * output.cc (Output_section::is_input_address_mapped): Assume a missing
937 entry is mapped.
938 * testsuite/Makefile.am: Add the eh_test test.
939 * testsuite/Makefile.in: Regenerate.
940 * testsuite/eh_test_a.cc: New test.
941 * testsuite/eh_test_b.cc: New test.
942
6ec65f28
AM
9432015-04-23 Sriraman Tallam <tmsriram@google.com>
944
a100d66f
ST
945 * options.h (--weak-unresolved-symbols): New option.
946 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
947 binding to weak with new option.
948 * symtab.h (is_weak_undefined): Check for new option.
949 (is_strong_undefined): Check for new option.
950 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
951 * testsuite/Makefile.in: Regenerate.
952 * testsuite/weak_unresolved_symbols_test.cc: New file.
953
4b889c30
IC
9542015-04-20 Ian Coolidge <icoolidge@google.com>
955
956 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
957 GNU_UNIQUE.
958
4277535c
RÁE
9592015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
960
961 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
962 push_back.
963 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
964 * object.cc (Sized_relobj_file::do_layout): Use push_back.
965 * powerpc.cc (process_gc_mark): Use push_back.
966 (Target_powerpc::do_gc_mark_symbol): Use push_back.
967 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
968
7a2a1c79 9692015-04-16 Han Shen <shenhan@google.com>
5019d64a 970
6ec65f28
AM
971 * aarch64.cc (AArch64_insn_utilities): New utility class.
972 (AArch64_relobj::Mapping_symbol_position): New struct.
973 (AArch64_relobj::Mapping_symbol_info): New typedef.
974 (AArch64_relobj::do_count_local_symbols): New function overriding
975 parent's implementation.
976 (AArch64_relobj::mapping_symbol_info_): New member
977 (AArch64_relobj::scan_erratum_843419): New method.
978 (Target_aarch64::scan_erratum_843419_span): New method.
979 (Target_aarch64::is_erratum_843419_sequence): New method.
980 * options.h (fix_cortex_a53): New option.
5019d64a 981
a6a17750
CC
9822015-04-09 Cary Coutant <ccoutant@google.com>
983
984 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
985 in a PIE link.
986 * testsuite/Makefile.am (tls_pie_test.sh): New test.
987 * testsuite/Makefile.in: Regenerate.
988 * testsuite/tls_pie_test.sh: New.
989
437ddf0c
CC
9902015-04-09 Cary Coutant <ccoutant@google.com>
991
992 * debug.h (DEBUG_LOCATION): New.
993 (DEBUG_ALL): Include DEBUG_LOCATION.
994 (debug_string_to_enum): Add DEBUG_LOCATION.
995 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
996 output to print correct context.
997 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
998 up to 4 more locations at the beginning of the function.
999 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1000 result before sorting list of line numbers.
1001 * testsuite/debug_msg.sh: Allow range of line numbers for
1002 canonical results on optimized code.
1003
24491327
HS
10042015-04-07 HC Yen <hc.yen@mediatek.com>
1005
1006 Add AArch32 support for gold linker.
1007 gold/
1008 * arm.cc: Add V8 arch combine table.
1009
7fa5525f
RÁE
10102015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1011
1012 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1013
5368dcf2
RÁE
10142015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1015
1016 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1017 to find by using the return value of insert.
1018
9dbb4b02
RÁE
10192015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1020
1021 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1022 constructor call.
1023
1fa29f10
IT
10242015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1025
1026 PR gold/17641
1027 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1028 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1029 can convert mov to lea.
1030 (Target_x86_64::Scan::global): Ditto.
1031 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1032 %reg to lea foo(%rip), %reg if possible.
1033 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1034 * testsuite/x86_64_mov_to_lea1.s: New.
1035 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1036 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1037 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1038 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1039
39f3de7c
L
10402015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1041
1042 * configure: Regenerated.
1043
c4fc4724
IT
10442015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1045
1046 PR gold/17640
1047 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1048 (Target_i386::Scan::local): Don't create GOT entry, when we
1049 can convert GOT to GOTOFF.
1050 (Target_i386::Scan::global): Ditto.
1051 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1052 lea foo@GOTOFF(%reg), %reg if possible.
1053 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1054 * testsuite/i386_mov_to_lea1.s: New.
1055 * testsuite/i386_mov_to_lea2.s: Ditto.
1056 * testsuite/i386_mov_to_lea3.s: Ditto.
1057 * testsuite/i386_mov_to_lea4.s: Ditto.
1058 * testsuite/i386_mov_to_lea5.s: Ditto.
1059 * testsuite/i386_mov_to_lea.sh: Ditto.
1060
918357b9
L
10612015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1062
1063 * Makefile.am (ZLIB): New.
1064 (ZLIBINC): Likewise.
1065 (AM_CFLAGS): Add $(ZLIBINC).
1066 (AM_CXXFLAGS): Likewise.
1067 (ldadd_varldadd_var): Add $(ZLIB).
1068 (incremental_dump_LDADD): Likewise.
1069 (dwp_LDADD): Likewise.
1070 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1071 <zlib.h>.
1072 (zlib_compress): Don't check HAVE_ZLIB_H.
1073 (zlib_decompress): Likewise.
1074 * options.h (compress_debug_sections): Likewise.
1075 * configure.ac (AM_CONDITIONAL): Removed.
1076 * testsuite/Makefile.am (ZLIB): New.
1077 (LDADD): Add $(ZLIB).
1078 Don't check HAVE_ZLIB.
1079 * Makefile.in: Regenerated.
1080 * config.in: Likewise.
1081 * configure: Likewise.
1082 * testsuite/Makefile.in: Likewise.
1083
6b0ad2eb
JY
10842015-03-30 Jing Yu <jingyu@google.com>
1085
1086 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1087 TLSLD_ADD_DTPREL_LO12_NC.
1088 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1089 _TLS_MODULE_BASE_ point to the start of tls segment.
1090 (Target_aarch64::optimize_tls_reloc): Add cases for
1091 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1092 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1093 (Target_aarch64::Scan::local): Likewise.
1094 (Target_aarch64::Scan::global): Likewise.
1095 (Target_aarch64::Relocate::relocate): Likewise.
1096 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1097 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1098 relocations.
1099
0916f9e7
RÁE
11002015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1101
1102 * merge.cc (Object_merge_map::add_mapping): call
1103 Object_merge_map::Input_merge_map::add_mapping.
1104 (Object_merge_map::Input_merge_map::add_mapping): New.
1105 (Output_merge_data::do_add_input_section): Call
1106 get_or_make_input_merge_map before a loop.
1107 (Output_merge_string<Char_type>::finalize_merged_data): Call
1108 get_or_make_input_merge_map before a loop.
1109 * merge.h (Object_merge_map): Make Input_merge_map public.
1110 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1111 (Relobj::get_or_create_merge_map): New.
1112 * object.h (Relobj::get_or_create_merge_map): New.
1113
282c9750
AM
11142015-03-24 Alan Modra <amodra@gmail.com>
1115
1116 PR 18147
1117 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1118 relocation errors for branches to strong undefined symbols.
1119
67f95b96
RÁE
11202015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1121
1122 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1123 (Object_merge_map::is_merge_section_for): Remove.
1124 (Object_merge_map::find_merge_section): New.
1125 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1126 (Object_merge_map::find_merge_section): New.
1127 (Object_merge_map::get_input_merge_map): Add a const version.
1128 * object.cc (Relobj::is_merge_section_for): Remove.
1129 (Relobj::find_merge_section): New.
1130 * object.h (Relobj::is_merge_section_for): Remove.
1131 (Relobj::find_merge_section): New.
1132 * output.cc
1133 (Output_section::Input_section::is_merge_section_for): Remove.
1134 (Output_section::add_merge_input_section): Don't call
1135 add_merge_input_section.
1136 (Output_section::find_merge_section): Return const. Use
1137 object->find_merge_section.
1138 (Output_section::build_lookup_maps): Don't build a map for
1139 merge sections.
1140 (Output_section::is_input_address_mapped): Return false if
1141 section is not found.
1142 (Output_section::find_starting_output_address): Use
1143 find_merge_section instead of is_merge_section_for.
1144 (Output_section::add_script_input_section): Don't build a map for
1145 merge sections.
1146 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1147 (Output_section_lookup_maps::find_merge_section): Remove.
1148 (Output_section_lookup_maps::add_merge_input_section) Remove.
1149 (Output_section::find_merge_section): Return const.
1150
152f7024
CC
11512015-03-22 Cary Coutant <cary@google.com>
1152
1153 PR gold/18106
1154 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1155 non-SIB form of lea, with nop after the call.
1156
bccffdfd
CC
11572015-03-21 Cary Coutant <cary@google.com>
1158
1159 PR gold/14217
1160 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1161 .tdata section.
1162 (Output_segment::set_section_addresses): Don't align size of relro
1163 segment for .tbss.
1164
1c582fe7
CC
11652015-03-21 Cary Coutant <cary@google.com>
1166
1167 PR gold/18010
1168 * stringpool.cc (Stringpool_template): Don't optimize if section
1169 alignment is greater than sizeof(char).
1170
410da591
CC
11712015-03-21 Cary Coutant <cary@google.com>
1172
1173 PR gold/18048
1174 * script-c.h (script_include_directive): Add first_token parameter.
1175 * script.cc (script_include_directive): Add first_token parameter, and
1176 pass it to read_script_file.
1177 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1178 (PARSING_MEMORY_DEF): New tokens.
1179 (top): Add new productions for INCLUDE files.
1180 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1181 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1182 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1183 (section_cmd): Pass PARSING_SECTION_CMDS.
1184 (file_or_sections_cmd): Remove.
1185 (memory_def): Pass PARSING_MEMORY_DEF.
1186 * testsuite/Makefile.am (memory_test_2): New test.
1187 * testsuite/Makefile.in: Regenerate.
1188 * testsuite/memory_test_inc.t: New script file.
1189 * testsuite/memory_test_inc_1.t.src: New script file.
1190 * testsuite/memory_test_inc_2.t.src: New script file.
1191 * testsuite/memory_test_inc_3.t.src: New script file.
1192
0d5bbdb0
CC
11932015-03-21 Cary Coutant <cary@google.com>
1194
1195 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1196 (Sized_relobj_dwo::setup): Build compressed section map.
1197 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1198 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1199 section map.
1200 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1201 compressed_sections_ field.
1202 (build_compressed_section_map): Take Object instead of
1203 Sized_relobj_file parameter; add decompress_if_needed parameter.
1204 (Sized_relobj_file::do_find_special_sections): Store compressed
1205 section map in parent Object.
1206 (Sized_relobj_file::do_decompressed_section_contents): Move
1207 implementation to Object::decompressed_section_contents.
1208 (Sized_relobj_file::do_discard_decompressed_sections): Move
1209 implementation to Object::discard_decompressed_sections.
1210 * object.h (build_compressed_section_map): Declare.
1211 (Object::Object): Add compressed_sections_ field.
1212 (Object::section_is_compressed): Move implementation here.
1213 (Object::decompressed_section_contents): De-virtualize.
1214 (Object::discard_decompressed_sections): De-virtualize.
1215 (Object::do_section_is_compressed): Delete.
1216 (Object::do_decompressed_section_contents): Delete.
1217 (Object::set_compressed_sections): New method.
1218 (Object::compressed_sections): New method.
1219 (Object::compressed_sections_): New data member.
1220 (Compressed_section_info, Compressed_section_map): Move to top of file.
1221 (Sized_relobj_file::do_section_is_compressed): Delete.
1222 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1223 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1224 (Sized_relobj_file::compressed_sections_): Move to Object class.
1225
bd9e0d46
CC
12262015-03-21 Cary Coutant <ccoutant@google.com>
1227
1228 PR gold/18152
1229 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1230 deferred objects.
1231
943c8b43
CC
12322015-03-11 Cary Coutant <ccoutant@google.com>
1233
1234 * options.cc (General_options::finalize): Don't allow -z relro
1235 with incremental linking.
1236 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1237 (incremental_test_2): Likewise.
1238 (incremental_test_3): Likewise.
1239 (incremental_test_4): Likewise.
1240 (incremental_test_5): Likewise.
1241 (incremental_test_6): Likewise.
1242 (incremental_copy_test): Likewise.
1243 (incremental_common_test_1): Likewise.
1244 (incremental_comdat_test_1): Likewise.
1245 * testsuite/Makefile.in: Regenerate.
1246
e1663197
CC
12472015-03-09 Cary Coutant <ccoutant@google.com>
1248
1249 PR gold/14675
1250 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1251 return enum indicating whether .eh_frame section is empty, optimizable,
1252 unrecognized, or an end marker. Adjust explicit instantiations.
1253 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1254 (Eh_frame::add_ehframe_input_section): Change return type.
1255 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1256 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1257 to the .eh_frame output section until we see the end marker.
1258 (Layout::finalize_eh_frame_section): New.
1259 * layout.h: (Layout::finalize_eh_frame_section): New.
1260
beb8418f
L
12612015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1262
1263 * output.cc (Relobj::initialize_input_to_output_map<size>):
1264 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1265
48c73428
CC
12662015-03-04 Cary Coutant <ccoutant@google.com>
1267
1268 * parameters.cc (Parameters::set_target_once): Call
1269 Target::select_as_default_target just once from here...
1270 (set_parameters_target): ...instead of from here.
1271
12722015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1273
1274 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1275 Output_section_data instead of a Merge_map.
1276 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1277 (Eh_frame::read_cie): Use add_merge_mapping instead of
1278 Merge_map::add_mapping.
1279 (Eh_frame::read_fde): Ditto.
1280 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1281 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1282 merge_map_->get_output_offset.
1283 (Eh_frame::do_is_merge_section_for): Delete.
1284 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1285 instead of a Merge_map.
1286 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1287 Merge_map.
1288 (Eh_frame::do_is_merge_section_for): Delete.
1289 (Eh_frame::merge_map_): Delete.
1290 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1291 and use a Output_section_data instead of a Merge_map.
1292 (Object_merge_map::add_mapping): Ditto.
1293 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1294 (Object_merge_map::is_merge_section_for): Pass in and use a
1295 Output_section_data instead of a Merge_map.
1296 (Merge_map): Delete.
1297 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1298 of merge_map_.get_output_offset.
1299 (Output_merge_base::do_is_merge_section_for): Delete.
1300 (Output_merge_data::do_add_input_section): Use
1301 object->add_merge_mapping instead of add_mapping.
1302 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1303 * merge.h (Merge_map): Delete forward declaration.
1304 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1305 instead of a Merge_map.
1306 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1307 (Object_merge_map::is_merge_section_for): Pass in and use a
1308 Output_section_data instead of a Merge_map.
1309 (Input_merge_map::Object_merge_map::merge_map): Replace with
1310 output_data.
1311 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1312 Output_section_data instead of a Merge_map.
1313 (Merge_map): Delete.
1314 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1315 (Output_merge_base::do_is_merge_section_for): Delete.
1316 (Output_merge_base::add_mapping): Delete.
1317 (Output_merge_base::merge_map_): Delete.
1318 * object.cc (Relobj::initialize_input_to_output_map): New.
1319 (Relobj::initialize_input_to_output_map): New.
1320 (Relobj::merge_output_offset): New.
1321 (Relobj::is_merge_section_for): New.
1322 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1323 bits.
1324 * object.h (Relobj::merge_map): Delete.
1325 (initialize_input_to_output_map): New.
1326 (set_merge_map): Delete.
1327 (add_merge_mapping): New.
1328 (merge_output_offset): New.
1329 (is_merge_section_for): New.
1330 * output.cc (Output_section::Input_section::is_merge_section_for):
1331 Use object->is_merge_section_for.
1332 * output.h (Output_section_data::is_merge_section_for): Delete.
1333 (Output_section_data::do_is_merge_section_for): Delete.
1334 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1335 Use object->initialize_input_to_output_map.
1336 (Merged_symbol_value<size>::value_from_output_section): Use
1337 object->merge_output_offset.
1338
48c73428 13392015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1340 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1341
1342 * output.cc (Output_section::add_merge_input_section): Do not
1343 attempt to merge sections with an entsize of 0.
1344
48c73428 13452015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1346
1347 * attributes.h (class Output_attributes_section_data ): Add
1348 do_print_to_mapfile function.
1349
ec86f434
AM
13502015-02-24 Alan Modra <amodra@gmail.com>
1351
1352 PR 18010
1353 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1354 complain if value is not a multiple of four.
1355 (Target_powerpc::Relocate::relocate): Correct handling of
1356 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1357
be66981e
L
13582015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1359
1360 * configure.ac (default_size): Set to 32 for x32.
1361 * configure: Regenerated.
1362
e3ee8ed4
AM
13632015-02-18 Alan Modra <amodra@gmail.com>
1364
1365 PR 17954
1366 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1367 visibility.
1368
3a935c6c
RÁE
13692015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1370
1371 * gc.h (Garbage_collection::add_reference): Don't use find.
1372
e0a1e121
RÁE
13732015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1374
1375 * object.cc (write_local_symbols): avoid std::vector copy.
1376
45a4fb1a
RÁE
13772015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1378
1379 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1380
2d9afefe
MW
13812015-02-09 Mark Wielaard <mjw@redhat.com>
1382
1383 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1384 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1385
e9c1bdad
CC
13862015-02-16 Cary Coutant <ccoutant@google.com>
1387
1388 PR gold/13577
1389 PR gold/16992
1390 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1391 DF_SYMBOLIC if --dynamic-list option is used.
1392 * options.cc (General_options::finalize): --dynamic-list is not
1393 mutually exclusive with -Bsymbolic.
1394 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1395 listed in --dynamic-list.
1396 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1397 -Bsymbolic-functions.
1398 * testsuite/Makefile.in: Regenerate.
1399
0ed4b0bf
CC
14002015-02-16 Cary Coutant <ccoutant@google.com>
1401
1402 PR gold/17971
1403 * incremental.cc: Remove redundant include of "output.h".
1404
1a920511
JY
14052015-02-12 Jing Yu <jingyu@google.com>
1406
1407 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1408 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1409 New relocation.
1410 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1411 TLSLE_MOVW_* relocations.
1412 (Target_aarch64::Scan::global): Likewise.
1413 (Target_aarch64::Relocate::relocate): Likewise.
1414 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1415 for new TLSLE_MOVW_* relocations.
1416
07f107f3
WN
14172015-02-11 Will Newton <will.newton@linaro.org>
1418
1419 PR gold/13321
1420 * arm.cc (Target_arm::make_plt_section): Create an ARM
1421 state mapping symbol at the start of the PLT.
1422
e051a5b5
L
14232015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1424
1425 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1426 Replace two_file_shared_2.so with two_file_shared_1.so.
1427 * testsuite/Makefile.in: Regenerated.
1428
dddcc5b9
AM
14292015-02-09 Alan Modra <amodra@gmail.com>
1430
1431 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1432 plugin_test_thin.a and defsym_test.
1433 * testsuite/Makefile.in: Regenerate.
1434
b39b8b9d
RÁE
14352015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1436
1437 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1438 body.
1439
b66d1c52
CC
14402015-02-04 Peter Collingbourne <pcc@google.com>
1441
1442 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1443 forwarding symbols when computing symbol resolution info for plugins.
1444 * plugin.h (Plugin_manager::symtab): New method.
1445 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1446
23081de0
CC
14472015-02-03 Cary Coutant <ccoutant@google.com>
1448 Peter Collingbourne <pcc@google.com>
1449
1450 PR gold/15660
1451 * archive.cc (Thin_archive_object_unlocker): New class.
1452 (Archive::include_member): Unlock external members of thin archives.
1453 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1454 (plugin_test_2): Likewise.
1455 (plugin_test_3): Likewise.
1456 (plugin_test_4): Likewise.
1457 (plugin_test_5): Likewise.
1458 (plugin_test_6): Likewise.
1459 (plugin_test_7): Likewise.
1460 (plugin_test_8): Likewise.
1461 (plugin_test_9): Likewise.
1462 (plugin_test_10): Likewise.
1463 (plugin_test_11): New test case.
1464 * testsuite/Makefile.in: Regenerate.
1465 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1466 file to decide whether to claim file.
1467 (all_symbols_read_hook): Likewise.
1468 * testsuite/plugin_test_1.sh: Adjust expected output.
1469 * testsuite/plugin_test_2.sh: Likewise.
1470 * testsuite/plugin_test_3.sh: Likewise.
1471 * testsuite/plugin_test_6.sh: Likewise.
1472 * testsuite/plugin_test_tls.sh: Likewise.
1473 * testsuite/plugin_test_11.sh: New testcase.
1474
14752015-02-03 Cary Coutant <ccoutant@google.com>
1476
1477 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1478 file descriptors when debugging enabled. Add debug output.
1479 (Descriptors::release): Add debug output.
1480 (Descriptors::close_some_descriptor): Likewise.
1481 (Descriptors::close_all): Likewise.
1482 * fileread.cc (File_read::lock): Likewise.
1483 (File_read::unlock): Likewise.
1484
24dd5808
CC
14852015-02-02 Cary Coutant <ccoutant@google.com>
1486
1487 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1488 executable output file.
1489
fa89cc82
HS
14902015-01-22 Han Shen <shenhan@google.com>
1491
1492 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1493 (Target_arm::do_plt_address_for_global): New method.
1494 (Target_arm::do_plt_address_for_local): New method.
1495 (Target_arm::rel_irelative_section): New method.
1496 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1497 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1498 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1499 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1500 (Target_arm::Scan::check_non_pic): Add ifunc support.
1501 (Target_arm::Scan::local): Add ifunc support.
1502 (Target_arm::Scan::global): Add ifunc support.
1503 (Target_arm::make_plt_section): New method.
1504 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1505 (Target_arm::make_local_ifunc_plt_entry): New method.
1506 (Target_arm::got_irelative_): New member.
1507 (Target_arm::rel_irelative_): New member.
1508 (Target_arm::got_section): Add creation for got_irelative_.
1509 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1510 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1511 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1512 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1513 (Output_data_plt_arm::IRelative_data): New type.
1514 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1515 (Output_data_plt_arm::add_entry): Add more parameters.
1516 (Output_data_plt_arm::add_relocation): New method.
1517 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1518 (Output_data_plt_arm::rel_irelative): New method.
1519 (Output_data_plt_arm::entry_count): Modified.
1520 (Output_data_plt_arm::address_for_global): New method.
1521 (Output_data_plt_arm::address_for_local): New method.
23081de0 1522gold/
fa89cc82
HS
1523 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1524 (Output_data_plt_arm::insert_irelative_data): New method.
1525 (Output_data_plt_arm::irelative_rel_): New member.
1526 (Output_data_plt_arm::got_): New member.
1527 (Output_data_plt_arm::got_irelative_): New member.
1528 (Output_data_plt_arm::irelative_count_): New member.
1529 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1530 (Output_data_plt_arm::irelative_data_vec_): New member.
1531 (Output_data_plt_arm::do_write): Write out irelative entries.
1532 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1533 more parameters to ctor.
1534 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1535 more parameters to ctor.
1536 * output.h (Output_data_reloc::add_local_relative): New method.
1537 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1538
0f81d3f0
AM
15392015-01-29 Alan Modra <amodra@gmail.com>
1540
1541 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1542 and GOT_TLSGD to LE optimization.
1543
65d92137
CC
15442015-01-28 Cary Coutant <ccoutant@google.com>
1545
1546 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1547 for undef TLS symbols.
1548 (Target_x86_64::Relocate::relocate_tls): Likewise.
1549 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1550
5485698a
CC
15512015-01-25 Cary Coutant <ccoutant@google.com>
1552
1553 * output.cc (Output_segment::set_section_addresses): Fix calculation
1554 of size of relro segment.
1555
b01a4b04
AM
15562015-01-22 Alan Modra <amodra@gmail.com>
1557
1558 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1559 condition for need of ifunc plt entry.
1560 (Target_powerpc::Scan::global <got relocs>): Likewise.
1561
3d0064a9
CC
15622015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1563
1564 * mips.cc (reloc_high): Add r_sym.
1565 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1566 reloc_high constructor.
1567 (Mips_relocate_functions::relgot16_local): Likewise.
1568 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1569 r_type to decide whether LO16 matches HI16.
1570 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1571 rello16 and relgot16_local.
1572
a5cd8f05
CC
15732015-01-09 Cary Coutant <ccoutant@google.com>
1574
1575 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1576 unless alignment is larger than page size.
1577
4fc1b9d4
L
15782015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1579 Cary Coutant <ccoutant@google.com>
1580
1581 PR gold/17729
1582 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1583 (DEFAULT_TARGET_X32): Set for x32.
1584 * x86_64.cc (cmp_insn_32): New.
1585 (lea_r10_insn_32): Likewise.
1586 (lea_r11_insn_32): Likewise.
1587 (cmp_insn_64): Likewise.
1588 (lea_r10_insn_64): Likewise.
1589 (lea_r11_insn_64): Likewise.
1590 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1591 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1592 (check_DATA): Add split_x32 files.
1593 (split_x32_[1234n].o): New targets.
1594 (split_x32_[124]): New targets.
1595 (split_x32_[1234r].stdout): New targets.
1596 * testsuite/split_x32.sh: New file.
1597 * testsuite/split_x32_1.s: Likewise.
1598 * testsuite/split_x32_2.s: Likewise.
1599 * testsuite/split_x32_3.s: Likewise.
1600 * testsuite/split_x32_4.s: Likewise.
1601 * testsuite/split_x32_n.s: Likewise.
1602 * configure: Regenerated.
1603 * testsuite/Makefile.in: Likewise.
1604
e749cab8
L
16052015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1606
1607 PR gold/17809
1608 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1609 x32.
1610
af759df0
AM
16112015-01-02 Alan Modra <amodra@gmail.com>
1612
1613 * version.cc (print_version): Just print current year.
1614 * dwp.cc (print_version): Likewise.
1615
b90efa5b
AM
16162015-01-01 Alan Modra <amodra@gmail.com>
1617
1618 Update year range in copyright notice of all files.
1619
f12d1e8a
AM
16202014-12-25 Alan Modra <amodra@gmail.com>
1621
1622 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1623 new enums.
1624 (Target_arm::merge_object_attributes, ): Likewise.
1625
5c294fee
TG
16262014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1627
1628 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1629 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1630 AEABI_VFP_args_vfp to check that.
1631 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1632 value and replace hardcoded values by enum values.
1633
e30880c2
CC
16342014-12-22 Cary Coutant <ccoutant@google.com>
1635
1636 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1637
bd040da1
L
16382014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1639
1640 PR gold/14608
1641 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1642 to "return i * i * 3;".
1643
e02a4046
CC
16442014-12-16 Cary Coutant <ccoutant@google.com>
1645
1646 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1647 (Mapfile::print_output_data): Use current_data_size() to avoid
1648 assert for sections requiring postprocessing; if address is not valid,
1649 print 0.
1650 (Mapfile::print_output_section): Use current_data_size(); print note
1651 that addresses and sizes are before compression.
1652
add6016b
L
16532014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1654
1655 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1656 Cast current_group_size to unsigned long when reporting error.
1657
0bf32ea9
JY
16582014-12-10 Jing Yu <jingyu@google.com>
1659
1660 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1661 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1662 Update error message.
1663 (Target_aarch64::do_relax): Use absolute value of option
1664 stub_group_size. Replace local variable with class member
1665 stub_group_size_.
1666
cbcb23fa
AM
16672014-12-04 Alan Modra <amodra@gmail.com>
1668
1669 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1670 addend of PLTREL24 reloc when not generating a plt stub. Make
1671 max_branch_offset an "Address".
fbad6518 1672 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1673 (Target_powerpc::Relocate::relocate): Likewise.
1674
1611bc4a
AM
16752014-12-04 Alan Modra <amodra@gmail.com>
1676
1677 PR 17670
1678 * symtab.cc (Symbol::set_undefined): Remove assertion.
1679 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1680 on symbols defined in discarded sections, instead return false.
1681 Rearrange params, update all callers.
1682 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1683 branches to syms in discarded sections.
1684 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1685 undefined and flag as discarded.
1686 (Target_powerpc::Relocate::relocate): Localize variable.
1687
4759c34e
L
16882014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1689
1690 PR gold/17675
1691 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1692 * testsuite/Makefile.in: Regenerated.
1693
1f98a074
AM
16942014-12-03 Alan Modra <amodra@gmail.com>
1695
1696 PR 17566
1697 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1698 when adding dynamic relocations against section symbols.
1699
fb257835
DI
17002014-12-01 Dimitry Ivanov <dimitry@google.com>
1701
1702 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1703 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1704 * options.h (General_options): New -z option (global).
1705
d8e60314
CC
17062014-12-01 Cary Coutant <ccoutant@google.com>
1707
1708 PR gold/17578
1709 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1710 is given.
1711 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1712 given but some inputs require executable stack.
1713
982bbd97
CC
17142014-11-26 Cary Coutant <ccoutant@google.com>
1715
1716 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1717 .debug_str_offsets; strip .debug_gnu_pubnames and
1718 .debug_gnu_pubtypes.
1719 (lines_only_debug_sections): Strip all four new sections.
1720
bb779192
HS
17212014-11-26 Jing Yu <jingyu@google.com>
1722
1723 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1724 register to be x0 when to relax TLSDESC_LD64_LO12.
1725
a3e60ddb
AM
17262014-11-26 Alan Modra <amodra@gmail.com>
1727
1728 * powerpc.cc (struct Stub_table_owner): New.
1729 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1730 unsigned int vector. Update all references.
1731 (powerpc_relobj::set_stub_table): Take an unsigned int param
1732 rather than a Stub_table. Update callers.
1733 (Powerpc_relobj::clear_stub_table): New function.
1734 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1735 stub_group_size_ vars.
1736 (Target_powerpc::new_stub_table): Delete.
1737 (max_branch_delta): New function, extracted from..
1738 (Target_powerpc::Relocate::relocate): ..here..
1739 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1740 status on whether stub created successfully.
1741 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1742 default sizing to..
1743 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1744 reduce on relax failure.
1745 (Target_powerpc::group_sections): Add "no_size_errors" param.
1746 Use stub_group_size_. Set up group info in a temp vector,
1747 before building Stub_table vector. Account for input sections
1748 possibly already converted to relaxed sections.
1749 (Stub_table::init): Delete. Merge into..
1750 (Stub_table::Stub_table): ..here.
1751 (Stub_table::can_reach_stub): New function.
1752 (Stub_table::add_plt_call_entry): Add "from" parameter and
1753 return true iff stub could be reached.
1754 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1755 param too.
1756 (Stub_table::clear_stubs): Add "all" param.
1757
a20605cf
AM
17582014-11-26 Alan Modra <amodra@gmail.com>
1759
1760 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1761 (Target_powerpc::group_sections): Use it.
1762
43b64deb
CC
17632014-11-25 Cary Coutant <ccoutant@google.com>
1764
1765 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1766 (Binary_to_elf::write_symbol): Add st_size parameter.
1767 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1768
c924eb67
CC
17692014-11-25 Cary Coutant <ccoutant@google.com>
1770
1771 PR gold/17639
1772 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1773 (Sized_relobj_file::do_layout): Handle deferred sections properly
1774 during GC pass 1. Don't add reloc sections to deferred list twice.
1775 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1776 (Sized_relobj_file::is_deferred_layout_): New data member.
1777
9d585188
L
17782014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1779
1780 PR gold/17619
1781 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1782 Check PC-relative offset overflow in PLT entry.
1783
3ffaac20
AM
17842014-11-21 Alan Modra <amodra@gmail.com>
1785
1786 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1787 for undefined weaks.
1788
0cfb0717
AM
17892014-11-20 Alan Modra <amodra@gmail.com>
1790
1791 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1792 from --stub-group-size parameter divided by 1024.
1793 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1794 template parameter. Update all uses.
1795 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1796 has_stub_value. Set for long branches. Don't report overflow for
1797 branch to undefined weak symbols. Print info message on
1798 overflowing branch to stub.
1799
f9dffbf0
AM
18002014-11-20 Alan Modra <amodra@gmail.com>
1801
1802 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1803
e88ba8d5
L
18042014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1805
1806 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1807 entry for R_X86_64_GOTPLT64.
1808 (Target_x86_64<size>::Relocate::relocate): Update comments for
1809 R_X86_64_GOTPLT64.
1810
d37ffe25
ED
18112014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1812
1813 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1814 * plugin.h: add lock definition
1815
9726c3c1
HS
18162014-10-29 Han Shen <shenhan@google.com>
1817 Jing Yu <jingyu@google.com>
1818
1819 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1820 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1821 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1822 Symbol::TLS_REF.
1823 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1824 method.
1825 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1826 (Target_aarch64::tls_ld_to_le): New method.
1827 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1828 for 64bit targets.
1829 (Output_data_plt_aarch64::irelative_rel_): New data member.
1830 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1831 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1832 (Output_data_plt_aarch64::add_relocation): New method.
1833 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1834 offset. Add got_irelative size to got size.
1835 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1836 type string with the new typename.
1837 (AArch64_relocate_functions::update_adr): Replace parameter x with
1838 immed.
1839 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1840 (AArch64_relocate_functions::reloc_common): New method.
1841 (AArch64_relocate_funcsions::rela_general): Extract common part out
1842 into reloc_common method.
1843 (AArch64_relocate_functions::rela_general): Likewise.
1844 (AArch64_relocate_functions::pcrela_general): Likewise.
1845 (AArch64_relocate_functions::adr): New method.
1846 (AArch64_relocate_functions::adrp): Calculate immed before calling
1847 update_adr.
1848 (AArch64_relocate_functions::adrp): Likewise.
1849 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1850 comparing x to 0. Calculate immed from ~x when x < 0.
1851 (Target_aarch64::optimize_tls_reloc): Add new cases for
1852 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1853 TLSLD_MOVW_DTPREL_G0_NC.
1854 (Target_aarch64::possible_function_pointer_reloc): Implement this
1855 method.
1856 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1857 comment.
1858 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1859 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1860 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1861 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1862 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1863 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1864 (Target_aarch64::make_plt_entry): Call add_entry with two more
1865 parameters.
1866 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1867 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1868 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1869 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1870 (Target_aarch64::Relocate::relocate_tls): Add cases for
1871 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1872 TLSLD_MOVW_DTPREL_G0_NC.
1873 * testsuite/icf_safe_so_test.cc: Correct test comment.
1874 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1875
80272b8c
AM
18762014-10-22 Alan Modra <amodra@gmail.com>
1877
1878 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1879 thread_starter.
1880
998a69f4
AS
18812014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1882
1883 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1884
aed56ec5
CC
18852014-10-17 Cary Coutant <ccoutant@google.com>
1886
1887 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1888 Add "typename" keyword.
1889
bb779192 18902014-10-15 Han Shen <shenhan@google.com>
72f4393d 1891 Jing Yu <jingyu@google.com>
83a01957
HS
1892
1893 Patch for gold aarch64 backend to support relaxation.
1894 * aarch64-reloc.def: Change format.
1895 * aarch64.cc (class Reloc_stub): New class.
1896 (class Stub_table): New class.
1897 (class AArch64_relobj): New class.
1898 (class AArch64_input_section): New class.
1899 (class AArch64_output_section): New class.
1900 (Target_aarch64::new_stub_table): New method.
1901 (Target_aarch64::new_aarch64_input_section): New method.
1902 (Target_aarch64::find_aarch64_input_section): New method.
1903 (Target_aarch64::scan_section_for_stubs): New method.
1904 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1905 (Target_aarch64::relocate_stub): New method.
1906 (Target_aarch64::current_target): New method.
1907 (Target_aarch64::do_make_elf_object): New method.
1908 (Target_aarch64::do_may_relax): New method.
1909 (Target_aarch64::do_relax): New method.
1910 (Target_aarch64::group_sections): New method.
1911 (Target_aarch64::scan_reloc_for_stub): New method.
1912 (Target_aarch64::do_make_output_section): New method.
1913 (Target_aarch64::stub_tables_): New data member.
1914 (Target_aarch64::aarch64_input_section_map_): New data member.
1915 (AArch64_relocate_functions::maybe_apply_stub): New method.
1916
db4c9594
CC
19172014-09-30 Cary Coutant <ccoutant@google.com>
1918
1919 PR gold/17432
1920 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1921
cd6da036
KC
19222014-09-30 Kito Cheng <kito@0xlab.org>
1923
1924 PR gold/13597
1925 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1926 hash table before sysv-style hash table.
1927
5f772412
ST
19282014-09-29 Sriraman Tallam <tmsriram@google.com>
1929
1930 * options.h (--pic-executable): Add negative to alias to -no-pie.
1931
5efeedf6
CC
19322014-09-26 Cary Coutant <ccoutant@google.com>
1933
1934 PR gold/16773
1935 * object.cc (Sized_relobj_file): Compute value of section symbols
1936 for TLS sections the same as TLS symbols.
1937
1707f183
CC
19382014-09-25 Cary Coutant <ccoutant@google.com>
1939
1940 PR gold/17432
1941 * resolve.cc (Symbol_table::resolve): Override common placeholder
1942 symbols, but adjust sizes.
1943 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1944 symbols to common lists.
1945
00cac886
AM
19462014-09-24 Alan Modra <amodra@gmail.com>
1947
1948 * po/POTFILES.in: Regenerate.
1949
635aa30e 19502014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1951 Cary Coutant <ccoutant@google.com>
635aa30e 1952
71b9b91b 1953 PR gold/14860
635aa30e
CC
1954 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1955 on input_sections_blocker.
1956 * layout.cc (Write_sections_task::locks): Unblock
1957 input_sections_blocker_.
1958 * layout.h (Write_sections_task::Write_sections_task): Add
1959 input_sections_blocker.
1960 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1961 to DEPENDENCIES.
1962 * testsuite/Makefile.in: Regenerate.
1963
c0c71592
RÁE
19642014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1965
1966 * testsuite/Makefile.am (plugin_test_10): New test.
1967 * testsuite/Makefile.in: Regenerate
1968 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1969 * testsuite/plugin_test_10.sh: New file.
1970
6168c2a1
RÁE
19712014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1972
1973 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1974 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1975 during the replacement phase.
1976
3a531937
JY
19772014-09-17 Han Shen <shenhan@google.com>
1978 Jing Yu <jingyu@google.com>
1979
1980 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1981 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1982 * aarch64.cc (Target_aarch64): Add data members
1983 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1984 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1985 constructor.
1986 (Target_aarch64::do_reloc_symbol_index): New method.
1987 (Target_aarch64::do_reloc_addend): New method.
1988 (Target_aarch64::add_tlsdesc_info): New method.
1989 (Target_aarch64::do_dynsym_value): New method.
1990 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1991 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1992 (Target_aarch64::make_data_plt): Add new parameters: got,
1993 got_irelative. Pass them to do_make_data_plt.
1994 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1995 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1996 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1997 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1998 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1999 (Target_aarch64::got_tlsdesc_section): New method.
2000 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2001 (Target_aarch64::define_tls_base_symbol): New method.
2002 (Target_aarch64::reserve_tlsdesc_entries): New method.
2003 (Target_aarch64::got_mod_index_entry): New method.
2004 (Target_aarch64::rela_tlsdesc_section): New method.
2005 (Target_aarch64::rela_irelative_section): New method.
2006 (Target_aarch64::Tlsdesc_info): New struct.
2007 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2008 relocations and tlsdesc relocations.
2009 (Target_aarch64::optimize_tls_reloc): Implement method.
2010 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2011 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2012 in constructor.
2013 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2014 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2015 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2016 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2017 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2018 (Output_data_plt_aarch64::rela_irelative): New method.
2019 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2020 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2021 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2022 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2023 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2024 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2025 (Output_data_plt_aarch64_standard): New member variables:
2026 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2027 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2028 New parameter: got, got_irelative.
2029 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2030 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2031 (Output_data_plt_aarch64::do_write): Replace got_address with
2032 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2033 (AArch64_relocate_functions::update_movnz): New method.
2034 (AArch64_relocate_functions): Correct format.
2035 (AArch64_relocate_functions::movnz): New method.
2036 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2037 before the switch. Add new cases to switch.
00cac886 2038 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
2039 tlsgd tlsdesc cases.
2040 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2041 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2042 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2043 Call reloc_name_in_error_message to print unsupported reloc.
2044 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2045 make_data_plt.
2046 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2047 relocs. Fill in some more dynamic tags.
2048 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2049 Skip call tls_get_addr when tlsgd is relaxed.
2050 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2051 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2052 tlsdesc->ie relaxation.
2053
62661c93
SS
20542014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2055
2056 * mips.cc (Target_mips_nacl): New class.
2057 (Target_selector_mips_nacl): New class.
2058 (target_selector_mips32): Rename from target_selector_mips32be and use
2059 Target_selector_mips_nacl instead of Target_selector_mips.
2060 (target_selector_mips32el): Rename from target_selector_mips32 and use
2061 Target_selector_mips_nacl instead of Target_selector_mips.
2062 (target_selector_mips64): Rename from target_selector_mips64be and use
2063 Target_selector_mips_nacl instead of Target_selector_mips.
2064 (target_selector_mips64el): Rename from target_selector_mips64 and use
2065 Target_selector_mips_nacl instead of Target_selector_mips.
2066 (Target_mips::mips_info): Add const attribute.
2067
54674d38
CC
20682014-09-02 Cary Coutant <ccoutant@google.com>
2069
2070 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2071 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2072 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2073 (Sized_incr_dynobj::do_section_name): Likewise.
2074 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2075 (Sized_incr_dynobj::do_section_name): Likewise.
2076 * object.h (Object::section_name): Likewise.
2077 (Object::do_section_name): Likewise.
2078 (Sized_relobj_file::do_section_name): Likewise.
2079 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2080 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2081
9860cbcf
CC
20822014-09-02 Cary Coutant <ccoutant@google.com>
2083
2084 PR gold/17005
2085 * ehframe.cc (Fde::write): Add output_offset parameter.
2086 (Cie::write): Likewise.
2087 (Eh_frame::set_final_data_size): Account for offset within output
2088 section.
2089 (Eh_frame::do_sized_write): Likewise.
2090 * ehframe.h (Fde::write): Add output_offset parameter.
2091 (Cie::write): Likewise.
2092 * output.cc (Output_section::Input_section_sort_entry): Remove
2093 section_has_name_; add output_section_name parameter. Use
2094 output section name for non-input sections.
2095 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2096 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2097 (Output_section::Input_section_sort_compare): Remove logic for
2098 sections without names.
2099 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2100 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2101 Likewise.
2102 (Output_section::Input_section_sort_section_name_compare): Likewise.
2103
8e33481e
HS
21042014-08-29 Han Shen <shenhan@google.com>
2105 Jing Yu <jingyu@google.com>
2106
2107 * aarch64-reloc-property.cc
2108 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2109 reference reloc property in the table.
2110 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2111 3 other entries.
2112 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2113 2 new overloaded methods.
2114 (Output_data_got_aarch64::do_write): Add code to write out
2115 static relocs.
2116 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2117 static relocs.
2118 (Output_data_got_aarch64::static_relocs): New vector to
2119 hold static relocs.
2120 (Target_aarch64::TCB_SIZE): New const static memeber.
2121 (Target_aarch64::tcb_size): New method.
2122 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2123 (Target_aarch64::Relocate::relocate_tls): New method.
2124 (Target_aarch64::Scan::local): Add code handling new reloc types.
2125 (Target_aarch64::Scan::global): Add code handling new reloc types.
2126
81233653
ST
21272014-08-13 Sriraman Tallam <tmsriram@google.com>
2128
2129 * options.h (-no-pie): Add option.
2130
9363c7c3
JY
21312014-08-08 Jing Yu <jingyu@google.com>
2132 Han Shen <shenhan@google.com>
2133
2134 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2135 (DEFFILES): add aarch64-reloc.def.
2136 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2137 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2138 * Makefile.in: Regenerate.
2139 * aarch64-reloc-property.cc: New file.
2140 * aarch64-reloc-property.h: New file.
2141 * aarch64-reloc.def: New file.
2142 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2143 with tab to make the format consistent.
2144 (Output_data_got_aarch64::symbol_table_): New method.
2145 (Target_aarch64::do_plt_address_for_global): New method.
2146 (Target_aarch64::do_plt_address_for_local): New method.
2147 (Target_aarch64::do_select_as_default_target): New method.
2148 (Target_aarch64::do_make_data_plt): New method.
2149 (Target_aarch64::make_data_plt): New method.
2150 (Output_data_plt_aarch64::has_irelative_section): New method.
2151 (Output_data_plt_aarch64::address_for_global): New method.
2152 (Output_data_plt_aarch64::address_for_local): New method.
2153 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2154 (Output_data_plt_aarch64::add_entry): Implement contents.
2155 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2156 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2157 the got_pov entry to plt0.
2158 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2159 Implement contents.
2160 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2161 (AArch64_howto): New struct.
2162 (aarch64_howto[]): New static const array.
2163 (AArch64_relocate_functions): New class.
2164 (Target_aarch64::Scan::get_reference_flags): Remove method.
2165 (Target_aarch64::Scan::local): Implement to support a few relocations.
2166 (Target_aarch64::Scan::global): Implement to support a few relocations.
2167 (Target_aarch64::make_plt_section): Implement contents.
2168 (Target_aarch64::make_plt_entry): Implement contents.
2169 (Target_aarch64::do_finalize_sections): Implement contents.
2170 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2171 (Target_aarch64::relocate_section): Implement contents.
2172
ad9fe6c1
AM
21732014-08-06 Alan Modra <amodra@gmail.com>
2174
2175 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2176
7cd4e5b7
AM
21772014-08-06 Alan Modra <amodra@gmail.com>
2178
2179 PR 13227
2180 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2181
5ad9b0a7
ST
21822014-07-21 Sriraman Tallam <tmsriram@google.com>
2183
2184 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2185 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2186
e051745c
CC
21872014-07-08 Cary Coutant <ccoutant@google.com>
2188
2189 * expression.cc (struct Expression::Expression_eval_info): Add
2190 new fields type_pointer, vis_pointer, and nonvis_pointer.
2191 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2192 nonvis_pointer parameters. Adjust all calls.
2193 (Symbol_expression::value): Update type, visibility, and nonvis bits
2194 in caller.
2195 * script.cc (Symbol_assignment::sized_finalize): Update type,
2196 visibility, and remaining st_other bits for new symbol.
2197 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2198 vis_pointer, and nonvis_pointer parameters.
2199 * symtab.h (Symbol::set_type): New method.
2200
2201 * testsuite/Makefile.am (defsym_test): New test.
2202 * testsuite/Makefile.in: Regenerate.
2203 * testsuite/defsym_test.c: New file.
2204 * testsuite/defsym_test.sh: New file.
2205
f35c4853
CC
22062014-07-08 Cary Coutant <ccoutant@google.com>
2207
2208 PR gold/15639
2209 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2210 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2211 (Sized_dynobj::base_read_symbols): ...new method.
2212 * object.h (Sized_relobj_file::base_read_symbols): New method.
2213 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2214 (Sized_relobj_file::base_read_symbols): ...new method.
2215 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2216 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2217 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2218
2900af2d
AM
22192014-07-04 Alan Modra <amodra@gmail.com>
2220
2221 * po/POTFILES.in: Regenerate.
2222
053a4d68
JY
22232014-07-02 Jing Yu <jingyu@google.com>
2224
2225 * aarch64.cc: New file
2226 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2227 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2228 * Makefile.in: Regenerate.
2229 * configure.tgt: Add entries for aarch64*.
2230 * configure.ac: Likewise.
2231 * configure: Likewise.
2232
7b549045
AM
22332014-06-27 Alan Modra <amodra@gmail.com>
2234
2235 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2236
cb818dbf
CC
22372014-06-24 Cary Coutant <ccoutant@google.com>
2238
2239 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2240 sections.
2241 (Dwo_file::sized_read_unit_index): Likewise.
2242
9810d34d
SS
22432014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2244
2245 * mips.cc: New file.
2246 * Makefile.am (TARGETSOURCES): Add mips.cc
2247 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2248 * configure.tgt: Add entries for mips*.
2249 * configure.ac: Likewise.
2250 * Makefile.in: Regenerate.
2251 * configure: Likewise.
2252
9baa787b
CC
22532014-06-09 Cary Coutant <ccoutant@google.com>
2254
2255 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2256 unit_length is within section bounds.
2257
8f89af0a
CC
22582014-06-09 Cary Coutant <ccoutant@google.com>
2259
2260 PR gold/16980
2261 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2262 map.
2263
a47622ac
AM
22642014-06-07 Alan Modra <amodra@gmail.com>
2265
2266 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2267
4320c691
CC
22682014-06-06 Cary Coutant <ccoutant@google.com>
2269
2270 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2271 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2272 (Dwarf_pubnames_table::read_header): Likewise.
2273 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2274 .debug_gnu_pubtypes.
2275
270c9937
JB
22762014-06-05 Joel Brobecker <brobecker@adacore.com>
2277
2278 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2279 * Makefile.in, configure: Regenerate.
2280
397998fc
AM
22812014-06-03 Alan Modra <amodra@gmail.com>
2282
2283 * powerpc.cc (addis_12_2): Define.
2284 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2285
61f5c66f
AM
22862014-06-03 Alan Modra <amodra@gmail.com>
2287
2288 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2289 st_other output.
2290
f6971787
AM
22912014-06-02 Alan Modra <amodra@gmail.com>
2292
2293 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2294 Only ignore relocs on ELFv1.
2295 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2296
f6fb8322
CC
22972014-05-30 Cary Coutant <ccoutant@google.com>
2298
2299 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2300 * testsuite/Makefile.in: Regenerate.
2301 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2302
c23dd342
L
23032014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2304
2305 PR gold/16945
2306 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2307 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2308
5fe7ffdc
AM
23092014-05-15 Alan Modra <amodra@gmail.com>
2310
2311 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2312 Compare FDE contents with DW_CFA_nop rather than 0.
2313
a82bef93
ST
23142014-05-13 Sriraman Tallam <tmsriram@google.com>
2315
2316 * symtab.h (may_need_copy_reloc): Remove check for position independent
2317 code.
2318 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2319 position independence before pc absolute may_need_copy_reloc call.
2320 Add check for executable output befor pc relative may_need_copy_reloc
2321 call.
2322 * i386.cc: Ditto.
2323 * arm.cc: Ditto.
2324 * sparc.cc: Ditto.
2325 * tilegx.cc: Ditto.
2326 * powerpc.cc: Add check for no position independence before
2327 may_need_copy_reloc calls.
2328 * testsuite/pie_copyrelocs_test.cc: New file.
2329 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2330 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2331 * Makefile.in: Regenerate.
a82bef93 2332
53c66605
ML
23332014-05-08 Martin Liška <mliska@suse.cz>
2334
2335 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2336
57b2284c
CC
23372014-05-06 Cary Coutant <ccoutant@google.com>
2338
2339 PR gold/16900
2340 * i386.cc (Output_data_got_plt_i386): New class.
2341 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2342 parameter. Change all callers.
2343 (Output_data_plt_i386::layout_): Remove.
2344 (Output_data_plt_i386::got_plt_): Change type.
2345 (Target_i386::got_plt_): Change type. Change all references.
2346 (Target_i386::got_section): Create instance of new class.
2347 (Output_data_got_plt_i386::do_write): New function.
2348 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2349 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2350 parameter. Change all callers.
2351 (Output_data_plt_x86_64::layout_): Remove.
2352 (Output_data_plt_x86_64::got_plt_): Change type.
2353 (Target_x86_64::got_plt_): Change type. Change all references.
2354 (Target_x86_64::got_section): Create instance of new class.
2355 (Output_data_got_plt_x86_64::do_write): New function.
2356 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2357 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2358 class.
2359
6b97515d 23602014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2361
6b97515d
CC
2362 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2363 if we have pubnames/pubtypes.
2364
d1bddd3c
CC
23652014-05-02 Cary Coutant <ccoutant@google.com>
2366
5fe7ffdc
AM
2367 * defstd.cc (in_segment): Define __ehdr_start here...
2368 * layout.cc (Layout::finalize): ...Instead of here. Set the
2369 output segment when known.
2370 * resolve.cc (Symbol::override_base_with_special): Remember
2371 the original binding.
2372 * symtab.cc (Symbol::set_output_segment): New function.
2373 (Symbol::set_undefined): New function.
2374 * symtab.h (Symbol::is_weak_undefined): Check original undef
2375 binding.
2376 (Symbol::is_strong_undefined): New function.
2377 (Symbol::set_output_segment): New function.
2378 (Symbol::set_undefined): New function.
2379 * target-reloc.h (is_strong_undefined): Remove.
2380 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2381 Check for hidden undefs.
2382 (relocate_section): Call Symbol::is_strong_undefined.
2383
2384 * testsuite/Makefile.am (ehdr_start_test_1)
2385 (ehdr_start_test_2, ehdr_start_test_3)
2386 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2387 * testsuite/Makefile.in: Regenerate.
2388 * testsuite/ehdr_start_def.cc: New source file.
2389 * testsuite/ehdr_start_test.cc: New source file.
2390 * testsuite/ehdr_start_test.t: New linker script.
2391 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2392
7849f6d8
CC
23932014-04-23 Cary Coutant <ccoutant@google.com>
2394
bf2cc635 2395 PR gold/16870
7849f6d8
CC
2396 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2397
99fd8cff
CC
23982014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2399
2400 * layout.cc (Layout::include_section): Allow a target to decide
2401 whether to include a section.
2402 * target.h (Target::should_include_section): New function.
2403 (Target::do_should_include_section): New function.
2404
91f43acd
CC
24052014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2406
2407 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2408 inline into ...
2409 (Copy_relocs::emit): ... here.
2410 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2411 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2412 (Copy_reloc_entry::entries_): Change from private to protected.
2413
c4eb27e1
ST
24142014-04-02 Sriraman Tallam <tmsriram@google.com>
2415
2416 * icf.cc (get_section_contents): Replace copies of reloc
2417 vectors with const references.
2418
ae447ddd
CC
24192014-04-02 Cary Coutant <ccoutant@google.com>
2420
2421 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2422 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2423 * configure: Regenerate.
2424 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2425 -fno-use-linker-plugin.
2426 (LINK1, CXXLINK1): Add it to the link command.
2427 * testsuite/Makefile.in: Regenerate.
2428
fa47fa92
AM
24292014-03-12 Alan Modra <amodra@gmail.com>
2430
2431 * Makefile.in: Regenerate.
2432
9b12c500
CC
24332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2434
2435 * symtab.h (Symbol::set_nonvis): New function.
2436
beacaa96
CC
24372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2438
2439 * symtab.cc (Sized_symbol<32>::init_output_data):
2440 Instantiate the template.
2441 (Sized_symbol<64>::init_output_data): Likewise.
2442
800d9823
CC
24432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2444
2445 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2446 adjust dynamic symbol value.
2447 * target.h (Target::adjust_dyn_symbol): New function.
2448 (Target::do_adjust_dyn_symbol): New function.
2449
918fc1f8 24502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2451
918fc1f8
CC
2452 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2453 Get the value of DYNAMIC_CUSTOM dynamic entry.
2454 * output.h (Output_data_dynamic::add_custom): New function.
2455 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2456 dynamic entry.
2457 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2458 * target.h (Target::dynamic_tag_custom_value): New function.
2459 (Target::do_dynamic_tag_custom_value): New function.
2460
98ff9231
CC
24612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2462
2463 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2464 dynsym indexes.
2465 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2466 (Target::do_has_custom_set_dynsym_indexes): New function.
2467 (Target::set_dynsym_indexes): New function.
2468 (Target::do_set_dynsym_indexes): New function.
2469
b80eed39
AM
24702014-03-07 Alan Modra <amodra@gmail.com>
2471
2472 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2473 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2474 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2475 (Powerpc_relocate_functions::has_overflow_bitfield,
2476 overflowed): Use the above.
2477 (Target_powerpc::Relocate::relocate): Correct overflow checking
2478 for a number of relocations. Modify overflow test for 16-bit
2479 fields in instructions to signed/unsigned according to whether
2480 the field takes a signed or unsigned value.
2481
4b95cf5c
AM
24822014-03-05 Alan Modra <amodra@gmail.com>
2483
2484 Update copyright years.
2485
45965137
AM
24862014-03-05 Alan Modra <amodra@gmail.com>
2487
2488 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2489 R_PPC64_ADDR64_LOCAL.
2490 (Target_powerpc::Relocate::relocate): Likewise.
2491
2c80b753
AM
24922014-03-03 Alan Modra <amodra@gmail.com>
2493
2494 * dwp.cc (print_version): Update copyright year to current.
2495
c1c69e83
AM
24962014-02-10 Alan Modra <amodra@gmail.com>
2497
2498 * po/gold.pot: Regenerate.
2499
dd0c4e70
CC
25002014-02-06 Cary Coutant <ccoutant@google.com>
2501
2502 Fix problem where -u is ignored when a weak undef is seen.
2503
2504 * archive.cc (Library_base::should_include_member): Reorder
2505 code to check for -u option if a weak undef has already been seen.
2506 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2507 * testsuite/Makefile.in: Regenerate.
2508 * testsuite/weak_undef_file3.cc: New file.
2509 * testsuite/weak_undef_file4.cc: New file.
2510 * testsuite/weak_undef_test_2.cc: New file.
2511
1a221d3d
CC
25122014-02-05 Cary Coutant <ccoutant@google.com>
2513
2514 Fix issues with gold undefined symbol diagnostics.
2515
2516 PR binutils/15435
2517 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2518 check to here.
2519 * target-reloc.h (is_strong_undefined): New function.
2520 (relocate_section): Move undef vtable symbol check from here.
2521 Check for is_strong_undefined.
2522
e889f0a4 25232014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2524
e889f0a4
CC
2525 Fix problems with the --dynamic-list option.
2526
2527 PR gold/13577
2528 * options.cc (General_options::parse_dynamic_list):
2529 Set have_dynamic_list_.
2530 (General_options::General_options): Initialize have_dynamic_list_.
2531 (General_options::finalize): Turn off -Bsymbolic and
2532 -Bsymbolic-functions if --dynamic-list provided.
2533 * options.h (General_options::have_dynamic_list): New function.
2534 (General_options::have_dynamic_list_): New data member.
2535 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2536 correctly.
5fe7ffdc 2537
e889f0a4
CC
2538 PR gold/16530
2539 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2540 in --dynamic-list, mark it.
5fe7ffdc 2541
e889f0a4
CC
2542 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2543 (dynamic_list_2): New test case.
2544 * testsuite/Makefile.in: Regenerate.
2545 * testsuite/dynamic_list_2.cc: New file.
2546 * testsuite/dynamic_list_2.t: New file.
2547 * testsuite/dynamic_list_lib1.cc: New file.
2548 * testsuite/dynamic_list_lib2.cc: New file.
2549 * testsuite/gc_dynamic_list_test.c: New file.
2550 * testsuite/gc_dynamic_list_test.sh: New file.
2551 * testsuite/gc_dynamic_list_test.t: New file.
2552
ec673e64
CC
25532014-01-28 Cary Coutant <ccoutant@google.com>
2554
2555 Add .gdb_index version 7 support.
2556
2557 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2558 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2559 debug sections.
2560 (Dwarf_ranges_table::read_ranges_table): Likewise.
2561 (Dwarf_pubnames_table::read_section): Check for GNU-style
2562 sections, and for compressed debug sections.
2563 (Dwarf_pubnames_table::read_header): Compute end address of table.
2564 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2565 for end of list by offset, not by offset == 0.
2566 (Dwarf_info_reader::do_read_string_table): Check for compressed
2567 debug sections.
2568 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2569 Initialize new data members.
2570 (Dwarf_pubnames_table::next_name): return flag_byte.
2571 (Dwarf_pubnames_table::end_of_table_): New data member.
2572 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2573 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2574 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2575 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2576 read skeleton type unit DIEs.
2577 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2578 (Gdb_index::do_write): Write flag_byte.
2579 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2580 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2581 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2582 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2583
221fd5d5
L
25842014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2585
2586 * version.cc (print_version): Update copyright year to 2014.
2587
6c09fb0b
ILT
25882013-12-19 Dimitry Andric <dimitry@andric.com>
2589
2590 * stringpool.cc (Stringpool_template::reserve): Add
2591 HAVE_UNORDERED_MAP case.
2592 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2593
8356f2d0
CC
25942013-12-18 Cary Coutant <ccoutant@google.com>
2595
2596 * configure.ac: Check for <unordered_set> and <unordered_map>.
2597 * config.in: Regenerate.
2598 * configure: Regenerate.
2599 * system.h: Use <unordered_set> and <unordered_map> if available.
2600
f2c7d7ee
RM
26012013-12-10 Roland McGrath <mcgrathr@google.com>
2602
2603 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2604 with $(INSTALL_PROGRAM_ENV).
2605 * Makefile.in: Regenerate.
2606
6632e8cc
CC
26072013-11-22 Cary Coutant <ccoutant@google.com>
2608
2609 * configure.ac: Add check for which library is needed for
2610 dlopen.
2611 * configure: Regenerate.
2612
0c075858
CC
26132013-11-22 Cary Coutant <ccoutant@google.com>
2614
2615 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2616 assembler.
2617 * testsuite/Makefile.in: Regenerate.
2618
f49fe902
L
26192013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2620
2621 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2622 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2623 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2624 (Target_x86_64<size>::Scan::local): Likewise.
2625 (Target_x86_64<size>::Scan::global): Likewise.
2626 (Target_x86_64<size>::Relocate::relocate): Likewise.
2627 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2628 Likewise.
2629 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2630 R_X86_64_PC32_BND.
2631
2632 * testsuite/Makefile.am (check_PROGRAMS): Add
2633 exception_x86_64_bnd_test.
2634 (exception_x86_64_bnd_test_SOURCES): New macro.
2635 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2636 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2637 (exception_x86_64_bnd_test_LDADD): Likewise.
2638 (exception_x86_64_bnd_1.o): New rule.
2639 (exception_x86_64_bnd_2.o): Likewise.
2640 * testsuite/Makefile.in: Regenerated.
2641
9055360d
AM
26422013-11-15 Alan Modra <amodra@gmail.com>
2643
2644 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2645 accessor.
2646 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2647 Only call ppc64_local_entry_offset for 64-bit. Restrict
2648 symval_for_branch lookup to ELFv1.
2649 (Stub_table::add_plt_call_entry): Use unsigned int off.
2650 (Output_data_glink::Address, invalid_address): New.
2651 (Output_data_glink::add_eh_frame): Move out of line. Add
2652 support for ELFv2.
2653 (Output_data_glink::add_global_entry, find_global_entry,
2654 global_entry_address): New functions.
2655 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2656 ge_size): New variables.
2657 (Output_data_glink::set_final_data_size): Add global entry
2658 stub sizing.
2659 (Output_data_glink::do_write): Write global entry stubs.
2660 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2661 parameter. Return true for ELFv2. Adjust callers.
2662 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2663 ELFv1. Similarly for ifunc and dynamic relocation processing
2664 specific to ELFv1. Recognize that symbols are defined on
2665 their plt entries for ELFv2.
2666 (Target_powerpc::symval_for_branch): Assert if called for
2667 ELFv2 or ppc32.
2668 (Target_powerpc::Relocate::relocate): Use global entry plt
2669 stub for symbol value if such exists on ELFv2.
2670 (Target_powerpc::Relocate::relocate): Don't call
2671 symval_for_branch when ELFv2. Do adjust for local entry
2672 offset when ELFv2.
2673 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2674 plt stub for ELFv2.
2675 (Target_powerpc::do_plt_address_for_global): Similarly.
2676
cafdd569
CC
26772013-11-14 Cary Coutant <ccoutant@google.com>
2678
2679 Revert patch -- this did not fix the problem, and there is
2680 no race there.
2681
2682 2013-11-14 Cary Coutant <ccoutant@google.com>
2683
2684 PR gold/14860
2685 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2686 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2687 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2688 updating fde_offsets_.
2689 (Eh_frame_hdr::lock_): New data member.
2690
94e49e16
CC
26912013-11-14 Cary Coutant <ccoutant@google.com>
2692
2693 * dwp.cc (Dwo_file_entry): New type.
2694 (File_list): Use Dwo_file_entry.
2695 (Dwo_file::verify): New function.
2696 (Dwo_file::verify_dwo_list): New function.
2697 (Dwo_file::sized_verify_dwo_list): New function.
2698 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2699 list.
2700 (Dwp_options): New enum type.
2701 (dwp_options): Add --verify-only.
2702 (usage): Likewise.
2703 (main): Likewise.
2704 * dwp.h (gold_info): Add declaration.
2705
7cdd7d57
CC
27062013-11-14 Cary Coutant <ccoutant@google.com>
2707
2708 PR gold/14860
2709 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2710 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2711 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2712 updating fde_offsets_.
2713 (Eh_frame_hdr::lock_): New data member.
2714
1d946cb3
CC
27152013-11-06 Cary Coutant <ccoutant@google.com>
2716
2717 PR gold/15758
2718 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2719 before reloc sections.
2720
4f65b40e
AM
27212013-11-04 Alan Modra <amodra@gmail.com>
2722
2723 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2724 (Symbol::needs_dynamic_reloc): Test new flag.
2725 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2726 (Target_powerpc::Scan::get_reference_flags): Add target param.
2727 Return FUNC_DESC_ABI for 64-bit ELFv1.
2728 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2729 call.
2730 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2731 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2732
908794a9
CC
27332013-10-31 Cary Coutant <ccoutant@google.com>
2734
2735 Restore support for dwp v2 DWARF package file format.
2736
2737 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2738 tu_length parameter. Adjust all callers.
2739 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2740 * dwp.cc: Include dwarf.h.
2741 (Section_bounds): New struct type.
2742 (Unit_set): New struct type.
2743 (Dwo_file::Dwo_file): Initialize new data member.
2744 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2745 Combine and rename to...
2746 (Dwo_file::read_unit_index): ...this.
2747 (Dwo_file::sized_read_compunit_index)
2748 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2749 (Dwo_file::sized_read_unit_index): ...this.
2750 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2751 parameters; add section_id parameter.
2752 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2753 (Dwo_file::add_unit_set): ...this.
2754 (Dwo_file::shndx_map_): Remove.
2755 (Dwo_file::sect_offsets_): New data member.
2756 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2757 (Dwp_output_file::add_section): Rename to...
2758 (Dwp_output_file::add_contribution): ...this.
2759 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2760 (Dwp_output_file::add_tu_set): Likewise.
2761 (Dwp_output_file::Contribution): New type.
2762 (Dwp_output_file::Section::contributions): New data member.
2763 (Dwp_output_file::Cu_or_tu_set): Remove.
2764 (Dwp_output_file::Section::Section): New ctor.
2765 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2766 (Dwp_output_file::Dwp_index::Section_table): New type.
2767 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2768 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2769 parameter.
2770 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2771 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2772 (Dwp_output_file::Dwp_index::section_table): New member function.
2773 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2774 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2775 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2776 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2777 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2778 (Dwp_output_file::Dwp_index::section_table_): New data member.
2779 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2780 (Dwp_output_file::add_output_section): New member function.
2781 (Dwp_output_file::write_new_section): New member function.
2782 (Dwp_output_file::write_contributions): New member function.
2783 (Dwp_output_file::section_id_map_): New data member.
2784 (class Dwo_id_info_reader): Remove.
2785 (class Unit_reader): New class.
2786 (get_dwarf_section_name): New function.
2787 (Dwo_file::read_executable): Adjust initializations of class data.
2788 (Dwo_file::read): Add support for v2 package file format.
2789 (Dwo_file::read_unit_index): Likewise.
2790 (Dwo_file::sized_read_unit_index): Likewise.
2791 (Dwo_file::copy_section): Likewise.
2792 (Dwo_file::add_unit_set): Likewise.
2793 (Dwp_output_file::add_output_section): Likewise.
2794 (Dwp_output_file::add_contribution): Likewise.
2795 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2796 for empty slot.
2797 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2798 file format.
2799 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2800 slot.
2801 (Dwp_output_file::initialize): Remove unused function.
2802 (Dwp_output_file::finalize): Add support for v2 package file format.
2803 (Dwp_output_file::write_index): Likewise.
2804 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2805 function prototype.
2806
2500c017
CC
28072013-10-31 Cary Coutant <ccoutant@google.com>
2808
2809 * configure.ac: Fix check for -fmerge-constants.
2810 * configure.ac: Regenerate.
2811
dd0845d7
RM
28122013-10-30 Roland McGrath <mcgrathr@google.com>
2813
2814 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2815 Correct 9-byte nop sequence to match what the assembler generates.
2816
b4f7960d
AM
28172013-10-30 Alan Modra <amodra@gmail.com>
2818
2819 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2820 ppc64_local_entry_offset, ppc64_local_entry_offset,
2821 do_read_symbols): New functions.
2822 (Powerpc_relobj::e_flags_, st_other_): New vars.
2823 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2824 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2825 (Powerpc_relobj::e_flags_): New var.
2826 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2827 and adjust for ELFv2.
2828 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2829 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2830 (Powerpc_dynobj::do_find_special_sections): Likewise.
2831 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2832 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2833 to ELFv2 local entry.
2834 (Target_powerpc::do_relax): No thread safe barriers needed for
2835 ELFv2.
2836 (Output_data_plt_powerpc::initial_plt_entry_size_,
2837 plt_entry_size): Delete. Replace all uses with
2838 first_plt_entry_offset() and plt_entry_size().
2839 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2840 reserved_size parm. Update callers.
2841 (Output_data_plt_powerpc::entry_count): Update.
2842 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2843 and use Target_powerpc::first_plt_entry_offset().
2844 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2845 rename to plt_entry_size.
2846 (Output_data_plt_powerpc::add_ifunc_entry,
2847 add_local_ifunc_entry): Adjust reloc for ELFv2.
2848 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2849 (glink_eh_frame_fde_64v2): New.
2850 (Stub_table::plt_call_size): Support ELFv2 sizing.
2851 (Output_data_glink::add_eh_frame): Use the new FDE.
2852 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2853 (Stub_table::do_write): Write ELFv2 stubs and glink.
2854 (Target_powerpc::Relocate::relocate): Replaces nop after call
2855 with ld 2,24(1) and adjust local offset destination for ELFv2.
2856
f9c6b907
AM
28572013-10-30 Alan Modra <amodra@gmail.com>
2858
2859 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2860 (Target_powerpc::Scan::global, local): Likewise.
2861 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2862 on all ppc64 @h and @ha relocs.
2863
e84fe78f
AM
28642013-10-14 Alan Modra <amodra@gmail.com>
2865
2866 * output.h (Output_data_got::add_constant): Tidy.
2867 (Output_data_got::add_constant_pair): New function.
2868 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2869 methods used so as to first call reserve_ent().
2870
679e4abf
RM
28712013-10-11 Roland McGrath <mcgrathr@google.com>
2872
44dcb735
RM
2873 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2874 add_got_entry and add_got_entry_pair.
2875
13323c49
RM
2876 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2877 (HAVE_PUBNAMES): Likewise.
2878 * configure: Regenerate.
2879
1496b446
RM
2880 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2881 * testsuite/Makefile.in: Regenerate.
2882
cc84c10b
RM
2883 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2884 Remove const from declaration.
2885 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2886 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2887 * output.h (Output_file_header): Remove const from member target_
2888 and corresponding constructor argument.
2889 * output.cc (Output_file_header::Output_file_header): Update prototype.
2890 (Output_file_header::do_sized_write): Use this->target_ in place
2891 of parameters()->target().
2892
52f66a2c
RM
2893 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2894
2b64b551
RM
2895 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2896 * configure: Regenerate.
2897 * Makefile.in: Regenerate.
2898 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2899 * testsuite/merge_string_literals_2.c: Likewise.
2900 * testsuite/Makefile.am
2901 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2902 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2903 literal -fmerge-constants.
2904 * testsuite/Makefile.in: Regenerate.
2905
43819297
RM
2906 * i386.cc (Target_i386): Remove unused member dynbss_.
2907 * arm.cc (Target_arm): Likewise.
2908 * powerpc.cc (Target_powerpc): Likewise.
2909 * sparc.cc (Target_sparc): Likewise.
2910 * tilegx.cc (Target_tilegx): Likewise.
2911 * x86_64.cc (Target_x86_64): Likewise.
2912 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2913 type_signature_, type_offset_.
2914 * plugin.h (Plugin_hook): Remove unused member layout_.
2915 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2916 mapfile_.
2917 (Read_member): Remove unused members input_objects_, symtab_,
2918 mapfile_, layout_.
2919 (Check_library): Remove unused member symtab_.
2920 * archive.h (Lib_group): Remove unused member lib_.
2921 * archive.cc (Lib_group::Lib_group): Update initializer.
2922 * incremental.h (Incremental_binary): Remove unused member target_.
2923 (Incremental_script_entry): Removed unused member script_.
2924 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2925 * icf.h (Icf): Remove unused member num_tracked_relocs.
2926
39d9ead7
RM
2927 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2928 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2929 its only use.
2930 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2931
679e4abf
RM
2932 * archive.h: Use struct rather than class for forward declaration
2933 of Read_symbols_data.
2934
54de2ea6
CC
29352013-10-07 Cary Coutant <ccoutant@google.com>
2936
2937 PR gold/16010
2938 * testsuite/Makefile.am (icf_test): Fix dependencies.
2939 (icf_safe_test): Likewise.
2940 (icf_safe_so_test): Likewise.
2941 (large_symbol_alignment): Add empty _LDADD rule.
2942 * testsuite/Makefile.in: Regenerate.
2943
b14016f0
L
29442013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2945
2946 PR gold/15927
2947 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2948 relocation for R_X86_64_32 on x32.
2949
eb426534
RM
29502013-08-27 Roland McGrath <mcgrathr@google.com>
2951
2952 * output.cc (Output_segment::set_section_addresses): Take new
2953 Target* argument. If target->isolate_execinstr() and the segment
2954 is executable and starts at a target->abi_pagesize() boundary,
2955 pad its end out to a target->abi_pagesize() boundary with code fill.
2956 * output.h (Output_segment::set_section_addresses): Update decl.
2957 * layout.h (Layout::check_output_data_for_reset_values): Take new
2958 argument RELAX_OUTPUTS.
2959 (Layout): New member relax_output_list_.
2960 (Layout::add_relax_output): New method.
2961 * layout.cc (Layout::Layout): Update constructor.
2962 (Layout::reset_relax_output): New method.
2963 (Layout::clean_up_after_relaxation): Call it.
2964 (Layout::prepare_for_relaxation): Update caller.
2965 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2966 Call reset_relax_output before re-processing segments for
2967 isolate_execinstr case.
2968 (Layout::write_data): Handle relax_output_list_.
2969 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2970 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2971
9aff4b7a
NC
29722013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2973
2974 PR binutils/15834
2975 * object.h: Fix typos.
2976
93f8221c
RM
29772013-08-16 Roland McGrath <mcgrathr@google.com>
2978
2979 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2980 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2981
e44c3715
CC
29822013-08-07 Cary Coutant <ccoutant@google.com>
2983
2984 Revert support for v2 DWP files:
2985
2986 2013-03-01 Cary Coutant <ccoutant@google.com>
2987
2988 Add dwp support for v2 DWARF package file format.
2989 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2990 tu_length parameter. Adjust all callers.
2991 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2992 * dwp.cc: Include dwarf.h.
2993 (Section_bounds): New struct type.
2994 (Unit_set): New struct type.
2995 (Dwo_file::Dwo_file): Initialize new data member.
2996 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2997 Combine and rename to...
2998 (Dwo_file::read_unit_index): ...this.
2999 (Dwo_file::sized_read_compunit_index)
3000 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3001 (Dwo_file::sized_read_unit_index): ...this.
3002 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3003 parameters; add section_id parameter.
3004 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3005 (Dwo_file::add_unit_set): ...this.
3006 (Dwo_file::shndx_map_): Remove.
3007 (Dwo_file::sect_offsets_): New data member.
3008 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3009 (Dwp_output_file::add_section): Rename to...
3010 (Dwp_output_file::add_contribution): ...this.
3011 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3012 (Dwp_output_file::add_tu_set): Likewise.
3013 (Dwp_output_file::Contribution): New type.
3014 (Dwp_output_file::Section::contributions): New data member.
3015 (Dwp_output_file::Cu_or_tu_set): Remove.
3016 (Dwp_output_file::Section::Section): New ctor.
3017 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3018 (Dwp_output_file::Dwp_index::Section_table): New type.
3019 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3020 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3021 parameter.
3022 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3023 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3024 (Dwp_output_file::Dwp_index::section_table): New member function.
3025 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3026 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3027 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3028 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3029 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3030 (Dwp_output_file::Dwp_index::section_table_): New data member.
3031 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3032 (Dwp_output_file::add_output_section): New member function.
3033 (Dwp_output_file::write_new_section): New member function.
3034 (Dwp_output_file::write_contributions): New member function.
3035 (Dwp_output_file::section_id_map_): New data member.
3036 (class Dwo_id_info_reader): Remove.
3037 (class Unit_reader): New class.
3038 (get_dwarf_section_name): New function.
3039 (Dwo_file::read_executable): Adjust initializations of class data.
3040 (Dwo_file::read): Add support for v2 package file format.
3041 (Dwo_file::read_unit_index): Likewise.
3042 (Dwo_file::sized_read_unit_index): Likewise.
3043 (Dwo_file::copy_section): Likewise.
3044 (Dwo_file::add_unit_set): Likewise.
3045 (Dwp_output_file::add_output_section): Likewise.
3046 (Dwp_output_file::add_contribution): Likewise.
3047 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3048 for empty slot.
3049 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3050 file format.
3051 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3052 slot.
3053 (Dwp_output_file::initialize): Remove unused function.
3054 (Dwp_output_file::finalize): Add support for v2 package file format.
3055 (Dwp_output_file::write_index): Likewise.
3056 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3057 function prototype.
3058
c6905c28
CC
30592013-07-31 Cary Coutant <ccoutant@google.com>
3060
3061 * object.cc (Sized_relobj::do_output_section_address): New function.
3062 (Sized_relobj): Instantiate explicitly.
3063 * object.h (Object::output_section_address): New function.
3064 (Object::do_output_section_address): New function.
3065 (Sized_relobj::do_output_section_address): New function.
3066 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3067
30682013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3069 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3070
3071 * parameters.cc (Parameters::entry): Return target-specific entry
3072 symbol name.
3073 * target.h (Target::entry_symbol_name): New function.
3074 (Target_info::entry_symbol_name): New data member.
3075
3076 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3077 * i386.cc (Target_i386::i386_info): Likewise.
3078 (Target_i386_nacl::i386_nacl_info): Likewise.
3079 * sparc.cc (Target_sparc::sparc_info): Likewise.
3080 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3081 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3082 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3083 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3084
234d4ab8
SA
30852013-07-22 Sterling Augustine <saugustine@google.com>
3086
3087 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3088 Convert parameter shndx to local variable. Add parameters symtab
3089 and symtab_size. Scan over section names. Find relocation
3090 section corresponding to current section. Create and initialize
3091 reloc_mapper_ and reloc_type_.
3092 (Dwarf_pubnames_table::read_header): Add assertion. Change
3093 unit_length to off_t. Initialize member unit_length_. Fill in field
3094 cu_offset_.
3095 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3096 Initialize new fields unit_length_ and cu_offset_.
3097 (Dwarf_pubnames_table::read_section): Update prototype.
3098 (Dwarf_pubnames_table::cu_offset): New member function.
3099 (Dwarf_pubnames_table::subsection_size): Likewise.
3100 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3101 New fields.
3102 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3103 member functions public.
3104 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3105 Update comment. Rework logic. Move repeated parts to...
3106 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3107 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3108 pubtypes_table_, and stmt_list_offset.
3109 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3110 Gdb_index::find_pubtype_offset,
3111 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3112 (Gdb_index::pubnames_read): Update prototype and rework logic.
3113 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3114 Forward declare.
3115 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3116 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3117 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3118 Gdb_index::map_pubtable_to_dies):
3119 Declare functions.
3120 (Gdb_index::pubnames_read): Update declaration.
3121 (Gdb_index::Pubname_offset_map): New type.
3122 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3123 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3124 Gdb_index::stmt_list_offset): Declare.
3125 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3126 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3127 Gdb_index::pubtypes_offset_): Remove.
3128
a3ed37d8
RM
31292013-07-19 Roland McGrath <mcgrathr@google.com>
3130
3131 * options.h (General_options): Add -Trodata-segment option.
3132 * parameters.cc (Parameters::check_rodata_segment): New function.
3133 (Parameters::set_target_once): Call it.
3134 * parameters.h (Parameters): Declare it (private member function).
3135 * layout.cc (load_seg_unusable_for_headers): New function, broken
3136 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3137 then validate rodata segment rather than text segment.
3138 (relaxation_loop_body): Call that.
3139 (is_text_segment): New function. Don't admit a non-executable
3140 segment if TARGET->isolate_execinstr().
3141 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3142
eb5b4ded
CC
31432013-07-15 Shawn Landden <shawnlandden@gmail.com>
3144
3145 PR gold/15070
3146 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3147 * nacl.h (Sniff_file::View::View): Request aligned view.
3148
4d5effb9
CC
31492013-07-11 Cary Coutant <ccoutant@google.com>
3150
3151 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3152 correct BRLT entry size.
3153
ba8ca3e7
AM
31542013-07-03 Alan Modra <amodra@gmail.com>
3155
3156 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3157 comment.
3158
267257d2
CC
31592013-07-01 Cary Coutant <ccoutant@google.com>
3160
3161 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3162 reloc_type_.
3163 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3164 (Dwarf_ranges_table::lookup_reloc): New function.
3165 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3166 reloc_type_.
3167 (Dwarf_ranges_table::lookup_reloc): New function.
3168 (Dwarf_ranges_table::reloc_type_): New data member.
3169
06f30c9d
CC
31702013-06-27 Jing Yu <jingyu@google.com>
3171
3172 PR gold/15662
3173 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3174 function.
3175 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3176 (Target_powerpc::do_relax): Call the above.
3177
a2d7bf59
AM
31782013-06-27 Cary Coutant <ccoutant@google.com>
3179
3180 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3181 on garbage collected .opd section.
3182
31832013-06-27 Alan Modra <amodra@gmail.com>
3184
3185 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3186 is non-zero.
3187 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3188 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3189
32364e50
CC
31902013-06-14 Cary Coutant <ccoutant@google.com>
3191
3192 * resolve.cc (Symbol::override_base): Don't override st_type
3193 from plugin placeholder symbols.
3194 (Symbol_table::resolve): Likewise.
3195 (Symbol_table::should_override): Don't complain about TLS mismatch
3196 if the TO symbol is a plugin placeholder.
3197 * testsuite/Makefile.am (plugin_test_tls): New test.
3198 * testsuite/Makefile.in: Regenerate.
3199 * testsuite/plugin_test_tls.sh: New test script.
3200 * testsuite/two_file_test_2_tls.cc: New test source.
3201 * testsuite/two_file_test_tls.cc: New test source.
3202
7fb47cc9
CC
32032013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3204
3205 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3206 the maximum segment alignment is larger than the page size.
3207 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3208 correctly aligns the symbols with large alignemnt.
3209 * testsuite/Makefile.in: Regenerate.
3210 * testsuite/large_symbol_alignment.cc: New file.
3211
6934001a
CC
32122013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3213 Sriraman Tallam <tmsriram@google.com>
3214
3215 * options.h (sort_section): New option.
3216 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3217 Rename from Input_section_sort_section_name_special_ordering_compare.
3218 (Input_section_sort_section_name_compare): New struct.
3219 * output.cc (Output_section::Input_section_sort_section_name_compare::
3220 operator()): New function.
3221 (Output_section::sort_attached_input_sections): Use new sort function
3222 for .text if --sort-section=name is specified.
3223 * layout.cc (Layout::make_output_section):
3224 Add sorting by name when --sort-section=name is specified.
3225 * testsuite/Makefile.am (text_section_grouping): Test option
3226 --sort-section=name.
3227 * testsuite/Makefile.in: Regenerate.
3228 * testsuite/section_sorting_name.cc: New file.
3229 * testsuite/section_sorting_name.sh: New file.
3230
93acabad
CC
32312013-05-21 Cary Coutant <ccoutant@google.com>
3232
3233 * symtab.h (Symbol::is_cxx_vtable): New function.
3234 * target-reloc.h (relocate_section): Check for vtable symbol.
3235 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3236 * testsuite/Makefile.in: Regenerate.
3237 * testsuite/missing_key_func.cc: New test source.
3238 * testsuite/missing_key_func.sh: New test script.
3239
60e8b3fc
CC
32402013-05-21 Cary Coutant <ccoutant@google.com>
3241
2b64b551
RM
3242 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3243 type of enclosing symbol.
3244 (Relocate_info::location): Check symbol type when describing symbol.
3245 * object.h (Symbol_location_info): Remove unused line_number;
3246 add enclosing_symbol_type.
3247 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3248
9df9de2c
CC
32492013-05-13 Cary Coutant <ccoutant@google.com>
3250
2b64b551
RM
3251 * configure.ac: Export DEFAULT_TARGET.
3252 * configure: Regenerate.
3253 * Makefile.in: Regenerate.
3254 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3255 * testsuite/Makefile.in: Regenerate.
3256 * testsuite/debug_msg.sh: Delete duplicate tests.
3257 Don't check undef_int error message match for powerpc where the
3258 source file and line number aren't available.
9df9de2c 3259
bbc5ae17
RM
32602013-05-10 Roland McGrath <mcgrathr@google.com>
3261
3262 * options.h (General_options): Add --rosegment-gap option.
3263 * options.cc (finalize): --rosegment-gap implies --rosegment.
3264 * layout.cc (set_segment_offsets): Let user option override
3265 target->rosegment_gap().
3266
0c6e6c39
RM
32672013-05-10 Roland McGrath <mcgrathr@google.com>
3268
3269 * options.h (General_options): Remove leading space from help
3270 messages for -nostdlib and --rosegment.
3271
cde7cb01
MR
32722013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3273
3274 PR ld/15365
3275 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3276
f31ae5b8
AM
32772013-05-03 Alan Modra <amodra@gmail.com>
3278
3279 * merge.cc (Output_merge_string::do_add_input_section): Correct
3280 scan for number of strings. Rename vars to avoid shadowing.
3281 Include missing terminator in input_size_.
3282
d3a7cd45
L
32832013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3284
3285 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3286 Restore empty string handling.
3287
6ad3daba
CC
32882013-05-01 Cary Coutant <ccoutant@google.com>
3289
3290 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3291 uninitialized warning.
3292
e31908b6
CC
32932013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3294
3295 * output.cc (Output_section::add_merge_input_section): Allow
3296 to merge sections if the alignment is more than character size.
3297 * merge.h (Output_merge_string::Output_merge_string): Remove
3298 assert.
3299 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3300 only not-null strings. Check the alignment of strings.
3301 * stringpool.h
3302 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3303 alignment as the argument.
3304 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3305 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3306 Align non-zero length strings according to the addralign_.
3307 (Stringpool_template<Stringpool_char>::set_string_offsets):
3308 Updating offsets according to the given alignment.
3309 * testsuite/Makefile.am (text_section_grouping): Test if string
3310 literals are getting merged.
3311 * testsuite/Makefile.in: Regenerate.
3312 * testsuite/merge_string_literals_1.c: New file.
3313 * testsuite/merge_string_literals_2.c: Ditto.
3314 * testsuite/merge_string_literals.sh: Ditto.
3315
0e804863
ILT
33162013-04-26 Ian Lance Taylor <iant@google.com>
3317
3318 * target-reloc.h (relocate_section): If the reloc offset is out of
3319 range, pass VIEW as NULL to relocate.relocate.
3320 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3321 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3322 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3323 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3324 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3325 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3326
e7c5ea40
CC
33272013-04-26 Geoff Pike <gpike@chromium.org>
3328
3329 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3330 * layout.cc (Hash_task): New class.
3331 (Layout::queue_build_id_tasks): New function.
3332 (Layout::write_build_id): Handle single-thread portion of build ID
3333 computation. (In some cases, all of it is single-threaded.) Replace
3334 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3335 functionality in fewer lines of code.
3336 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3337 * options.h (General_options): make "--build-id" default to tree
3338 rather than sha1. Add two new options related to --build-id=tree:
3339 --build-id-chunk-size-for-treehash and
3340 --build-id-min-file-size-for-treehash.
3341 * Makefile.am: add testing of --build-id=tree and related new options
3342 (these tests will be invoked by "make check").
3343 * Makefile.in: Regenerate.
3344
49926cd0
AM
33452013-04-25 Alan Modra <amodra@gmail.com>
3346
3347 * configure.tgt: Add powerpcle and powerpc64le.
3348
a4034750
AM
33492013-04-22 Alan Modra <amodra@gmail.com>
3350
3351 PR gold/15355
3352 * layout.cc (Layout::segment_precedes): Allow more than one
3353 segment with the same type and flags.
3354
e79c84aa
CC
33552013-04-15 Cary Coutant <ccoutant@google.com>
3356
3357 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3358 allocate space in file for BSS sections.
3359
2199fbe7
CC
33602013-04-15 Cary Coutant <ccoutant@google.com>
3361
3362 * script-sections.cc (Orphan_output_section): Reset address
3363 to zero after each orphaned section for relocatable links.
3364
502e8a84
CC
33652013-04-15 Cary Coutant <ccoutant@google.com>
3366
a4034750
AM
3367 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3368 section starting address for relocatable link.
3369 * testsuite/Makefile.am (script_test_11): New test.
3370 * testsuite/Makefile.in: Regenerate.
3371 * testsuite/script_test_11.c: New source file.
3372 * testsuite/script_test_11.t: New linker script.
502e8a84 3373
0cfdc767
AM
33742013-04-13 Alan Modra <amodra@gmail.com>
3375
3376 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3377 owner when sections are not adjacent and exceed group size.
3378 (Target_powerpc::group_sections): Handle corner case.
3379 (Target_powerpc::Branch_info::make_stub): Handle case where
3380 stub table doesn't exist due to branches in non-exec sections.
3381 (Target_powerpc::Relocate::relocate): Likewise.
3382
6830ee24
AM
33832013-04-11 Alan Modra <amodra@gmail.com>
3384
3385 PR gold/15354
3386 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3387 .branch_lt to match bfd ld. Adjust comments throughout file.
3388
54a3d865
ILT
33892013-04-04 Ian Lance Taylor <iant@google.com>
3390
3391 GCC PR c++/56840
3392 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3393 sections before checking whether they are included in the link.
3394
9993ba11
ST
33952013-03-29 Sriraman Tallam <tmsriram@google.com>
3396
3397 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3398 object before calling the plugin claim_file handler. Pass the elf
3399 object of the archive to the plugin. Delete the elf object if the
3400 plugin claims the file.
3401
ebacd51e
AM
34022013-03-21 Alan Modra <amodra@gmail.com>
3403
3404 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3405 segment when omagic.
3406
117be58f
AM
34072013-03-21 Alan Modra <amodra@gmail.com>
3408
3409 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3410 comparison warning.
3411 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3412 uninitialized" warning.
3413
32e2b61d
AM
34142013-03-20 Alan Modra <amodra@gmail.com>
3415
3416 * symtab.h (Symbol::clear_version): New function.
3417 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3418 is_needed by weak references. Clear version for symbols defined
3419 in as-needed objects that are not needed.
3420
b3ccdeb5
AM
34212013-03-15 Alan Modra <amodra@gmail.com>
3422
3423 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3424 static and public. Add report_err param. Return false for data refs.
3425 (Target_powerpc::rela_dyn_section): New overloaded function.
3426 (Target_powerpc::plt_, iplt_): Elucidate.
3427 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3428 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3429 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3430 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3431 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3432 push_branch and make_plt_entry for ifunc syms when
3433 reloc_needs_plt_for_ifunc.
3434 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3435 for ifunc unless reloc_needs_plt_for_ifunc.
3436
ad3d8a2f
AM
34372013-03-15 Alan Modra <amodra@gmail.com>
3438
3439 * gc.h (gc_process_relocs): Don't look through function descriptors.
3440 * icf.cc (get_section_contents): Do so here instead.
3441
4d9aa155
AM
34422013-03-13 Alan Modra <amodra@gmail.com>
3443
3444 * powerpc.cc (is_branch_reloc): Forward declare.
3445 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3446 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3447 false for 64-bit, true for 32-bit non-branch relocs.
3448 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3449 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3450 nm output.
3451 (icf_safe_test): Generate linker map file as well as nm output.
3452 (icf_safe_so_test): Likewise.
3453 * testsuite/Makefile.in: Regenerate.
3454 * testsuite/icf_test.sh: Parse linker map file to determine
3455 section folding.
3456 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3457 * testsuite/icf_safe_so_test.sh: Likewise.
3458 (X86_32_or_ARM_specific_safe_fold): Merge into..
3459 (arch_specific_safe_fold): ..this.
3460 (X86_64_specific_safe_fold): Delete unused function.
3461
57420c20
AM
34622013-03-12 Alan Modra <amodra@gmail.com>
3463
3464 * gc.h (gc_process_relocs): Look through function descriptors
3465 to determine shndx, symvalue and addend used by ICF. Tidy
3466 variable duplication.
3467
dc3714f3
AM
34682013-03-11 Alan Modra <amodra@gmail.com>
3469
3470 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3471 * layout.cc (Layout_task_runner::run): ..to here.
3472 * symtab.h (struct Symbol_location): Extract from..
3473 (class Symbol_table): ..here.
3474 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3475 * target.h (class Target): Add function_location and
3476 do_function_location functions.
3477 (class Sized_target): Add do_function_location.
3478 * object.h (class Sized_relobj_file): Move find_shdr..
3479 (class Object): ..to here.
3480 * object.cc: Likewise. Update to suit. Instantiate.
3481 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3482 * powerpc.cc (class Powerpc_dynobj): New.
3483 (Target_powerpc::do_function_location): New function.
3484 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3485 (Powerpc_dynobj::do_read_symbols): New function.
3486 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3487
956b03bb
ILT
34882013-03-08 Ian Lance Taylor <iant@google.com>
3489
3490 * options.cc (General_options::string_to_object_format): Accept
3491 "default".
3492
4bead2d5
AM
34932013-03-08 Alan Modra <amodra@gmail.com>
3494
3495 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3496 pointer to Post_fde.
3497 (struct Post_fde): Move definition to here..
3498 * ehframe.cc (struct Post_fde): ..from here.
3499 (Cie::write): Don't alloc Post_fde.
3500 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3501
02e60bf7
AM
35022013-03-07 Alan Modra <amodra@gmail.com>
3503
3504 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3505 relocation referencing .LC0.
3506 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3507
8343f03a
AM
35082013-03-07 Alan Modra <amodra@gmail.com>
3509
3510 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3511 always_inline. Add assembly for powerpc to avoid GOT.
3512
3366d57c
AM
35132013-03-07 Alan Modra <amodra@gmail.com>
3514
3515 * testsuite/script_test_10.sh: Don't test .bss section
3516 header number.
3517
6c77229c
AM
35182013-03-06 Alan Modra <amodra@gmail.com>
3519
3520 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3521 (Target_powerpc::symval_for_branch): Add symtab param. Update
3522 all callers. Handle folded sections.
3523 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3524 to Powerpc_relobj.
3525 (Global_symbol_visitor_opd::operator()): Likewise.
3526
a39e4af6
AM
35272013-03-04 Alan Modra <amodra@gmail.com>
3528
3529 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3530 * testsuite/Makefile.in: Regenerate.
3531
d5834edb
CC
35322013-03-01 Cary Coutant <ccoutant@google.com>
3533
3534 Add dwp support for v2 DWARF package file format.
3535 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3536 tu_length parameter. Adjust all callers.
3537 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3538 * dwp.cc: Include dwarf.h.
3539 (Section_bounds): New struct type.
3540 (Unit_set): New struct type.
3541 (Dwo_file::Dwo_file): Initialize new data member.
3542 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3543 Combine and rename to...
3544 (Dwo_file::read_unit_index): ...this.
3545 (Dwo_file::sized_read_compunit_index)
3546 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3547 (Dwo_file::sized_read_unit_index): ...this.
3548 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3549 parameters; add section_id parameter.
3550 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3551 (Dwo_file::add_unit_set): ...this.
3552 (Dwo_file::shndx_map_): Remove.
3553 (Dwo_file::sect_offsets_): New data member.
3554 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3555 (Dwp_output_file::add_section): Rename to...
3556 (Dwp_output_file::add_contribution): ...this.
3557 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3558 (Dwp_output_file::add_tu_set): Likewise.
3559 (Dwp_output_file::Contribution): New type.
3560 (Dwp_output_file::Section::contributions): New data member.
3561 (Dwp_output_file::Cu_or_tu_set): Remove.
3562 (Dwp_output_file::Section::Section): New ctor.
3563 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3564 (Dwp_output_file::Dwp_index::Section_table): New type.
3565 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3566 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3567 parameter.
3568 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3569 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3570 (Dwp_output_file::Dwp_index::section_table): New member function.
3571 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3572 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3573 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3574 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3575 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3576 (Dwp_output_file::Dwp_index::section_table_): New data member.
3577 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3578 (Dwp_output_file::add_output_section): New member function.
3579 (Dwp_output_file::write_new_section): New member function.
3580 (Dwp_output_file::write_contributions): New member function.
3581 (Dwp_output_file::section_id_map_): New data member.
3582 (class Dwo_id_info_reader): Remove.
3583 (class Unit_reader): New class.
3584 (get_dwarf_section_name): New function.
3585 (Dwo_file::read_executable): Adjust initializations of class data.
3586 (Dwo_file::read): Add support for v2 package file format.
3587 (Dwo_file::read_unit_index): Likewise.
3588 (Dwo_file::sized_read_unit_index): Likewise.
3589 (Dwo_file::copy_section): Likewise.
3590 (Dwo_file::add_unit_set): Likewise.
3591 (Dwp_output_file::add_output_section): Likewise.
3592 (Dwp_output_file::add_contribution): Likewise.
3593 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3594 for empty slot.
3595 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3596 file format.
3597 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3598 slot.
3599 (Dwp_output_file::initialize): Remove unused function.
3600 (Dwp_output_file::finalize): Add support for v2 package file format.
3601 (Dwp_output_file::write_index): Likewise.
3602 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3603 function prototype.
3604
a68a081d
CC
36052013-03-01 Cary Coutant <ccoutant@google.com>
3606
3607 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3608 function into class definition in header file.
3609 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3610 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3611 New function.
3612 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3613
9d5781f8
AM
36142013-02-28 Alan Modra <amodra@gmail.com>
3615
3616 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3617 * target.cc (Target::do_plt_fde_location): New function.
3618 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3619 accessor function, and constructor param.
3620 (struct Post_fde, Post_fdes): Declare.
3621 (Cie::write): Add post_fdes param.
3622 * ehframe.cc (Fde::write): Use plt_fde_location.
3623 (struct Post_fde): Define.
3624 (Cie::write): Stash FDEs added post merge mapping.
3625 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3626 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3627 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3628 other FDEs.
3629 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3630 (Target_powerpc::has_glink): New function.
3631 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3632 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3633 glink_eh_frame_fde_32, default_fde): New data.
3634 (Stub_table::eh_frame_added_): New var.
3635 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3636 Make const.
3637 (Stub_table::add_eh_frame): New function.
3638 (Output_data_glink::add_eh_frame): New function.
3639 (Target_powerpc::make_glink_section): Call add_eh_frame.
3640
214383dd
ILT
36412013-02-15 Ian Lance Taylor <iant@google.com>
3642
3643 * options.h (DEFINE_uint64_alias): Define.
3644 (class General_options): Add -Ttext-segment as an alias for
3645 -Ttext.
3646
91c2b899
AM
36472013-02-15 Alan Modra <amodra@gmail.com>
3648
3649 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3650 (Stub_table::do_write): ..here, two places.
3651 (Stub_table::plt_call_size): Use it here too.
3652
20e2a8aa
ILT
36532013-02-11 Ian Lance Taylor <iant@google.com>
3654
3655 * descriptors.cc (Descriptors::close_all): New function.
3656 * descriptors.h (class Descriptors): Declare close_all.
3657 (close_all_descriptors): New inline function.
3658 * plugin.cc: Include "descriptors.h".
3659 (Plugin_manager::cleanup): Call close_all_descriptors.
3660
8952bc69
AM
36612013-02-06 Alan Modra <amodra@gmail.com>
3662
3663 * README: Update coding style link.
3664
29bd8b6b
CC
36652013-01-28 Cary Coutant <ccoutant@google.com>
3666
a4034750
AM
3667 * dwp.cc (File_list): New typedef.
3668 (Dwo_name_info_reader): New class.
3669 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3670 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3671 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3672 (Dwo_file::read_executable): New function.
3673 (Dwo_file::read): Move common setup code to ...
3674 (Dwo_file::make_object): ... here.
3675 (dwp_options): Add --exec/-e.
3676 (usage): Likewise.
3677 (main): Likewise.
29bd8b6b 3678
c6ac678d
ST
36792013-01-24 Sriraman Tallam <tmsriram@google.com>
3680
3681 * layout.cc (Layout::layout): Check for option text_reorder.
3682 (Layout::make_output_section): Ditto.
3683 * options.h (text_reorder): New option.
3684 * output.cc (Input_section_sort_compare): Remove special ordering
3685 of section names.
3686 (Output_section::
3687 Input_section_sort_section_name_special_ordering_compare::
3688 operator()): New function.
3689 (Output_section::sort_attached_input_sections): Use new sort function
3690 for .text.
3691 * output.h (Input_section_sort_section_name_special_ordering_compare):
3692 New struct.
3693 * testsuite/Makefile.am (text_section_grouping): Test option
3694 --no-text-reorder
3695 * testsuite/Makefile.in: Regenerate.
3696 * testsuite/text_section_grouping.sh: Check order of functions without
3697 default text reordering.
3698
50701cc1
MF
36992013-01-18 Mike Frysinger <vapier@gentoo.org>
3700
3701 * options.h (General_options): Change default to true for new_dtags.
3702
b1b00fcc
MF
37032013-01-18 Mike Frysinger <vapier@gentoo.org>
3704
3705 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3706 when enable_new_dtags is false. Only add DT_RUNPATH when
3707 enable_new_dtags is true.
3708
ec5b8187
AM
37092013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3710
3711 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3712 used in declaration and definition consistent.
3713 (Target_powerpc::symval_for_branch): Ditto.
3714
a880d4c4
ST
37152013-01-16 Sriraman Tallam <tmsriram@google.com>
3716
3717 * testsuite/plugin_final_layout.cc: Fix comment.
3718
7c381248
ST
37192013-01-16 Sriraman Tallam <tmsriram@google.com>
3720
3721 * layout.cc (Layout::layout): Do not do default sorting for
3722 text sections when section ordering is specified.
3723 (make_output_section): Ditto.
3724 * testsuite/plugin_final_layout.cc: Name the function sections
3725 to catch reordering issues.
3726
e2458743
AM
37272013-01-15 Alan Modra <amodra@gmail.com>
3728
3729 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3730 plt-thread-safe.
3731
431ed302
AM
37322013-01-15 Alan Modra <amodra@gmail.com>
3733
3734 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3735 * testsuite/Makefile.in: Regenerate.
3736
0ec6429b
AM
37372013-01-14 Alan Modra <amodra@gmail.com>
3738
3739 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3740 * testsuite/Makefile.in: Regenerate.
3741
0bf402d5
ILT
37422013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3743
36af3926 3744 PR bfd/14430
0bf402d5
ILT
3745 Fix mingw gold build with plugins enabled
3746 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3747 * configure.ac: Export DLOPEN_LIBS and add headers check.
3748 * plugin.cc: Handle non-dlfcn case.
3749 * Makefile.in: Regenerate.
3750 * config.in: Regenerate.
3751 * configure: Regenerate.
3752 * testsuite/Makefile.in: Regenerate.
3753
9e9143bc
ST
37542013-01-09 Sriraman Tallam <tmsriram@google.com>
3755
3756 * output.h (sort_attached_input_sections): Change to be public.
3757 * script-sections.cc
3758 (Output_section_definition::set_section_addresses): Sort
3759 attached input sections according to section order before linker
3760 script assigns section addresses.
3761 (Orphan_output_section::set_section_addresses): Sort
3762 attached input sections according to section order before linker
3763 script assigns section addresses.
3764 * Makefile.am (final_layout.sh): Use a simple linker script to
3765 check if section ordering still works.
3766 * Makefile.in: Regenerate.
3767
679af368
ILT
37682013-01-09 Ben Cheng <bccheng@google.com>
3769
3770 * arm.cc (Target_arm::attributes_accept_div): New function.
3771 (Target_arm::attributes_forbid_div): New function.
3772 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3773 attribute using the same new functions as what bfd/elf32_arm.c
3774 does.
3775
3136a00e
CC
37762013-01-07 Cary Coutant <ccoutant@google.com>
3777
3778 PR gold/14993
3779 * output.cc (Output_section::add_input_section): For incremental
3780 updates, don't track input sections that are allocated from patch
3781 space.
3782
f2a6224b
L
37832013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3784 Ian Lance Taylor <iant@google.com>
3785
3786 PR gold/14897
3787 * configure.ac (--enable-ld): Removed.
3788 (install_as_default): Set to yes only for --enable-gold=default
3789 or --disable-ld.
3790 * configure: Regenerated.
3791
4f46f626
L
37922013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3793
3794 * options.h (General_options): Add -fuse-ld= for GCC linker
3795 option compatibility.
3796
26e4ef59
CC
37972013-01-04 Cary Coutant <ccoutant@google.com>
3798
3799 * configure.ac: Fix typo restoring CXXFLAGS.
3800 * configure: Regenerate.
3801
3d587466
CC
38022013-01-04 Cary Coutant <ccoutant@google.com>
3803
4f46f626
L
3804 * testsuite/Makefile.am (CXXLINK_S): New macro.
3805 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3806 * testsuite/Makefile.in: Regenerate.
3d587466 3807
44db6695
L
38082013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3809
3810 * version.cc (print_version): Update copyright year to 2013.
3811
edcac0c1
ILT
38122012-12-20 Ian Lance Taylor <iant@google.com>
3813
3814 * layout.cc (Layout::special_ordering_of_input_section): New
3815 function.
3816 (Layout::layout): If input section requires special ordering, must
3817 sort input sections.
3818 (Layout::make_output_section): May sort .text input sections.
3819 (Layout::is_section_name_prefix_grouped): Remove.
3820 * layout.h (class Layout): Declare
3821 special_ordering_of_input_section. Don't declare
3822 is_section_name_prefix_grouped.
3823 * output.cc (Output_section::add_input_section): Revert last
3824 change.
3825 (Output_section::Input_section_sort::match_file_name): Don't crash
3826 if called on output section data.
3827 (Output_section::Input_section_sort_compare): Sort based on
3828 special ordering.
3829 (Output_section::Input_section_sort_section_order_index_compare):
3830 Revert last patch.
3831 (Output_section::sort_attached_input_sections): Likewise.
3832
28f2a4ac
ST
38332012-12-18 Sriraman Tallam <tmsriram@google.com>
3834
edcac0c1 3835 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3836 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3837 * output.cc (Output_section::add_input_section): Check if section
3838 name contains special prefix. Keep input sections to sort such
3839 sections.
3840 (Output_section::Input_section_sort_section_order_index_compare
3841 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3842 (Output_section::sort_attached_input_sections): Add condition to
3843 Input_section_entry constructor call.
28f2a4ac
ST
3844 * testsuite/Makefile.am (text_section_grouping): New test.
3845 * testsuite/Makefile.in: Regenerate.
3846 * testsuite/text_section_grouping.cc: New file.
3847 * testsuite/text_section_grouping.sh: New file.
3848
5bf135a7
NC
38492012-12-17 Nick Clifton <nickc@redhat.com>
3850
3851 * Makefile.am: Add copyright notice.
3852 * NEWS: Likewise.
3853 * README: Likewise.
3854 * configure.ac: Likewise.
3855 * ftruncate.c: Likewise.
3856 * Makefile.in: Regenerate.
3857
59965708
CC
38582012-12-14 Cary Coutant <ccoutant@google.com>
3859
a4034750
AM
3860 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3861 --no-as-needed flag.
3862 (exception_separate_shared_12_test): Likewise.
3863 (incremental_copy_test): Likewise.
3864 * testsuite/Makefile.in: Regenerate.
59965708 3865
2a77e2ab
CC
38662012-12-14 Cary Coutant <ccoutant@google.com>
3867
3868 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3869 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3870
e3deeb9c
AM
38712012-12-12 Alan Modra <amodra@gmail.com>
3872
3873 * powerpc.cc (class Track_tls): New.
3874 (class Relocate, class Scan): Inherit Track_tls.
3875 (Target_powerpc::Scan::local, global): Track tls optimization
3876 and avoid creating plt entry for __tls_get_addr if all uses
3877 are optimized away.
3878 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3879
d8f5a274
AM
38802012-12-12 Alan Modra <amodra@gmail.com>
3881
3882 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3883 Replace no_toc_optimize with toc_optimize.
3884 * output.h (Output_section::input_sections): Provide non-const variant.
3885 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3886 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3887 accessors.
3888 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3889 (class Sort_toc_sections): New.
3890 (Target_powerpc::do_finalize_sections): Sort toc sections.
3891 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3892
4c8a1de1
RM
38932012-12-10 Roland McGrath <mcgrathr@google.com>
3894
3895 * testsuite/binary_unittest.cc (read_all): New function.
3896 (Sized_binary_test): Use it instead of ::read.
3897 * fileread.cc (do_read): Don't assume pread always reads the whole
3898 amount in a single call.
3899
edc27beb
AM
39002012-12-10 Alan Modra <amodra@gmail.com>
3901
3902 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3903 Set EM_PPC64 or EM_PPC here.
3904 (Target_selector_powerpc::do_recognize): Delete.
3905
906b9150
AM
39062012-12-10 Alan Modra <amodra@gmail.com>
3907
3908 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3909 stub_table_.
3910 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3911
418c15ae
RM
39122012-12-07 Roland McGrath <mcgrathr@google.com>
3913
3914 * testsuite/binary_unittest.cc (Sized_binary_test):
3915 Use open_descriptor rather than ::open.
3916
decdd3bc
AM
39172012-12-07 Alan Modra <amodra@gmail.com>
3918
3919 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3920 typedef and invalid_address constant.
3921 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3922 instantiate constants.
3923
db399005
ILT
39242012-12-06 Roland McGrath <mcgrathr@google.com>
3925
3926 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3927 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3928 * aclocal.m4: Regenerate.
3929 * configure: Regenerate.
3930 * Makefile.in: Regenerate.
3931 * testsuite/Makefile.in: Regenerate.
3932
aba6bc71
AM
39332012-12-07 Alan Modra <amodra@gmail.com>
3934
3935 * options.h (General_options): Add no_toc_optimize.
3936 * powerpc.cc (ok_lo_toc_insn): New function.
3937 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3938
9e69ed50
AM
39392012-12-06 Alan Modra <amodra@gmail.com>
3940
3941 * options.h (General_options): Add plt_align, plt_static_chain,
3942 plt_thread_safe. Update stub_group_size help text.
3943 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3944 for new plt_thread_safe_ var.
3945 (use_plt_offset): Correct comments.
3946 (Target_powerpc::do_relax): Look for thread creation symbols to
3947 determine default plt_thread_safe value. Clear plt call stubs
3948 as well as branch stubs each iteration.
3949 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3950 insn constants.
3951 (l, hi, ha, write_insn): Move earlier.
3952 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3953 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3954 plt stubs too.
3955 (Stub_table::update_size): Adjust.
3956 (Stub_table::prev_size, set_prev_size): Delete.
3957 (Stub_table::stub_align): Let --plt-align affect result.
3958 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3959 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3960 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3961 (Stub_table::do_write): Support more stub variants.
3962
f43ba157
AM
39632012-12-04 Alan Modra <amodra@gmail.com>
3964
3965 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3966 (Target_powerpc::do_define_standard_symbols): New function.
3967
34171bc5
AM
39682012-12-03 Alan Modra <amodra@gmail.com>
3969
3970 * output.h: Formatting, whitespace.
3971
dc9589e9 39722012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3973
3974 * layout.h (Layout::get_executable_sections): Declare.
3975 * layout.cc (Layout::get_executable_sections): New function.
3976 * arm.cc (Target_arm::group_sections): Use it.
3977 (Arm_output_section::group_sections): Delete now redundant test.
3978 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3979 param to handle relative relocs.
3980 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3981 (Output_data_reloc::add_absolute): Adjust.
3982 (Output_data_reloc::add_relative): New function.
3983 (Output_data::reset_data_size): New function.
3984 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3985 (Output_section::set_addralign): New function.
3986 (Output_section::checkpoint_set_addralign): New function.
3987 (Output_section::clear_section_offsets_need_adjustment): New function.
3988 (Output_section::input_sections): Make public.
3989 * powerpc.cc (class Output_data_brlt_powerpc): New.
3990 (class Stub_table, class Stub_control): New.
3991 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3992 stub_table_, set_stub_table, stub_table): New vectors and accessor
3993 functions.
3994 (Target_powerpc::do_may_relax, do_relax, push_branch,
3995 new_stub_table, stub_tables, brlt_section, group_sections,
3996 add_branch_lookup_table, find_branch_lookup_table,
3997 write_branch_lookup_table, make_brlt_section): New functions.
3998 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3999 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4000 branch_info_): New vars.
4001 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4002 make call stubs here.
4003 (Output_data_glink): Remove all call stub handling from this class.
4004 (Target_powerpc::Scan::local, global): Save interesting branch
4005 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4006 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4007 functions on final link.
4008 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4009 Handle long branch destinations too.
4010 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4011 do_plt_address_for_local): Adjust lookup of plt call stubs.
4012
627b30b7
AM
40132012-11-30 Alan Modra <amodra@gmail.com>
4014
4015 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4016 relocs against protected symbols when building 32-bit shared libs.
4017
40b469d7
AM
40182012-11-30 Alan Modra <amodra@gmail.com>
4019
4020 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4021 param. Call got_section() to make .got. Update all callers
4022 and their callers and so on.
4023
bb66a627
AM
40242012-11-30 Alan Modra <amodra@gmail.com>
4025
4026 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4027 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4028 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4029 value if it already exists.
4030
d2cf1c6c
L
40312012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4032
4033 PR gold/14858
4034 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4035
edccdf7c
RM
40362012-11-14 Roland McGrath <mcgrathr@google.com>
4037
4038 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4039 than bfc instruction for data sandboxing.
4040
6febeb74
AM
40412012-11-08 Alan Modra <amodra@gmail.com>
4042
4043 * po/POTFILES.in: Regenerate.
4044
0a6f1bf2
AM
40452012-11-05 Alan Modra <amodra@gmail.com>
4046
4047 * configure.ac: Apply 2012-09-10 change to config.in here.
4048 * configure: Regenerate.
4049
26a4e9cb
AM
40502012-11-05 Alan Modra <amodra@gmail.com>
4051
4052 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4053 (struct Opd_ent): Use "Address" rather than "Offset".
4054 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4055 (Target_powerpc::got_section): Make public.
4056 (Target_powerpc::scan_relocs): Move code setting symbols..
4057 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4058 Create _SDA_BASE_ only when referenced.
4059
cc928013
RM
40602012-11-02 Roland McGrath <mcgrathr@google.com>
4061
4062 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4063 from last change.
4064
50ed5eb1
RM
40652012-11-01 Roland McGrath <mcgrathr@google.com>
4066
62fe925a
RM
4067 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4068 for offset_in_output_section parameter.
4069 (Sized_target::relocate_special_relocatable): Likewise.
4070 * arm.cc (Target_arm::relocate_relocs): Likewise.
4071 (Target_arm::relocate_special_relocatable): Likewise.
4072 * i386.cc (Target_i386::relocate_relocs): Likewise.
4073 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4074 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4075 * target-reloc.h (relocate_relocs): Likewise.
4076 * testsuite/testfile.cc (Target_test): Likewise.
4077 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4078 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4079
4080 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4081 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4082
4083 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4084 parameter, which is unused in the [!F_SETFD] case.
4085
50ed5eb1
RM
4086 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4087 SYMNDX to off_t before comparing it to this->data_size().
4088 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4089 * incremental.cc (Output_section_incremental_inputs::do_write):
4090 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4091
2cadc0bf
RM
4092 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4093
3bfcb652
NC
40942012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4095
4096 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4097 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4098 in EABI_VER5.
4099
c1a8d56e
CC
41002012-10-29 Cary Coutant <ccoutant@google.com>
4101
4102 * dwp.cc (usage): Add file and exit status parameters;
4103 add --help and --version options.
4104 (print_version): New function.
4105 (main): Add --help and --version options.
4106
b2490a7b
L
41072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4108
4109 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4110 final_layout_sequence.txt.
4111 * testsuite/Makefile.in: Regenerated.
4112
aa543512
L
41132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4114
4115 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4116 COMPILE generated by automake.
4117 (LINK1): Likewise.
4118 (CXXCOMPILE1): Likewise.
4119 (CXXLINK1): Likewise.
4120 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4121 (LINK): Likewise.
4122 (CXXCOMPILE): Likewise.
4123 (CXXLINK): Likewise.
4124 * testsuite/Makefile.in: Regenerated.
4125
d361fafb
L
41262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4127
4128 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4129 on bad fwrite return.
4130
598c7410
L
41312012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4132
4133 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4134 on val.
4135
35c813e2
CC
41362012-10-23 Cary Coutant <ccoutant@google.com>
4137
4138 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4139 * testsuite/Makefile.in: Regenerate.
4140 * testsuite/dwp_test.h: New source file.
4141 * testsuite/dwp_test_1.cc: New source file.
4142 * testsuite/dwp_test_1.s: New source file.
4143 * testsuite/dwp_test_1.sh: New source file.
4144 * testsuite/dwp_test_1b.cc: New source file.
4145 * testsuite/dwp_test_1b.s: New source file.
4146 * testsuite/dwp_test_2.cc: New source file.
4147 * testsuite/dwp_test_2.s: New source file.
4148 * testsuite/dwp_test_2.sh: New source file.
4149 * testsuite/dwp_test_main.cc: New source file.
4150 * testsuite/dwp_test_main.s: New source file.
4151
77429909
CC
41522012-10-23 Cary Coutant <ccoutant@google.com>
4153
4154 * dwp.h: New header file.
4155 * dwp.cc: New source file.
4156 * gold.h: Move shared declarations to system.h.
4157 * system.h: New header file.
4158 * Makefile.am: Add dwp.
4159 * Makefile.in: Regenerate.
4160
ed5d6712
CC
41612012-10-23 Cary Coutant <ccoutant@google.com>
4162
4163 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4164 Dwarf_info_reader::read_from_pointer.
4165 (Dwarf_pubnames_table::read_header): Likewise.
4166 (Dwarf_pubnames_table::next_name): Likewise.
4167 (Dwarf_die::read_attributes): Likewise.
4168 (Dwarf_die::skip_attributes): Likewise.
4169 (Dwarf_info_reader::read_from_pointer): New function template.
4170 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4171 (Dwarf_pubnames_table): Likewise.
4172 (Dwarf_info_reader::read_from_pointer): New function template.
4173 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4174 Dwarf_pubnames_table ctor.
4175
8787852d
CC
41762012-10-23 Cary Coutant <ccoutant@google.com>
4177
4178 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4179 abbrev_shndx.
4180 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4181 abbrev_shndx_.
4182 (Dwarf_info_reader::set_abbrev_shndx): New method.
4183 (Dwarf_info_reader::abbrev_shndx_): New data member.
4184
9fc236f3
CC
41852012-10-23 Cary Coutant <ccoutant@google.com>
4186
4187 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4188 from object, not parameters.
4189 (Dwarf_info_reader::parse): Likewise.
4190 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4191 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4192 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4193 methods.
4194
effe8365
CC
41952012-10-23 Cary Coutant <ccoutant@google.com>
4196
4197 * fileread.cc (Input_file::Input_file): New constructor.
4198 * fileread.h (class Input_file): Add new constructor.
4199
1698990d
AM
42002012-10-18 Alan Modra <amodra@gmail.com>
4201
4202 PR gold/14727
4203 * object.cc (Relobj::is_section_name_included): Also match
4204 .sdata personality section.
4205
168a4726
AM
42062012-10-18 Alan Modra <amodra@gmail.com>
4207
4208 * target-reloc.h (class Default_comdat_behavior): New, package up..
4209 (get_comdat_behaviour): ..this.
4210 (relocate_section): Add Relocate_comdat_behavior template arg,
4211 adjust code to suit.
4212 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4213 (Target_arm::scan_reloc_section): Likewise.
4214 * i386.cc (Target_i386::relocate_section): Likewise.
4215 * sparc.cc (Target_sparc::relocate_section): Likewise.
4216 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4217 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4218 * powerpc.cc (class Relocate_comdat_behavior): New.
4219 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4220 gold::relocate_section with new template arg.
4221
acc276d8
AM
42222012-10-18 Alan Modra <amodra@gmail.com>
4223
4224 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4225 dynamic relocs for GOT_TPREL got entries, without symbol if
4226 resolving locally.
4227 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4228 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4229 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4230
e10f9870
AM
42312012-10-17 Alan Modra <amodra@gmail.com>
4232
4233 PR gold/14726
4234 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4235
ae034989
ST
42362012-10-16 Sriraman Tallam <tmsriram@google.com>
4237
4238 * layout.cc (Layout::include_section): Keep sections marked
4239 SHF_EXCLUDE when doing relocatable links.
4240
f3a0ed29
AM
42412012-10-16 Alan Modra <amodra@gmail.com>
4242
4243 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4244 (Target_powerpc::do_finalize_sections): Call it.
4245 (Output_data_save_res): New class and supporting functions.
4246 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4247 normal symbols defined in object files.
4248
c6de8ed4
AM
42492012-10-12 Alan Modra <amodra@gmail.com>
4250
4251 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4252 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4253 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4254 section if scan_opd_relocs not yet called.
4255 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4256
03e25981
AM
42572012-10-12 Alan Modra <amodra@gmail.com>
4258
4259 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4260 add_local_ifunc_entry): Revert last change.
4261 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4262
c9824451
AM
42632012-10-05 Alan Modra <amodra@gmail.com>
4264
4265 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4266 do_plt_address_for_global): New functions.
4267 (Output_data_got_powerpc::do_write): Don't segfault when linking
4268 statically.
4269 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4270 add_local_ifunc_entry): Return true on adding entry..
4271 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4272 glink->add_entry call. Remove unused symtab param. Adjust calls.
4273 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4274 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4275 set up symbols here.
4276 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4277 syms here. Do so even when no .iplt. Don't segfault when linking
4278 statically.
4279 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4280 new variants without reloc param.
4281 (Glink_sym_ent::Glink_sym_ent): Likewise.
4282 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4283 reloc when refs will resolve to plt call stub.
4284 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4285 R_PPC_PLTREL24 to resolve locally.
4286 (Target_powerpc::Scan::global): Correct ifunc handling.
4287 (Target_powerpc::Relocate::relocate): Correct local sym glink
4288 lookup. Don't destroy "value" when we have a plt call stub,
4289 and when checking plt call validity.
4290 (Target_powerpc::do_dynsym_value): Simplify.
4291
19fec8c1
AM
42922012-10-05 Alan Modra <amodra@gmail.com>
4293
4294 * i386.cc (Output_data_plt_i386::address_for_global,
4295 address_for_local): Add plt offset to returned value. Adjust uses.
4296 * sparc.cc (Output_data_plt_sparc::address_for_global,
4297 address_for_local): Likewise.
4298 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4299 address_for_local): Likewise.
4300 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4301 address_for_local): Likewise.
4302 * target.h (Target::plt_address_for_global, plt_address_for_local):
4303 Update comment.
4304 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4305 (Output_data_got::Got_entry::write): Nor here.
4306 * output.h: Comment fix.
4307
e867b647
WL
43082012-10-02 Jiong Wang <jiwang@tilera.com>
4309
4310 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4311 global_offset_table_ value for larget got.
4312 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4313
e5d5f5ed
AM
43142012-09-29 Alan Modra <amodra@gmail.com>
4315
4316 * powerpc.cc (Target_powerpc::iplt_): New output section.
4317 (Target_powerpc::iplt_section, make_iplt_section,
4318 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4319 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4320 Target_powerpc::plt_entry_count): Count iplt entries too.
4321 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4322 reloc section in constructor. New params.
4323 (Target_powerpc::make_plt_section): Create reloc section here instead.
4324 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4325 functions.
4326 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4327 (Output_data_glink::add_entry, find_entry): New functions to
4328 deal with local syms.
4329 (Glink_sym_ent): Add support for local syms.
4330 (Output_data_glink::do_write): Handle ifunc plt entries.
4331 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4332 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4333 (Target_powerpc::Relocate::relocate): Likewise.
4334 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4335
ec4dbad3
AM
43362012-09-25 Alan Modra <amodra@gmail.com>
4337
4338 * object.h (Sized_relobj_file::adjust_local_symbol,
4339 do_adjust_local_symbol): New functions.
4340 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4341 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4342 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4343 and irregular opd entry spacing.
4344 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4345 (Global_symbol_visitor_opd): New functor.
4346 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4347 on deleted opd entries.
4348
5c0b3823
WL
43492012-09-15 Jiong Wang <jiwang@tilera.com>
4350
4351 * tilegx.cc: New file.
4352 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4353 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4354 * configure.tgt: Add entries for tilegx*.
4355 * configure.ac: Likewise.
4356 * Makefile.in: Rebuild.
4357 * configure: Likewise.
4358 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4359 tilegx.
4360
bfdfa4cd
AM
43612012-09-13 Alan Modra <amodra@gmail.com>
4362
4363 * target-reloc.h (scan_relocs): Call scan.local for relocs
4364 against symbols in discarded sections. Pass is_discarded
4365 param.
4366 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4367 Add is_discarded param.
4368 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4369 is_discarded to flag opd entry as discarded. Don't emit dyn
4370 relocs on such entries.
4371 (Target_powerpc::Scan::global): Similarly detect and handle
4372 such opd entries.
4373 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4374 opd_ent_. Update all uses.
4375 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4376 (Target_powerpc::relocate_section): Zero out discarded opd
4377 entry relocs.
4378
d77a0555
ILT
43792012-09-12 Ian Lance Taylor <iant@google.com>
4380
4381 PR gold/14570
4382 * output.cc: Rename Output_data_got template parameter from size
4383 to got_size for all functions. Compile all variants of
4384 Output_data_got.
4385 (Output_data_got::Got_entry::write): Correct use of size for
4386 symbol value. Use local_is_tls rather than casting to
4387 Sized_relobj_file.
4388 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4389 (class Sized_relobj_file): Add do_local_is_tls.
4390 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4391
815a1205
AM
43922012-09-11 Alan Modra <amodra@gmail.com>
4393
4394 PR gold/14566
4395 * layout.cc (Layout::set_segment_offsets): When using
4396 common-page-size alignment, ensure we are on a new max-page-size
4397 page.
4398 * output.cc (Output_segment::set_section_addresses): Use
4399 abi_pagesize, not common_pagesize for relro boundary.
4400 (Output_segment::set_offset): Likewise.
4401
bd73a62d
AM
44022012-09-11 Alan Modra <amodra@gmail.com>
4403
4404 * output.h (Output_data_got::add_global_tls, add_local_tls,
4405 add_local_tls_pair): New functions.
4406 (Output_data_got::add_local_pair_with_rel): Remove second
4407 reloc param. Expand comment.
4408 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4409 use_plt_or_tls_offset_, similarly for constructor param.
4410 (Output_data_got::Got_entry::write): Add got_index param.
4411 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4412 add_local_tls_pair): New functions.
4413 (Output_data_got::Got_entry::write): Handle tls symbols
4414 with use_plt_or_tls_offset_ set specially.
4415 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4416 (Output_data_got::do_write): Replace iterator with index, pass
4417 index to entry write function.
4418 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4419 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4420 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4421 call.
4422 * i386.cc (Target_i386::Scan::local): Likewise.
4423 * sparc.cc (Target_sparc::Scan::local): Likewise.
4424 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4425 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4426 do_tls_offset_for_global): New functions.
4427 (Target_powerpc::Scan::local): Correct TLS relocations and got
4428 entry values.
4429 (Target_powerpc::Scan::global): Don't emit unnecessary
4430 dynamic relocations on TLS GOT entries.
4431
00716ab1
AM
44322012-09-10 Matthias Klose <doko@ubuntu.com>
4433
4434 * config.in: Disable sanity check for kfreebsd.
4435
c891b3f9
SA
44362012-09-10 Sterling Augustine <saugustine@google.com>
4437
4438 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4439 (Gdb_index::pubtypes_read): New parameter.
4440 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4441 to calls.
4442 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4443 pubtypes_object_.
4444
e81fea4d
AM
44452012-09-09 Alan Modra <amodra@gmail.com>
4446
4447 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4448 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4449 * gc.h (gc_process_relocs): Call target gc_add_reference.
4450 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4451 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4452 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4453 unnecessary cast.
4454 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4455 to cater for when we don't need code offset. Update use.
4456 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4457 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4458 set_opd_valid): New functions.
4459 (Target_powerpc::do_gc_add_reference): New function.
4460 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4461 stashed refs.
4462 (Target_powerpc::do_gc_mark_symbol): New function.
4463
d2d60eef
CC
44642012-09-06 Cary Coutant <ccoutant@google.com>
4465
4466 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4467 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4468 (Dwarf_die::skip_attributes): Likewise.
4469 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4470 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4471 (main): Call it.
4472 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4473
32ed4573
L
44742012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4475
4476 * testsuite/script_test_3.t: Add .got.plt output section
4477 statement.
4478 * testsuite/script_test_4.t: Likewise.
4479
f4baf0d4
AM
44802012-09-05 Alan Modra <amodra@gmail.com>
4481
4482 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4483 update all uses and lose "enum" when using type.
4484
864a1b56
AM
44852012-09-05 Alan Modra <amodra@gmail.com>
4486
4487 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4488 * configure: Regenerate.
4489 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4490 (plugin_final_layout.stdout): Likewise.
4491 (memory_test): Set page sizes to 0x1000.
4492 * testsuite/Makefile.in: Regenerate.
4493 * testsuite/discard_locals_test.sh: Add FIXME comment.
4494 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4495 * testsuite/pr14265.t: Add .got output section statement.
4496 * testsuite/script_test_2.t: Likewise.
4497 * testsuite/script_test_3.t: Likewise.
4498 * testsuite/script_test_4.t: Likewise.
4499 * testsuite/script_test_5.t: Likewise.
4500 * testsuite/script_test_6.t: Likewise.
4501 * testsuite/script_test_7.t: Likewise.
4502 * testsuite/script_test_9.t: Likewise.
4503
3ea0a085
AM
45042012-09-05 Alan Modra <amodra@gmail.com>
4505
4506 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4507 (Powerpc_relocate_functions::Status): New typedef.
4508 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4509 (Target_powerpc::Scan::local): Handle REL64.
4510 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4511 for REL32 and REL64.
4512 (Target_powerpc::symval_for_branch): New function, extracted from..
4513 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4514 checks. Report overflow errors.
4515
7404fe1b
AM
45162012-09-05 Alan Modra <amodra@gmail.com>
4517
4518 * object.h (Sized_relobj_file::emit_relocs): Delete.
4519 (Sized_relobj_file::emit_relocs_reltype): Delete.
4520 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4521 relocate_relocs for --emit-relocs.
4522 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4523 * output.h: Update comment.
4524 (Output_segment::first_section): New function.
4525 (Output_segment::first_section_load_address): Use first_section.
4526 * output.cc (Output_segment::first_section): New function extracted..
4527 (Output_segment::first_section_load_address): ..from here. Delete.
4528 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4529 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4530 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4531 adjust call to target.h function.
4532 * i386.cc (Target_i386): Likewise.
4533 * sparc.cc (Target_sparc): Likewise.
4534 * x86_64.cc (Target_x86_64): Likewise.
4535 * powerpc.cc (Target_powerpc): Likewise.
4536 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4537 first tls section has section symbol for optimised local dynamic
4538 output relocs.
4539 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4540 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4541 optimised tls code.
4542 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4543 Rename to relocate_relocs. Update error message.
4544
957564c9
AS
45452012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4546
4547 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4548 --just-symbols.
4549
dd93cd0a
AM
45502012-08-31 Alan Modra <amodra@gmail.com>
4551
4552 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4553 (Powerpc_relobj::toc_base_offset): New stub function.
4554 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4555 got_mod_index_offset to tlsld_got_offset. Update all refs.
4556 (Target_powerpc::Relocate::enum skip_tls): New.
4557 (Target_powerpc::call_tls_get_addr_): New var.
4558 (Target_powerpc::is_branch_reloc): Move to file scope.
4559 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4560 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4561 New functions.
4562 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4563 (powerpc_info): Correct common_pagesize for ppc64.
4564 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4565 (Powerpc_relocate_functions): Add overflow check enums and functions.
4566 Add non-shift version of rela, rela_ua. Delete all rel public
4567 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4568 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4569 addr16_ha3, addr14 functions.
4570 (Output_data_got_powerpc::add_constant_pair): New function.
4571 (Output_data_got_powerpc::got_base_offset): Likewise.
4572 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4573 (instruction constants): Sort, add some more.
4574 (Output_data_glink::do_write): Add and use Address typedef. Use
4575 object->toc_base_offset() stub for 64-bit.
4576 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4577 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4578 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4579 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4580 Always treat .opd relocs as against locally defined symbol.
4581 Correct condition for RELATIVE relocs.
4582 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4583 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4584 for 32-bit syms with a plt entry. Correct ppc64 toc base
4585 calculations. Handle TLS relocs, and more. Add overflow
4586 checking and adjust for Powerpc_relocate_functions changes.
4587 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4588 Reinstate --emit-relocs code with FIXME.
4589
a1373b60
AM
45902012-08-30 Alan Modra <amodra@gmail.com>
4591
4592 * layout.cc (Layout::set_segment_offsets): Set p_align to
4593 abi_pagesize, not common_pagesize.
4594 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4595 to determine whether file header can go in segment.
4596
703d02da
AM
45972012-08-30 Alan Modra <amodra@gmail.com>
4598
4599 * output.h (Output_reloc::Output_reloc <output section>): Add
4600 is_relative param. Adjust calls.
4601 (Output_reloc::add_output_section_relative): New functions.
4602 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4603 is_relative.
4604 (Output_reloc::symbol_value): Handle SECTION_CODE.
4605
16164a6b
ST
46062012-08-24 Sriraman Tallam <tmsriram@google.com>
4607
4608 * gold.cc (queue_middle_tasks): Call layout again when unique
4609 segments for sections is desired.
4610 * layout.cc (Layout::Layout): Initialize new members.
4611 (Layout::get_output_section_flags): New function.
4612 (Layout::choose_output_section): Call get_output_section_flags.
4613 (Layout::layout): Make output section for mapping to a unique segment.
4614 (Layout::insert_section_segment_map): New function.
4615 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4616 output sections marked so.
16164a6b
ST
4617 (Layout::segment_precedes): Check for unique segments when sorting.
4618 * layout.h (Layout::Unique_segment_info): New struct.
4619 (Layout::Section_segment_map): New typedef.
4620 (Layout::insert_section_segment_map): New function.
4621 (Layout::get_output_section_flags): New function.
4622 (Layout::is_unique_segment_for_sections_specified): New function.
4623 (Layout::set_unique_segment_for_sections_specified): New function.
4624 (Layout::unique_segment_for_sections_specified_): New member.
4625 (Layout::section_segment_map_): New member.
4626 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4627 Rename is_gc_pass_one to is_pass_one.
4628 Rename is_gc_pass_two to is_pass_two.
4629 Rename is_gc_or_icf to is_two_pass.
4630 Check for which pass based on whether symbols data is present.
4631 Make it two pass when unique segments for sections is desired.
4632 * output.cc (Output_section::Output_section): Initialize new
4633 members.
4634 * output.h (Output_section::is_unique_segment): New function.
4635 (Output_section::set_is_unique_segment): New function.
4636 (Output_section::is_unique_segment_): New member.
4637 (Output_section::extra_segment_flags): New function.
4638 (Output_section::set_extra_segment_flags): New function.
4639 (Output_section::extra_segment_flags_): New member.
4640 (Output_section::segment_alignment): New function.
4641 (Output_section::set_segment_alignment): New function.
4642 (Output_section::segment_alignment_): New member.
4643 (Output_segment::Output_segment): Initialize is_unique_segment_.
4644 (Output_segment::is_unique_segment): New function.
4645 (Output_segment::set_is_unique_segment): New function.
4646 (Output_segment::is_unique_segment_): New member.
4647 * plugin.cc (allow_unique_segment_for_sections): New function.
4648 (unique_segment_for_sections): New function.
4649 (Plugin::load): Add new functions to transfer vector.
4650 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4651 * Makefile.in: Regenerate.
4652 * testsuite/plugin_final_layout.sh: Check if unique segment
4653 functionality works.
4654 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4655 are available.
4656 (allow_unique_segment_for_sections): New global.
4657 (unique_segment_for_sections): New global.
4658 (claim_file_hook): Call allow_unique_segment_for_sections.
4659 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4660
1e2bee4f
CC
46612012-08-22 Cary Coutant <ccoutant@google.com>
4662
4663 * layout.cc (Layout::include_section): Don't assert on GROUP
4664 sections with --emit-relocs.
4665
1d5dfe78
CC
46662012-08-21 Cary Coutant <ccoutant@google.com>
4667
4668 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4669 if --export-dynamic-symbol names an undef symbol.
4670
c9269dff
AM
46712012-08-18 Alan Modra <amodra@gmail.com>
4672
4673 * powerpc.cc: Formatting and white space.
4674 (Powerpc_relobj): Rename got2_section_ to special_.
4675 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4676 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4677 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4678 (Target_powerpc): Add Address typedef and invalid_address. Use
4679 throughout.
4680 (Target_powerpc::is_branch_reloc): New function.
4681 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4682 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4683 for dst_mask, value and addend.
4684 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4685 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4686 (Output_data_glink::do_write): Correct toc base. Don't try to use
4687 uint16_t for 24-bit offset. Use get_output_section_offset and
4688 check return.
4689 (Target_powerpc::Scan::local): Handle more relocs.
4690 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4691 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4692 Plug in toc restoring insn after plt calls. Translate branches
4693 to function descriptor symbols to corresponding entry point.
4694 (Target_powerpc::relocate_for_relocatable): Check return from
4695 get_output_section_offset.
4696 * symtab.h: Comment typo.
4697
b1759dce
ILT
46982012-08-14 Ian Lance Taylor <iant@google.com>
4699
4700 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4701 unsupported_relocal_local to call unsupported_reloc_global.
4702
b9b2ae8b
NC
47032012-08-14 Nick Clifton <nickc@redhat.com>
4704
4705 PR ld/14265
4706 * script-sections.cc (Sections_element::output_section_name): Add
4707 keep return parameter.
4708 (Output_section_element::match_name): Add keep return parameter.
4709 Return the value of the keep_ member.
4710 * script-sections.h (class Output_section): Update
4711 output_section_name prototype.
4712 * layout.cc (Layout::keep_input_section): New public member
4713 function.
4714 (Layout::choose_output_section): Pass keep parameter to
4715 output_section_name.
4716 * layout.h (class Layout): Add keep_input_section.
4717 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4718 sections.
4719 * testsuite/Makefile.am: Add a test.
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/pr14265.c: Source file for the test.
4722 * testsuite/pr14265.t: Linker script for the test.
4723 * testsuite/pr14265.sh: Shell script for the test.
4724
921b5322
AM
47252012-08-14 Alan Modra <amodra@gmail.com>
4726
4727 * target.h (Target::output_section_name): New function.
4728 (Target::do_output_section_name): New function.
4729 * layout.cc (Layout::choose_output_section): Call the above.
4730 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4731
6ce78956
AM
47322012-08-14 Alan Modra <amodra@gmail.com>
4733
4734 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4735 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4736 for replace_constant call.
4737 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4738 (Output_data_glink::do_print_to_mapfile): New function.
4739 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4740 (Target_powerpc::Relocate::relocate): Likewise.
4741
d1a8cabd
AM
47422012-08-14 Alan Modra <amodra@gmail.com>
4743
4744 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4745 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4746 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4747 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4748 all references to shndx_. Handle special case for R_PPC_PLTREL24
4749 here.
4750 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4751 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4752 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4753 here.
4754 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4755 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4756
d83ce4e3
AM
47572012-08-12 Alan Modra <amodra@gmail.com>
4758
4759 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4760 (glink insn constants): Use uint32_t.
4761 (Output_data_glink::add_entry): Use insert, not [] operator.
4762
cf43a2fe
AM
47632012-08-11 Alan Modra <amodra@gmail.com>
4764
4765 * object.h (Sized_relobj_file::find_shdr): New function.
4766 (Sized_relobj_file::find_special_sections): New function.
4767 * object.cc (Sized_relobj_file::find_shdr): New function.
4768 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4769 (Sized_relobj_file::find_special_sections): New function, split out..
4770 (Sized_relobj_file::do_read_symbols): ..from here.
4771 * output.h (Output_data_got::replace_constant): New function.
4772 (Output_data_got::num_entries): New function.
4773 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4774 (Output_data_got::got_offset): Protected rather than private.
4775 (Output_data_got::replace_got_entry): New function.
4776 * output.cc (Output_data_got::replace_got_entry): New function.
4777 * powerpc.cc (class Powerpc_relobj): New.
4778 (class Powerpc_relocate_functions): Delete all psymval variants or
4779 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4780 Implement _ha functions using corresponding _hi function.
4781 (Powerpc_relobj::find_special_sections): New function.
4782 (Target_powerpc::do_make_elf_object): New function.
4783 (class Output_data_got_powerpc): New.
4784 (class Output_data_glink): New.
4785 (class Powerpc_scan_relocatable_reloc): New.
4786 Many more changes througout file.
4787
3c892704
NC
47882012-08-09 Nick Clifton <nickc@redhat.com>
4789
4790 * po/vi.po: Updated Vietnamese translation.
4791
82435b3b
ILT
47922012-08-07 Ian Lance Taylor <iant@google.com>
4793
4794 * layout.cc (Layout::add_target_dynamic_tags): If
4795 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4796 plt_rel.
4797
a6dc81d2
NC
47982012-07-30 Nick Clifton <nickc@redhat.com>
4799
4800 * po/gold.pot: Updated template.
4801 * po/es.po: Updated Spanish translation.
4802
f1415016
CC
48032012-07-18 Cary Coutant <ccoutant@google.com>
4804
4805 PR gold/14344
4806 * configure.ac: Add check for -gpubnames support.
4807 * configure: Regenerate.
4808 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4809 support; force -gno-pubnames.
4810 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4811 support.
4812 (gdb_index_test_4): New test.
4813 * testsuite/Makefile.in: Regenerate.
4814 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4815 * testsuite/gdb_index_test_2.sh: Likewise.
4816 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4817 * testsuite/gdb_index_test_4.sh: New script.
4818 * testsuite/gdb_index_test_comm.sh: New script with common code;
4819 don't look for space after colon.
4820
b7fd7c37
ST
48212012-07-16 Sriraman Tallam <tmsriram@google.com>
4822
4823 * gold.cc (queue_middle_tasks): Update function order only after
4824 deferred objects due to plugins are processed.
4825
1f3212db
ILT
48262012-07-11 Ian Lance Taylor <iant@google.com>
4827
4828 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4829 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4830 (Target_arm::scan_reloc_for_stub): Likewise.
4831 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4832 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4833 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4834 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4835 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4836
81c82a68
ILT
48372012-07-10 Dodji Seketeli <dodji@redhat.com>
4838 Ian Lance Taylor <iant@google.com>
4839
4840 PR gold/14309
4841 * configure.ac: Test whether std::tr1::hash<off_t> works.
4842 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4843 needed.
4844 * output.h (class Output_fill): Add virtual destructor.
4845 * configure, config.in: Rebuild.
4846
eabc84f4
RM
48472012-06-22 Roland McGrath <mcgrathr@google.com>
4848
4849 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4850
370e30b6
RÁE
48512012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4852
4853 * plugin.cc (Plugin::load): Handle position independent executables.
4854
fb1b895d
CC
48552012-06-06 Cary Coutant <ccoutant@google.com>
4856
4857 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4858 add .debug_macro.
4859 (lines_only_debug_sections): Likewise.
4860 (gdb_fast_lookup_sections): New static array.
4861 (is_gdb_debug_section): Rename formal parameter.
4862 (is_lines_only_debug_section): Likewise.
4863 (is_gdb_fast_lookup_section): New function.
4864 (Layout::include_section): Check for ".zdebug_" prefix; pass
4865 section name suffix to is_gdb_debug_section, et al.; check for
4866 fast-lookup sections when building .gdb_index.
4867 * options.h (--strip-debug-gdb): Update GDB version number.
4868
7c0640fa
CC
48692012-06-06 Cary Coutant <ccoutant@google.com>
4870
4871 * configure.ac: Add check for fallocate.
4872 * configure: Regenerate.
4873 * config.in: Regenerate.
4874
4875 * options.h (class General_options): Add --mmap-output-file and
4876 --posix-fallocate options.
4877 * output.cc: (posix_fallocate): Remove; replace with...
4878 (gold_fallocate): New function.
4879 (Output_file::map_no_anonymous): Call gold_fallocate.
4880 (Output_file::map): Check --mmap-output-file option.
4881
2a49eb69
DK
48822012-06-05 Jing Yu <jingyu@google.com>
4883
4884 * gold.h (textdomain): Add do {} to empty while(0).
4885 (bindtextdomain): Likewise.
4886
fad072ac
CC
48872012-06-04 Cary Coutant <ccoutant@google.com>
4888
4889 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4890 has_dynsym_index.
4891
8cc69fb6
ST
48922012-05-25 Sriraman Tallam <tmsriram@google.com>
4893
4894 * symtab.cc (Symbol_table::define_special_symbol):
4895 Initialize *poldsym to prevent uninitialized variable errors.
4896
1be75daa
CC
48972012-05-23 Cary Coutant <ccoutant@google.com>
4898
4899 * layout.cc (Layout::section_name_mapping): Add rules to handle
4900 exact match on .data.rel.ro.local or .data.rel.ro.
4901 (Layout::output_section_name): Check for exact matches.
4902
9b689de0
CC
49032012-05-23 Cary Coutant <ccoutant@google.com>
4904
4905 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4906 more carefully.
4907
b24fdbf5
CC
49082012-05-22 Cary Coutant <ccoutant@google.com>
4909
4910 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4911 object before exporting symbol.
4912
e550e1a2
L
49132012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4914
4915 * testsuite/tls_test.cc: Include "config.h" first.
4916 * testsuite/tls_test_c.c: Likewise.
4917
df7b86aa
NC
49182012-05-17 Daniel Richard G. <skunk@iskunk.org>
4919 Nick Clifton <nickc@redhat.com>
4920
4921 PR 14072
4922 * configure.in: Add check that sysdep.h has been included before
4923 any system header files.
4924 * configure: Regenerate.
4925 * config.in: Regenerate.
4926
1007b503
CC
49272012-05-14 Cary Coutant <ccoutant@google.com>
4928
4929 * layout.cc (Layout::make_output_section): Mark .tdata section
4930 as RELRO.
4931 * testsuite/relro_test.cc: Add a TLS variable.
4932
fd885f3a
L
49332012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4934
4935 PR gold/14091
4936 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4937 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4938 R_X86_64_64.
4939
80f5885c
CC
49402012-05-08 Cary Coutant <ccoutant@google.com>
4941
4942 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4943 (lines_only_debug_sections): Likewise.
4944
2e702c99
RM
49452012-05-02 Roland McGrath <mcgrathr@google.com>
4946
4947 * nacl.cc: New file.
4948 * nacl.h: New file.
4949 * Makefile.am (CCFILES, HFILES): Add them.
4950 * Makefile.in: Regenerate.
4951 * i386.cc (Output_data_plt_i386_nacl): New class.
4952 (Output_data_plt_i386_nacl_exec): New class.
4953 (Output_data_plt_i386_nacl_dyn): New class.
4954 (Target_i386_nacl): New class.
4955 (Target_selector_i386_nacl): New class.
4956 (target_selector_i386): Use it instead of Target_selector_i386.
4957 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4958 (Target_x86_64_nacl): New class.
4959 (Target_selector_x86_64_nacl): New class.
4960 (target_selector_x86_64, target_selector_x32): Use it instead of
4961 Target_selector_x86_64.
4962 * arm.cc (Output_data_plt_arm_nacl): New class.
4963 (Target_arm_nacl): New class.
4964 (Target_selector_arm_nacl): New class.
4965 (target_selector_arm, target_selector_armbe): Use it instead of
4966 Target_selector_arm.
4967
4968 * target-select.cc (select_target): Take new Input_file* and off_t
4969 arguments, pass them on to recognize method of selector.
4970 * object.cc (make_elf_sized_object): Update caller.
4971 * parameters.cc (parameters_force_valid_target): Likewise.
4972 * incremental.cc (make_sized_incremental_binary): Likewise.
4973 * target-select.h: Update decl.
4974 (Target_selector::recognize): Take new Input_file* argument,
4975 pass it on to do_recognize.
4976 (Target_selector::do_recognize): Take new Input_file* argument.
4977 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4978 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4979 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4980 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4981
4982 * target.h (Target::Target_info): New members isolate_execinstr
4983 and rosegment_gap.
4984 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4985 * arm.cc (Target_arm::arm_info): Update initializer.
4986 * i386.cc (Target_i386::i386_info): Likewise.
4987 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4988 * sparc.cc (Target_sparc::sparc_info): Likewise.
4989 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4990 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4991 * layout.cc (Layout::attach_allocated_section_to_segment):
4992 Take new const Target* argument. If target->isolate_execinstr(), act
4993 like --rosegment.
4994 (Layout::find_first_load_seg): Take new const Target* argument;
4995 if target->isolate_execinstr(), reject PF_X segments.
4996 (Layout::relaxation_loop_body): Update caller.
4997 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4998 reset file offset to zero when we hit LOAD_SEG, and then do a second
4999 loop over the segments before LOAD_SEG to reassign offsets after
5000 addresses have been determined. Handle target->rosegment_gap().
5001 (Layout::attach_section_to_segment): Take new const Target* argument;
5002 pass it to attach_allocated_section_to_segment.
5003 (Layout::make_output_section): Update caller.
5004 (Layout::attach_sections_to_segments): Take new const Target* argument;
5005 pass it to attach_section_to_segment.
5006 * gold.cc (queue_middle_tasks): Update caller.
5007 * layout.h (Layout): Update method decls with new arguments.
5008
5009 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5010 Target_info pointer to use.
5011 (Target_arm::do_make_data_plt): New virtual method.
5012 (Target_arm::make_data_plt): New method that calls it.
5013 (Target_arm::make_plt_entry): Use it.
5014 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5015 for the section alignment.
5016 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5017 method.
5018 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5019 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5020 method.
5021 (Output_data_plt_arm::get_plt_entry_size): Call it.
5022 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5023 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5024 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5025 method.
5026 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5027 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5028 method instead of sizeof(plt_entry).
5029 (Output_data_plt_arm::add_entry): Likewise.
5030 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5031 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5032 than static method.
5033 (Target_arm::plt_entry_size): Likewise.
5034 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5035 Move to ...
5036 (Output_data_plt_arm_standard): ... here, new class.
5037 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5038 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5039 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5040
5041 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5042 Take additional argument for the PLT entry size.
5043 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5044 Use get_plt_entry_size method rather than plt_entry_size variable.
5045 (Output_data_plt_x86_64::reserve_slot): Likewise.
5046 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5047 (Output_data_plt_x86_64::add_entry): Likewise.
5048 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5049 (Output_data_plt_x86_64::address_for_global): Likewise.
5050 (Output_data_plt_x86_64::address_for_local): Likewise.
5051 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5052 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5053 Make method non-static.
5054 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5055 method.
5056 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5057 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5058 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5059 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5060 virtual method.
5061 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5062 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5063 virtual method.
5064 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5065 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5066 virtual method.
5067 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5068 (Output_data_plt_x86_64::plt_entry_size)
5069 (Output_data_plt_x86_64::first_plt_entry)
5070 (Output_data_plt_x86_64::plt_entry)
5071 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5072 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5073 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5074 (Output_data_plt_x86_64_standard): ... here, new class.
5075 (Target_x86_64::Target_x86_64): Take optional argument for the
5076 Target_info pointer to use.
5077 (Target_x86_64::do_make_data_plt): New virtual method.
5078 (Target_x86_64::make_data_plt): New method to call it.
5079 (Target_x86_64::init_got_plt_for_update): Use that.
5080 Call this->plt_->add_eh_frame method here.
5081 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5082 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5083 rather than static method.
5084 (Target_x86_64::plt_entry_size): Likewise.
5085 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5086 rather than plt_entry_size variable. Move guts of PLT filling to...
5087 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5088 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5089 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5090
5091 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5092 additional argument for the section alignment.
5093 Don't do add_eh_frame_for_plt here.
5094 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5095 non-static. Use get_plt_entry_size method rather than plt_entry_size
5096 variable.
5097 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5098 method.
5099 (Output_data_plt_i386::get_plt_entry_size): Call it.
5100 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5101 (Output_data_plt_i386::add_eh_frame): New method to call it.
5102 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5103 method.
5104 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5105 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5106 method.
5107 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5108 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5109 method instead of plt_entry_size.
5110 (Output_data_plt_i386::plt_entry_size)
5111 (Output_data_plt_i386::plt_eh_frame_fde_size)
5112 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5113 (Output_data_plt_i386_standard): ... here, new class.
5114 (Output_data_plt_i386_exec): New class.
5115 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5116 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5117 (Output_data_plt_i386::exec_plt_entry): Move to ...
5118 (Output_data_plt_i386_exec::plt_entry): ... here.
5119 (Output_data_plt_i386_dyn): New class.
5120 (Output_data_plt_i386::first_plt_entry): Move to ...
5121 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5122 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5123 (Output_data_plt_i386_dyn::plt_entry): ... here.
5124 (Target_i386::Target_i386): Take optional argument for the Target_info
5125 pointer to use.
5126 (Target_i386::do_make_data_plt): New virtual method.
5127 (Target_i386::make_data_plt): New method to call it.
5128 (Target_i386::make_plt_section): Use that.
5129 Call this->plt_->add_eh_frame method here.
5130 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5131 rather than plt_entry_size variable.
5132 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5133 (Output_data_plt_i386::address_for_local): Likewise.
5134 (Output_data_plt_i386::do_write): Likewise.
5135 Move guts of PLT filling to...
5136 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5137 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5138 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5139 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5140
b9b9f2ee
CC
51412012-05-01 Cary Coutant <ccoutant@google.com>
5142
5143 * dwarf_reader.cc (Dwarf_die::read_attributes)
5144 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5145 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5146 * reduced_debug_output.cc
5147 (Output_reduced_debug_info_section::get_die_end): Remove
5148 DW_FORM_GNU_ref_index. Add default case.
5149
57923f48
MW
51502012-04-26 Mark Wielaard <mjw@redhat.com>
5151
5152 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5153 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5154 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5155 DW_AT_high_pc as offset from DW_AT_low_pc.
5156
5157 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5158 * testsuite/Makefile.in: Regenerate.
5159 * testsuite/gdb_index_test_3.c: New test source file.
5160 * testsuite/gdb_index_test_3.sh: New test source file.
5161
2c54b4f4
ILT
51622012-04-25 Ian Lance Taylor <iant@google.com>
5163
5164 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5165 pointer.
5166 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5167 as a class, not a struct.
5168 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5169 (Target_arm::apply_cortex_a8_workaround): Likewise.
5170 * gc.h: Declare Reloc_types as a struct, not a class.
5171 * object.h: Declare Symbols_data as a struct.
5172 * reloc.h: Declare Read_relocs_data as a struct.
5173 * target.h: Declare Relocate_info as a struct.
5174
a5a5f7a3
DM
51752012-04-24 David S. Miller <davem@davemloft.net>
5176
5177 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5178 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5179 and R_SPARC_WPLT30.
5180
f038d496
CC
51812012-04-24 Cary Coutant <ccoutant@google.com>
5182
5183 * incremental-dump.cc (find_input_containing_global): Replace
5184 magic number with symbolic constant.
5185 (dump_incremental_inputs): Update version number.
5186 * incremental.cc (Output_section_incremental_inputs): Update version
5187 number; import symbolic constants from Incremental_inputs_reader.
5188 (Incremental_inputs::create_data_sections): Align relocations
5189 section correctly for 64-bit targets.
5190 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5191 constants; add padding.
5192 (Output_section_incremental_inputs::write_header): Add assert for
5193 header_size.
5194 (Output_section_incremental_inputs::write_input_files): Add assert
5195 for input_entry_size.
5196 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5197 add assert for object_info_size, input_section_entry_size,
5198 global_sym_entry_size.
5199 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5200 for data structure sizes; use them.
5201 (Incremental_input_entry_reader): Import symbolic constants from
5202 Incremental_inputs_reader; use them.
5203
a4d85145
DM
52042012-04-23 David S. Miller <davem@davemloft.net>
5205
5206 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5207 and elf_flags_set_.
5208 (Target_sparc::Target_sparc): Initialize new fields.
5209 (Target_sparc::do_make_elf_object): New function.
5210 (Target_sparc::do_adjust_elf_header): New function.
5211
1d509098
CC
52122012-04-23 Cary Coutant <ccoutant@google.com>
5213
5214 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5215 CU range table of gdb index.
5216
7ebeff7f
DM
52172012-04-20 David S. Miller <davem@davemloft.net>
5218
5219 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5220 instead of false.
5221
13cf9988
DM
52222012-04-16 David S. Miller <davem@davemloft.net>
5223
2a1079e8
DM
5224 * sparc.cc (Target_sparc::got_address): New function.
5225 (Sparc_relocate_functions::gdop_hix22): New function.
5226 (Sparc_relocate_functions::gdop_lox10): New function.
5227 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5228 relocs.
5229 (Target_sparc::Scan::local): Likewise if the global symbol is not
5230 preemptible and is not IFUNC.
5231 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5232 transformations for local and non-preemptible non-IFUNC global
5233 symbols.
5234
0bc964fc
DM
5235 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5236 writing out 64-bit part of ranges.
5237
661d7a80
DM
5238 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5239 -fpic and -fpie respectively.
5240 * Makefile.in: Regenerate.
5241
8c2bf391
DM
5242 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5243 (Target_sparc::Target_sparc): Initialize new field.
5244 (Target_sparc::do_plt_section_for_global): New function.
5245 (Target_sparc::do_plt_section_for_local): New function.
5246 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5247 (Target_sparc::make_plt_section): New function, broken out of
5248 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5249 (Target_sparc::make_plt_entry): Call make_plt_section.
5250 (Target_sparc::make_local_ifunc_plt_entry): New function.
5251 (Target_sparc::rela_ifunc_section): New function.
5252 (Target_sparc::plt_section): Remove const.
5253 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5254 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5255 and ifunc_count_ fields.
5256 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5257 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5258 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5259 (Output_data_plt_sparc::rela_ifunc): New function.
5260 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5261 (Output_data_plt_sparc::has_ifunc_section): New function.
5262 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5263 (Output_data_plt_sparc::address_for_global): New function.
5264 (Output_data_plt_sparc::address_for_local): New function.
5265 (Output_data_plt_sparc::plt_index_to_offset): New function.
5266 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5267 and entry_count.
5268 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5269 entry_count.
5270 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5271 R_SPARC_JMP_IREL to switch.
5272 (Target_sparc::Scan::check_non_pic): Likewise.
5273 (Target_sparc::Scan::local): Handle IFUNC symbols.
5274 (Target_sparc::Scan::local): Likewise.
5275 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5276 and plt_address_for_local.
5277 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5278 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5279
13cf9988
DM
5280 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5281 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5282 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5283 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5284 global relocs too.
5285 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5286 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5287 calls.
5288 * sparc.cc (Target_sparc::Scan::global): Likewise.
5289 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5290
31821be0
CC
52912012-04-16 Cary Coutant <ccoutant@google.com>
5292
5293 * archive.cc (Library_base::should_include_member): Check for
5294 --export-dynamic-symbol.
5295 * options.h (class General_options): Add --export-dynamic-symbol.
5296 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5297 --export-dynamic-symbol.
5298 (Symbol_table::gc_mark_undef_symbols): Likewise.
5299 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5300
2615994e
DM
53012012-04-12 David S. Miller <davem@davemloft.net>
5302
5303 * sparc.cc (Reloc::wdisp10): New relocation method.
5304 (Reloc::h34): Likewise.
5305 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5306 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5307 R_SPARC_WDISP10.
5308 (Target_sparc::Scan::local): Likewise.
5309 (Target_sparc::Scan::global): Likewise.
5310 (Target_sparc::Relocate::relocate): Likewise.
5311
6782735d
CC
53122012-04-09 Cary Coutant <ccoutant@google.com>
5313
5314 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5315 low_pc == 0.
5316
8c7a0b00
ILT
53172012-04-06 Ian Lance Taylor <iant@google.com>
5318
5319 * timer.cc: #include <unistd.h>.
5320
58797674
RM
53212012-04-06 Roland McGrath <mcgrathr@google.com>
5322
5323 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5324 * config.in: Regenerate.
5325 * configure: Regenerate.
5326
44350750
NC
53272012-04-05 Nick Clifton <nickc@redhat.com>
5328
5329 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5330 (AM_LC_MESSAGES): Add.
5331 * aclocal.m4: Regenerate.
5332 * config.in: Regenerate.
5333 * configure: Regenerate.
5334
c1027032
CC
53352012-03-21 Cary Coutant <ccoutant@google.com>
5336
5337 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5338 * Makefile.in: Regenerate.
5339 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5340 (Sized_elf_reloc_mapper::symbol_section): New function.
5341 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5342 (make_elf_reloc_mapper): New function.
5343 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5344 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5345 (Dwarf_abbrev_table::do_get_abbrev): New function.
5346 (Dwarf_ranges_table::read_ranges_table): New function.
5347 (Dwarf_ranges_table::read_range_list): New function.
5348 (Dwarf_pubnames_table::read_section): New function.
5349 (Dwarf_pubnames_table::read_header): New function.
5350 (Dwarf_pubnames_table::next_name): New function.
5351 (Dwarf_die::Dwarf_die): New function.
5352 (Dwarf_die::read_attributes): New function.
5353 (Dwarf_die::skip_attributes): New function.
5354 (Dwarf_die::set_name): New function.
5355 (Dwarf_die::set_linkage_name): New function.
5356 (Dwarf_die::attribute): New function.
5357 (Dwarf_die::string_attribute): New function.
5358 (Dwarf_die::int_attribute): New function.
5359 (Dwarf_die::uint_attribute): New function.
5360 (Dwarf_die::ref_attribute): New function.
5361 (Dwarf_die::child_offset): New function.
5362 (Dwarf_die::sibling_offset): New function.
5363 (Dwarf_info_reader::check_buffer): New function.
5364 (Dwarf_info_reader::parse): New function.
5365 (Dwarf_info_reader::do_parse): New function.
5366 (Dwarf_info_reader::do_read_string_table): New function.
5367 (Dwarf_info_reader::lookup_reloc): New function.
5368 (Dwarf_info_reader::get_string): New function.
5369 (Dwarf_info_reader::visit_compilation_unit): New function.
5370 (Dwarf_info_reader::visit_type_unit): New function.
5371 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5372 Sized_elf_reloc_mapper.
5373 (Sized_dwarf_line_info::symbol_section): Remove function.
5374 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5375 (Sized_dwarf_line_info::read_line_mappings): Remove object
5376 parameter, adjust callers.
5377 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5378 * dwarf_reader.h: Include <sys/types.h>.
5379 (class Track_relocs): Remove forward declaration.
5380 (class Elf_reloc_mapper): New class.
5381 (class Sized_elf_reloc_mapper): New class.
5382 (class Dwarf_abbrev_table): New class.
5383 (class Dwarf_range_list): New class.
5384 (class Dwarf_ranges_table): New class.
5385 (class Dwarf_pubnames_table): New class.
5386 (class Dwarf_die): New class.
5387 (class Dwarf_info_reader): New class.
5388 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5389 (Sized_dwarf_line_info::symbol_section): Remove member function.
5390 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5391 base class.
5392 * gdb-index.cc: New source file.
5393 * gdb-index.h: New source file.
5394 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5395 and .debug_types sections, call Layout::add_to_gdb_index.
5396 (Sized_relobj_incr::do_section_name): Implement.
5397 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5398 return type; Implement.
5399 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5400 return type.
5401 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5402 parameter list and return type.
5403 (Sized_incr_dynobj::do_section_contents): Likewise.
5404 * layout.cc: Include gdb-index.h.
5405 (Layout::Layout): Initialize gdb_index_data_.
5406 (Layout::init_fixed_output_section): Check for .gdb_index section.
5407 (Layout::add_to_gdb_index): New function. Instantiate.
5408 * layout.h: Add forward declaration for class Gdb_index.
5409 (Layout::add_to_gdb_index): New member function.
5410 (Layout::gdb_index_data_): New data member.
5411 * main.cc: Include gdb-index.h.
5412 (main): Print statistics for gdb index.
5413 * object.cc (Object::section_contents): Move code into
5414 do_section_contents.
5415 (need_decompressed_section): Check for sections needed when building
5416 gdb index.
5417 (build_compressed_section_map): Likewise.
5418 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5419 gdb index.
5420 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5421 sections; call Layout::add_to_gdb_index.
5422 (Sized_relobj_file::do_decompressed_section_contents): Call
5423 do_section_contents directly.
5424 * object.h (Object::do_section_contents): Adjust parameter list and
5425 return type.
5426 (Object::do_decompressed_section_contents): Call do_section_contents
5427 directly.
5428 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5429 return type.
5430 * options.h (class General_options): Add --gdb-index option.
5431 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5432 list and return type.
5433 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5434 * reloc.h (Track_relocs::checkpoint): New function.
5435 (Track_relocs::reset): New function.
5436
5437 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5438 New test cases.
5439 * testsuite/Makefile.in: Regenerate.
5440 * testsuite/gdb_index_test.cc: New test source file.
5441 * testsuite/gdb_index_test_1.sh: New test source file.
5442 * testsuite/gdb_index_test_2.sh: New test source file.
5443
647f1574
DK
54442012-03-19 Doug Kwan <dougkwan@google.com>
5445
5446 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5447 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5448 __exidx_start and __exidx_end. Make symbol table parameter
5449 anonymous as it is not used.
5450 * gold.cc (queue_middle_tasks): Call target hook to define any
5451 target-specific symbols.
5452 * target.h (Target::define_standard_symbols): New method.
5453 (Target::do_define_standard_symbols): Same.
5454 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5455 * testsuite/Makefile.in: Regenerate.
5456 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5457 and __exidx_end.
5458 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5459 relocations are generated for __exidx_start and __exidx_end.
5460
7c6109da
DK
54612012-03-16 Doug Kwan <dougkwan@google.com>
5462
5463 * testsuite/Makefile.am: Disable test initpri3b.
5464 * testsuite/Makefile.in: Regenerate.
5465
7b8957f8
DK
54662012-03-15 Doug Kwan <dougkwan@google.com>
5467
5468 * arm.cc (Target_arm::got_section): Make .got section read-only
5469 if -z now is given.
5470
14dc9ef7
ILT
54712012-03-15 Ian Lance Taylor <iant@google.com>
5472
5473 PR gold/13850
5474 * layout.cc (Layout::make_output_section): Correctly mark
5475 SHT_INIT_ARRAY, et. al., as relro.
5476
fa40b62a
DK
54772012-03-14 Doug Kwan <dougkwan@google.com>
5478
5479 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5480 dynamic relocations for protected symbols in shared objects.
5481
fd325007
ILT
54822012-03-13 Ian Lance Taylor <iant@google.com>
5483
5484 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5485 keep the larger alignment.
5486
e8dd54e1
CC
54872012-03-12 Cary Coutant <ccoutant@google.com>
5488
5489 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5490 handling of DW_LNE_define_file.
5491
feb5f3b0
CC
54922012-03-12 Cary Coutant <ccoutant@google.com>
5493
5494 * reduced_debug_output.cc
5495 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5496 codes to switch.
5497
a1fb4256
CC
54982012-02-29 Cary Coutant <ccoutant@google.com>
5499
5500 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5501
5dd8762a
CC
55022012-02-29 Cary Coutant <ccoutant@google.com>
5503
5504 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5505 Call Object::decompressed_section_contents.
5506 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5507 New dtor.
5508 (Sized_dwarf_line_info::buffer_start_): New data member.
5509 * merge.cc (Output_merge_data::do_add_input_section): Call
5510 Object::decompressed_section_contents.
5511 (Output_merge_string::do_add_input_section): Likewise.
5512 * object.cc (need_decompressed_section): New function.
5513 (build_compressed_section_map): Decompress sections needed later.
5514 (Sized_relobj_file::do_decompressed_section_contents): New function.
5515 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5516 * object.h (Object::decompressed_section_contents): New function.
5517 (Object::discard_decompressed_sections): New function.
5518 (Object::do_decompressed_section_contents): New function.
5519 (Object::do_discard_decompressed_sections): New function.
5520 (Compressed_section_info): New type.
5521 (Compressed_section_map): Include decompressed section contents.
5522 (Sized_relobj_file::do_decompressed_section_contents): New function.
5523 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5524
7b5de7ee
CC
55252012-02-16 Cary Coutant <ccoutant@google.com>
5526
5527 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5528 * testsuite/Makefile.in: Regenerate.
5529
f9fa4a63
CC
55302012-02-14 Cary Coutant <ccoutant@google.com>
5531
5532 * options.cc (General_options::finalize): Disallow -pie and -static.
5533
2c175ebc
DK
55342012-02-03 Doug Kwan <dougkwan@google.com>
5535
5536 * arm.cc (Arm_relocate_functions::abs8,
5537 Arm_relocate_functions::abs16): Use
5538 Bits::has_signed_unsigned_overflow32.
5539 (Arm_relocate_functions::thm_abs8): Correct range of
5540 overflow check.
5541 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5542 in assertions.
5543
90cff06f
DK
55442012-02-02 Doug Kwan <dougkwan@google.com>
5545
5546 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5547 position independent outputs, not just shared objects.
5548
63887f3d
L
55492012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5550
5551 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5552 * configure: Regenerated.
5553
bef2b434
ILT
55542012-01-27 Ian Lance Taylor <iant@google.com>
5555
5556 * reloc.h (Bits): New class with static functions, copied from
5557 namespace utils in arm.cc.
5558 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5559 instead.
5560
c335b55d
L
55612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5562
5563 * incremental.cc (write_info_blocks): Correct relocation offset.
5564
41194d9f
L
55652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5566
5567 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5568 (Relocate::tls_gd_to_le): Likewise.
5569
1bae613c
L
55702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5571
5572 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5573
24482ca0
L
55742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5575
5576 * configure.ac: Check if -mcmodel=medium works.
5577 * configure: Regenerated.
5578
c2c7840a
CC
55792012-01-24 Cary Coutant <ccoutant@google.com>
5580
5581 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5582 definition and ...
5583 (read_unsigned_LEB_128_x): ... this new function.
5584 (read_signed_LEB_128): Replaced with inline definition and ...
5585 (read_signed_LEB_128_x): ... this new function.
5586 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5587 (read_unsigned_LEB_128): Add inline definition.
5588 (read_signed_LEB_128_x): New function.
5589 (read_signed_LEB_128): Add inline definition.
5590 * testsuite/Makefile.am (leb128_unittest): New unit test.
5591 * testsuite/Makefile.in: Regenerate.
5592 * testsuite/leb128_unittest.cc: New unit test.
5593
833de760 55942012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5595
5596 PR gold/13617
5597 * i386.cc (Target_i386::do_code_fill): When using a jmp
5598 instruction, pad with nop instructions.
5599 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5600
618d6666
L
56012012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5602
5603 * x86_64.cc (gc_process_relocs): Add typename on types used in
5604 template.
5605 (scan_relocs): Likewise.
5606 (relocate_section): Likewise.
5607 (apply_relocation): Likewise.
5608
3660ff06
L
56092012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5610
5611 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5612 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5613 under x32.
5614
fc51264f
L
56152012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5616
5617 * x86_64.cc: Initial support for x32.
5618
dd74ae06
CC
56192012-01-03 Cary Coutant <ccoutant@google.com>
5620
5621 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5622 Use abstract base class for GOT.
5623 * gold/output.h (class Output_data_got_base): New abstract base class.
5624 (class Output_data_got): Derive from new base class, adjust ctors.
5625 (Output_data_got::reserve_slot): Make virtual; rename to
5626 do_reserve_slot; Adjust callers.
5627 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5628 pointer to abstract base class.
5629 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5630
83896202
ILT
56312011-12-18 Ian Lance Taylor <iant@google.com>
5632
5633 * object.h (Relobj::local_symbol_value): New function.
5634 (Relobj::local_plt_offset): New function.
5635 (Relobj::local_has_got_offset): New function.
5636 (Relobj::local_got_offset): New function.
5637 (Relobj::set_local_got_offset): New function.
5638 (Relobj::do_local_symbol_value): New pure virtual function.
5639 (Relobj::do_local_plt_offset): Likewise.
5640 (Relobj::do_local_has_got_offset): Likewise.
5641 (Relobj::do_local_got_offset): Likewise.
5642 (Relobj::do_set_local_got_offset): Likewise.
5643 (Sized_relobj::do_local_has_got_offset): Rename from
5644 local_has_got_offset.
5645 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5646 (Sized_relobj::do_set_local_got_offset): Rename from
5647 set_local_got_offset.
5648 (Sized_relobj_file::do_local_plt_offset): Rename from
5649 local_plt_offset.
5650 (Sized_relobj_file::do_local_symbol_value): New function.
5651 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5652 local_plt_offset.
5653 * output.cc (Output_data_got::Got_entry::write): Change object to
5654 Relobj. Use local_symbol_value.
5655 (Output_data_got::add_global_with_rel): Change rel_dyn to
5656 Output_data_reloc_generic*. Use add_global_generic.
5657 (Output_data_got::add_global_with_rela): Remove. Change all
5658 callers to use add_global_with_rel.
5659 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5660 Output_data_reloc_generic*. Use add_global_generic.
5661 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5662 callers to use add_global_pair_with_rel.
5663 (Output_data_got::add_local): Change object to Relobj*.
5664 (Output_data_got::add_local_plt): Likewise.
5665 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5666 change rel_dyn to Output_data_reloc_generic*. Use
5667 add_local_generic.
5668 (Output_data_got::add_local_with_rela): Remove. Change all
5669 callers to use all_local_with_rel.
5670 (Output_data_got::add_local_pair_with_rel): Change object to
5671 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5672 add_output_section_generic.
5673 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5674 callers to use add_local_pair_with_rel.
5675 (Output_data_got::reserve_local): Change object to Relobj*.
5676 * output.h: (class Output_data_reloc_generic): Add pure virtual
5677 declarations for add_global_generic, add_local_generic,
5678 add_output_section_generic.
5679 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5680 functions for Output_data_reloc_generic. Update declarations for
5681 changes listed in output.cc.
5682 (class Output_data_got): Change template parameter to got_size.
5683 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5684 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5685 function.
5686 (Sized_relobj_incr::do_local_plt_offset): New function.
5687 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5688 add_global_generic.
5689
76677ad0
CC
56902011-12-17 Cary Coutant <ccoutant@google.com>
5691
5692 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5693 * resolve.cc (Symbol_table::resolve): Likewise.
5694 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5695 arrays.
5696 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5697
8b8dd8d5
ILT
56982011-12-16 Ian Lance Taylor <iant@google.com>
5699
5700 * output.h (Output_data_reloc_generic::add): Only call
5701 add_dynamic_reloc if this is a dynamic reloc section.
5702
d55525b9
L
57032011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5704
5705 PR gold/13505
5706 * target-reloc.h (apply_relocation): Replace <64, false> with
5707 <size, big_endian>.
5708
ff81c7c1
NC
57092011-11-25 Nick Clifton <nickc@redhat.com>
5710
5711 * po/it.po: New Italian translation.
5712
628f39be
SA
57132011-11-17 Sterling Augustine <saugustine@google.com>
5714
5715 * script.cc (script_include_directive): Implement.
5716 (read_script_file): New local variables name and search_path. Update
5717 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5718 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5719 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5720
98ef3ea4
SA
57212011-11-11 Sterling Augustine <saugustine@google.com>
5722
5723 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5724 (file_or_sections_cmd): Likewise.
5725
f4a8b6d7
DK
57262011-11-11 Doug Kwan <dougkwan@google.com>
5727
5728 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5729 if --just-symbols is given.
5730
29ab395d
DK
57312011-11-10 Doug Kwan <dougkwan@google.com>
5732
5733 PR gold/13362
5734 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5735 when processing data relocs.
5736 * reloc.h (Relocate_functions::rel_unaligned): New method.
5737 (Relocate_functions::pcrel_unaligned): Ditto.
5738 (Relocate_functions::rel32_unaligned): Ditto.
5739 (Relocate_functions::pcrel32_unaligned): Ditto.
5740
2c339f71
DK
57412011-11-09 Doug Kwan <dougkwan@google.com>
5742
5743 PR gold/13362
5744 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5745 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5746 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5747 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5748 (Relocate_functions::rel_unaligned): New.
5749 (Relocate_functions::rel32_unaligned): New.
5750 * target-reloc.h (relocate_for_relocatable): Add code to handle
5751 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5752 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5753 arm_unaligned_reloc_r): New targets.
5754 * testsuite/Makefile.in: Regenerate.
5755 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5756 linking.
5757
3f3cddf1
ILT
57582011-11-02 Ian Lance Taylor <iant@google.com>
5759
5760 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5761 NATIVE_LINKER.
5762 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5763 * options.cc (General_options::finalize): Use library search path
5764 from configure script if specified. If not native and no sysroot,
5765 only search TOOLLIBDIR.
5766 * options.h (Search_directory::Search_directory): Change name to
5767 const std::string&.
5768 (General_options::add_to_library_path_with_sysroot): Change arg to
5769 const std::string&.
5770 * configure, Makefile.in, config.in: Rebuild.
5771
a8e2273b
ILT
57722011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5773
5774 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5775 we are working around the ARM1176 Erratum.
5776 * options.h (General_options::fix_arm1176): Add option.
5777 * testsuite/Makefile.am: Add testcases, and keep current ones
5778 working.
5779 * testsuite/Makefile.in: Regenerate.
5780 * testsuite/arm_fix_1176.s: New file.
5781 * testsuite/arm_fix_1176.sh: Likewise.
5782
cd6eab1c
ILT
57832011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5784
5785 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5786 may_use_blx_.
5787 (Target_arm::may_use_blx): Remove method.
5788 (Target_arm::set_may_use_blx): Likewise.
5789 (Target_arm::may_use_v4t_interworking): New method.
5790 (Target_arm::may_use_v5t_interworking): Likewise.
5791 (Target_arm::may_use_blx_): Remove member variable.
5792 (Arm_relocate_functions::arm_branch_common): Check for v5T
5793 interworking.
5794 (Arm_relocate_functions::thumb_branch_common): Likewise.
5795 (Reloc_stub::stub_type_for_reloc): Likewise.
5796 (Target_arm::do_finalize_sections): Correct interworking checks.
5797 * testsuite/Makefile.am: Add new tests.
5798 * testsuite/Makefile.in: Regenerate.
5799 * testsuite/arm_farcall_arm_arm.s: New test.
5800 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5801 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5802 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5803 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5804 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5805 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5806 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5807
286adcf4
CC
58082011-10-31 Cary Coutant <ccoutant@google.com>
5809
5810 PR gold/13023
5811 * expression.cc (Expression::eval_with_dot): Add
5812 is_section_dot_assignment parameter.
5813 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5814 absolute and assigning to dot within a section.
5815 * script-sections.cc
5816 (Output_section_element_assignment::set_section_addresses): Pass
5817 dot_section to set_if_absolute.
5818 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5819 as is_section_dot_assignment flag to eval_with_dot.
5820 (Output_section_element_dot_assignment::set_section_addresses):
5821 Likewise.
5822 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5823 parameter. Also set value if relative to dot_section; set the
5824 symbol's output_section.
5825 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5826 parameter. Adjust all callers.
5827 (Expression::eval_maybe_dot): Likewise.
5828 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5829 Adjust all callers.
5830 * testsuite/script_test_2.t: Test assignment of an absolute value
5831 to dot within an output section element.
5832
9634ed06
CC
58332011-10-31 Cary Coutant <ccoutant@google.com>
5834
5835 * options.h (class General_options): Add --[no-]gnu-unique options.
5836 * symtab.cc (Symbol_table::sized_write_globals): Convert
5837 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5838
de4101c7
CC
58392011-10-31 Cary Coutant <ccoutant@google.com>
5840
5841 PR gold/13359
5842 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5843 unnecessary assertion.
5844 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5845
7257cc92
ST
58462011-10-31 Sriraman Tallam <tmsriram@google.com>
5847
5848 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5849 gc_mark_symbol.
5850 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5851 gc_mark_symbol.
5852 Change to just keep the section associated with symbol.
5853 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5854 they are externally visible and --export-dynamic is turned on.
5855 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5856
bfc34b3f
ILT
58572011-10-19 Ian Lance Taylor <iant@google.com>
5858
5859 PR gold/13163
5860 * script-sections.cc
5861 (Output_section_element_dot_assignment::needs_output_section): New
5862 function.
5863
ea0d8c47
ILT
58642011-10-19 Ian Lance Taylor <iant@google.com>
5865
5866 PR gold/13204
5867 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5868 --section-start option was seen.
5869 * options.h (General_options::any_section_start): New function.
5870
abd242a9
DM
58712011-10-18 David S. Miller <davem@davemloft.net>
5872
5873 PR binutils/13301
5874 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5875 member to track relocation locations that have moved during TLS
5876 reloc optimizations.
5877 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5878 (Target_sparc::Relocate::relocate): Adjust view down by 4
5879 bytes if it matches reloc_adjust_addr_.
5880 (Target_sparc::Relocate::relocate_tls): Always move the
5881 __tls_get_addr call delay slot instruction forward 4 bytes when
5882 performing relaxation.
5883
bab9090f
CC
58842011-10-18 Cary Coutant <ccoutant@google.com>
5885
5886 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5887 (Output_file::map_no_anonymous): Check for non-zero
5888 return code from posix_fallocate.
5889
f7c5b166
CC
58902011-10-17 Cary Coutant <ccoutant@google.com>
5891
5892 PR gold/13245
5893 * plugin.cc (is_visible_from_outside): Check for symbols
5894 referenced from dynamic objects.
5895 * resolve.cc (Symbol_table::resolve): Don't count references
5896 from dynamic objects as references from real ELF files.
5897 * testsuite/plugin_test_2.sh: Adjust expected result.
5898
b490c0bb
CC
58992011-10-17 Cary Coutant <ccoutant@google.com>
5900
5901 * gold.cc: Include timer.h.
5902 (queue_middle_tasks): Stamp time.
5903 (queue_final_tasks): Likewise.
5904 * main.cc (main): Store timer in parameters. Print timers
5905 for each pass.
5906 * parameters.cc (Parameters::Parameters): Initialize timer_.
5907 (Parameters::set_timer): New function.
5908 (set_parameters_timer): New function.
5909 * parameters.h (Parameters::set_timer): New function.
5910 (Parameters::timer): New function.
5911 (Parameters::timer_): New data member.
5912 (set_parameters_timer): New function.
5913 * timer.cc (Timer::stamp): New function.
5914 (Timer::get_pass_time): New function.
5915 * timer.h (Timer::stamp): New function.
5916 (Timer::get_pass_time): New function.
5917 (Timer::pass_times_): New data member.
5918
f475cf7b
CC
59192011-10-17 Cary Coutant <ccoutant@google.com>
5920
5921 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5922 task for members of lib groups.
5923
cdd7e244
CC
59242011-10-17 Cary Coutant <ccoutant@google.com>
5925
5926 PR gold/13288
4f95c8b4 5927 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5928 (File_read::make_view): Move bounds check (replace with assert)...
5929 (File_read::find_or_make_view): ... to here.
5930
dfb45471
CC
59312011-10-12 Cary Coutant <ccoutant@google.com>
5932
4f95c8b4 5933 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5934 ::read returns less than requested size.
5935
53bbcc1b
CC
59362011-10-10 Cary Coutant <ccoutant@google.com>
5937
4f95c8b4 5938 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5939 Initialize defined_count_.
5940 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5941 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5942 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5943 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5944 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5945 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5946 member.
5947 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5948 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5949 Return zeroes instead of internal error.
5950
397b129b
CC
59512011-10-10 Cary Coutant <ccoutant@google.com>
5952
5953 PR gold/13249
4f95c8b4 5954 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5955 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5956 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5957 (Output_reloc::type_): Adjust size of bit field.
5958 (Output_reloc::use_plt_offset_): New bit field.
5959 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5960 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5961 flag. Adjust all callers.
4f95c8b4 5962 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5963 creating RELATIVE relocations.
5964
d5698657
NC
59652011-10-10 Nick Clifton <nickc@redhat.com>
5966
5967 * po/es.po: Updated Spanish translation.
5968 * po/fi.po: Updated Finnish translation.
5969
6a59a5c2
DN
59702011-10-03 Diego Novillo <dnovillo@google.com>
5971
5972 * options.cc (parse_uint): Fix dereference of RETVAL.
5973
f0558624
ST
59742011-09-29 Sriraman Tallam <tmsriram@google.com>
5975
5976 * layout.h (section_order_map_): New member.
5977 (get_section_order_map): New member function.
5978 * output.cc (Output_section::add_input_section): Check for patterns
5979 only when --section-ordering-file is specified.
5980 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5981 output_sections have been formed.
5982 * layout.cc (Layout_Layout): Initialize section_order_map_.
5983 * plugin.cc (update_section_order): Store order in order_map. Do not
5984 update the order.
5985 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5986 * testsuite/Makefile.in: Regenerate.
5987 * testsuite/plugin_section_order.c: New file.
5988 * testsuite/plugin_final_layout.cc: New file.
5989 * testsuite/plugin_final_layout.sh: New file.
5990
a7dac153
CC
59912011-09-29 Cary Coutant <ccoutant@google.com>
5992
4f95c8b4 5993 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5994 Check for NULL.
4f95c8b4 5995 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5996 symbols during incremental update.
5997 (Symbol_table::add_from_dynobj): Likewise.
5998
eebd87a5
ILT
59992011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6000 Ian Lance Taylor <iant@google.com>
6001
6002 * symtab.cc (Symbol_table::define_special_symbol): Always
6003 canonicalize version string.
6004
403a3331
CC
60052011-09-26 Cary Coutant <ccoutant@google.com>
6006
4f95c8b4
CC
6007 * gold.cc (queue_initial_tasks): Move option checks ...
6008 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
6009 some options; make others fatal.
6010
235061c2
CC
60112011-09-26 Cary Coutant <ccoutant@google.com>
6012
6013 gcc PR lto/47247
6014 * plugin.cc (get_symbols_v2): New function.
6015 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6016 (is_referenced_from_outside): New function.
6017 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6018 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6019 (get_symbols): Pass version parameter.
6020 (get_symbols_v2): New function.
6021 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6022 parameter.
6023 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6024 (onload): Add LDPT_GET_SYMBOLS_V2.
6025 (all_symbols_read_hook): Use get_symbols_v2; check for
6026 LDPR_PREVAILING_DEF_IRONLY_EXP.
6027 * testsuite/plugin_test_3.sh: Update expected results.
6028
dc87f620
ILT
60292011-09-23 Simon Baldwin <simonb@google.com>
6030
6031 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6032 configuration options.
6033 * configure: Regenerate.
6034 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6035 * Makefile.in: Regenerate.
6036 * testsuite/Makefile.in: Regenerate.
6037
a8279f82
ST
60382011-09-19 Sriraman Tallam <tmsriram@google.com>
6039
6040 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6041
0c9350c8
CC
60422011-09-19 Cary Coutant <ccoutant@google.com>
6043
6044 * incremental.cc (can_incremental_update): Fix typo in comment.
6045 * incremental.h (can_incremental_update): Likewise.
6046
aa06ae28
CC
60472011-09-18 Cary Coutant <ccoutant@google.com>
6048
6049 * incremental.cc (can_incremental_update): New function.
6050 * incremental.h (can_incremental_update): New function.
6051 * layout.cc (Layout::init_fixed_output_section): Call it.
6052 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6053 * object.cc (Sized_relobj_file::do_layout): Call
6054 can_incremental_update.
6055
ebb300b2
CC
60562011-09-13 Cary Coutant <ccoutant@google.com>
6057
6058 * configure.ac: Check for glibc support for gnu_indirect_function
6059 support with static linking, setting automake conditional
6060 IFUNC_STATIC.
6061 * Makefile.in: Regenerate.
6062 * configure: Regenerate.
6063
6064 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6065 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6066 for IFUNC_STATIC.
6067 * testsuite/Makefile.in: Regenerate.
6068
1206d0d5
CC
60692011-09-13 Cary Coutant <ccoutant@google.com>
6070
6071 * incremental.cc (Sized_relobj_incr::do_layout): Call
6072 report_comdat_group for kept comdat sections.
6073 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6074 * testsuite/Makefile.in: Regenerate.
6075 * testsuite/incr_comdat_test_1.cc: New source file.
6076 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6077 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6078 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6079
40b29874
ILT
60802011-09-13 Ian Lance Taylor <iant@google.com>
6081
6082 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6083 variable external_symbols_offset.
6084
1b045aac
ILT
60852011-09-12 Ian Lance Taylor <iant@google.com>
6086
6087 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6088 triggered if object has no symbols.
6089
24c6c55a
DM
60902011-09-09 David S. Miller <davem@davemloft.net>
6091
6092 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6093 (Output_fill_debug_line::do_write): Likewise.
6094
66570254
CC
60952011-08-29 Cary Coutant <ccoutant@google.com>
6096
6097 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6098 casts to match formatting specs.
6099 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6100
8ea8cd50
CC
61012011-08-26 Cary Coutant <ccoutant@google.com>
6102
6103 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6104 remaining hole size when allocating.
6105 (Layout::make_output_section): Set fill methods for debug sections.
6106 * layout.h (Free_list::Free_list_node): Move from private to
6107 public.
6108 (Free_list::set_min_hole_size): New function.
6109 (Free_list::begin, Free_list::end): New functions.
6110 (Free_list::min_hole_): New data member.
6111 * output.cc: Include dwarf.h.
6112 (Output_fill_debug_info::do_minimum_hole_size): New function.
6113 (Output_fill_debug_info::do_write): New function.
6114 (Output_fill_debug_line::do_minimum_hole_size): New function.
6115 (Output_fill_debug_line::do_write): New function.
6116 (Output_section::Output_section): Initialize new data member.
6117 (Output_section::set_final_data_size): Ensure patch space is larger
6118 than minimum hole size.
6119 (Output_section::do_write): Fill holes in debug sections.
6120 * output.h (Output_fill): New class.
6121 (Output_fill_debug_info): New class.
6122 (Output_fill_debug_line): New class.
6123 (Output_section::set_free_space_fill): New function.
6124 (Output_section::free_space_fill_): New data member.
6125 * testsuite/Makefile.am (incremental_test_3): Add
6126 --incremental-patch option.
6127 (incremental_test_4): Likewise.
6128 (incremental_test_5): Likewise.
6129 (incremental_test_6): Likewise.
6130 (incremental_copy_test): Likewise.
6131 (incremental_common_test_1): Likewise.
6132 * testsuite/Makefile.in: Regenerate.
6133
7cf80422
NC
61342011-08-26 Nick Clifton <nickc@redhat.com>
6135
6136 * po/es.po: Updated Spanish translation.
6137
c3f7b0e5
CC
61382011-08-01 Cary Coutant <ccoutant@google.com>
6139
6140 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6141 * gold/testsuite/Makefile.in: Regenerate.
6142 * gold/testsuite/justsyms_exec.c: New source file.
6143 * gold/testsuite/justsyms_lib.c: New source file.
6144
9590bf25
CC
61452011-08-01 Cary Coutant <ccoutant@google.com>
6146
6147 * layout.cc (Layout::set_segment_offsets): Don't realign text
6148 segment if -Ttext was specified.
6149 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6150 file type.
6151 * object.h (Sized_relobj_file::e_type): New function.
6152 (Sized_relobj_file::e_type_): New data member.
6153 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6154 base address for ET_EXEC files.
6155 * target.cc (Target::do_make_elf_object_implementation): Allow
6156 ET_EXEC files with --just-symbols option.
6157
dcd8d12e
CC
61582011-07-28 Cary Coutant <ccoutant@google.com>
6159
6160 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6161 Add thread_number parameter.
6162 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6163 * workqueue-threads.cc
6164 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6165 current thread if its thread number is greater than desired thread
6166 count.
6167 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6168 Add thread_number parameter.
6169 (Workqueue::should_cancel_thread): Likewise.
6170 (Workqueue::find_runnable_or_wait): Pass thread_number to
6171 should_cancel_thread.
6172 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6173 parameter.
6174
804eb480
ST
61752011-07-22 Sriraman Tallam <tmsriram@google.com>
6176
6177 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6178 only after checking if it cannot be forced local.
6179 * symtab.h (is_externally_visible): Check if the symbol is not forced
6180 local.
6181
f1ddb600
ILT
61822011-07-15 Ian Lance Taylor <iant@google.com>
6183
6184 * options.h (class General_options): Add --print-output-format.
6185 Move -EL next to -EB, for better --help output.
6186 * target-select.cc: Include <cstdio>, "options.h", and
6187 "parameters.h".
6188 (Target_selector::do_target_bfd_name): New function.
6189 (print_output_format): New function.
6190 * target-select.h (class Target_selector): Update declarations.
6191 (Target_selector::target_bfd_name): New function.
6192 (print_output_format): Declare.
6193 * main.cc: Include "target-select.h".
6194 (main): Handle --print-output-format.
6195 * gold.cc: Include "target-select.h".
6196 (queue_initial_tasks): Handle --print-output-format when there are
6197 no input files.
6198 * parameters.cc (parameters_force_valid_target): Give a better
6199 error message if -EB/-EL does not match target.
6200 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6201 function.
6202
7d172687
ILT
62032011-07-15 Ian Lance Taylor <iant@google.com>
6204
6205 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6206 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6207 (Output_data_plt_i386::do_write): Write address of .dynamic
6208 section to first entry in .got.plt section.
6209 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6210 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6211 Initialize layout_.
6212 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6213 section to first entry in .got.plt section.
6214 * layout.h (Layout::dynamic_section): New function.
6215
e9552f7e
ST
62162011-07-13 Sriraman Tallam <tmsriram@google.com>
6217
6218 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6219 to claim_file call.
6220 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6221 input_section_position_, and input_section_glob_.
6222 (read_layout_from_file): Call function section_ordering_specified.
6223 * layout.h (is_section_ordering_specified): New function.
6224 (section_ordering_specified): New function.
6225 (section_ordering_specified_): New boolean member.
6226 * main.cc(main): Call load_plugins after layout object is defined.
6227 * output.cc (Output_section::add_input_section): Use
6228 function section_ordering_specified to check if section ordering is
6229 needed.
6230 * output.cc (Output_section::add_relaxed_input_section): Use
6231 function section_ordering_specified to check if section ordering is
6232 needed.
6233 (Output_section::update_section_layout): New function.
6234 (Output_section::sort_attached_input_sections): Check if input section
6235 must be reordered.
6236 * output.h (Output_section::update_section_layout): New function.
6237 * plugin.cc (get_section_count): New function.
6238 (get_section_type): New function.
6239 (get_section_name): New function.
6240 (get_section_contents): New function.
6241 (update_section_order): New function.
58797674 6242 (allow_section_ordering): New function.
e9552f7e
ST
6243 (Plugin::load): Add the new interfaces to the transfer vector.
6244 (Plugin_manager::load_plugins): New parameter.
6245 (Plugin_manager::all_symbols_read): New parameter.
6246 (Plugin_manager::claim_file): New parameter. Save the elf object for
6247 unclaimed objects.
6248 (Plugin_manager::get_elf_object): New function.
6249 (Plugin_manager::get_view): Change to directly use the bool to check
6250 if get_view is called from claim_file_hook.
6251 * plugin.h (input_objects): New function
6252 (Plugin__manager::load_plugins): New parameter.
6253 (Plugin_manager::claim_file): New parameter.
6254 (Plugin_manager::get_elf_object): New function.
6255 (Plugin_manager::in_claim_file_handler): New function.
6256 (Plugin_manager::in_claim_file_handler_): New member.
6257 (layout): New function.
6258 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6259 handler with an extra parameter. Make the elf object before calling
6260 claim_file handler.
6261 * testsuite/plugin_test.c (get_section_count): New function pointer.
6262 (get_section_type): New function pointer.
6263 (get_section_name): New function pointer.
6264 (get_section_contents): New function pointer.
6265 (update_section_order): New function pointer.
6266 (allow_section_ordering): New function pointer.
6267 (onload): Check if the new interfaces exist.
6268
9446efde
ILT
62692011-07-13 Ian Lance Taylor <iant@google.com>
6270
6271 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6272 relro section.
6273 * x86_64.cc (Target_x86_64::got_section): Likewise.
6274 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6275 (relro_now_test_SOURCES): New variable.
6276 (relro_now_test_DEPENDENCIES): New variable.
6277 (relro_now_test_LDFLAGS): New variable.
6278 (relro_now_test_LDADD): New variable.
6279 (relro_now_test.so): New target.
6280 * testsuite/Makefile.in: Rebuild.
6281
07aa62f2
ILT
62822011-07-12 Ian Lance Taylor <iant@google.com>
6283
6284 PR gold/12980
6285 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6286 GLOB_DAT relocation rather than a RELATIVE relocation for a
6287 protected symbol when creating a shared library.
6288 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6289 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6290 * testsuite/protected_main_1.cc (main): Test that protected
6291 function has same address.
6292
e2153196
ILT
62932011-07-11 Ian Lance Taylor <iant@google.com>
6294
6295 PR gold/12979
6296 * options.h (class General_options): Add -Bgroup.
6297 * options.cc (General_options::finalize): If -Bgroup is set,
6298 default to --unresolved-symbols=report-all.
6299 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6300 * target-reloc.h (issue_undefined_symbol_error): Handle
6301 --unresolved-symbols=report-all.
6302
6daf5215
ILT
63032011-07-08 Ian Lance Taylor <iant@google.com>
6304
6305 PR gold/11985
6306 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6307 if linker script discards key sections.
6308 (Layout::create_dynamic_symtab): Likewise.
6309 (Layout::assign_local_dynsym_offsets): Likewise.
6310 (Layout::sized_create_version_sections): Likewise.
6311 (Layout::create_interp): Likewise.
6312 (Layout::finish_dynamic_section): Likewise.
6313 (Layout::set_dynamic_symbol_size): Likewise.
6314
beabb2c6
ILT
63152011-07-08 Ian Lance Taylor <iant@google.com>
6316
6317 PR gold/12386
6318 * options.h (class General_options): Add --unresolved-symbols.
6319 * target-reloc.h (issue_undefined_symbol_error): Check
6320 --unresolved-symbols. Add comments.
6321
9c16daf1
ILT
63222011-07-08 Ian Lance Taylor <iant@google.com>
6323
6324 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6325 expression more complex.
6326
191f1a2d
ILT
63272011-07-08 Ian Lance Taylor <iant@google.com>
6328
6329 PR gold/11317
6330 * target-reloc.h (issue_undefined_symbol_error): New inline
6331 function, broken out of relocate_section.
6332 (relocate_section): Call issue_undefined_symbol_error.
6333 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6334 there is no TLS segment if we are about to issue an undefined
6335 symbol error.
6336 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6337
62855347
ILT
63382011-07-08 Ian Lance Taylor <iant@google.com>
6339
6340 PR gold/12279
6341 * resolve.cc (Symbol_table::should_override): Add fromtype
6342 parameter. Change all callers. Give error when linking together
6343 TLS and non-TLS symbol.
6344 (Symbol_table::should_override_with_special): Add fromtype
6345 parameter. Change all callers.
6346 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6347 there is no TLS segment if we have reported some errors.
6348 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6349
67181c72
ILT
63502011-07-08 Ian Lance Taylor <iant@google.com>
6351
6352 PR gold/12372
6353 * target.h (Target::plt_address_for_global): New function.
6354 (Target::plt_address_for_local): New function.
6355 (Target::plt_section_for_global): Remove.
6356 (Target::plt_section_for_local): Remove.
6357 (Target::do_plt_address_for_global): New virtual function.
6358 (Target::do_plt_address_for_local): New virtual function.
6359 (Target::do_plt_section_for_global): Remove.
6360 (Target::do_plt_section_for_local): Remove.
6361 (Target::register_global_plt_entry): Add Symbol_table and Layout
6362 parameters.
6363 * output.cc (Output_data_got::Got_entry::write): Use
6364 plt_address_for_global and plt_address_for_local.
6365 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6366 address of output section.
6367 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6368 got_irelative_, and irelative_count_ fields. Update
6369 declarations.
6370 (Output_data_plt_i386::has_irelative_section): New function.
6371 (Output_data_plt_i386::entry_count): Add irelative_count_.
6372 (Output_data_plt_i386::set_final_data_size): Likewise.
6373 (class Target_i386): Add got_irelative_ and rel_irelative_
6374 fields. Update declarations.
6375 (Target_i386::Target_i386): Initialize new fields.
6376 (Target_i386::do_plt_address_for_global): New function replacing
6377 do_plt_section_for_global.
6378 (Target_i386::do_plt_address_for_local): New function replacing
6379 do_plt_section_for_local.
6380 (Target_i386::got_section): Create got_irelative_.
6381 (Target_i386::rel_irelative_section): New function.
6382 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6383 fields. Don't define __rel_iplt_{start,end}.
6384 (Output_data_plt_i386::add_entry): Add symtab and layout
6385 parameters. Change all callers. Use different PLT and GOT for
6386 IFUNC symbols.
6387 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6388 layout parameters. Change all callers. Use different PLT and
6389 GOT.
6390 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6391 (Output_data_plt_i386::rel_irelative): New function.
6392 (Output_data_plt_i386::address_for_global): New function.
6393 (Output_data_plt_i386::address_for_local): New function.
6394 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6395 IRELATIVE GOT when changing IFUNC GOT entries.
6396 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6397 reloc.
6398 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6399 if we didn't create an IRELATIVE GOT.
6400 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6401 plt_address_for_local.
6402 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6403 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6404 got_irelative_, and irelative_count_ fields. Update
6405 declarations.
6406 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6407 Initialize new fields. Remove symtab parameter. Change all
6408 callers.
6409 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6410 irelative_count_.
6411 (Output_data_plt_x86_64::has_irelative_section): New function.
6412 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6413 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6414 fields. Update declarations.
6415 (Target_x86_64::Target_x86_64): Initialize new fields.
6416 (Target_x86_64::do_plt_address_for_global): New function replacing
6417 do_plt_section_for_global.
6418 (Target_x86_64::do_plt_address_for_local): New function replacing
6419 do_plt_section_for_local.
6420 (Target_x86_64::got_section): Create got_irelative_.
6421 (Target_x86_64::rela_irelative_section): New function.
6422 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6423 all callers. Don't create __rel_iplt_{start,end}.
6424 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6425 parameters. Change all callers. Use different PLT and GOT for
6426 IFUNC symbols.
6427 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6428 layout parameters. Change all callers. Use different PLT and
6429 GOT.
6430 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6431 parameters. Change all callers. Use different PLT and GOT for
6432 IFUNC symbols.
6433 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6434 (Output_data_plt_x86_64::rela_irelative): New function.
6435 (Output_data_plt_x86_64::address_for_global): New function.
6436 (Output_data_plt_x86_64::address_for_local): New function.
6437 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6438 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6439 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6440 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6441 parameters.
6442 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6443 reloc.
6444 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6445 symbols if we didn't create an IRELATIVE GOT.
6446 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6447 plt_address_for_local.
6448 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6449 * testsuite/ifuncvar1.c: New test file.
6450 * testsuite/ifuncvar2.c: New test file.
6451 * testsuite/ifuncvar3.c: New test file.
6452 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6453 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6454 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6455 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6456 * testsuite/Makefile.in: Rebuild.
6457
33c15b45
CC
64582011-07-07 Cary Coutant <ccoutant@google.com>
6459
6460 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6461 (two_file_test_1_ndebug.o): Likewise.
6462 (two_file_test_1b_ndebug.o): Likewise.
6463 (two_file_test_2_ndebug.o): Likewise.
6464 (two_file_test_main_ndebug.o): Likewise.
6465 (incremental_test_2): Link with no-debug versions.
6466
f48b5fb7
CC
64672011-07-06 Cary Coutant <ccoutant@google.com>
6468
6469 * gold/incremental.cc
6470 (Output_section_incremental_inputs::write_info_blocks): Check for
6471 hidden and internal symbols.
6472
221597a5
CC
64732011-07-06 Cary Coutant <ccoutant@google.com>
6474
6475 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6476 Check disposition for startup file.
6477 (Incremental_inputs::report_command_line): Ignore
6478 --incremental-startup-unchanged option.
6479 * options.cc (General_options::parse_incremental_startup_unchanged):
6480 New function.
6481 (General_options::General_options): Initialize new data member.
6482 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6483 (General_options): Add --incremental-startup-unchanged option.
6484 (General_options::incremental_startup_disposition): New function.
6485 (General_options::incremental_startup_disposition_): New data member.
6486
e24719f6
CC
64872011-07-06 Cary Coutant <ccoutant@google.com>
6488
6489 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6490 input file index to Script_info ctor.
6491 (Sized_incremental_binary::do_file_has_changed): Find the
6492 command-line argument for files named in scripts.
6493 * incremental.h (Script_info::Script_info): New ctor
6494 with input file index.
6495 (Script_info::input_file_index): New function.
6496 (Script_info::input_file_index_): New data member.
6497 (Incremental_binary::get_library): Add const.
6498 (Incremental_binary::get_script_info): Add const.
6499 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6500 * testsuite/Makefile.am (incremental_test_5): New test case.
6501 (incremental_test_6): New test case.
6502 * testsuite/Makefile.in: Regenerate.
6503
8f7c81e8
CC
65042011-07-06 Cary Coutant <ccoutant@google.com>
6505
6506 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6507 debug output when command lines differ.
6508
9fbd3822
CC
65092011-07-06 Cary Coutant <ccoutant@google.com>
6510
6511 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6512 --incremental-patch option.
6513 * layout.cc (Free_list::allocate): Extend allocation beyond original
6514 end if enabled.
6515 (Layout::make_output_section): Mark sections that should get
6516 patch space.
6517 * options.cc (parse_percent): New function.
6518 * options.h (parse_percent): New function.
6519 (DEFINE_percent): New macro.
6520 (General_options): Add --incremental-patch option.
6521 * output.cc (Output_section::Output_section): Initialize new data
6522 members.
6523 (Output_section::add_input_section): Print section name when out
6524 of patch space.
6525 (Output_section::add_output_section_data): Likewise.
6526 (Output_section::set_final_data_size): Add patch space when
6527 doing --incremental-full.
6528 (Output_section::do_reset_address_and_file_offset): Remove patch
6529 space.
6530 (Output_segment::set_section_list_addresses): Print debug output
6531 only if --incremental-update.
6532 * output.h (Output_section::set_is_patch_space_allowed): New function.
6533 (Output_section::is_patch_space_allowed_): New data member.
6534 (Output_section::patch_space_): New data member.
6535 * parameters.cc (Parameters::incremental_full): New function.
6536 * parameters.h (Parameters::incremental_full): New function
6537 * testsuite/Makefile.am (incremental_test_2): Add test for
6538 --incremental-patch option.
6539 * testsuite/Makefile.in: Regenerate.
6540 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6541 (t18): Remove function body.
6542
f6cccc2c
DK
65432011-07-05 Doug Kwan <dougkwan@google.com>
6544
6545 PR gold/12771
6546 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6547 Arm_Address type for relocation result.
6548 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6549 overflow check.
6550 (Arm_relocate_functions::abs32): Use unaligned access.
6551 (Arm_relocate_functions::rel32): Ditto.
6552 (Arm_relocate_functions::prel31): Ditto.
6553 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6554 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6555 static data relocations.
6556 * testsuite/Makefile.in: Regnerate.
6557 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6558
28a13fec
ILT
65592011-07-05 Ian Lance Taylor <iant@google.com>
6560
6561 PR gold/12392
6562 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6563 symbols if necessary.
6564 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6565
24d47b34
ILT
65662011-07-05 Ian Lance Taylor <iant@google.com>
6567
6568 PR gold/12952
6569 * resolve.cc (Symbol::override_base_with_special): Simply override
6570 version with special symbol version, ignoring previous version.
6571
41f9cbbe
ILT
65722011-07-05 Ian Lance Taylor <iant@google.com>
6573
6574 * object.cc (Sized_relobj_file::include_section_group): Add
6575 information to comment about signature location.
6576
886288f1
ILT
65772011-07-02 Ian Lance Taylor <iant@google.com>
6578
6579 PR gold/12957
6580 * options.h (class General_options): Add -f and -F.
6581 * options.cc (General_options::finalize): Fatal error if -f/-F
6582 are used without -shared.
6583 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6584
ae3a6d4f
ILT
65852011-07-02 Ian Lance Taylor <iant@google.com>
6586
6587 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6588
21131061
ILT
65892011-07-01 Ian Lance Taylor <iant@google.com>
6590
6591 PR gold/12525
6592 PR gold/12952
6593 * resolve.cc (Symbol::override_base_with_special): Don't override
6594 the version if the overriding symbol has a different name.
6595 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6596 all callers. If we give an error about an undefined version,
6597 define the base version if necessary.
6598 * dynobj.h (class Versions): Update declaration.
6599 * testsuite/weak_alias_test_5.cc: New file.
6600 * testsuite/weak_alias_test.script: New file.
6601 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6602 and versioned_alias have the right value, and call t2.
6603 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6604 weak_alias_test_5.so.
6605 (weak_alias_test_LDADD): Likewise.
6606 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6607 * testsuite/Makefile.in: Rebuild.
6608
611062c0
ILT
66092011-07-01 Ian Lance Taylor <iant@google.com>
6610
6611 PR gold/12525
6612 * options.h (class General_options): Support -z notext.
6613 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6614 -Wl,-z,notext.
6615 (two_file_shared_nonpic.so): Likewise.
6616 (two_file_shared_mixed.so): Likewise.
6617 (two_file_shared_mixed_1.so): Likewise.
6618 (weak_undef_lib_nonpic.so): Likewise.
6619 (alt/weak_undef_lib_nonpic.so): Likewise.
6620 (tls_test_shared_nonpic.so): Likewise.
6621 * testsuite/Makefile.in: Rebuild.
6622
328c7c2f
ILT
66232011-07-01 Ian Lance Taylor <iant@google.com>
6624
6625 PR gold/12525
6626 * configure.ac: Test whether static linking works, setting
6627 the automake conditional HAVE_STATIC.
6628 * testsuite/Makefile.am: Disable tests using -static if
6629 HAVE_STATIC is not true.
6630 * configure, testsuite/Makefile.in: Rebuild.
6631
02d7cd44
ILT
66322011-07-01 Ian Lance Taylor <iant@google.com>
6633
6634 PR gold/12525
6635 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6636 Assert if we see DW_EH_PE_indirect.
6637 * target.h (Target::ehframe_datarel_base): New function.
6638 (Target::do_ehframe_datarel_base): New target function.
6639 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6640 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6641 function.
6642
07a60597
ILT
66432011-07-01 Ian Lance Taylor <iant@google.com>
6644
6645 PR gold/12571
6646 * options.h (class General_options): Add
6647 --ld-generated-unwind-info.
6648 * ehframe.cc (Fde::write): Add address parameter. Change all
6649 callers. If associated with PLT, fill in address and size.
6650 (Cie::set_output_offset): Only add merge mapping if there is an
6651 object.
6652 (Cie::write): Add address parameter. Change all callers.
6653 (Eh_frame::add_ehframe_for_plt): New function.
6654 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6655 input_offset_ fields into union u_, with new plt field.
6656 (Fde::Fde): Adjust for new union field.
6657 (Fde::Fde) [Output_data version]: New constructor.
6658 (Fde::add_mapping): Only add merge mapping if there is an object.
6659 (class Cie): Update declarations.
6660 (class Eh_frame): Declare add_ehframe_for_plt.
6661 * layout.cc (Layout::layout_eh_frame): Break out code into
6662 make_eh_frame_section, and call it.
6663 (Layout::make_eh_frame_section): New function.
6664 (Layout::add_eh_frame_for_plt): New function.
6665 * layout.h (class Layout): Update declarations.
6666 * merge.cc (Merge_map::add_mapping): Add assertion.
6667 * i386.cc: Include "dwarf.h".
6668 (class Output_data_plt_i386): Make first_plt_entry,
6669 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6670 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6671 and plt_eh_frame_fde.
6672 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6673 boundary. Call add_eh_frame_for_plt if appropriate.
6674 * x86_64.cc: Include "dwarf.h".
6675 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6676 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6677 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6678 and plt_eh_frame_fde.
6679 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6680 appropriate.
6681
14788a3f
ILT
66822011-06-29 Ian Lance Taylor <iant@google.com>
6683
6684 PR gold/12629
6685 * object.cc (Sized_relobj_file::layout_section): Change shdr
6686 parameter to be const.
6687 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6688 out of do_layout.
6689 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6690 appropriate. Call layout_eh_frame_section.
6691 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6692 sections.
6693 * object.h (class Sized_relobj_file): Update declarations.
6694
6c21fce1
ILT
66952011-06-29 Ian Lance Taylor <iant@google.com>
6696
37e41b03 6697 PR gold/12652
6c21fce1
ILT
6698 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6699 modifier.
6700 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6701
4d5e4e62
ILT
67022011-06-29 Ian Lance Taylor <iant@google.com>
6703
6704 PR gold/12675
6705 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6706 SHT_X86_64_UNWIND.
6707 * layout.cc (Layout::layout_eh_frame): Likewise.
6708
886f533a
ILT
67092011-06-29 Ian Lance Taylor <iant@google.com>
6710
6711 PR gold/12695
6712 * layout.cc (Layout::symtab_section_shndx): New function.
6713 * layout.h (class Layout): Declare symtab_section_shndx.
6714 * output.cc (Output_section::write_header): Call it.
6715
f3ae1b28
ILT
67162011-06-29 Ian Lance Taylor <iant@google.com>
6717
6718 PR gold/12818
6719 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6720 symbols which are not used in a relocation.
6721
aecf301f
ILT
67222011-06-28 Ian Lance Taylor <iant@google.com>
6723
6724 PR gold/12898
6725 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6726 script create indistinguishable segments.
6727 (Layout::set_segment_offsets): Use stable_sort when sorting
6728 segments. Pass this to Compare_segments constructor.
6729 * layout.h (class Layout): Make segment_precedes non-static.
6730 (class Compare_segments): Change from struct to class. Add
6731 layout_ field. Add constructor.
6732 * script-sections.cc
6733 (Script_sections::attach_sections_using_phdrs_clause): Rename
6734 local orphan to is_orphan. Don't report failure to put empty
6735 section in segment. On attachment failure, report name of
6736 section, and attach to first PT_LOAD segment.
6737
03ef7571
ILT
67382011-06-28 Ian Lance Taylor <iant@google.com>
6739
6740 PR gold/12934
6741 * target-select.cc (Target_selector::Target_selector): Add
6742 emulation parameter. Change all callers.
6743 (select_target_by_bfd_name): Rename from select_target_by_name.
6744 Change all callers.
6745 (select_target_by_emulation): New function.
6746 (supported_emulation_names): New function.
6747 * target-select.h (class Target_selector): Add emulation_ field.
6748 Update declarations.
6749 (Target_selector::recognize_by_bfd_name): Rename from
6750 recognize_by_name. Change all callers.
6751 (Target_selector::supported_bfd_names): Rename from
6752 supported_names. Change all callers.
6753 (Target_selector::recognize_by_emulation): New function.
6754 (Target_selector::supported_emulations): New function.
6755 (Target_selector::emulation): New function.
6756 (Target_selector::do_recognize_by_bfd_name): Rename from
6757 do_recognize_by_name. Change all callers.
6758 (Target_selector::do_supported_bfd_names): Rename from
6759 do_supported_names. Change all callers.
6760 (Target_selector::do_recognize_by_emulation): New function.
6761 (Target_selector::do_supported_emulations): New function.
6762 (select_target_by_bfd_name): Change name in declaration.
6763 (select_target_by_emulation): Declare.
6764 (supported_emulation_names): Declare.
6765 * parameters.cc (parameters_force_valid_target): Try to find
6766 target based on emulation from -m option.
6767 * options.h (class General_options): Change doc string for -m.
6768 * options.cc (help): Print emulations.
6769 (General_options::parse_V): Likewise.
6770 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6771 Add emulation parameter. Change all callers.
6772
200b2bb9
ILT
67732011-06-28 Ian Lance Taylor <iant@google.com>
6774
6775 * target.h (class Target): Add osabi_ field.
6776 (Target::osabi): New function.
6777 (Target::set_osabi): New function.
6778 (Target::Target): Initialize osabi_.
6779 (Target::do_adjust_elf_header): Make pure virtual.
6780 (Sized_target::do_adjust_elf_header): Declare.
6781 * target.cc (Sized_target::do_adjust_elf_header): New function.
6782 (class Sized_target): Instantiate all versions.
6783 * freebsd.h (class Target_freebsd): Remove.
6784 (Target_selector_freebsd::do_recognize): Call set_osabi on
6785 Target.
6786 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6787 (Target_selector_freebsd::set_osabi): Remove.
6788 * i386.cc (class Target_i386): Inherit from Sized_target rather
6789 than Target_freebsd.
6790 * x86_64.cc (class Target_x86_64): Likewise.
6791
b3ce541e
ILT
67922011-06-28 Ian Lance Taylor <iant@google.com>
6793
6794 * target.h (Target::can_check_for_function_pointers): Rewrite.
6795 Make non-virtual.
6796 (Target::can_icf_inline_merge_sections): Likewise.
6797 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6798 (Target::Target_info): Add can_icf_inline_merge_sections field.
6799 (Target::do_can_check_for_function_pointers): New virtual
6800 function.
6801 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6802 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6803 from can_check_for_function_pointers, move in file.
6804 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6805 section_may_have_icf_unsafe_poineters, move in file.
6806 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6807 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6808 Rename from can_check_for_function_pointers, move in file.
6809 (Target_i386::can_icf_inline_merge_sections): Remove.
6810 (Target_i386::i386_info): Initialize
6811 can_icf_inline_merge_sections.
6812 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6813 Initialize can_icf_inline_merge_sections.
6814 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6815 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6816 Rename from can_check_for_function_pointers, move in file.
6817 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6818 (Target_x86_64::x86_64_info): Initialize
6819 can_icf_inline_merge_sections.
6820 * testsuite/testfile.cc (Target_test::test_target_info):
6821 Likewise.
6822 * icf.cc (get_section_contents): Correct formatting.
6823
6d1c4efb
ILT
68242011-06-27 Ian Lance Taylor <iant@google.com>
6825
6826 * symtab.cc (Symbol::versioned_name): New function.
6827 (Symbol_table::add_to_final_symtab): Use versioned_name when
6828 appropriate.
6829 (Symbol_table::sized_write_symbol): Likewise.
6830 * symtab.h (class Symbol): Declare versioned_name.
6831 * stringpool.h (class Stringpool_template): Add variant of add
6832 which takes a std::basic_string.
6833 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6834 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6835 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6836 (ver_test_12.o): New target.
6837 * testsuite/Makefile.in: Rebuild.
6838
57eb9b50
DK
68392011-06-27 Doug Kwan <dougkwan@google.com>
6840
6841 * arm.cc (Arm_relocate_functions::thm_jump8,
6842 Arm_relocate_functions::thm_jump11): Use a wider signed
6843 type to compute offset.
6844 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6845 arm_thm_jump8.
6846 * testsuite/Makefile.in: Regenerate.
6847 * testsuite/arm_branch_in_range.sh: Check test results of
6848 arm_thm_jump11 and arm_thm_jump8.
6849 * testsuite/arm_thm_jump11.s: New test source file.
6850 * testsuite/arm_thm_jump11.t: New linker script.
6851 * testsuite/arm_thm_jump8.s: New test source file.
6852 * testsuite/arm_thm_jump8.t: New linker script.
6853
487b39df
ILT
68542011-06-24 Ian Lance Taylor <iant@google.com>
6855
6856 * layout.cc: Include "object.h".
6857 (ctors_sections_in_init_array): New static variable.
6858 (Layout::is_ctors_in_init_array): New function.
6859 (Layout::layout): Add entry to ctors_sections_in_init_array if
6860 appropriate.
6861 * layout.h (class Layout): Declare is_ctors_in_init_array.
6862 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6863 is_ctors_reverse_view is set.
6864 (Sized_relobj_file::write_sections): Add layout parameter. Change
6865 all callers. Set is_ctors_reverse_view field of View_size.
6866 (Sized_relobj_file::reverse_words): New function.
6867 * object.h (Sized_relobj_file::View_size): Add
6868 is_ctors_reverse_view field.
6869 (class Sized_relobj_file): Update declarations.
6870 * testsuite/initpri3.c: New test.
6871 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6872 initpri3b.
6873 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6874 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6875 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6876 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6877 * testsuite/Makefile.in: Rebuild.
6878
472076e4
CC
68792011-06-24 Cary Coutant <ccoutant@google.com>
6880
6881 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6882 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6883 (debug_msg_cdebug.err): New targets.
6884 * testsuite/Makefile.in: Regenerate.
6885 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6886 Fix checks for link with shared library.
6887
a60af0db
DK
68882011-06-24 Doug Kwan <dougkwan@google.com>
6889
6890 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6891 skip empty text sections.
6892 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6893
5393d741
ILT
68942011-06-22 Ian Lance Taylor <iant@google.com>
6895
6896 PR gold/12910
6897 * options.h (class General_options): Add --ctors-in-init-array.
6898 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6899 friends as SHT_PROGBITS for merging sections.
6900 (Layout::layout): Remove special handling of .init_array and
6901 friends. Don't sort if doing relocatable link. Sort for .ctors
6902 and .dtors if ctors_in_init_array.
6903 (Layout::make_output_section): Force correct section types for
6904 .init_array and friends. Don't sort if doing relocatable link,
6905 Don't sort .ctors and .dtors if ctors_in_init_array.
6906 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6907 (Layout::output_section_name): Add relobj parameter. Change all
6908 callers. Handle .ctors. and .dtors. in code rather than table.
6909 Handle .ctors and .dtors if ctors_in_init_array.
6910 (Layout::match_file_name): New function, moved from output.cc.
6911 * layout.h (class Layout): Update declarations.
6912 * output.cc: Include "layout.h".
6913 (Input_section_sort_entry::get_priority): New function.
6914 (Input_section_sort_entry::match_file_name): Just call
6915 Layout::match_file_name.
6916 (Output_section::Input_section_sort_init_fini_compare::operator()):
6917 Handle .ctors and .dtors. Sort by explicit priority rather than
6918 by name.
6919 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6920 * testsuite/initpri2.c: New test.
6921 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6922 (check_PROGRAMS): Add initpri2.
6923 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6924 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6925 * configure, testsuite/Makefile.in: Rebuild.
6926
e1f74f98
ILT
69272011-06-19 Ian Lance Taylor <iant@google.com>
6928
6929 PR gold/12880
6930 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6931 .interp section to a PT_INTERP segment even if we have seen a
6932 --dynamic-linker option. Don't do it if we have seen a PHDRS
6933 clause in a linker script.
6934 (Layout::finalize): Don't create a .interp section if we've
6935 already create a PT_INTERP segment.
6936 (Layout::create_interp): Always call choose_output_section (revert
6937 patch of 2011-06-17). Don't create PT_INTERP segment.
6938 * script-sections.cc
6939 (Script_sections::create_note_and_tls_segments): Add a .interp
6940 section to a PT_INTERP segment even if we have seen a
6941 --dynamic-linker option.
6942
766f91bb
ILT
69432011-06-18 Ian Lance Taylor <iant@google.com>
6944
6945 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6946 merely because a non-PT_LOAD segment has a dynamic reloc.
6947
0d212c3a
ILT
69482011-06-18 Ian Lance Taylor <iant@google.com>
6949
6950 * layout.cc (Layout::finish_dynamic_section): Don't create
6951 DT_FLAGS entry if not needed.
6952
911a5072
ILT
69532011-06-18 Ian Lance Taylor <iant@google.com>
6954
6955 PR gold/12745
6956 * layout.cc (Layout::layout_eh_frame): Correct handling of
6957 writable .eh_frame section.
6958
534b4e5f
ILT
69592011-06-17 Ian Lance Taylor <iant@google.com>
6960
6961 PR gold/12893
6962 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6963 symbol is redefined with the exact same object and value.
6964
10b4f102
ILT
69652011-06-17 Ian Lance Taylor <iant@google.com>
6966
6967 PR gold/12880
6968 * layout.h (class Layout): Add interp_segment_ field.
6969 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6970 (Layout::attach_allocated_section_to_segment): If making shared
6971 library, put .interp section in PT_INTERP segment.
6972 (Layout::finalize): Also call create_interp if -dynamic-linker
6973 option was used.
6974 (Layout::create_interp): Assert that there is no PT_INTERP
6975 segment. If not using a SECTIONS clause, use make_output_section.
6976 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6977 * script-sections.cc
6978 (Script_sections::create_note_and_tls_segments): If making shared
6979 library, put .interp section in PT_INTERP segment.
6980
a29b0dad
ILT
69812011-06-17 Ian Lance Taylor <iant@google.com>
6982
e588ea8d
ILT
6983 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6984 when making a shared library.
6985
69862011-06-17 Ian Lance Taylor <iant@google.com>
6987
6988 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6989 parameter. Change all callers. Don't issue warning about PC32
6990 against locally defined symbol.
a29b0dad 6991
9d3b0698
ILT
69922011-06-16 Ian Lance Taylor <iant@google.com>
6993
6994 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6995 occurs in same object.
6996
85b0f90c
AM
69972011-06-14 Alan Modra <amodra@gmail.com>
6998
6999 * po/POTFILES.in: Regenerate.
7000
a94907d9
ILT
70012011-06-09 Ian Lance Taylor <iant@google.com>
7002
7003 * script-sections.cc
7004 (Orphan_output_section::set_section_addresses): For a relocatable
7005 link set address to 0.
7006
4fb3a1c3
CC
70072011-06-09 Cary Coutant <ccoutant@google.com>
7008
7009 PR gold/12804
7010 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7011 used with --compress-debug-sections.
7012 * gold/object.cc (Sized_relobj_file::do_layout): Report
7013 uncompressed size of compressed input sections.
7014
61220854
CC
70152011-06-08 Cary Coutant <ccoutant@google.com>
7016
7017 PR gold/12804
7018 * testsuite/two_file_test_2_v1.cc: Change initialization of
7019 v2 to keep it in .data.
7020
e6455dfb
CC
70212011-06-07 Cary Coutant <ccoutant@google.com>
7022
7023 * common.cc (Symbol_table::do_allocate_commons_list): Call
7024 gold_fallback.
7025 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7026 (Errors::fallback): New function.
7027 (gold_fallback): New function.
7028 * errors.h (Errors::fallback): New function.
7029 * gold.cc (gold_exit): Change status parameter to enum; adjust
7030 all callers.
7031 (queue_initial_tasks): Call gold_fallback.
7032 * gold.h: Include cstdlib.
7033 (Exit_status): New enum type.
7034 (gold_exit): Change status parameter to enum.
7035 (gold_fallback): New function.
7036 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7037 (Layout::create_symtab_sections): Likewise.
7038 (Layout::create_shdrs): Likewise.
7039 * main.cc (main): Adjust call to gold_exit.
7040 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7041 (Output_data_got::add_got_entry_pair): Likewise.
7042 (Output_section::add_input_section): Likewise.
7043 (Output_section::add_output_section_data): Likewise.
7044 (Output_segment::set_section_list_addresses): Likewise.
7045 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7046
fb0e076f
CC
70472011-06-07 Cary Coutant <ccoutant@google.com>
7048
7049 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7050 for incremental links.
7051 * output.cc (Output_segment::set_section_list_addresses): Remove
7052 FIXME and test for TLS or BSS.
7053
a5ee4d5d
CC
70542011-06-07 Cary Coutant <ccoutant@google.com>
7055
7056 * testsuite/Makefile.am: Add incremental_copy_test,
7057 incremental_common_test_1.
7058 * testsuite/Makefile.in: Regenerate.
7059 * testsuite/common_test_1_v1.c: New source file.
7060 * testsuite/common_test_1_v2.c: New source file.
7061 * testsuite/copy_test_v1.cc: New source file.
7062
5146f448
CC
70632011-06-07 Cary Coutant <ccoutant@google.com>
7064
7065 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7066 update, allocate common from bss section's free list.
7067 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7068 linker-defined symbols.
7069 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7070 Skip GOT and PLT entries that are no longer referenced.
7071 (Output_section_incremental_inputs::write_info_blocks): Mark
7072 linker-defined symbols.
7073 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7074 * output.cc (Output_section::allocate): New function.
7075 * output.h (Output_section::allocate): New function.
7076 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7077 linker-defined symbols.
7078 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7079 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7080 (Symbol::init_base_output_data): Likewise.
7081 (Symbol::init_base_output_segment): Likewise.
7082 (Symbol::init_base_constant): Likewise.
7083 (Sized_symbol::init_output_data): Likewise.
7084 (Sized_symbol::init_output_segment): Likewise.
7085 (Sized_symbol::init_constant): Likewise.
7086 (Symbol_table::do_define_in_output_data): Likewise.
7087 (Symbol_table::do_define_in_output_segment): Likewise.
7088 (Symbol_table::do_define_as_constant): Likewise.
7089 * symtab.h (Symbol::is_predefined): New function.
7090 (Symbol::init_base_output_data): Add is_predefined parameter.
7091 (Symbol::init_base_output_segment): Likewise.
7092 (Symbol::init_base_constant): Likewise.
7093 (Symbol::is_predefined_): New data member.
7094 (Sized_symbol::init_output_data): Add is_predefined parameter.
7095 (Sized_symbol::init_output_segment): Likewise.
7096 (Sized_symbol::init_constant): Likewise.
7097 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7098
26d3c67d
CC
70992011-06-07 Cary Coutant <ccoutant@google.com>
7100
7101 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7102 instead of emit_copy_reloc.
7103 (Copy_relocs::emit_copy_reloc): Refactor.
7104 (Copy_relocs::make_copy_reloc): New function.
7105 (Copy_relocs::add_copy_reloc): Remove.
7106 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7107 section.
7108 (Copy_relocs::make_copy_reloc): New function.
7109 (Copy_relocs::add_copy_reloc): Remove.
7110 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7111 unchanged input files.
7112 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7113 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7114 Reserve BSS space for COPY relocations.
7115 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7116 (Output_section_incremental_inputs::write_info_blocks): Record
7117 whether a symbol is copied from a shared object.
7118 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7119 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7120 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7121 (Incremental_input_entry_reader::get_output_symbol_index): Add
7122 is_copy parameter.
7123 (Incremental_binary::emit_copy_relocs): New function.
7124 (Incremental_binary::do_emit_copy_relocs): New function.
7125 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7126 new data member.
7127 (Sized_incremental_binary::add_copy_reloc): New function.
7128 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7129 (Sized_incremental_binary::Copy_reloc): New struct.
7130 (Sized_incremental_binary::Copy_relocs): New typedef.
7131 (Sized_incremental_binary::copy_relocs_): New data member.
7132 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7133 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7134 * target.h (Sized_target::emit_copy_reloc): New function.
7135 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7136
7cdb37d9
CC
71372011-06-02 Cary Coutant <ccoutant@google.com>
7138
7139 PR gold/12163
7140 * gold/archive.cc (Archive::Archive): Initialize new data member.
7141 (Archive::include_all_members): Return if archive has already been
7142 included.
7143 * gold/archive.h (Archive::include_all_members_): New data member.
7144
cc643b88
NC
71452011-06-02 Nick Clifton <nickc@redhat.com>
7146
7147 * dynobj.h: Fix spelling mistake in comment.
7148 * output.cc: Likewise.
7149
f62a3ca7 71502011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7151 Asier Llano
f62a3ca7
DK
7152
7153 PR gold/12826
cc643b88 7154 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7155 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7156 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7157 redundant arm_exidx_test.so.
7158 * testsuite/Makefile.in: Regenerate.
7159 (check_SCRIPTS): Add pr12826.sh
7160 (check_DATA): Add pr12826.stdout
7161 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7162 * testsuite/pr12826.sh: New file.
7163 * testsuite/pr12826_1.s: Ditto.
7164 * testsuite/pr12826_1.s: Ditto.
7165
8dbe1edc
ILT
71662011-05-30 Ian Lance Taylor <iant@google.com>
7167
7168 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7169 sections.
7170
c49875be
ILT
71712011-05-29 Ian Lance Taylor <iant@google.com>
7172
7173 PR gold/12804
7174 * testsuite/Makefile.am: Use different file name for two_file_test
7175 temporary file for each incremental test.
7176 * testsuite/Makefile.in: Rebuild.
7177
69d53f7a
ILT
71782011-05-29 Ian Lance Taylor <iant@google.com>
7179
7180 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7181 binary input file is empty.
7182
41d0ab5f
ILT
71832011-05-27 Ian Lance Taylor <iant@google.com>
7184
7185 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7186 (ver_test_9.so): Likewise.
7187 * testsuite/Makefile.in: Rebuild.
7188
89d8a36b
CC
71892011-05-26 Cary Coutant <ccoutant@google.com>
7190
7191 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7192 * incremental.cc (Incremental_inputs::report_input_section): Fix
7193 comment, indentation.
7194 (Incremental_inputs::report_comdat_group): New function.
7195 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7196 of data for incremental input file entry.
7197 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7198 group count, COMDAT group signatures.
7199 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7200 an unchanged input file.
7201 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7202 Initialize new data member.
7203 (Incremental_object_entry::add_comdat_group): New function.
7204 (Incremental_object_entry::get_comdat_group_count): New function.
7205 (Incremental_object_entry::get_comdat_signature_key): New function.
7206 (Incremental_object_entry::groups_): New data member.
7207 (Incremental_inputs::report_comdat_group): New function.
7208 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7209 data for incremental input file entry.
7210 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7211 (Incremental_input_entry_reader::get_input_section): Adjust size of
7212 data for incremental input file entry.
7213 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7214 (Incremental_input_entry_reader::get_comdat_group_signature): New
7215 function.
7216 * object.cc (Sized_relobj::include_section_group): Report kept
7217 COMDAT groups for incremental links.
7218
1706a06f
ILT
72192011-05-24 David Meyer <pdox@google.com>
7220
7221 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7222 with name parameter. Add found_name parameter.
7223 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7224 * dirsearch.h (class Dirsearch): Update declaration.
7225
a10ae760
ILT
72262011-05-24 Ian Lance Taylor <iant@google.com>
7227
7228 * archive.cc (Library_base::should_include_member): Pull in object
7229 from archive if it defines the entry symbol.
7230 * parameters.cc (Parameters::entry): New function.
7231 * parameters.h (class Parameters): Declare entry.
7232 * output.h (class Output_file_header): Remove entry_ field.
7233 * output.cc (Output_file_header::Output_file_header): Remove entry
7234 parameter. Change all callers.
7235 (Output_file_header::entry): Use parameters->entry.
7236 * gold.cc (queue_middle_tasks): Likewise.
7237 * plugin.cc (Plugin_hook::run): Likewise.
7238
aa92d6ed
CC
72392011-05-24 Cary Coutant <ccoutant@google.com>
7240
7241 * gold.cc (queue_initial_tasks): Pass incremental base filename
7242 to Output_file::open_base_file; don't print error message.
7243 * incremental-dump.cc (main): Adjust call to
7244 Output_file::open_for_modification.
7245 * incremental-dump.cc (main): Likewise.
7246 * incremental.cc (Incremental_inputs::report_command_line):
7247 Ignore --incremental-base option when comparing command lines.
7248 Ignore parameter when given as separate argument.
7249 * options.h (class General_options): Add --incremental-base.
7250 * output.cc (Output_file::Output_file):
7251 (Output_file::open_base_file): Add base_name and writable parameters;
7252 read base file into new file; print error message here.
7253 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7254 callers.
7255 * output.h (Output_file::open_for_modification): Rename to...
7256 (Output_file::open_base_file): ...this; add base_name and
7257 writable parameters; adjust all callers.
7258 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7259 callers.
7260 * testsuite/Makefile.am (incremental_test_4): Test
7261 --incremental-base.
7262 * testsuite/Makefile.in: Regenerate.
7263
2eedd706
CC
72642011-05-24 Cary Coutant <ccoutant@google.com>
7265
7266 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7267 incremental_test_4.
7268 * testsuite/Makefile.in: Regenerate.
7269 * testsuite/two_file_test_1_v1.cc: New test source file.
7270 * testsuite/two_file_test_1b_v1.cc: New test source file.
7271 * testsuite/two_file_test_2_v1.cc: New test source file.
7272
0f1c85a6
CC
72732011-05-24 Cary Coutant <ccoutant@google.com>
7274
7275 * dynobj.h (Dynobj::do_dynobj): New function.
7276 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7277 flag and soname for shared objects.
7278 * incremental.cc (Incremental_inputs::report_object): Make
7279 either Incremental_object_entry or Incremental_dynobj_entry; add
7280 soname to string table.
7281 (Incremental_inputs::report_input_section): Add assertion.
7282 (Output_section_incremental_inputs::set_final_data_size): Adjust
7283 type of input file entry for shared libraries; adjust size of
7284 shared library info entry.
7285 (Output_section_incremental_inputs::write_input_files): Write
7286 as_needed flag for shared libraries.
7287 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7288 of input file entry for shared libraries; write soname.
7289 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7290 soname from incremental info.
7291 * incremental.h (enum Incremental_input_flags): Add
7292 INCREMENTAL_INPUT_AS_NEEDED.
7293 (Incremental_input_entry::Incremental_input_entry): Initialize new
7294 data member.
7295 (Incremental_input_entry::set_as_needed): New function.
7296 (Incremental_input_entry::as_needed): New function.
7297 (Incremental_input_entry::do_dynobj_entry): New function.
7298 (Incremental_input_entry::as_needed_): New data member.
7299 (Incremental_object_entry::Incremental_object_entry): Don't check
7300 for shared library.
7301 (Incremental_object_entry::do_type): Likewise.
7302 (class Incremental_dynobj_entry): New class.
7303 (Incremental_input_entry_reader::as_needed): New function.
7304 (Incremental_input_entry_reader::get_soname): New function.
7305 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7306 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7307 size of shared library info entry.
58797674 7308 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7309 incremental link when adding DT_NEEDED entries.
7310 * object.h (Object::Object): Initialize new data member.
7311 (Object::dynobj): New function.
7312 (Object::set_as_needed): New function.
7313 (Object::as_needed): New function.
7314 (Object::do_dynobj): New function.
7315 (Object::as_needed_): New data member.
7316
6fa2a40b
CC
73172011-05-24 Cary Coutant <ccoutant@google.com>
7318
7319 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7320 info; adjust display of GOT entries.
7321 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7322 vector of input objects; remove file_status_.
7323 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7324 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7325 got_plt reader; call target hooks to reserve GOT entries.
7326 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7327 of input file info header and GOT info entry.
7328 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7329 relocation info.
7330 (Got_plt_view_info::got_descriptor): Remove.
7331 (Got_plt_view_info::sym_index): New data member.
7332 (Got_plt_view_info::input_index): New data member.
7333 (Local_got_offset_visitor::visit): Write input file index.
7334 (Global_got_offset_visitor::visit): Write 0 for input file index.
7335 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7336 with sym_index and input_index.
7337 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7338 incremental info GOT entry; replace got_descriptor with input_index.
7339 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7340 map from input file index to object.
7341 (Sized_relobj_incr::do_layout): Replace direct data member reference
7342 with accessor function.
7343 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7344 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7345 Adjust size of input file info header.
7346 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7347 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7348 (Incremental_input_entry_reader::get_input_section): Adjust size of
7349 input file info header.
7350 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7351 of incremental info GOT entry.
7352 (Incremental_got_plt_reader::get_got_desc): Remove.
7353 (Incremental_got_plt_reader::get_got_symndx): New function.
7354 (Incremental_got_plt_reader::get_got_input_index): New function.
7355 (Sized_incremental_binary::Sized_incremental_binary): Remove
7356 file_status_; add input_objects_.
7357 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7358 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7359 (Sized_incremental_binary::file_is_unchanged): Remove.
7360 (Sized_incremental_binary::set_input_object): New function.
7361 (Sized_incremental_binary::input_object): New function.
7362 (Sized_incremental_binary::file_status_): Remove.
7363 (Sized_incremental_binary::input_objects_): New data member.
7364 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7365 references.
7366 (Sized_relobj_incr::invalid_address): Move to base class.
7367 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7368 class.
7369 (Sized_relobj_incr::do_output_section_offset): Likewise.
7370 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7371 (Sized_relobj_incr::section_offsets_): Likewise.
7372 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7373 function.
7374 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7375 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7376 with accessor function.
7377 (Sized_relobj_file::do_layout): Likewise.
7378 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7379 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7380 (Sized_relobj_file::compute_final_local_value): Replace refs to
7381 section_offsets_ with accessor function.
7382 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7383 * object.h (Relobj::Relobj): Initialize new data members.
7384 (Relobj::add_dyn_reloc): New function.
7385 (Relobj::first_dyn_reloc): New function.
7386 (Relobj::dyn_reloc_count): New function.
7387 (Relobj::first_dyn_reloc_): New data member.
7388 (Relobj::dyn_reloc_count_): New data member.
7389 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7390 references.
7391 (Sized_relobj::Address): New typedef.
7392 (Sized_relobj::invalid_address): Move here from child class.
7393 (Sized_relobj::Sized_relobj): Initialize new data members.
7394 (Sized_relobj::sized_relobj): New function.
7395 (Sized_relobj::is_output_section_offset_invalid): Move here from
7396 child class.
7397 (Sized_relobj::get_output_section_offset): Likewise.
7398 (Sized_relobj::local_has_got_offset): Likewise.
7399 (Sized_relobj::local_got_offset): Likewise.
7400 (Sized_relobj::set_local_got_offset): Likewise.
7401 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7402 (Sized_relobj::clear_got_offsets): New function.
7403 (Sized_relobj::section_offsets): Move here from child class.
7404 (Sized_relobj::do_output_section_offset): Likewise.
7405 (Sized_relobj::do_set_section_offset): Likewise.
7406 (Sized_relobj::Local_got_offsets): Likewise.
7407 (Sized_relobj::local_got_offsets_): Likewise.
7408 (Sized_relobj::section_offsets_): Likewise.
7409 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7410 references.
7411 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7412 class.
7413 (Sized_relobj_file::sized_relobj): New function
7414 (Sized_relobj_file::local_has_got_offset): Move to base class.
7415 (Sized_relobj_file::local_got_offset): Likewise.
7416 (Sized_relobj_file::set_local_got_offset): Likewise.
7417 (Sized_relobj_file::get_output_section_offset): Likewise.
7418 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7419 (Sized_relobj_file::do_output_section_offset): Likewise.
7420 (Sized_relobj_file::do_set_section_offset): Likewise.
7421 (Sized_relobj_file::Local_got_offsets): Likewise.
7422 (Sized_relobj_file::local_got_offsets_): Likewise.
7423 (Sized_relobj_file::section_offsets_): Likewise.
7424 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7425 (all constructors).
7426 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7427 (Output_reloc::get_symbol_index): Likewise.
7428 (Output_reloc::local_section_offset): Likewise.
7429 (Output_reloc::get_address): Likewise.
7430 (Output_reloc::symbol_value): Likewise.
7431 (Output_data_got::reserve_slot): Move to class definition.
7432 (Output_data_got::reserve_local): New function.
7433 (Output_data_got::reserve_slot_for_global): Remove.
7434 (Output_data_got::reserve_global): New function.
7435 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7436 (all constructors, two instantiations).
7437 (Output_reloc::get_relobj): New function (two instantiations).
7438 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7439 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7440 (Output_data_reloc::add_global): Adjust type of relobj.
7441 (Output_data_reloc::add_global_relative): Likewise.
7442 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7443 (Output_data_reloc::add_local): Likewise.
7444 (Output_data_reloc::add_local_relative): Likewise.
7445 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7446 (Output_data_reloc::add_local_section): Likewise.
7447 (Output_data_reloc::add_output_section): Likewise.
7448 (Output_data_reloc::add_absolute): Likewise.
7449 (Output_data_reloc::add_target_specific): Likewise.
7450 (Output_data_got::reserve_slot): Move definition here.
7451 (Output_data_got::reserve_local): New function.
7452 (Output_data_got::reserve_global): New function.
7453 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7454 section_offsets_ with accessor function.
7455 (Sized_relobj_file::write_sections): Likewise.
7456 (Sized_relobj_file::do_relocate_sections): Likewise.
7457 * target.h (Sized_target::reserve_local_got_entry): New function.
7458 (Sized_target::reserve_global_got_entry): New function.
7459 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7460 (Target_x86_64::reserve_global_got_entry): New function.
7461 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7462
4829d394
CC
74632011-05-23 Cary Coutant <ccoutant@google.com>
7464
7465 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7466 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7467 bit when checking got_type.
7468 * incremental.cc (Sized_incremental_binary::setup_readers):
7469 Store symbol table and string table locations; initialize bit vector
7470 of file status flags.
7471 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7472 unchanged files.
7473 (Sized_incremental_binary::do_process_got_plt): New function.
7474 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7475 (Output_section_incremental_inputs::set_final_data_size): Record
7476 file index for each input file.
7477 (Output_section_incremental_inputs::write_got_plt): Store file index
7478 instead of input entry offset for each GOT entry.
7479 * incremental.h
7480 (Incremental_input_entry::Incremental_input_entry): Initialize new
7481 data member.
7482 (Incremental_input_entry::set_offset): Store file index.
7483 (Incremental_input_entry::get_file_index): New function.
7484 (Incremental_input_entry::file_index_): New data member.
7485 (Incremental_binary::process_got_plt): New function.
7486 (Incremental_binary::do_process_got_plt): New function.
7487 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7488 data members.
7489 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7490 (Sized_incremental_binary::set_file_is_unchanged): New function.
7491 (Sized_incremental_binary::file_is_unchanged): New function.
7492 (Sized_incremental_binary::do_process_got_plt): New function.
7493 (Sized_incremental_binary::file_status_): New data member.
7494 (Sized_incremental_binary::main_symtab_loc_): New data member.
7495 (Sized_incremental_binary::main_strtab_loc_): New data member.
7496 * output.cc (Output_data_got::Got_entry::write): Add case
7497 RESERVED_CODE.
7498 (Output_data_got::add_global): Call add_got_entry.
7499 (Output_data_got::add_global_plt): Likewise.
7500 (Output_data_got::add_global_with_rel): Likewise.
7501 (Output_data_got::add_global_with_rela): Likewise.
7502 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7503 (Output_data_got::add_global_pair_with_rela): Likewise.
7504 (Output_data_got::add_local): Call add_got_entry.
7505 (Output_data_got::add_local_plt): Likewise.
7506 (Output_data_got::add_local_with_rel): Likewise.
7507 (Output_data_got::add_local_with_rela): Likewise.
7508 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7509 (Output_data_got::add_local_pair_with_rela): Likewise.
7510 (Output_data_got::reserve_slot): New function.
7511 (Output_data_got::reserve_slot_for_global): New function.
7512 (Output_data_got::add_got_entry): New function.
7513 (Output_data_got::add_got_entry_pair): New function.
7514 (Output_section::add_output_section_data): Edit FIXME.
7515 * output.h
7516 (Output_section_data_build::Output_section_data_build): New
7517 constructor with size parameter.
7518 (Output_data_space::Output_data_space): Likewise.
7519 (Output_data_got::Output_data_got): Initialize new data member; new
7520 constructor with size parameter.
7521 (Output_data_got::add_constant): Call add_got_entry.
7522 (Output_data_got::reserve_slot): New function.
7523 (Output_data_got::reserve_slot_for_global): New function.
7524 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7525 (Output_data_got::add_got_entry): New function.
7526 (Output_data_got::add_got_entry_pair): New function.
7527 (Output_data_got::free_list_): New data member.
7528 * target.h (Sized_target::init_got_plt_for_update): New function.
7529 (Sized_target::register_global_plt_entry): New function.
7530 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7531 Initialize new data member; call init; add constructor with PLT count.
7532 (Output_data_plt_x86_64::init): New function.
7533 (Output_data_plt_x86_64::add_relocation): New function.
7534 (Output_data_plt_x86_64::reserve_slot): New function.
7535 (Output_data_plt_x86_64::free_list_): New data member.
7536 (Target_x86_64::init_got_plt_for_update): New function.
7537 (Target_x86_64::register_global_plt_entry): New function.
7538 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7539 incremental updates.
7540 (Output_data_plt_x86_64::add_relocation): New function.
7541 * testsuite/object_unittest.cc (Object_test): Set default options.
7542
ec69d6da
ILT
75432011-05-16 Ian Lance Taylor <iant@google.com>
7544
7545 * options.h (class General_options): Make -i a synonym for -r.
7546
732e31de
ILT
75472011-05-16 Ian Lance Taylor <iant@google.com>
7548
7549 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7550
403676b5
CC
75512011-05-10 Cary Coutant <ccoutant@google.com>
7552
7553 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7554 strip_all (-s).
7555
5b7b7d6e
ILT
75562011-05-06 Ian Lance Taylor <iant@google.com>
7557
7558 * layout.cc (Layout::layout): If the output section flags change,
7559 update the ordering.
7560
f0f9babf
CC
75612011-04-25 Cary Coutant <ccoutant@google.com>
7562
7563 * incremental-dump.cc (dump_incremental_inputs): Print local
7564 symbol info for each input file.
7565 * incremental.cc
7566 (Output_section_incremental_inputs::set_final_data_size): Add local
7567 symbol info to input file entries in incremental info.
7568 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7569 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7570 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7571 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7572 implementation.
7573 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7574 (Sized_incr_relobj::do_relocate): Write the local symbols.
7575 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7576 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7577 Adjust size of input file header.
7578 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7579 (Incremental_inputs_reader::get_local_symbol_count): New function.
7580 (Incremental_inputs_reader::get_input_section): Adjust size of input
7581 file header.
7582 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7583 (Sized_incr_relobj::This): New typedef.
7584 (Sized_incr_relobj::sym_size): New const data member.
7585 (Sized_incr_relobj::Local_symbol): New struct.
7586 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7587 (Sized_incr_relobj::do_local_symbol_offset): New function.
7588 (Sized_incr_relobj::local_symbol_count_): New data member.
7589 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7590 (Sized_incr_relobj::local_symbol_index_): New data member.
7591 (Sized_incr_relobj::local_symbol_offset_): New data member.
7592 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7593 (Sized_incr_relobj::local_symbols_): New data member.
7594 * object.h (Relobj::output_local_symbol_count): New function.
7595 (Relobj::local_symbol_offset): New function.
7596 (Relobj::do_output_local_symbol_count): New function.
7597 (Relobj::do_local_symbol_offset): New function.
7598 (Sized_relobj::do_output_local_symbol_count): New function.
7599 (Sized_relobj::do_local_symbol_offset): New function.
7600
d0a9ace3
ILT
76012011-04-22 Vladimir Simonov <sv@sw.ru>
7602
7603 * descriptors.cc (set_close_on_exec): New function.
7604 (Descriptors::open): Use set_close_on_exec.
7605 * output.cc (S_ISLNK): Define if not defined.
7606
94a3fc8b
CC
76072011-04-22 Cary Coutant <ccoutant@google.com>
7608
7609 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7610 global symbol map.
7611 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7612 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7613 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7614 relocations.
7615 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7616 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7617 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7618 * incremental.h
7619 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7620 function.
7621 (Incremental_binary::apply_incremental_relocs): New function.
7622 (Incremental_binary::do_apply_incremental_relocs): New function.
7623 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7624 data member.
7625 (Sized_incremental_binary::add_global_symbol): New function.
7626 (Sized_incremental_binary::global_symbol): New function.
7627 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7628 (Sized_incremental_binary::symbol_map_): New data member.
7629 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7630 * target.h (Sized_target::apply_relocation): New function.
7631 * target-reloc.h (apply_relocation): New function.
7632 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7633
c87e4302
DK
76342011-04-22 Doug Kwan <dougkwan@google.com>
7635
7636 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7637 flag of a SHT_ARM_EXIDX section.
2e702c99 7638 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7639 * testsuite/Makefile.in: Regenerate.
7640 * testsuite/arm_exidx_test.s: New file.
7641 * testsuite/arm_exidx_test.sh: Same.
7642
e7782cf6
CC
76432011-04-20 Cary Coutant <ccoutant@google.com>
7644
7645 PR gold/12689
7646 * archive.h (Incremental_archive_entry::Archive_member):
7647 Initialize arg_serial_ (second constructor).
7648
308ecdc7
ILT
76492011-04-17 Ian Lance Taylor <iant@google.com>
7650
7651 * object.cc (Relocate_info::location): Simplify location string.
7652 * errors.cc (Errors::error_at_location): Don't print program
7653 name.
7654 (Errors::warning_at_location): Likewise.
7655 (Errors::undefined_symbol): Likewise.
7656 * testsuite/debug_msg.sh: Update accordingly.
7657
bec5b579
CC
76582011-04-14 Cary Coutant <ccoutant@google.com>
7659
7660 * gold/layout.cc (Layout::symtab_section_offset): New function.
7661 * gold/layout.h (Layout::symtab_section_offset): New function.
7662 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7663
88597d34
ILT
76642011-04-12 Ian Lance Taylor <iant@google.com>
7665
7666 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7667 with MREMAP_MAYMOVE.
7668 * output.h (class Output_file): Add map_is_allocated_ field.
7669 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7670 not available, provide stubs. If mremap is not available, #define
7671 it to gold_mremap.
7672 (MREMAP_MAYMOVE): Define if not defined.
7673 (Output_file::Output_file): Initialize map_is_allocated_.
7674 (Output_file::resize): Check map_is_allocated_.
7675 (Output_file::map_anonymous): If mmap fails, use malloc.
7676 (Output_file::unmap): Don't do anything for an anonymous map.
7677 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7678 is not available, provide stubs.
7679 (File_read::View::~View): Use free rather than delete[].
7680 (File_read::make_view): Use malloc rather than new[]. If mmap
7681 fails, use malloc.
7682 (File_read::find_or_make_view): Use malloc rather than new[].
7683 * gold.h: Remove HAVE_REMAP code.
7684 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7685 exists. Rename mremap to gold_mremap. If mmap is not available
7686 don't do anything.
7687 * configure, config.in: Rebuild.
7688
11e361bc
ILT
76892011-04-11 Ian Lance Taylor <iant@google.com>
7690
7691 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7692 initialize local variable v.
7693
cdc29364
CC
76942011-04-11 Cary Coutant <ccoutant@google.com>
7695
7696 * archive.cc (Archive::include_member): Adjust call to
7697 report_object.
7698 (Add_archive_symbols::run): Track argument serial numbers.
7699 (Lib_group::include_member): Likewise.
7700 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7701 * archive.h (Incremental_archive_entry::Archive_member):
7702 Initialize arg_serial_.
7703 (Archive_member::arg_serial_): New data member.
7704 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7705 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7706 incremental link.
7707 (Sized_dynobj::do_for_all_local_got_entries): New function.
7708 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7709 function.
7710 * fileread.cc (get_mtime): New function.
7711 * fileread.h (get_mtime): New function.
7712 * gold.cc (queue_initial_tasks): Check for incremental update.
7713 (process_incremental_input): New function.
7714 (queue_middle_tasks): Don't force valid target for incremental
7715 update.
7716 * incremental-dump.cc (find_input_containing_global): Adjust
7717 size of symbol info entry.
7718 (dump_incremental_inputs): Dump argument serial number and
7719 in_system_directory flag; bias shndx by 1; print symbol names
7720 when dumping per-file symbol lists; use new symbol info readers.
7721 * incremental.cc
7722 (Output_section_incremental_inputs:update_data_size): New function.
7723 (Sized_incremental_binary::setup_readers): Setup input readers
7724 for each input file; build maps for files added from libraries
7725 and scripts.
7726 (Sized_incremental_binary::check_input_args): New function.
7727 (Sized_incremental_binary::do_check_inputs): Build map of argument
7728 serial numbers to input arguments.
7729 (Sized_incremental_binary::do_file_has_changed): Rename
7730 do_file_is_unchanged to this; compare file modification times.
7731 (Sized_incremental_binary::do_init_layout): New function.
7732 (Sized_incremental_binary::do_reserve_layout): New function.
7733 (Sized_incremental_binary::do_get_input_reader): Remove.
7734 (Sized_incremental_binary::get_symtab_view): New function.
7735 (Incremental_checker::can_incrementally_link_output_file): Remove.
7736 (Incremental_inputs::report_command_line): Exclude --debug options.
7737 (Incremental_inputs::report_archive_begin): Add parameter; track
7738 argument serial numbers; don't put input file entry for archive
7739 before archive members.
7740 (Incremental_inputs::report_archive_end): Put input file entry
7741 for archive after archive members.
7742 (Incremental_inputs::report_object): Add parameter; track argument
7743 serial numbers and in_system_directory flag.
7744 (Incremental_inputs::report_script): Add parameter; track argument
7745 serial numbers.
7746 (Output_section_incremental_inputs::set_final_data_size): Adjust
7747 size of symbol info entry; check for forwarding symbols.
7748 (Output_section_incremental_inputs::write_input_files): Write
7749 in_system_directory flag and argument serial number.
7750 (Output_section_incremental_inputs::write_info_blocks): Map section
7751 indices between incremental info and original input file; store
7752 input section index for each symbol.
7753 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7754 change operator() to visit().
7755 (class Global_got_offset_visitor): Likewise.
7756 (class Global_symbol_visitor_got_plt):
7757 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7758 classes.
7759 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7760 (Sized_incr_relobj::do_read_symbols): New function.
7761 (Sized_incr_relobj::do_layout): New function.
7762 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7763 (Sized_incr_relobj::do_add_symbols): New function.
7764 (Sized_incr_relobj::do_should_include_member): New function.
7765 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7766 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7767 (Sized_incr_relobj::do_section_size): New function.
7768 (Sized_incr_relobj::do_section_name): New function.
7769 (Sized_incr_relobj::do_section_contents): New function.
7770 (Sized_incr_relobj::do_section_flags): New function.
7771 (Sized_incr_relobj::do_section_entsize): New function.
7772 (Sized_incr_relobj::do_section_address): New function.
7773 (Sized_incr_relobj::do_section_type): New function.
7774 (Sized_incr_relobj::do_section_link): New function.
7775 (Sized_incr_relobj::do_section_info): New function.
7776 (Sized_incr_relobj::do_section_addralign): New function.
7777 (Sized_incr_relobj::do_initialize_xindex): New function.
7778 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7779 (Sized_incr_relobj::do_read_relocs): New function.
7780 (Sized_incr_relobj::do_gc_process_relocs): New function.
7781 (Sized_incr_relobj::do_scan_relocs): New function.
7782 (Sized_incr_relobj::do_count_local_symbols): New function.
7783 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7784 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7785 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7786 (Sized_incr_relobj::do_relocate): New function.
7787 (Sized_incr_relobj::do_set_section_offset): New function.
7788 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7789 (Sized_incr_dynobj::do_read_symbols): New function.
7790 (Sized_incr_dynobj::do_layout): New function.
7791 (Sized_incr_dynobj::do_add_symbols): New function.
7792 (Sized_incr_dynobj::do_should_include_member): New function.
7793 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7794 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7795 (Sized_incr_dynobj::do_section_size): New function.
7796 (Sized_incr_dynobj::do_section_name): New function.
7797 (Sized_incr_dynobj::do_section_contents): New function.
7798 (Sized_incr_dynobj::do_section_flags): New function.
7799 (Sized_incr_dynobj::do_section_entsize): New function.
7800 (Sized_incr_dynobj::do_section_address): New function.
7801 (Sized_incr_dynobj::do_section_type): New function.
7802 (Sized_incr_dynobj::do_section_link): New function.
7803 (Sized_incr_dynobj::do_section_info): New function.
7804 (Sized_incr_dynobj::do_section_addralign): New function.
7805 (Sized_incr_dynobj::do_initialize_xindex): New function.
7806 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7807 (make_sized_incremental_object): New function.
7808 (Incremental_library::copy_unused_symbols): New function.
7809 (Incremental_library::do_for_all_unused_symbols): New function.
7810 * incremental.h (enum Incremental_input_flags): New type.
7811 (class Incremental_checker): Remove.
7812 (Incremental_input_entry::Incremental_input_entry): Add argument
7813 serial number.
7814 (Incremental_input_entry::arg_serial): New function.
7815 (Incremental_input_entry::set_is_in_system_directory): New function.
7816 (Incremental_input_entry::is_in_system_directory): New function.
7817 (Incremental_input_entry::arg_serial_): New data member.
7818 (Incremental_input_entry::is_in_system_directory_): New data member.
7819 (class Script_info): Move here from script.h.
7820 (Script_info::Script_info): Add filename parameter.
7821 (Script_info::filename): New function.
7822 (Script_info::filename_): New data member.
7823 (Incremental_script_entry::Incremental_script_entry): Add argument
7824 serial number.
7825 (Incremental_object_entry::Incremental_object_entry): Likewise.
7826 (Incremental_object_entry::add_input_section): Build list of input
7827 sections with map to original shndx.
7828 (Incremental_object_entry::get_input_section_index): New function.
7829 (Incremental_object_entry::shndx_): New data member.
7830 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7831 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7832 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7833 serial number.
7834 (Incremental_inputs::report_archive_begin): Likewise.
7835 (Incremental_inputs::report_object): Likewise.
7836 (Incremental_inputs::report_script): Likewise.
7837 (class Incremental_global_symbol_reader): New class.
7838 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7839 and store flags and input file type.
7840 (Incremental_input_entry_reader::arg_serial): New function.
7841 (Incremental_input_entry_reader::type): Extract type from flags.
7842 (Incremental_input_entry_reader::is_in_system_directory): New function.
7843 (Incremental_input_entry_reader::get_input_section_count): Call
7844 accessor function for type.
7845 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7846 function for type; adjust size of global symbol entry.
7847 (Incremental_input_entry_reader::get_global_symbol_count): Call
7848 accessor function for type.
7849 (Incremental_input_entry_reader::get_object_count): Likewise.
7850 (Incremental_input_entry_reader::get_object_offset): Likewise.
7851 (Incremental_input_entry_reader::get_member_count): Likewise.
7852 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7853 (Incremental_input_entry_reader::get_member_offset): Likewise.
7854 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7855 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7856 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7857 (Incremental_input_entry_reader::get_global_symbol_reader): New
7858 function.
7859 (Incremental_input_entry_reader::get_output_symbol_index): New
7860 function.
7861 (Incremental_input_entry_reader::type_): Remove.
7862 (Incremental_input_entry_reader::flags_): New data member.
7863 (Incremental_inputs_reader::input_file_offset): New function.
7864 (Incremental_inputs_reader::input_file_index): New function.
7865 (Incremental_inputs_reader::input_file): Call input_file_offset.
7866 (Incremental_inputs_reader::input_file_at_offset): New function.
7867 (Incremental_relocs_reader::get_r_type): Reformat.
7868 (Incremental_relocs_reader::get_r_shndx): Reformat.
7869 (Incremental_relocs_reader::get_r_offset): Reformat.
7870 (Incremental_relocs_reader::data): New function.
7871 (Incremental_binary::Incremental_binary): Initialize new data members.
7872 (Incremental_binary::check_inputs): Add cmdline parameter.
7873 (Incremental_binary::file_is_unchanged): Remove.
7874 (Input_reader::arg_serial): New function.
7875 (Input_reader::get_unused_symbol_count): New function.
7876 (Input_reader::get_unused_symbol): New function.
7877 (Input_reader::do_arg_serial): New function.
7878 (Input_reader::do_get_unused_symbol_count): New function.
7879 (Input_reader::do_get_unused_symbol): New function.
7880 (Incremental_binary::input_file_count): New function.
7881 (Incremental_binary::get_input_reader): Change signature to use
7882 index instead of filename.
7883 (Incremental_binary::file_has_changed): New function.
7884 (Incremental_binary::get_input_argument): New function.
7885 (Incremental_binary::get_library): New function.
7886 (Incremental_binary::get_script_info): New function.
7887 (Incremental_binary::init_layout): New function.
7888 (Incremental_binary::reserve_layout): New function.
7889 (Incremental_binary::output_file): New function.
7890 (Incremental_binary::do_check_inputs): New function.
7891 (Incremental_binary::do_file_is_unchanged): Remove.
7892 (Incremental_binary::do_file_has_changed): New function.
7893 (Incremental_binary::do_init_layout): New function.
7894 (Incremental_binary::do_reserve_layout): New function.
7895 (Incremental_binary::do_input_file_count): New function.
7896 (Incremental_binary::do_get_input_reader): Change signature.
7897 (Incremental_binary::input_args_map_): New data member.
7898 (Incremental_binary::library_map_): New data member.
7899 (Incremental_binary::script_map_): New data member.
7900 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7901 new data members.
7902 (Sized_incremental_binary::output_section): New function.
7903 (Sized_incremental_binary::inputs_reader): Add const.
7904 (Sized_incremental_binary::symtab_reader): Add const.
7905 (Sized_incremental_binary::relocs_reader): Add const.
7906 (Sized_incremental_binary::got_plt_reader): Add const.
7907 (Sized_incremental_binary::get_symtab_view): New function.
7908 (Sized_incremental_binary::Inputs_reader): New typedef.
7909 (Sized_incremental_binary::Input_entry_reader): New typedef.
7910 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7911 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7912 (Sized_incremental_binary::do_file_has_changed): New function.
7913 (Sized_incremental_binary::do_init_layout): New function.
7914 (Sized_incremental_binary::do_reserve_layout): New function.
7915 (Sized_input_reader::Inputs_reader): Remove.
7916 (Sized_input_reader::Input_entry_reader): Remove.
7917 (Sized_input_reader::do_arg_serial): New function.
7918 (Sized_input_reader::do_get_unused_symbol_count): New function.
7919 (Sized_input_reader::do_get_unused_symbol): New function.
7920 (Sized_incremental_binary::do_input_file_count): New function.
7921 (Sized_incremental_binary::do_get_input_reader): Change signature;
7922 use index instead of filename.
7923 (Sized_incremental_binary::section_map_): New data member.
7924 (Sized_incremental_binary::input_entry_readers_): New data member.
7925 (class Sized_incr_relobj): New class.
7926 (class Sized_incr_dynobj): New class.
7927 (make_sized_incremental_object): New function.
7928 (class Incremental_library): New class.
7929 * layout.cc (Free_list::num_lists): New static data member.
7930 (Free_list::num_nodes): New static data member.
7931 (Free_list::num_removes): New static data member.
7932 (Free_list::num_remove_visits): New static data member.
7933 (Free_list::num_allocates): New static data member.
7934 (Free_list::num_allocate_visits): New static data member.
7935 (Free_list::init): New function.
7936 (Free_list::remove): New function.
7937 (Free_list::allocate): New function.
7938 (Free_list::dump): New function.
7939 (Free_list::print_stats): New function.
7940 (Layout_task_runner::run): Resize output file for incremental updates.
7941 (Layout::Layout): Initialize new data members.
7942 (Layout::set_incremental_base): New function.
7943 (Layout::init_fixed_output_section): New function.
7944 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7945 incremental updates.
7946 (Layout::create_gold_note): Do not create gold note section for
7947 incremental updates.
7948 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7949 for incremental updates.
7950 (Layout::set_section_offsets): For incremental updates, allocate space
7951 from free list.
7952 (Layout::create_symtab_sections): Layout with offsets relative to
7953 start of section; for incremental updates, allocate space from free
7954 list.
7955 (Layout::create_shdrs): For incremental updates, allocate space from
7956 free list.
7957 (Layout::finish_dynamic_section): For incremental updates, do not
7958 check --as-needed (fixed in subsequent patch).
7959 * layout.h (class Free_list): New class.
7960 (Layout::set_incremental_base): New function.
7961 (Layout::incremental_base): New function.
7962 (Layout::init_fixed_output_section): New function.
7963 (Layout::allocate): New function.
7964 (Layout::incremental_base_): New data member.
7965 (Layout::free_list_): New data member.
7966 * main.cc (main): Print Free_list statistics.
7967 * object.cc (Relobj::finalize_incremental_relocs): Add
7968 clear_counts parameter; clear counts only when clear_counts is set.
7969 (Sized_relobj::Sized_relobj): Initialize new base class.
7970 (Sized_relobj::do_layout): Don't report special sections.
7971 (Sized_relobj::do_for_all_local_got_entries): New function.
7972 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7973 symtab_off to all symbol table offsets.
7974 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7975 * object.h (class Got_offset_list): Move to top of file.
7976 (Object::Object): Allow case where input_file == NULL.
7977 (Object::~Object): Likewise.
7978 (Object::input_file): Assert that input_file != NULL.
7979 (Object::lock): Allow case where input_file == NULL.
7980 (Object::unlock): Likewise.
7981 (Object::is_locked): Likewise.
7982 (Object::token): Likewise.
7983 (Object::release): Likewise.
7984 (Object::is_incremental): New function.
7985 (Object::get_mtime): New function.
7986 (Object::for_all_local_got_entries): New function.
7987 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7988 (Object::set_is_in_system_directory): New function.
7989 (Object::is_in_system_directory): New function.
7990 (Object::do_is_incremental): New function.
7991 (Object::do_get_mtime): New function.
7992 (Object::do_for_all_local_got_entries): New function.
7993 (Object::is_in_system_directory_): New data member.
7994 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7995 (class Sized_relobj_base): New class.
7996 (class Sized_relobj): Derive from Sized_relobj_base.
7997 (class Sized_relobj::Symbols): Redeclare from base class.
7998 (class Sized_relobj::local_got_offset_list): Remove.
7999 (class Sized_relobj::Output_sections): Redeclare from base class.
8000 (class Sized_relobj::do_for_all_local_got_entries): New function.
8001 (class Sized_relobj::write_local_symbols): Add offset parameter.
8002 (class Sized_relobj::local_symbol_offset_): Update comment.
8003 (class Sized_relobj::local_dynsym_offset_): Update comment.
8004 * options.cc (Input_arguments::add_file): Remove const.
8005 * options.h (Input_file_argument::Input_file_argument):
8006 Initialize arg_serial_ (all constructors).
8007 (Input_file_argument::set_arg_serial): New function.
8008 (Input_file_argument::arg_serial): New function.
8009 (Input_file_argument::arg_serial_): New data member.
8010 (Input_arguments::Input_arguments): Initialize file_count_.
8011 (Input_arguments::add_file): Remove const.
8012 (Input_arguments::number_of_input_files): New function.
8013 (Input_arguments::file_count_): New data member.
8014 (Command_line::number_of_input_files): Call
8015 Input_arguments::number_of_input_files.
8016 * output.cc (Output_segment_headers::Output_segment_headers):
8017 Set current size.
8018 (Output_section::Input_section::current_data_size): New function.
8019 (Output_section::Output_section): Initialize new data members.
8020 (Output_section::add_input_section): Don't do merge sections for
8021 an incremental link; allocate space from free list for an
8022 incremental update.
8023 (Output_section::add_output_section_data): Allocate space from
8024 free list for an incremental update.
8025 (Output_section::update_data_size): New function.
8026 (Output_section::set_fixed_layout): New function.
8027 (Output_section::reserve): New function.
8028 (Output_segment::set_section_addresses): Remove const.
8029 (Output_segment::set_section_list_addresses): Remove const; allocate
8030 space from free list for an incremental update.
8031 (Output_segment::set_offset): Adjust size of RELRO segment for an
8032 incremental update.
8033 * output.h (Output_data::current_data_size): Move here from
8034 child classes.
8035 (Output_data::pre_finalize_data_size): New function.
8036 (Output_data::update_data_size): New function.
8037 (Output_section_headers::update_data_size): new function.
8038 (Output_section_data_build::current_data_size): Move to Output_data.
8039 (Output_data_strtab::update_data_size): New function.
8040 (Output_section::current_data_size): Move to Output_data.
8041 (Output_section::set_fixed_layout): New function.
8042 (Output_section::has_fixed_layout): New function.
8043 (Output_section::reserve): New function.
8044 (Output_section::update_data_size): New function.
8045 (Output_section::has_fixed_layout_): New data member.
8046 (Output_section::free_list_): New data member.
8047 (Output_segment::set_section_addresses): Remove const.
8048 (Output_segment::set_section_list_addresses): Remove const.
8049 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8050 New function.
8051 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8052 New function.
8053 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8054 parameter when calling Add_symbols constructor; store argument
8055 serial number for members of a lib group.
8056 (Add_symbols::locks): Allow case where token == NULL.
8057 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8058 (Read_member::~Read_member): New function.
8059 (Read_member::is_runnable): New function.
8060 (Read_member::locks): New function.
8061 (Read_member::run): New function.
8062 (Check_script::~Check_script): New function.
8063 (Check_script::is_runnable): New function.
8064 (Check_script::locks): New function.
8065 (Check_script::run): New function.
8066 (Check_library::~Check_library): New function.
8067 (Check_library::is_runnable): New function.
8068 (Check_library::locks): New function.
8069 (Check_library::run): New function.
8070 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8071 (Add_symbols::library_): New data member.
8072 (class Read_member): New class.
8073 (class Check_script): New class.
8074 (class Check_library): New class.
8075 * reloc.cc (Read_relocs::is_runnable): Allow case where
8076 token == NULL.
8077 (Read_relocs::locks): Likewise.
8078 (Scan_relocs::locks): Likewise.
8079 (Relocate_task::locks): Likewise.
8080 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8081 to clear counters.
8082 (Sized_relobj::incremental_relocs_scan): Fix comment.
8083 (Sized_relobj::do_relocate): Pass output file offset to
8084 write_local_symbols.
8085 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8086 from class declaration.
8087 * script.cc (read_input_script): Allocate Script_info; pass
8088 argument serial number to report_script.
8089 * script.h (class Script_info): Move to incremental.h.
8090 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8091 * symtab.h (Symbol_table::add_from_incrobj): New function.
8092 (Symbol_table::set_file_offset): New function.
8093
b961d0d7
CC
80942011-04-05 Cary Coutant <ccoutant@google.com>
8095
8096 * incremental-dump.cc (dump_incremental_inputs): Change signature
8097 to take a Sized_incremental_binary; change caller. Use readers
8098 in Sized_incremental_binary.
8099 * incremental.cc
8100 (Sized_incremental_binary::find_incremental_inputs_sections):
8101 Rename do_find_incremental_inputs_sections to this.
8102 (Sized_incremental_binary::setup_readers): New function.
8103 (Sized_incremental_binary::do_check_inputs): Check
8104 has_incremental_info_ flag; move setup code to setup_readers;
8105 use input readers.
8106 (Sized_incremental_binary::do_file_is_unchanged): New function.
8107 (Sized_incremental_binary::do_get_input_reader): New function.
8108 * incremental.h (class Incremental_binary): Move to end of file.
8109 (Incremental_binary::file_is_unchanged): New function.
8110 (Incremental_binary::do_file_is_unchanged): New function.
8111 (Incremental_binary::Input_reader): New class.
8112 (Incremental_binary::get_input_reader): New function.
8113 (class Sized_incremental_binary): Move to end of file.
8114 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8115 input section reader classes.
8116 (Sized_incremental_binary::has_incremental_info): New function.
8117 (Sized_incremental_binary::inputs_reader): New function.
8118 (Sized_incremental_binary::symtab_reader): New function.
8119 (Sized_incremental_binary::relocs_reader): New function.
8120 (Sized_incremental_binary::got_plt_reader): New function.
8121 (Sized_incremental_binary::do_file_is_unchanged): New function.
8122 (Sized_incremental_binary::Sized_input_reader): New class.
8123 (Sized_incremental_binary::get_input_reader): New function.
8124 (Sized_incremental_binary::find_incremental_inputs_sections):
8125 Rename do_find_incremental_inputs_sections to this.
8126 (Sized_incremental_binary::setup_readers): New function.
8127 (Sized_incremental_binary::has_incremental_info_): New data member.
8128 (Sized_incremental_binary::inputs_reader_): New data member.
8129 (Sized_incremental_binary::symtab_reader_): New data member.
8130 (Sized_incremental_binary::relocs_reader_): New data member.
8131 (Sized_incremental_binary::got_plt_reader_): New data member.
8132 (Sized_incremental_binary::current_input_file_): New data member.
8133
a869183f
PP
81342011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8135
8136 PR gold/12640
8137 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8138 violation.
8139
81402011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8141
8142 * archive.cc (Archive::include_member): Adjust call to report_object.
8143 (Add_archive_symbols::run): Add script_info to call to
8144 report_archive_begin.
8145 (Lib_group::include_member): Adjust call to report_object.
8146 (Add_lib_group_symbols::run): Adjust call to report_object.
8147 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8148 blocks. Add object count for script input files.
8149 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8150 script_info parameter; change all callers.
8151 (Incremental_inputs::report_object): Add script_info parameter;
8152 change all callers.
8153 (Incremental_inputs::report_script): Store backpointer to
8154 incremental info entry.
8155 (Output_section_incremental_inputs::set_final_data_size): Record
8156 additional information for scripts.
8157 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8158 * incremental.h (Incremental_script_entry::add_object): New function.
8159 (Incremental_script_entry::get_object_count): New function.
8160 (Incremental_script_entry::get_object): New function.
8161 (Incremental_script_entry::objects_): New data member; adjust
8162 constructor.
8163 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8164 (Incremental_inputs::report_object): Add script_info parameter.
8165 (Incremental_inputs_reader::get_object_count): New function.
8166 (Incremental_inputs_reader::get_object_offset): New function.
8167 * options.cc (Input_arguments::add_file): Return reference to
8168 new input argument.
8169 * options.h (Input_argument::set_script_info): New function.
8170 (Input_argument::script_info): New function.
8171 (Input_argument::script_info_): New data member; adjust all
8172 constructors.
8173 (Input_file_group::add_file): Return reference to new input argument.
8174 (Input_file_lib::add_file): Likewise.
8175 (Input_arguments::add_file): Likewise.
8176 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8177 * script.cc (Parser_closure::Parser_closure): Add script_info
8178 parameter; adjust all callers.
8179 (Parser_closure::script_info): New function.
8180 (Parser_closure::script_info_): New data member.
8181 (read_input_script): Report scripts earlier to incremental info.
8182 (script_add_file): Set script_info in Input_argument.
8183 (script_add_library): Likewise.
8184 * script.h (Script_options::Script_info): Rewrite class.
8185
a869183f 81862011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8187
8188 * archive.cc (Library_base::should_include_member): Move
8189 method here from class Archive.
8190 (Archive::Archive): Initialize base class.
8191 (Archive::should_include_member): Move to base class.
8192 (Archive::do_for_all_unused_symbols): New function.
8193 (Add_archive_symbols::run): Remove redundant access to
8194 incremental_inputs.
8195 (Lib_group::Lib_group): Initialize base class.
8196 (Lib_group::do_filename): New function.
8197 (Lib_group::include_member): Pass pointer to Lib_group to
8198 report_object.
8199 (Lib_group::do_for_all_unused_symbols): New function.
8200 (Add_lib_group_symbols::run): Report archive information for
8201 incremental links.
8202 * archive.h (class Library_base): New base class.
8203 (class Archive): Derive from Library_base.
8204 (Archive::filename): Move to base class.
8205 (Archive::set_incremental_info): Likewise.
8206 (Archive::incremental_info): Likewise.
8207 (Archive::Should_include): Likewise.
8208 (Archive::should_include_member): Likewise.
8209 (Archive::Armap_entry): Remove.
8210 (Archive::Unused_symbol_iterator): Remove.
8211 (Archive::unused_symbols_begin): Remove.
8212 (Archive::unused_symbols_end): Remove.
8213 (Archive::do_filename): New function.
8214 (Archive::do_get_mtime): New function.
8215 (Archive::do_for_all_unused_symbols): New function.
8216 (Archive::task_): Move to base class.
8217 (Archive::incremental_info_): Likewise.
8218 (class Lib_group): Derive from Library_base.
8219 (Lib_group::do_filename): New function.
8220 (Lib_group::do_get_mtime): New function.
8221 (Lib_group::do_for_all_unused_symbols): New function.
8222 (Lib_group::task_): Move to base class.
8223 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8224 function.
8225 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8226 function.
8227 * incremental.cc (Incremental_inputs::report_archive_begin):
8228 Use Library_base; call library's get_mtime; add incremental inputs
8229 entry before members.
8230 (class Unused_symbol_visitor): New class.
8231 (Incremental_inputs::report_archive_end): Use Library_base; use
8232 visitor class to record unused symbols; don't add incremental inputs
8233 entry after members.
8234 (Incremental_inputs::report_object): Use Library_base.
8235 * incremental.h
8236 (Incremental_archive_entry::Incremental_archive_entry): Remove
8237 unused Archive parameter.
8238 (Incremental_inputs::report_archive_begin): Use Library_base.
8239 (Incremental_inputs::report_archive_end): Likewise.
8240 (Incremental_inputs::report_object): Likewise.
8241 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8242 function.
8243 * object.h (Object::for_all_global_symbols): New function.
8244 (Object::do_for_all_global_symbols): New function.
8245 (Sized_relobj::do_for_all_global_symbols): New function.
8246 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8247 function.
8248 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8249 function.
8250
61ab3e40
ILT
82512011-03-27 Ian Lance Taylor <iant@google.com>
8252
8253 * archive.cc (Archive::interpret_header): Return -1 if something
8254 goes wrong. Change callers accordingly.
8255
30e1f9e6
CC
82562011-03-25 Cary Coutant <ccoutant@google.com>
8257
8258 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8259 * testsuite/Makefile.in: Regenerate.
8260
9370ce59 82612011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8262
8263 * plugin.cc (get_view): New.
8264 (Plugin::load): Pass get_view to the plugin.
8265 (Plugin_manager::get_view): New.
8266
9312bb0a
ILT
82672011-03-21 Ian Lance Taylor <iant@google.com>
8268
8269 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8270 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8271
7e12ba9e
ST
82722011-03-21 Sriraman Tallam <tmsriram@google.com>
8273
8274 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8275 Change == to -eq.
8276 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8277 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8278 Change == to -eq.
8279 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8280 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8281
fd7a005d
ILT
82822011-03-14 Ian Lance Taylor <iant@google.com>
8283
8284 * script-sections.cc (Sort_output_sections::script_compare):
8285 Rename from is_before, change return type.
8286 (Sort_output_sections::operator()): Adjust accordingly.
8287
ed16fd1b
ILT
82882011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8289
8290 PR gold/12572
8291 * testsuite/odr_violation2.cc: Add comment to make all error line
8292 numbers double digits.
8293 * testsuite/debug_msg.sh: Adjust expected errors.
8294
71ff8986
ILT
82952011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8296
8297 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8298 but mark earlier ones as non-canonical
8299 (offset_to_iterator): Update search target and example
8300 (do_addr2line): Return extra lines in a vector*
8301 (format_file_lineno): Extract from do_addr2line
8302 (one_addr2line): Add vector* out-param
8303 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8304 when a lineno entry appeared last for its instruction
8305 (Dwarf_line_info): Add vector* out-param
8306 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8307 * symtab.cc (Odr_violation_compare): Include the lineno in the
8308 comparison again.
8309 (linenos_from_loc): New. Combine the canonical line for an
8310 address with its other lines.
8311 (True_if_intersect): New. Helper functor to make
8312 std::set_intersection a query.
8313 (detect_odr_violations): Compare sets of lines instead of just
8314 one line for each function. This became less deterministic, but
8315 has fewer false positives.
8316 * symtab.h: Declarations.
8317 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8318 mix an optimized and non-optimized object in the same binary
8319 (odr_violation2.so): Same.
8320 * testsuite/Makefile.in: Regenerate from Makefile.am.
8321 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8322 * testsuite/debug_msg.sh: Update line numbers and add
8323 assertions.
8324 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8325 non-optimized context.
8326 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8327 isn't inlined, and use OdrDerived in an optimized context.
8328 * testsuite/odr_header1.h: Defines OdrDerived, where
8329 optimization will change the
8330 first-instruction-in-the-destructor's file and line number.
8331 * testsuite/odr_header2.h: Defines OdrBase.
8332
a19fefdc
ILT
83332011-03-09 Ian Lance Taylor <iant@google.com>
8334
8335 * fileread.cc (File_read::clear_views): Don't delete the whole
8336 file view.
8337
ecb351e9
ILT
83382011-03-08 Ian Lance Taylor <iant@google.com>
8339
8340 PR gold/12525
8341 * fileread.cc: #include <climits>.
8342 (GOLD_IOV_MAX): Define.
8343 (File_read::read_multiple): Limit number of entries by iov_max.
8344 * fileread.h (class File_read): Always set max_readv_entries to
8345 128.
8346
b821d13c
ILT
83472011-03-07 Ian Lance Taylor <iant@google.com>
8348
8349 PR gold/12525
8350 * options.h (class General_options): Add -dy and -dn.
8351
89243142
CC
83522011-03-02 Cary Coutant <ccoutant@google.com>
8353
8354 * testsuite/script_test_9.t: Add TLS segment.
8355
d0773f31
ILT
83562011-03-02 Simon Baldwin <simonb@google.com>
8357
8358 * configure.ac: Add check for gnu_indirect_function support in
8359 the toolchain building binutils.
8360 * configure: Rebuild.
8361
9370ce59 83622011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8363
8364 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8365 plugin only symbols.
8366 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8367 in plugin files as not needed in the symbol table.
8368
4cf7a849
ST
83692011-02-11 Sriraman Tallam <tmsriram@google.com>
8370
8371 * output.cc (Output_section::add_input_section): Delay fill
8372 generation for section ordering.
8373
b578bd7d
ILT
83742011-02-09 Ian Lance Taylor <iant@google.com>
8375
8376 PR gold/12316
8377 * object.h (class Sized_relobj): Remove clear_local_symbols.
8378 * reloc.cc (Sized_relobj::do_relocate): Don't call
8379 clear_local_symbols.
8380
9370ce59 83812011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8382
8383 * plugin.cc (is_visible_from_outside): Return true for symbols
8384 in the -u option.
8385
55382fb7
ILT
83862011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8387
8388 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8389 filename.
8390
4e271fff
ST
83912011-02-02 Sriraman Tallam <tmsriram@google.com>
8392
8393 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8394 to std::string.
4e271fff 8395 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8396 section_name to be std::string.
4e271fff
ST
8397 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8398
d433c3ac
ILT
83992011-01-25 Ian Lance Taylor <iant@google.com>
8400
8401 * script.cc (script_add_extern): Rewrite to use
8402 add_symbol_reference.
8403
880473a6
DK
84042011-01-25 Doug Kwan <dougkwan@google.com>
8405
d433c3ac 8406 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8407
f30f86fa
ILT
84082011-01-24 Ian Lance Taylor <iant@google.com>
8409
8410 * options.h (class General_options): Accept
8411 --no-detect-odr-violations.
8412
8e51a0b9
ILT
84132011-01-24 Ian Lance Taylor <iant@google.com>
8414
8415 * version.cc (version_string): Bump to 1.11.
8416
0f3b89d8
ILT
84172011-01-24 Ian Lance Taylor <iant@google.com>
8418
8419 * plugin.cc (class Plugin_rescan): Define new class.
8420 (Plugin_manager::claim_file): Set any_claimed_.
8421 (Plugin_manager::save_archive): New function.
8422 (Plugin_manager::save_input_group): New function.
8423 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8424 necessary.
8425 (Plugin_manager::new_undefined_symbol): New function.
8426 (Plugin_manager::rescan): New function.
8427 (Plugin_manager::rescannable_defines): New function.
8428 (Plugin_manager::add_input_file): Set any_added_.
8429 * plugin.h (class Plugin_manager): define new fields rescannable_,
8430 undefined_symbols_, any_claimed_, and any_added_. Declare
8431 Plugin_rescan as friend. Declare new functions.
8432 (Plugin_manager::Rescannable): Define type.
8433 (Plugin_manager::Rescannable_list): Define type.
8434 (Plugin_manager::Undefined_symbol_list): Define type.
8435 (Plugin_manager::Plugin_manager): Initialize new fields.
8436 * archive.cc (Archive::defines_symbol): New function.
8437 (Add_archive_symbols::run): Pass archive to plugins if any.
8438 * archive.h (class Archive): Declare defines_symbol.
8439 * readsyms.cc (Input_group::~Input_group): New function.
8440 (Finish_group::run): Pass input_group to plugins if any.
8441 * readsyms.h (class Input_group): Declare destructor.
8442 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8443 any.
8444
3bb951e5
ILT
84452011-01-10 Ian Lance Taylor <iant@google.com>
8446
8447 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8448 section as relro.
8449 (Layout::set_segment_offsets): Reset increase_relro before calling
8450 set_section_addresses a second time.
8451
0aa45fac
CC
84522011-01-04 Cary Coutant <ccoutant@google.com>
8453
8454 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8455 sections before NOBITS sections.
8456
0db46eb4
L
84572011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8458
8459 * version.cc (print_version): Update copyright to 2011.
8460
829c9745
CC
84612010-12-23 Cary Coutant <ccoutant@google.com>
8462
8463 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8464 of OS to this->add. Add OD parameter to second form of the function.
8465
7500420b
ILT
84662010-12-20 Ian Lance Taylor <iant@google.com>
8467
8468 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8469 second of two consecutive entries with same offset.
8470
f8e9a930
RW
84712010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8472
8473 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8474 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8475 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8476 to avoid unneeded links against $(LDADD).
8477 * testsuite/Makefile.in: Regenerate.
8478
2fbb4320
ILT
84792010-12-15 Ian Lance Taylor <iant@google.com>
8480
8481 PR gold/12324
8482 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8483 for R_X86_64_32 and R_X86_64_PC32.
8484 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8485 ver_matching_def_pic.o.
8486 (ver_matching_def_pic.o): New target.
8487
fedb228d
RW
84882010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8489
8490 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8491 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8492 Move definition before File_read::View member definitions.
8493 (File_read::View::~View): Initialize and hold lock before
8494 updating current_mapped_bytes.
8495
9b547ce6
RW
84962010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8497
8498 * dwarf_reader.cc: Remove outdated comment.
8499 * gold-threads.cc: Fix typo in error message.
8500 * archive.cc: Fix typos in comments.
8501 * archive.h: Likewise.
8502 * arm-reloc-property.cc: Likewise.
8503 * arm-reloc-property.h: Likewise.
8504 * arm-reloc.def: Likewise.
8505 * arm.cc: Likewise.
8506 * attributes.h: Likewise.
8507 * cref.cc: Likewise.
8508 * ehframe.cc: Likewise.
8509 * fileread.h: Likewise.
8510 * gold.h: Likewise.
8511 * i386.cc: Likewise.
8512 * icf.cc: Likewise.
8513 * incremental.h: Likewise.
8514 * int_encoding.cc: Likewise.
8515 * layout.h: Likewise.
8516 * main.cc: Likewise.
8517 * merge.h: Likewise.
8518 * object.cc: Likewise.
8519 * object.h: Likewise.
8520 * options.cc: Likewise.
8521 * readsyms.cc: Likewise.
8522 * reduced_debug_output.cc: Likewise.
8523 * reloc.cc: Likewise.
8524 * script-sections.cc: Likewise.
8525 * sparc.cc: Likewise.
8526 * symtab.h: Likewise.
8527 * target-reloc.h: Likewise.
8528 * target.cc: Likewise.
8529 * target.h: Likewise.
8530 * timer.cc: Likewise.
8531 * timer.h: Likewise.
8532 * x86_64.cc: Likewise.
8533
83e17bd5
CC
85342010-12-09 Cary Coutant <ccoutant@google.com>
8535
8536 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8537 stack.
8538 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8539 parameter; change all callers.
8540 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8541 * options.h (warn_execstack): New option.
8542
017257f8
DK
85432010-12-07 Doug Kwan <dougkwan@google.com>
8544
8545 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8546 like function call relocations.
8547
c20cbc06
ILT
85482010-12-07 Ian Lance Taylor <iant@google.com>
8549
8550 * archive.cc (Archive::get_elf_object_for_member): Permit
8551 punconfigured to be NULL.
8552 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8553 (Archive::include_member): Pass NULL to get_elf_object_for_member
8554 if we searched for the archive and this is the first included
8555 object.
8556
4dbfafcc
ILT
85572010-12-01 Ian Lance Taylor <iant@google.com>
8558
8559 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8560 track_relocs_type_ field.
8561 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8562 Set track_relocs_type_.
8563 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8564 contents when using RELA relocs.
8565 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8566 reloc_map_.
8567 * reloc.cc (Track_relocs::next_addend): New function.
8568 * reloc.h (class Track_relocs): Declare next_addend.
8569
e5e19edd
ILT
85702010-12-01 Ian Lance Taylor <iant@google.com>
8571
8572 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8573 virtual destructor.
8574
9a5ce24c
ILT
85752010-12-01 Ian Lance Taylor <iant@google.com>
8576
8577 * README: Update compilers known to work and fail.
8578
c7791212
NC
85792010-11-23 Matthias Klose <doko@ubuntu.com>
8580
8581 * configure.in: For --enable-gold, handle value `default' instead of
8582 `both*'. Always install ld as ld.bfd, install as ld if gold is
8583 not the default.
8584 * configure: Regenerate.
8585
0ad220c9
DK
85862010-11-18 Doug Kwan <dougkwan@google.com>
8587
8588 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8589 and right_alignment to be zero. Store result alignment only if it is
8590 greater than existing alignment.
8591
ab8056e0
CC
85922010-11-16 Cary Coutant <ccoutant@google.com>
8593
8594 PR gold/12220
8595 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8596 Check for ".zdebug_line".
8597
fd064a5b
CC
85982010-11-16 Doug Kwan <dougkwan@google.com>
8599 Cary Coutant <ccoutant@google.com>
8600
8601 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8602 by reference; adjust all callers.
8603 * output.cc (Output_segment::set_section_addresses): Adjust references
8604 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8605 list is empty.
8606 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8607 end at page boundary.
8608
6fc6ea19
CC
86092010-11-16 Cary Coutant <ccoutant@google.com>
8610
8611 PR gold/12220
8612 * layout.cc (Layout::choose_output_section): Transform names of
8613 compressed sections even when using a script with a SECTIONS clause.
8614 (Layout::output_section_name): Remove code to transform
8615 compressed debug section names.
8616 * output.cc (Output_section::add_input_section): Use uncompressed
8617 section size when tracking input sections.
8618
95a2c8d6
RS
86192010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8620
8621 * symtab.h (Symbol::NON_PIC_REF): Remove.
8622 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8623 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8624 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8625 (Symbol::use_plt_offset): Take a flags argument and pass it
8626 directly to needs_dynamic_reloc. Restrict check for undefined
8627 weak symbols to function calls.
8628 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8629 (Target_arm::Scan::global): Use it.
8630 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8631 (Target_arm::Relocate::relocate): Likewise.
8632 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8633 parameter with an r_type parameter. Use get_reference_flags
8634 to get the flags.
8635 (Target_arm::Relocate::relocate): Update accordingly.
8636 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8637 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8638 (Target_i386::Scan::global): Likewise.
8639 (Target_i386::Relocate::relocate): Likewise.
8640 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8641 parameter with an r_type parameter. Use get_reference_flags
8642 to get the flags.
8643 (Target_i386::Relocate::relocate): Update accordingly.
8644 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8645 (Target_powerpc::Scan::global): Use it.
8646 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8647 (Target_powerpc::Relocate::relocate): Likewise.
8648 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8649 (Target_sparc::Scan::global): Use it.
8650 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8651 (Target_sparc::Relocate::relocate): Likewise.
8652 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8653 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8654 (Target_x86_64::Scan::global): Likewise.
8655 (Target_x86_64::Relocate::relocate): Likewise.
8656
f625ae50
DK
86572010-11-08 Doug Kwan <dougkwan@google.com>
8658 Cary Coutant <ccoutant@google.com>
8659
8660 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8661 (Arm_exidx_merge_section::section_contents_): New data member.
8662 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8663 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8664 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8665 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8666 in parameters instead of calling Object::section_contents without
8667 locking.
8668 (Arm_output_section::group_section): New parameter TASK. Pass it
8669 to callees that need locking objects.
8670 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8671 to lock EXIDX input sections. Fix a formatting issue. Call
8672 Arm_exidx_merged_section::build_contents to create merged section
8673 contents.
8674 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8675 to lock object of stub table owner.
8676 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8677 TEXT_SIZE to initialize data member TEXT_SIZE_.
8678 (Arm_exidx_input_section::addralign): Fix typo in comment.
8679 (Arm_exidx_input_section::text_size): New method.
8680 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8681 that require locking objects. Lock objects before scanning for stubs
8682 and updating local symbols.
8683 (Arm_input_section<big_endian>::init): Copy contents of original
8684 input section.
2e702c99 8685 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8686 original input section instead of calling Object::section_contents
8687 without locking.
8688 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8689 size without calling Object::section_size().
8690 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8691 for size. Allocate a buffer for merged EXIDX entries.
8692 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8693 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8694 building code to Arm_exidx_merged_section::build_contetns. Write
8695 out contetns in buffer instead of building it on the fly.
8696 (Arm_relobj::make_exidx_input_section): Also pass text section size
8697 to Arm_exidx_input_section constructor.
8698 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8699 (Arm_dynobj::do_read_symbols): Fix memory leak.
8700 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8701 * target.h: (class Task): Add forward declaration.
8702 (Target::relax): Add new parameter TASK and pass it to
8703 Target::do_relax().
8704 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8705
5f9bcf58
CC
87062010-11-05 Cary Coutant <ccoutant@google.com>
8707
8708 PR gold/10708
8709 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8710 object when reading from the file.
8711 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8712 second layout pass.
8713 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8714 when reading section contents.
8715 (get_section_contents): Likewise.
8716 (icf::find_identical_sections): Likewise.
8717 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8718 object when reading from the file.
8719 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8720 the object when doing deferred section layout.
8721
e597fa08
NC
87222010-11-03 Nick Clifton <nickc@redhat.com>
8723
8724 PR gold/12001
8725 * script.h (class Symbol_assignment: name): New member. Returns
8726 the name of the symbol.
8727 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8728 Returns true if the given symbol name is on the list of
8729 assignments wating to be processed.
8730 * archive.cc (should_incldue_member): If the symbol is undefined,
8731 check to see if it is on the list of symbols pending assignment.
8732
3f9a3278
ILT
87332010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8734
8735 * script-sections.cc (Script_sections::find_memory_region): Check
8736 for a NULL output section pointer.
8737
d06fb4d1
DK
87382010-10-29 Doug Kwan <dougkwan@google.com>
8739
8740 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8741 Output_section::add_relaxed_input_section.
8742 * output.cc (Output_section::add_relaxed_input_section): Add new
8743 arguments LAYOUT and NAME. Set section order index.
8744 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8745 Copy section order index.
8746 * output.h (Output_section::add_relaxed_input_section): Add new
8747 arguments LAYOUT and NAME.
8748
90e24de5
ILT
87492010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8750
8751 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8752 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8753 * testsuite/Makefile.in: Regenerate.
8754
c9484ea5
DK
87552010-10-20 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8758 without SHF_LINK_ORDER flags.
8759 * layout.cc (Layout::choose_output_section): Do not filter
8760 SHF_LINK_ORDER flag in a relocatable link.
8761
5bc2f5be
CC
87622010-10-17 Cary Coutant <ccoutant@google.com>
8763
8764 * output.h (Output_segment::set_section_addresses): Change function
8765 signature. Update all callers.
8766 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8767 sections.
8768 (Output_segment::set_section_addresses): Align after last TLS
8769 section. Add padding before last relro section instead of after.
8770
0c91cf04
DK
87712010-10-17 Doug Kwan <dougkwan@google.com>
8772
8773 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8774 GOT output section to be writable.
8775
8c21d9d3
CC
87762010-10-14 Cary Coutant <ccoutant@google.com>
8777
8778 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8779 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8780 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8781 mode.
8782 * incremental.cc (report_command_line): Ignore all forms of
8783 --incremental.
8784 * layout.cc (Layout::Layout): Check parameters for incremental link
8785 mode.
8786 * options.cc (General_options::parse_incremental): New function.
8787 (General_options::parse_no_incremental): New function.
8788 (General_options::parse_incremental_full): New function.
8789 (General_options::parse_incremental_update): New function.
8790 (General_options::incremental_mode_): New data member.
8791 (General_options::finalize): Check incremental_mode_.
8792 * options.h (General_options): Update help text for --incremental.
8793 Add --no-incremental, --incremental-full, --incremental-update.
8794 (General_options::Incremental_mode): New enum type.
8795 (General_options::incremental_mode): New function.
8796 (General_options::incremental_mode_): New data member.
8797 * parameters.cc (Parameters::incremental_mode_): New data member.
8798 (Parameters::set_options): Set incremental_mode_.
8799 (Parameters::set_incremental_full): New function.
8800 (Parameters::incremental): New function.
8801 (Parameters::incremental_update): New function.
8802 (set_parameters_incremental_full): New function.
8803 * parameters.h (Parameters::set_incremental_full): New function.
8804 (Parameters::incremental): New function.
8805 (Parameters::incremental_update): New function.
8806 (Parameters::incremental_mode_): New data member.
8807 (set_parameters_incremental_full): New function.
8808 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8809 incremental link mode.
8810 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8811 (Sized_relobj::do_relocate_sections): Likewise.
8812 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8813 option.
8814 * testsuite/Makefile.in: Regenerate.
8815 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8816
bb32aa18 88172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8818
8819 * script-sections.h (class Script_sections): Make
8820 Sections_elements typedef public.
8821 * script-sections.cc (class Sort_output_sections): Add elements_
8822 field. Add constructor which sets it; change all callers.
8823 (Sort_output_sections::is_before): New function.
8824 (Sort_output_sections::operator()): Call is_before.
8825 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8826 conditional.
8827 * testsuite/script_test_10.sh: New test. Test script section
8828 order.
8829 * testsuite/script_test_10.t: Likewise.
8830 * testsuite/script_test_10.s: Likewise.
8831 * testsuite/Makefile.am: Wrap the cross linker tests and the
8832 common tests into NATIVE_OR_CROSS_LINKER.
8833 (check_SCRIPTS): Add script_test_10.sh.
8834 (check_DATA): Add script_test_10.stdout.
8835 (script_test_10.o, script_test_10): New targets.
8836 (script_test_10.stdout): New target.
8837 * configure, testsuite/Makefile.in: Regenerate.
8838
3cef7179
ILT
88392010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8840
8841 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8842 error for the deprecated relocations.
8843 (Target_arm::Scan::global): Likewise.
8844 (Target_arm::Relocate::relocate): Likewise.
8845
7411e9a8
RS
88462010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8847
8848 * fileread.cc (Input_file::find_file): Initialize *found_name
8849 and *namep when using the fallback search for case 4.
8850
6a9da32a
CC
88512010-10-11 Cary Coutant <ccoutant@google.com>
8852
8853 * options.h (class General_options): Redefine -z lazy as an alias for
8854 the negation of -z now.
8855
ac897c20
ILT
88562010-10-11 Ian Lance Taylor <iant@google.com>
8857
8858 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8859 binding.
8860
ea5cae92
NC
88612010-10-06 Nick Clifton <nickc@redhat.com>
8862
8863 * script-sections.cc(class Memory_region): Remove
8864 current_lma_offset_ field. Rename current_vma_offset_ to
8865 current_offset_. Add last_section_ field.
8866 (Memory_region::get_current_vma_address): Rename to
8867 get_current_address.
8868 (Memory_region::get_current_lma_address): Delete.
8869 (Memory_region::increment_vma_offset): Rename to
8870 increment_offset.
8871 (Memory_region::increment_lma_offset): Delete.
8872 (Memory_region::attributes_compatible): New method. Returns
8873 true if the provided section is compatible with the region.
8874 (Memory_region::get_last_section): New method. Returns the last
8875 section to use the region.
8876 (Memory_region::set_last_section): New method. Stores the last
8877 section to use the region.
8878 (Script_sections::block_in_region): New method. Returns true if
8879 a block of memory is contained within a region.
8880 (Script_sections::find_memory_region): New method. Locates a
8881 memory region to be used to set a VMA or LMA address.
8882 (Output_section_definition::set_section_addresses): Add code to
8883 check for addresses set by memory regions.
8884 (Output_segment::set_section_addresses): Remove memory region
8885 walking code.
8886 (Script_sections::create_segment): Add a warning if a header
8887 segment is created outside of any region.
8888 * script-sections.h (class Script_sections): Add prototypes for
8889 find_memory_region and block_in_region methods.
8890 * testsuite/memory_test.s: Use .long instead of .word.
8891 * testsuite/memory_test.t: Add some more output sections.
8892 * testsuite/memory_test.sh: Update expected output.
8893
a9bfd952
DK
88942010-10-02 Doug Kwan <dougkwan@google.com>
8895
8896 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8897 defintion to symtab.h
8898 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8899 declaration to defintion.
8900
bacff3ab
NC
89012010-10-01 Nick Clifton <nickc@redhat.com>
8902
8903 * expression.cc (eval): Replace dummy argument with NULL.
8904 (eval_maybe_dot): Check for a NULL result section pointer.
8905 (Symbol_expression::value): Likewise.
8906 (Dot_expression::value): Likewise.
8907 (BINARY_EXPRESSION): Likewise.
8908 (Max_expression::value): Likewise.
8909 (Min_expression::value): Likewise.
8910 (Absolute_expression::value): Likewise.
8911 (Addr_expression::value_from_output_section): Likewise.
8912 (Loaddddr_expression::value_from_output_section): Likewise.
8913 (Segment_start_expression::value): Likewise.
8914 * script-sections.cc
8915 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8916 argument with NULL.
8917 (Sections_elememt_dot_assignment::set_section_addresses):
8918 Likewise.
8919 (Output_data_expression::do_write_to_buffer): Likewise.
8920 (Output_section_definition::finalize_symbols): Likewise.
8921 (Output_section_definition::set_section_addresses): Likewise.
8922
f81bc8b5
DK
89232010-09-30 Doug Kwan <dougkwan@google.com>
8924
8925 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8926
c95e9f27
ST
89272010-09-28 Sriraman Tallam <tmsriram@google.com>
8928
8929 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8930 function.
c95e9f27
ST
8931 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8932 virtual function.
8933 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8934 virtual function.
8935 * icf.cc (get_section_contents): Inline merge sections only when
8936 target allows it.
8937
3cac54d2
RW
89382010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8939
8940 * configure: Regenerate.
8941
2904037a
ILT
89422010-09-17 Ian Lance Taylor <iant@google.com>
8943
8944 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8945 * testsuite/Makefile.am (memory_test.o): New target.
8946 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8947 memory_test.t.
8948 * testsuite/Makefile.in: Rebuild.
2904037a 8949
bca7fb63
DK
89502010-09-17 Doug Kwan <dougkwan@google.com>
8951
8952 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8953 defintion if relocation uses GOT entries of the symbol.
8954 * testsuite/icf_safe_test.sh: Fix test.
8955 * testsuite/icf_safe_so_test.sh: Fix test.
8956
4ef28648
CC
89572010-09-16 Cary Coutant <ccoutant@google.com>
8958
8959 * script_sections.cc (class Memory_region): Remove "NULL" from
8960 vector initializations.
8961
793990de
CC
89622010-09-15 Cary Coutant <ccoutant@google.com>
8963
8964 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8965 Resolve forwarding symbols.
8966
81e015e2
DK
89672010-09-15 Doug Kwan <dougkwan@google.com>
8968
8969 * gold/testsuite/script_test_3.t: Add ARM special sections.
8970 * gold/testsuite/script_test_4.t: Same.
8971 * gold/testsuite/script_test_5.t: Same.
8972 * gold/testsuite/script_test_6.t: Same.
8973 * gold/testsuite/script_test_7.t: Same.
8974 * gold/testsuite/script_test_7.t: Same.
8975 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8976
36171d64
CC
89772010-09-14 Cary Coutant <ccoutant@google.com>
8978
8979 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8980 (Target_x86_64::Relocate::relocate_tls): Replace check for
8981 saw_tls_block_reloc_ with test for executable section.
8982
d89051bd
CC
89832010-09-12 Cary Coutant <ccoutant@google.com>
8984
8985 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8986 position-independent executables to shared libraries need dynamic
8987 relocations.
8988 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8989 position-independent executables.
8990 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8991 * testsuite/Makefile.in: Regenerate.
8992
fca41f0f
NC
89932010-09-10 Nick Clifton <nickc@redhat.com>
8994
8995 PR gold/11997
8996 * testsuite/memory_test.t: Discard any sections that are not
8997 needed.
8998
6695e4b3
L
89992010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9000
9001 PR gold/11996
9002 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9003 "This::" to work around a bug in gcc 4.2.
9004
9005 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9006
0f72bf6f
RÁE
90072010-09-09 Rafael Espindola <espindola@google.com>
9008
9009 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9010 sections with different PF_X flags in the same segment.
9011 (Layout::find_first_load_seg): Search all segments to find the first
9012 one.
9013 * options.h (rosegment): New.
9014
90152010-09-08 Rafael Espindola <espindola@google.com>
a6577478 9016
05a79166 9017 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 9018
aa98ff75
DK
90192010-09-08 Doug Kwan <dougkwan@google.com>
9020
9021 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9022 (Arm_relobj::do_relocate_sections): Add new parameter for output
9023 file to match the parent.
9024 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9025 of local symbols instead of input values. Update code to track
9026 changes in gold::relocate_section.
9027 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9028 (Sized_relobj::compute_final_local_value_internal): New methods.
9029 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9030 body into private version of Sized_relobj::compute_final_local_value.
9031 Call the inline method.
9032 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9033 merged symbol value if there is one.
9034 (Symbol_value::has_output_value): New method defintiion.
9035 (Sized_relobj::Compute_final_local_value_status): New enum type.
9036 (Sized_relobj::compute_final_local_value): New methods.
9037 (Sized_relobj::compute_final_local_value_internal): New methods.
9038 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9039 and arm_cortex_a8.sh.
9040 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9041 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9042 New tests.
9043 * Makefile.in: Regenerate.
9044 * testsuite/arm_bl_out_of_range.s: Update test.
9045 * testsuite/thumb_bl_out_of_range.s: Ditto.
9046 * testsuite/thumb_blx_out_of_range.s: Ditto.
9047 * testsuite/arm_branch_out_of_range.sh: New file.
9048 * testsuite/arm_cortex_a8.sh: Ditto.
9049 * testsuite/arm_cortex_a8_b.s: Ditto.
9050 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9051 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9052 * testsuite/arm_cortex_a8_bl.s: Ditto.
9053 * testsuite/arm_cortex_a8_blx.s: Ditto.
9054 * testsuite/arm_cortex_a8_local.s: Ditto.
9055 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9056 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9057
05a79166
L
90582010-09-08 Rafael Espindola <espindola@google.com>
9059
9060 * Makefile.am (memory_test.stdout): Run readelf with -W.
9061 * Makefile.in: Regenerate.
9062 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9063 64 bit output.
9064
33dbc701
RÁE
90652010-09-08 Rafael Espindola <espindola@google.com>
9066
9067 * script-sections.cc (Script_sections::add_memory_region): Convert
9068 field precision to int.
9069 * script.cc (script_set_section_region, script_set_section_region):
9070 Convert field precision to int.
9071
731ca54a
RÁE
90722010-09-08 Rafael Espindola <espindola@google.com>
9073
9074 * arm.cc (do_finalize_sections): Create the __exidx_start and
9075 __exdix_end symbols even when the section is missing.
9076
7f8cd844
NC
90772010-09-08 Nick Clifton <nickc@redhat.com>
9078
9079 * README: Remove claim that MEMORY is not supported.
9080 * expression.cc (script_exp_function_origin)
9081 (script_exp_function_length): Move from here to ...
9082 * script.cc: ... here.
9083 (script_set_section_region, script_add_memory)
9084 (script_parse_memory_attr, script_include_directive): New
9085 functions.
9086 * script-sections.cc
9087 (class Memory_region): New class.
9088 (class Output_section_definition): Add set_memory_region,
9089 set_section_vma, set_section_lma and get_section_name methods.
9090 (class Script_Sections): Add add_memory_region,
9091 find_memory_region, find_memory_region_origin,
9092 find_memory_region_length and set_memory_region methods.
9093 Have set_section_addresses method walk the list of set memory
9094 regions.
9095 Extend the print methos to display memory regions.
9096 * script-sections.h: Add prototypes for new methods.
9097 Add enum for MEMORY region attributes.
9098 * yyscript.y: Add support for parsing MEMORY regions.
9099 * script-c.h: Add prototypes for new functions.
9100 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9101 * testsuite/Makefile.in: Regenerate.
9102 * testsuite/memory_test.sh: New script.
9103 * testsuite/memory_test.s: New assembler source file.
9104 * testsuite/memory_test.t: New linker script.
9105
a4649286
DK
91062010-08-27 Doug Kwan <dougkwan@google.com>
9107
9108 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9109 reference override an existing dynamic weak reference.
9110 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9111 * testsuite/Makefile.in: Regenerate.
9112 * testsuite/dyn_weak_ref.sh: New file.
9113 * testsuite/dyn_weak_ref_1.c: Ditto.
9114 * testsuite/dyn_weak_ref_2.c: Ditto.
9115
b56648ad
ILT
91162010-08-27 Ian Lance Taylor <iant@google.com>
9117
9118 * incremental.h (class Incremental_input_entry): Add virtual
9119 destructor.
9120
809313cb
ILT
91212010-08-27 Ian Lance Taylor <iant@google.com>
9122
9123 * testsuite/start_lib_test_3.c: Mark t3 as used.
9124
11e32464
NC
91252010-08-27 Nick Clifton <nickc@redhat.com>
9126
9127 * options.cc (version_script): Fix small typo in previous
9128 whitespace tidyup.
9129
ca09d69a
NC
91302010-08-25 Nick Clifton <nickc@redhat.com>
9131
9132 * archive.cc: Formatting fixes: Remove whitespace between
9133 typename and following asterisk. Remove whitespace between
9134 function name and opening parenthesis.
9135 * archive.h: Likewise.
9136 * arm.cc: Likewise.
9137 * attributes.cc: Likewise.
9138 * attributes.h: Likewise.
9139 * common.cc: Likewise.
9140 * copy-relocs.cc: Likewise.
9141 * dirsearch.h: Likewise.
9142 * dynobj.cc: Likewise.
9143 * ehframe.cc: Likewise.
9144 * ehframe.h: Likewise.
9145 * expression.cc: Likewise.
9146 * fileread.cc: Likewise.
9147 * fileread.h: Likewise.
9148 * gc.h: Likewise.
9149 * gold-threads.cc: Likewise.
9150 * gold.cc: Likewise.
9151 * i386.cc: Likewise.
9152 * icf.h: Likewise.
9153 * incremental-dump.cc: Likewise.
9154 * incremental.cc: Likewise.
9155 * layout.cc: Likewise.
9156 * layout.h: Likewise.
9157 * main.cc: Likewise.
9158 * merge.cc: Likewise.
9159 * merge.h: Likewise.
9160 * object.cc: Likewise.
9161 * object.h: Likewise.
9162 * options.cc: Likewise.
9163 * options.h: Likewise.
9164 * output.cc: Likewise.
9165 * output.h: Likewise.
9166 * plugin.cc: Likewise.
9167 * plugin.h: Likewise.
9168 * powerpc.cc: Likewise.
9169 * reloc.cc: Likewise.
9170 * script-c.h: Likewise.
9171 * script-sections.cc: Likewise.
9172 * script.cc: Likewise.
9173 * stringpool.cc: Likewise.
9174 * symtab.cc: Likewise.
9175 * symtab.h: Likewise.
9176 * target.cc: Likewise.
9177 * timer.cc: Likewise.
9178 * timer.h: Likewise.
9179 * version.cc: Likewise.
9180 * x86_64.cc: Likewise.
9181
b8fa8750
NC
91822010-08-24 Nick Clifton <nickc@redhat.com>
9183
9184 PR 11899
9185 * layout.cc (segment_precedes): Sort segments by their physical
9186 addresses, if they have been set.
9187
9919d93b
CC
91882010-08-23 Cary Coutant <ccoutant@google.com>
9189
9190 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9191 symbols data.
9192 (Lib_group::include_member): Unlock object after deleting its
9193 symbols data.
9194 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9195 the bug fixed here.
9196
97b4be1c
CC
91972010-08-19 Neil Vachharajani <nvachhar@google.com>
9198 Cary Coutant <ccoutant@google.com>
9199
9200 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9201 constructor, and set_blocker.
9202 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9203 readsyms_blocker_.
9204 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9205 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9206 * testsuite/Makefile.am (start_lib_test): New test case.
9207 * testsuite/Makefile.in: Regenerate.
9208 * testsuite/start_lib_test_main.c: New file.
9209 * testsuite/start_lib_test_1.c: New file.
9210 * testsuite/start_lib_test_2.c: New file.
9211 * testsuite/start_lib_test_3.c: New file.
9212
dd0b1884
ILT
92132010-08-19 Ian Lance Taylor <iant@google.com>
9214
9215 * Makefile.in: Rebuild with automake 1.11.1.
9216 * aclocal.m4: Likewise.
9217 * testsuite/Makefile.in: Likewise.
9218
7223e9ca
ILT
92192010-08-19 Ian Lance Taylor <iant@google.com>
9220
9221 PR 10893
9222 * i386.cc (class Output_data_plt_i386): Update declarations.
9223 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9224 local_ifuncs_ fields.
9225 (Target_i386::do_plt_section_for_global): New function.
9226 (Target_i386::do_plt_section_for_local): New function.
9227 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9228 parameter; change all callers. Initialize global_ifuncs_ and
9229 local_ifuncs_. If doing a static link define __rel_iplt_start and
9230 __rel_iplt_end.
9231 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9232 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9233 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9234 symbols.
9235 (Target_i386::make_plt_section): New function, broken out of
9236 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9237 (Target_i386::make_plt_entry): Call make_plt_section.
9238 (Target_i386::make_local_ifunc_plt_entry): New function.
9239 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9240 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9241 R_386_IRELATIVE to switch.
9242 (Target_i386::Scan::global): Likewise.
9243 (Target_i386::Relocate::relocate): Likewise.
9244 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9245 switch.
9246 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9247 (Target_x86_64::do_plt_section_for_global): New function.
9248 (Target_x86_64::do_plt_section_for_local): New function.
9249 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9250 parameter; change all callers. If doing a static link define
9251 __rela_iplt_start and __rela_iplt_end.
9252 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9253 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9254 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9255 to point to .plt.
9256 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9257 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9258 switch.
9259 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9260 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9261 R_X86_64_IRELATIVE to switch.
9262 (Target_x86_64::Scan::global): Likewise.
9263 (Target_x86_64::Relocate::relocate): Likewise.
9264 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9265 switch.
9266 * target.h (class Target): Add plt_section_for_global and
9267 plt_section_for_local functions. Add do_plt_section_for_global
9268 and do_plt_section_for_local virtual functions.
9269 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9270 clarifying comments.
9271 (Symbol::use_plt_offset): Handle IFUNC symbol.
9272 * object.cc (Sized_relobj::Sized_relobj): Initialize
9273 local_plt_offsets_.
9274 (Sized_relobj::local_has_plt_offset): New function.
9275 (Sized_relobj::local_plt_offset): New function.
9276 (Sized_relobj::set_local_plt_offset): New function.
9277 (Sized_relobj::do_count): Handle IFUNC symbol.
9278 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9279 a bit away from input_shndx_ field. Add set_is_func_symbol and
9280 is_ifunc_symbol functions.
9281 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9282 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9283 local_plt_offsets_ field.
9284 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9285 * output.h (class Output_section_data): Add non-const
9286 output_section function.
9287 (class Output_data_got): Update declarations.
9288 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9289 Add use_plt_offset parameter to global and local constructors.
9290 Change all callers. Change local_sym_index_ field to 31 bits.
9291 Change GSYM_CODE and CONSTANT_CODE accordingly.
9292 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9293 doing a static link don't set sh_link field.
9294 (Output_data_got::Got_entry::write): Use PLT offset if
9295 appropriate.
9296 (Output_data_got::add_global_plt): New function.
9297 (Output_data_got::add_local_plt): New function.
9298 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9299 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9300 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9301 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9302 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9303 IFUNC conditional.
9304 * testsuite/ifunc-sel.h: New file.
9305 * testsuite/ifuncmain1.c: New file.
9306 * testsuite/ifuncmain1vis.c: New file.
9307 * testsuite/ifuncmod1.c: New file.
9308 * testsuite/ifuncdep2.c: New file.
9309 * testsuite/ifuncmain2.c: New file.
9310 * testsuite/ifuncmain3.c: New file.
9311 * testsuite/ifuncmod3.c: New file.
9312 * testsuite/ifuncmain4.c: New file.
9313 * testsuite/ifuncmain5.c: New file.
9314 * testsuite/ifuncmod5.c: New file.
9315 * testsuite/ifuncmain6pie.c: New file.
9316 * testsuite/ifuncmod6.c: New file.
9317 * testsuite/ifuncmain7.c: New file.
9318 * configure, testsuite/Makefile.in: Rebuild.
9319
56f75c03
ILT
93202010-08-18 Ian Lance Taylor <iant@google.com>
9321
9322 * incremental.cc
9323 (Output_section_incremental_inputs::write_input_files): Add cast
9324 to avoid signed/unsigned comparison warning.
9325 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9326
55455f89
CC
93272010-08-12 Cary Coutant <ccoutant@google.com>
9328
9329 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9330
e2054bcb
ILT
93312010-08-13 Ian Lance Taylor <iant@google.com>
9332
9333 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9334
74f67560
DK
93352010-08-12 Cary Coutant <ccoutant@google.com>
9336 Doug Kwan <dougkwan@google.com>
9337
9338 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9339 defintion overrides non-weak undef, remember that the original undef
9340 is not weak.
9341 * symtab.cc (Symbol_table::sized_write_global): For undef without
9342 an original weak binding, set binding to global in output.
9343 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9344 * testsuite/Makefile.in: Regenerate.
9345 * testsuite/strong_ref_weak_def.sh: New file.
9346 * testsuite/strong_ref_weak_def_1.c: Ditto.
9347 * testsuite/strong_ref_weak_def_2.c: Ditto.
9348
d1238d12
CC
93492010-08-12 Cary Coutant <ccoutant@google.com>
9350
9351 * testsuite/incremental_test.sh: Rewrite.
9352 * testsuite/incremental_test_1.c: Rewrite.
9353 * testsuite/incremental_test_2.c: Rewrite.
9354
0e70b911
CC
93552010-08-12 Cary Coutant <ccoutant@google.com>
9356
9357 * arm.cc (Target_arm::got_size): Add const.
9358 (Target_arm::got_entry_count): New function.
9359 (Target_arm::plt_entry_count): New function.
9360 (Target_arm::first_plt_entry_offset): New function.
9361 (Target_arm::plt_entry_size): New function.
9362 (Output_data_plt_arm::entry_count): New function.
9363 (Output_data_plt_arm::first_plt_entry_offset): New function.
9364 (Output_data_plt_arm::get_plt_entry_size): New function.
9365 * i386.cc (Target_i386::got_size): Add const.
9366 (Target_i386::got_entry_count): New function.
9367 (Target_i386::plt_entry_count): New function.
9368 (Target_i386::first_plt_entry_offset): New function.
9369 (Target_i386::plt_entry_size): New function.
9370 (Output_data_plt_i386::entry_count): New function.
9371 (Output_data_plt_i386::first_plt_entry_offset): New function.
9372 (Output_data_plt_i386::get_plt_entry_size): New function.
9373 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9374 find_incremental_inputs_sections. Dump incremental_got_plt section.
9375 * incremental.cc: Include target.h.
9376 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9377 parameter. Adjust all callers. Find incremental_got_plt section.
9378 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9379 section.
9380 (Output_section_incremental_inputs::set_final_data_size): Calculate
9381 size of incremental_got_plt section.
9382 (Output_section_incremental_inputs::do_write): Write the
9383 incremental_got_plt section.
9384 (Got_plt_view_info): New struct.
9385 (Local_got_offset_visitor): New class.
9386 (Global_got_offset_visitor): New class.
9387 (Global_symbol_visitor_got_plt): New class.
9388 (Output_section_incremental_inputs::write_got_plt): New function.
9389 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9390 Add parameter. Adjust all callers.
9391 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9392 (Incremental_inputs::got_plt_section): New function.
9393 (Incremental_inputs::got_plt_section_): New data member.
9394 (Incremental_got_plt_reader): New class.
9395 * layout.cc (Layout::create_incremental_info_sections): Add the
9396 incremental_got_plt section.
9397 * object.h (Got_offset_list::get_list): New function.
9398 (Got offset_list::for_all_got_offsets): New function.
9399 (Sized_relobj::local_got_offset_list): New function.
9400 * powerpc.cc (Target_powerpc::got_size): Add const.
9401 (Target_powerpc::got_entry_count): New function.
9402 (Target_powerpc::plt_entry_count): New function.
9403 (Target_powerpc::first_plt_entry_offset): New function.
9404 (Target_powerpc::plt_entry_size): New function.
9405 (Output_data_plt_powerpc::entry_count): New function.
9406 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9407 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9408 * sparc.cc (Target_sparc::got_size): Add const.
9409 (Target_sparc::got_entry_count): New function.
9410 (Target_sparc::plt_entry_count): New function.
9411 (Target_sparc::first_plt_entry_offset): New function.
9412 (Target_sparc::plt_entry_size): New function.
9413 (Output_data_plt_sparc::entry_count): New function.
9414 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9415 (Output_data_plt_sparc::get_plt_entry_size): New function.
9416 * symtab.h (Symbol::got_offset_list): New function.
9417 (Symbol_table::for_all_symbols): New function.
9418 * target.h (Sized_target::got_entry_count): New function.
9419 (Sized_target::plt_entry_count): New function.
9420 (Sized_target::plt_entry_size): New function.
9421 * x86_64.cc (Target_x86_64::got_size): Add const.
9422 (Target_x86_64::got_entry_count): New function.
9423 (Target_x86_64::plt_entry_count): New function.
9424 (Target_x86_64::first_plt_entry_offset): New function.
9425 (Target_x86_64::plt_entry_size): New function.
9426 (Output_data_plt_x86_64::entry_count): New function.
9427 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9428 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9429
09ec0418
CC
94302010-08-12 Cary Coutant <ccoutant@google.com>
9431
9432 * archive.cc: Include incremental.h.
9433 (Archive::Archive): Initialize incremental_info_.
9434 (Archive::include_member): Record archive members in incremental info.
9435 (Add_archive_symbols::run): Record begin and end of an archive in
9436 incremental info.
9437 (Lib_group::include_member): Record objects in incremental info.
9438 * archive.h (Incremental_archive_entry): Forward declaration.
9439 (Archive::set_incremental_info): New member function.
9440 (Archive::incremental_info): New member function.
9441 (Archive::Unused_symbol_iterator): New class.
9442 (Archive::unused_symbols_begin): New member function.
9443 (Archive::unused_symbols_end): New member function.
9444 (Archive::incremental_info_): New data member.
9445 * incremental-dump.cc (find_input_containing_global): New function.
9446 (dump_incremental_inputs): Dump new incremental info sections.
9447 * incremental.cc: Include symtab.h.
9448 (Output_section_incremental_inputs): New class.
9449 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9450 new incremental info sections.
9451 (Sized_incremental_binary::do_check_inputs): Likewise.
9452 (Incremental_inputs::report_archive): Remove.
9453 (Incremental_inputs::report_archive_begin): New function.
9454 (Incremental_inputs::report_archive_end): New function.
9455 (Incremental_inputs::report_object): New function.
9456 (Incremental_inputs::finalize_inputs): Remove.
9457 (Incremental_inputs::report_input_section): New function.
9458 (Incremental_inputs::report_script): Rewrite.
9459 (Incremental_inputs::finalize): Do nothing but finalize string table.
9460 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9461 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9462 (Incremental_inputs::create_data_sections): New function.
9463 (Incremental_inputs::relocs_entsize): New function.
9464 (Output_section_incremental_inputs::set_final_data_size): New function.
9465 (Output_section_incremental_inputs::do_write): New function.
9466 (Output_section_incremental_inputs::write_header): New function.
9467 (Output_section_incremental_inputs::write_input_files): New function.
9468 (Output_section_incremental_inputs::write_info_blocks): New function.
9469 (Output_section_incremental_inputs::write_symtab): New function.
9470 * incremental.h (Incremental_script_entry): Forward declaration.
9471 (Incremental_object_entry): Forward declaration.
9472 (Incremental_archive_entry): Forward declaration.
9473 (Incremental_inputs): Forward declaration.
9474 (Incremental_inputs_header_data): Remove.
9475 (Incremental_inputs_header): Remove.
9476 (Incremental_inputs_header_write): Remove.
9477 (Incremental_inputs_entry_data): Remove.
9478 (Incremental_inputs_entry): Remove.
9479 (Incremental_inputs_entry_write): Remove.
9480 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9481 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9482 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9483 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9484 Likewise.
9485 (Incremental_input_entry): New class.
9486 (Incremental_script_entry): New class.
9487 (Incremental_object_entry): New class.
9488 (Incremental_archive_entry): New class.
9489 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9490 (Incremental_inputs::report_inputs): Remove.
9491 (Incremental_inputs::report_archive): Remove.
9492 (Incremental_inputs::report_archive_begin): New function.
9493 (Incremental_inputs::report_archive_end): New function.
9494 (Incremental_inputs::report_object): Change prototype.
9495 (Incremental_inputs::report_input_section): New function.
9496 (Incremental_inputs::report_script): Change prototype.
9497 (Incremental_inputs::get_reloc_count): New function.
9498 (Incremental_inputs::set_reloc_count): New function.
9499 (Incremental_inputs::create_data_sections): New function.
9500 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9501 (Incremental_inputs::inputs_section): New function.
9502 (Incremental_inputs::symtab_section): New function.
9503 (Incremental_inputs::relocs_section): New function.
9504 (Incremental_inputs::get_stringpool): Add const.
9505 (Incremental_inputs::command_line): Add const.
9506 (Incremental_inputs::inputs): Remove.
9507 (Incremental_inputs::command_line_key): New function.
9508 (Incremental_inputs::input_file_count): New function.
9509 (Incremental_inputs::input_files): New function.
9510 (Incremental_inputs::relocs_entsize): New function.
9511 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9512 (Incremental_inputs::finalize_inputs): Remove.
9513 (Incremental_inputs::Input_info): Remove.
9514 (Incremental_inputs::lock_): Remove.
9515 (Incremental_inputs::inputs_): Change type.
9516 (Incremental_inputs::inputs_map_): Remove.
9517 (Incremental_inputs::current_object_entry_): New data member.
9518 (Incremental_inputs::inputs_section_): New data member.
9519 (Incremental_inputs::symtab_section_): New data member.
9520 (Incremental_inputs::relocs_section_): New data member.
9521 (Incremental_inputs::reloc_count_): New data member.
9522 (Incremental_inputs_reader): New class.
9523 (Incremental_symtab_reader): New class.
9524 (Incremental_relocs_reader): New class.
9525 * layout.cc (Layout::finalize): Move finalization of incremental info
9526 and creation of incremental info sections to follow finalization of
9527 symbol table. Set offsets for postprocessing sections.
9528 (Layout::create_incremental_info_sections): Call
9529 Incremental_inputs::create_data_sections. Add incremental symtab
9530 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9531 sections to layout after input sections.
9532 * layout.h (struct Timespec): Forward declaration.
9533 (Layout::incremental_inputs): Add const.
9534 (Layout::create_incremental_info_sections): Add parameter.
9535 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9536 * object.cc: Include incremental.h.
9537 (Relobj::finalize_incremental_relocs): New function.
9538 (Sized_relobj::do_layout): Record input sections in incremental info.
9539 * object.h (Object::output_section): New function.
9540 (Object::output_section_offset): Moved from Relobj.
9541 (Object::get_incremental_reloc_base): New function.
9542 (Object::get_incremental_reloc_count): New function.
9543 (Object::do_output_section): New function.
9544 (Object::do_output_section_offset): Moved from Relobj.
9545 (Object::do_get_incremental_reloc_base): New function.
9546 (Object::do_get_incremental_reloc_count): New function.
9547 (Object::Object): Initialize new data members.
9548 (Relobj::output_section): Renamed do_output_section and moved to
9549 protected.
9550 (Relobj::output_section_offset): Moved to Object.
9551 (Relobj::do_get_incremental_reloc_base): New function.
9552 (Relobj::do_get_incremental_reloc_count): New function.
9553 (Relobj::allocate_incremental_reloc_counts): New function.
9554 (Relobj::count_incremental_reloc): New function.
9555 (Relobj::finalize_incremental_relocs): New function.
9556 (Relobj::next_incremental_reloc_index): New function.
9557 (Relobj::reloc_counts_): New data member.
9558 (Relobj::reloc_bases_): New data member.
9559 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9560 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9561 (Sized_relobj::incremental_relocs_scan): New function.
9562 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9563 (Sized_relobj::incremental_relocs_write): New function.
9564 (Sized_relobj::incremental_relocs_write_reltype): New function.
9565 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9566 incremental link.
9567 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9568 archives and object files elsewhere.
9569 (Add_symbols::run): Report object files here.
9570 (Finish_group::run): Report end of archive at end of group.
9571 * reloc.cc: Include layout.h, incremental.h.
9572 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9573 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9574 (Sized_relobj::incremental_relocs_scan): New function.
9575 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9576 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9577 (Sized_relobj::incremental_relocs_write): New function.
9578 (Sized_relobj::incremental_relocs_write_reltype): New function.
9579 * script.cc (read_input_script): Rewrite test for incremental link.
9580 Change call to Incremental_inputs::report_script.
9581 * symtab.h (Symbol_table::first_global_index): New function.
9582 (Symbol_table::output_count): New function.
9583
ce0d1972
DK
95842010-08-12 Doug Kwan <dougkwan@google.com>
9585
9586 * arm.cc (Target_arm::merge_object_attributes): Check command line
9587 options --no-wchar-size-warning and --no-enum-size-warning.
9588 * options.h (General_options): Add ld-compatible options
9589 --no-enum-size-warning and --no-wchar-size-warning.
9590
6e5710ce
ILT
95912010-08-04 Ian Lance Taylor <iant@google.com>
9592
9593 * x86_64.cc (Target_x86_64::Scan::local): Use
9594 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9595 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9596 (Target_x86_64::Scan::global): Likewise.
9597 (Target_x86_64::Relocate::relocate): Likewise.
9598 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9599 Likewise.
9600
fef830db
CC
96012010-08-03 Cary Coutant <ccoutant@google.com>
9602
9603 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9604 to reserve space in merged_strings vector. Keep total input size
9605 for stats.
9606 (Output_merge_string::do_print_merge_stats): Print total input size.
9607 * merge.h (Output_merge_string): Add input_size_ field.
9608 * stringpool.cc (Stringpool_template::string_length): Move
9609 implementations out of Stringpool_template class and place in
9610 stringpool.h.
9611 * stringpool.h (string_length): Move out of Stringpool_template.
9612
1e3811b0
ILT
96132010-08-03 Ian Lance Taylor <iant@google.com>
9614
9615 PR 11712
9616 * layout.cc (relaxation_loop_body): If address of load segment is
9617 set, adjust address to include headers if possible.
9618
7af0c620
ILT
96192010-08-03 Ian Lance Taylor <iant@google.com>
9620
9621 * version.cc (version_string): Bump to 1.10.
9622
22f0da72
ILT
96232010-08-03 Ian Lance Taylor <iant@google.com>
9624
9625 PR 11805
9626 * layout.h (enum Output_section_order): Define.
9627 (class Layout): Update declarations.
9628 * layout.cc (Layout::get_output_section): Add order parameter.
9629 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9630 is_first_non_relro parameters. Change all callers.
9631 (Layout::choose_output_section): Likewise.
9632 (Layout::add_output_section_data): Likewise.
9633 (Layout::make_output_section): Likewise. Set order.
9634 (Layout::default_section_order): New function.
9635 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9636 * output.cc (Output_section::Output_section): Initialize order_.
9637 Don't initialize deleted fields.
9638 (Output_segment::Output_segment): Don't initialize deleted
9639 fields.
9640 (Output_segment::add_output_section_to_load): New function
9641 replacing add_output_section. Change all callers to call this or
9642 add_output_section_to_nonload.
9643 (Output_segment::add_output_section_to_nonload): New function.
9644 (Output_segment::remove_output_section): Rewrite.
9645 (Output_segment::add_initial_output_data): Likewise.
9646 (Output_segment::has_any_data_sections): Likewise.
9647 (Output_segment::is_first_section_relro): Likewise.
9648 (Output_segment::maximum_alignment): Likewise.
9649 (Output_segment::has_dynamic_reloc): New function replacing
9650 dynamic_reloc_count. Change all callers.
9651 (Output_segment::has_dynamic_reloc_list): New function replacing
9652 dynamic_reloc_count_list. Change all callers.
9653 (Output_segment::set_section_addresses): Rewrite.
9654 (Output_segment::set_offset): Rewrite.
9655 (Output_segment::find_first_and_last_list): Remove.
9656 (Output_segment::set_tls_offsets): Rewrite.
9657 (Output_segment::first_section_load_address): Likewise.
9658 (Output_segment::output_section_count): Likewise.
9659 (Output_segment::section_with_lowest_load_address): Likewise.
9660 (Output_segment::write_section_headers): Likewise.
9661 (Output_segment::print_sections_to_map): Likewise.
9662 * output.h (class Output_data): Remove dynamic_reloc_count_
9663 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9664 (Output_data::add_dynamic_reloc): Rewrite.
9665 (Output_data::has_dynamic_reloc): New function.
9666 (Output_data::dynamic_reloc_count): Remove.
9667 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9668 is_last_relro_, is_first_non_relro_, is_interp_,
9669 is_dynamic_linker_section_ fields. Add order and set_order
9670 functions. Remove is_relro_local, set_is_relro_local,
9671 is_last_relro, set_is_last_relro, is_first_non_relro,
9672 set_is_first_non_relro functions, is_interp, set_is_interp,
9673 is_dynamic_linker_section, and set_is_dynamic_linker_section
9674 functions.
9675 (class Output_segment): Change Output_data_list from std::list to
9676 std:;vector. Add output_lists_ field. Remove output_data_ and
9677 output_bss_ fields. Update declarations.
9678
3ff2ccb0
ILT
96792010-08-02 Ian Lance Taylor <iant@google.com>
9680
9681 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9682 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9683 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9684
88a4108b
ILT
96852010-08-02 Ian Lance Taylor <iant@google.com>
9686
9687 PR 11855
9688 * script.cc (Script_options::Script_options): Initialize
9689 symbol_definitions_ and symbol_references_.
9690 (Script_options::add_symbol_assignment): Update
9691 symbol_definitions_ and symbol_references_.
9692 (Script_options::add_symbol_reference): New function.
9693 (script_symbol): New function.
9694 * script.h (class Script_options): Add symbol_definitions_ and
9695 symbol_references_ fields.
9696 (Script_options::referenced_const_iterator): New type.
9697 (Script_options::referenced_begin): New function.
9698 (Script_options::referenced_end): New function.
9699 (Script_options::is_referenced): New function.
9700 (Script_options::any_unreferenced): New function.
9701 * script-c.h (script_symbol): Declare.
9702 * yyscript.y (exp): Call script_symbol.
9703 * symtab.cc: Include "script.h".
9704 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9705 Change all callers. Check symbols referenced by scripts.
9706 (Symbol_table::add_undefined_symbols_from_command_line): Add
9707 layout parameter. Change all callers.
9708 (Symbol_table::do_add_undefined_symbols_from_command_line):
9709 Likewise. Break out loop body. Check symbols referenced by
9710 scripts.
9711 (Symbol_table::add_undefined_symbol_from_command_line): New
9712 function broken out of
9713 do_add_undefined_symbols_from_command_line.
9714 * symtab.h (class Symbol_table): Update declarations.
9715 * archive.cc: Include "layout.h".
9716 (Archive::should_include_member): Add layout parameter. Change
9717 all callers. Check for symbol mentioned in expression.
9718 * archive.h (class Archive): Update declaration.
9719 * object.cc (Sized_relobj::do_should_include_member): Add layout
9720 parameter.
9721 * object.h (Object::should_include_member): Add layout parameter.
9722 Change all callers.
9723 (Object::do_should_include_member): Add layout parameter.
9724 (class Sized_relobj): Update declaration.
9725 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9726 parameter.
9727 * dynobj.h (class Sized_dynobj): Update declaration.
9728 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9729 layout parameter.
9730 * plugin.h (class Sized_pluginobj): Update declaration.
9731
5f1ab67a
ILT
97322010-08-02 Ian Lance Taylor <iant@google.com>
9733
9734 PR 11866
9735 * output.cc (Output_segment::set_offset): Search for the first and
9736 last sections rather than assuming that the list is in order.
9737 (Output_segment::find_first_and_last_list): New function.
9738 * output.h (class Output_segment): Update declarations.
9739 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9740 (relro_strip_test_SOURCES): New variable.
9741 (relro_strip_test_DEPENDENCIES): New variable.
9742 (relro_strip_test_LDFLAGS): New variable.
9743 (relro_strip_test_LDADD): New variable.
9744 (relro_strip_test.so): New target.
9745
a8df5856
ILT
97462010-08-02 Ian Lance Taylor <iant@google.com>
9747
9748 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9749 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9750 (Target_i386::got_tlsdesc_section): New function.
9751 (Target_i386::got_section): Create space for GOT entries for
9752 TLSDESC relocations.
9753 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9754 R_386_TLS_GOTDESC.
9755 (Target_i386::Scan::global): Likewise.
9756 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9757 using TLSDESC GOT.
9758 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9759 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9760 (Target_x86_64::got_tlsdesc_section): New function.
9761 (Target_x86_64::got_section): Create space for GOT entries for
9762 TLSDESC relocations.
9763 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9764 R_386_TLS_GOTDESC.
9765 (Target_x86_64::Scan::global): Likewise.
9766 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9767 using TLSDESC GOT.
9768
0c10a0a6
ILT
97692010-08-02 Ian Lance Taylor <iant@google.com>
9770
9771 * testsuite/final_layout.sh: Use dc to convert from hex to
9772 decimal.
9773
41cbeecc
ST
97742010-07-29 Sriraman Tallam <tmsriram@google.com>
9775
9776 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9777 paramter to the call to gold::gc_process_relocs.
9778 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9779 paramter to the call to gold::gc_process_relocs.
9780 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9781 parameter to the call to gold::gc_process_relocs.
9782 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9783 template parameter to the call to gold::gc_process_relocs.
9784 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9785 paramter to the call to gold::gc_process_relocs.
9786 * gc.h (get_embedded_addend_size): New function.
9787 (gc_process_relocs): Save the size of the reloc for use by ICF.
9788 * icf.cc (get_section_contents): Get the addend from the text section
9789 for SHT_REL relocation sections.
9790 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9791 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9792 * int_encoding.h (read_from_pointer): New overloaded function.
9793 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9794 * testsuite/icf_sht_rel_addend_test.sh: New file.
9795 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9796 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9797
6ea55b82
RW
97982010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9799
9800 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9801 * Makefile.in: Regenerate.
9802 * testsuite/Makefile.in: Regenerate.
9803
9691462b
ILT
98042010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9805
9806 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9807 * gold/testsuite/debug_msg.cc: Likewise.
9808 * gold/testsuite/odr_violation1.cc
9809 * gold/testsuite/odr_violation2.cc
9810
76897331
CC
98112010-07-21 Cary Coutant <ccoutant@google.com>
9812
9813 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9814 string, and length fields.
9815 (Output_merge_string::Merged_strings_list): New type.
9816 (Output_merge_string::Merged_strings_lists): New typedef.
9817 (Output_merge_string): Replace merged_strings_ with
9818 merged_strings_lists_.
9819 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9820 Merged_strings_list per input object and section. Don't store pointer
9821 to the string. Don't store length with each merged string entry.
9822 (Output_merge_string::finalize_merged_data): Loop over list of merged
9823 strings lists. Recompute length of each merged string.
9824
78384e8f
CC
98252010-07-15 Cary Coutant <ccoutant@google.com>
9826
9827 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9828 here.
9829
783659f9
ILT
98302010-07-14 Ian Lance Taylor <iant@google.com>
9831
9832 * descriptors.cc (Descriptors::open): Report correct name in error
9833 message.
9834
131687b4
DK
98352010-07-13 Doug Kwan <dougkwan@google.com>
9836
9837 * arm.cc (Arm_input_section::Arm_input_section): For a
9838 SHT_ARM_EXIDX section, always keeps the input sections.
9839 (Arm_input_section::set_exidx_section_link): New method.
9840 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9841 has_errors_ to false.
9842 (Arm_exidx_input_section::has_errors,
9843 Arm_exidx_input_section::set_has_errors): New methods.
9844 (Arm_exidx_input_section::has_errors_): New data member.
9845 (Arm_relobj::get_exidx_shndx_list): New method.
9846 (Arm_output_section::append_text_sections_to_list): Do not skip
9847 section without SHF_EXECINSTR.
9848 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9849 errors.
2e702c99 9850 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9851 section header. Make error messages more verbose. Check for
9852 a non-executable section linked to an EXIDX section.
9853 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9854 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9855 check that there is no deferred EXIDX section if we exit early.
9856 Instead of not making an EXIDX section in case of an error, make one
9857 and set the has_errors flag of it.
9858 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9859 in a relocatable link.
9860 (Target_arm::do_relax): Look for the EXIDX output section instead of
9861 assuming that it is called .ARM.exidx.
2e702c99 9862 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9863 section list. Do not check for SHF_EXECINSTR section flags but
9864 skip any input section with errors.
9865 * output.cc (Output_section::Output_section): Initialize
9866 always_keeps_input_sections_ to false.
9867 (Output_section::add_input_section): Check for
9868 always_keeps_input_sections_.
9869 * output.h (Output_section::always_keeps_input_sections,
9870 Output_section::set_always_keeps_input_sections): New methods.
9871 (Output_section::always_keeps_input_sections): New data member.
9872
69517287
RÁE
98732010-07-13 Rafael Espindola <espindola@google.com>
9874
9875 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9876 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9877
82742395
ILT
98782010-07-13 Philip Herron <herron.philip@googlemail.com>
9879 Ian Lance Taylor <iant@google.com>
9880
9881 * output.h (Output_section_lookup_maps::add_merge_section):
9882 Correct check of whether value was inserted.
9883 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9884 (Output_section_lookup_maps::add_relaxed_input_section):
9885 Likewise.
9886 * arm.cc (Target_arm::got_section): Remove used local os.
9887 * i386.cc (Target_i386::got_section): Likewise.
9888 * x86_64.cc (Target_x86_64::got_section): Likewise.
9889 * sparc.cc (Target_sparc::got_section): Likewise.
9890 (Target_sparc::relocate): Remove unused local have_got_offset.
9891 * powerpc.cc (Target_powerpc::relocate): Likewise.
9892
f2d707b5
ILT
98932010-07-13 Ian Lance Taylor <iant@google.com>
9894
241531d6
ILT
9895 * compressed_output.cc (zlib_decompress): Fix signature in
9896 !HAVE_ZLIB_H case.
9897
f2d707b5
ILT
9898 * archive.cc (Archive::include_member): Unlock an external member
9899 of a thin archive. Don't bother to delete an object we know is
9900 NULL.
9901
a2e47362
CC
99022010-07-12 Cary Coutant <ccoutant@google.com>
9903
9904 * compressed_output.cc (zlib_decompress): New function.
9905 (get_uncompressed_size): New function.
9906 (decompress_input_section): New function.
9907 * compressed_output.h (get_uncompressed_size): New function.
9908 (decompress_input_section): New function.
9909 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9910 Handle compressed debug sections.
9911 * layout.cc (is_compressed_debug_section): New function.
9912 (Layout::output_section_name): Map compressed section names to
9913 canonical names.
9914 * layout.h (is_compressed_debug_section): New function.
9915 (is_debug_info_section): Recognize compressed debug sections.
9916 * merge.cc: Include compressed_output.h.
9917 (Output_merge_data::do_add_input_section): Handle compressed
9918 debug sections.
9919 (Output_merge_string::do_add_input_section): Handle compressed
9920 debug sections.
9921 * object.cc: Include compressed_output.h.
9922 (Sized_relobj::Sized_relobj): Initialize new data members.
9923 (build_compressed_section_map): New function.
9924 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9925 * object.h (Object::section_is_compressed): New method.
9926 (Object::do_section_is_compressed): New method.
9927 (Sized_relobj::Compressed_section_map): New type.
9928 (Sized_relobj::do_section_is_compressed): New method.
9929 (Sized_relobj::compressed_sections_): New data member.
9930 * output.cc (Output_section::add_input_section): Handle compressed
9931 debug sections.
9932 * reloc.cc: Include compressed_output.h.
9933 (Sized_relobj::write_sections): Handle compressed debug sections.
9934
ce279a62
CC
99352010-07-08 Cary Coutant <ccoutant@google.com>
9936
9937 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9938 weak when resolving to a dynamic def.
9939 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9940 for weak undef/dynamic def cases. Adjust callers.
9941 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9942 undef_binding_weak_.
9943 (Symbol_table::sized_write_globals): Adjust symbol binding.
9944 (Symbol_table::sized_write_symbol): Add binding parameter.
9945 * symtab.h (Symbol::set_undef_binding): New method.
9946 (Symbol::is_undef_binding_weak): New method.
9947 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9948 (Symbol_table::should_override): Add new parameter.
9949 (Symbol_table::sized_write_symbol): Add new parameter.
9950
9951 * testsuite/weak_undef_file1.cc: Add new test case.
9952 * testsuite/weak_undef_file2.cc: Fix header comment.
9953 * testsuite/weak_undef_test.cc: Add new test case.
9954
b2286c10
DK
99552010-06-29 Doug Kwan <dougkwan@google.com>
9956
9957 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9958 Initialize USE_SYMBOL_.
9959 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9960 definition.
9961 (Arm_reloc_property::uses_symbol_): New data member declaration.
9962 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9963 uses symbol value and symbol is undefined but not weakly undefined.
9964
4802450a
RÁE
99652010-06-28 Rafael Espindola <espindola@google.com>
9966
9967 * plugin.cc (Plugin::load): Use dlerror.
9968
e5ca47ba
ILT
99692010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9970
9971 * symtab.cc (detect_odr_violations): When reporting an ODR
9972 violation, report an object where the symbol is defined.
9973
8a75a161
DK
99742010-06-25 Doug Kwan <dougkwan@google.com>
9975
9976 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9977 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9978 definition.
9979 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9980 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9981 target hook to detect function points.
9982 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9983 * icf.h (Icf::check_section_for_function_pointers): Change type of
9984 parameter SECTION_NAME to const reference to std::string. Use
9985 target hook to determine if section may have unsafe pointers.
9986 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9987 method definition.
9988
42218b9f
RÁE
99892010-06-21 Rafael Espindola <espindola@google.com>
9990
9991 * fileread.cc (Input_file::find_fie): New
9992 (Input_file::open): Use Input_file::find_fie.
9993 * fileread.h (Input_file::find_fie): New
9994 * plugin.cc (set_extra_library_path): New.
9995 (Plugin::load): Add set_extra_library_path to the transfer vector.
9996 (Plugin_manager::set_extra_library_path): New.
9997 (Plugin_manager::add_input_file): Use the extra search path if set.
9998 (set_extra_library_path(): New.
9999 * plugin.h (Plugin_manager): Add set_extra_library_path and
10000 extra_search_path_.
10001
a0506cca
CC
100022010-06-19 Cary Coutant <ccoutant@google.com>
10003
10004 * layout.cc (gdb_sections): Add .debug_types.
10005 (lines_only_debug_sections): Likewise.
10006
6508b958
RÁE
100072010-06-18 Rafael Espindola <espindola@google.com>
10008
10009 * plugin.cc (add_input_file,add_input_library)
10010 (Plugin_manager::add_input_file): Make filename arguments const.
10011 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10012 const.
10013
3e235302
DK
100142010-06-16 Doug Kwan <dougkwan@google.com>
10015
10016 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10017 .ARM.attributes section if we have not merged any input
10018 attributes sections.
10019
106e8a6c
DK
100202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10021
10022 * arm.cc: Allow combining objects with no EABI version
10023 information.
10024
91ff43fe
RÁE
100252010-06-15 Rafael Espindola <espindola@google.com>
10026
10027 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10028
68ed838c
ILT
100292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10030
10031 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10032 (struct iovec): Correct !HAVE_READV definition.
10033
f3a2388f
CC
100342010-06-10 Cary Coutant <ccoutant@google.com>
10035
10036 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10037 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10038 reloc sections.
10039 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10040
10041 PR 11683
10042 * symtab.h (Symbol::is_placeholder): New member function.
10043 * target-reloc.h (relocate_section): Check for placeholder symbols.
10044
10045 * testsuite/Makefile.am (plugin_test_8): New test.
10046 (plugin_test_9): New test.
10047 * testsuite/Makefile.in: Regenerate.
10048
e1df38aa
NC
100492010-06-09 Nick Clifton <nickc@redhat.com>
10050
10051 * yyscript.y (input_list_element): Allow strings prefixed with
10052 the '-' character. Treat these as libraries.
10053 * script.cc (script_add_library): New function. Adds a library
10054 specified by "-l<name>" found in an input script.
10055 * script-c.h: Add prototype for script_add_library.
10056
25bbe950
DK
100572010-06-07 Doug Kwan <dougkwan@google.com>
10058
10059 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10060 Restrict stub-group size to be within long conditional branch
10061 range when working around cortex-A8 erratum.
10062
0f32ea4c
ILT
100632010-06-07 Damien Diederen <dd@crosstwine.com>
10064
10065 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10066 #ifdef typo.
10067
8fe2a369
ST
100682010-06-03 Sriraman Tallam <tmsriram@google.com>
10069
10070 PR gold/11658
10071 * output.cc
10072 (Output_section::Input_section_sort_entry::compare_section_ordering):
10073 Change to return non-zero correctly.
10074 (Output_section::Input_section_sort_section_order_index_compare
10075 ::operator()): Change to fix ambiguity in comparisons.
10076
6e9ba2ca
ST
100772010-06-01 Sriraman Tallam <tmsriram@google.com>
10078
10079 * gold.h (is_wildcard_string): New function.
10080 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10081 (Layout::layout_eh_frame): Ditto.
10082 (Layout::find_section_order_index): New method.
10083 (Layout::read_layout_from_file): New method.
10084 * layout.h (Layout::find_section_order_index): New method.
10085 (Layout::read_layout_from_file): New method.
10086 (Layout::input_section_position_): New private member.
10087 (Layout::input_section_glob_): New private member.
10088 * main.cc (main): Call read_layout_from_file here.
10089 * options.h (--section-ordering-file): New option.
10090 * output.cc (Output_section::input_section_order_specified_): New
10091 member.
10092 (Output_section::Output_section): Initialize new member.
10093 (Output_section::add_input_section): Add new parameter.
10094 Keep input sections when --section-ordering-file is used.
10095 (Output_section::set_final_data_size): Sort input sections when
10096 section ordering file is specified.
10097 (Output_section::Input_section_sort_entry): Add new parameter.
10098 Check sorting type.
10099 (Output_section::Input_section_sort_entry::compare_section_ordering):
10100 New method.
10101 (Output_section::Input_section_sort_compare::operator()): Change to
10102 consider section_order_index.
10103 (Output_section::Input_section_sort_init_fini_compare::operator()):
10104 Change to consider section_order_index.
10105 (Output_section::Input_section_sort_section_order_index_compare
10106 ::operator()): New method.
10107 (Output_section::sort_attached_input_sections): Change to sort
10108 according to section order when specified.
e1df38aa
NC
10109 (Output_section::add_input_section<32, true>): Add new parameter.
10110 (Output_section::add_input_section<64, true>): Add new parameter.
10111 (Output_section::add_input_section<32, false>): Add new parameter.
10112 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10113 * output.h (Output_section::add_input_section): Add new parameter.
10114 (Output_section::input_section_order_specified): New
10115 method.
10116 (Output_section::set_input_section_order_specified): New method.
10117 (Input_section::Input_section): Initialize section_order_index_.
10118 (Input_section::section_order_index): New method.
10119 (Input_section::set_section_order_index): New method.
10120 (Input_section::section_order_index_): New member.
10121 (Input_section::Input_section_sort_section_order_index_compare): New
10122 struct.
10123 (Output_section::input_section_order_specified_): New member.
10124 * script-sections.cc (is_wildcard_string): Delete and move modified
10125 method to gold.h.
10126 (Output_section_element_input::Output_section_element_input): Modify
10127 call to is_wildcard_string.
10128 (Output_section_element_input::Input_section_pattern
10129 ::Input_section_pattern): Ditto.
10130 (Output_section_element_input::Output_section_element_input): Ditto.
10131 * testsuite/Makefile.am (final_layout): New test case.
10132 * testsuite/Makefile.in: Regenerate.
10133 * testsuite/final_layout.cc: New file.
10134 * testsuite/final_layout.sh: New file.
10135
3537c84b
RÁE
101362010-06-01 Rafael Espindola <espindola@google.com>
10137
10138 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10139
105b6afd
RÁE
101402010-06-01 Rafael Espindola <espindola@google.com>
10141
10142 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10143 visibility of symbols.
10144
29e11421
DK
101452010-05-27 Doug Kwan <dougkwan@google.com>
10146
10147 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10148 from start of output section instead of address for a local symbol
10149 in a merged or relaxed section when doing a relocatable link.
10150
5e0f337e
RÁE
101512010-05-26 Rafael Espindola <espindola@google.com>
10152
703d02da 10153 PR 11604
5e0f337e
RÁE
10154 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10155 adding sections the garbage collector removed.
10156 * gold/testsuite/Makefile.am: Add test.
10157 * gold/testsuite/Makefile.in: Regenerate.
10158 * gold/testsuite/plugin_test_7.sh: New.
10159 * gold/testsuite/plugin_test_7_1.c: New.
10160 * gold/testsuite/plugin_test_7_2.c: New.
10161
f4187277
RÁE
101622010-05-26 Rafael Espindola <espindola@google.com>
10163
10164 * script-sections.cc (Output_section_definition::set_section_addresses):
10165 Check for --section-start.
10166
5c388529
DK
101672010-05-26 Doug Kwan <dougkwan@google.com>
10168
10169 * arm.cc (Arm_scan_relocatable_relocs): New class.
10170 (Target_arm::relocate_special_relocatable): New method.
10171 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10172 (Arm_relocate_functions::thumb_branch_common): Same.
10173 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10174 instead of Default_scan_relocatable_relocs.
10175 * target-reloc.h (relocate_for_relocatable): Let target handle
10176 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10177 * target.h (Sized_target::relocate_special_relocatable): New method.
10178
bca1c3ae
ILT
101792010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10180
10181 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10182
0439c796
DK
101832010-05-23 Doug Kwan <dougkwan@google.com>
10184
10185 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10186 instead of a cast.
10187 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10188 with a direct branch, not a conditional branch, to a stub.
10189 * merge.cc (Output_merge_base::record_input_section): New method
10190 defintion.
10191 (Output_merge_data::do_add_input_section): Record input section if
10192 keeps-input-sections flag is set.
10193 (Output_merge_string::do_add_input_section): Ditto.
10194 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10195 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10196 INPUT_SECTIONS_.
10197 (Output_merge_base::keeps_input_sections,
10198 Output_merge_base::set_keeps_input_sections,
10199 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10200 method definitions.
10201 (Output_merge_base::Input_sections): New type declaration.
10202 (Output_merge_base::input_sections_begin,
10203 Output_merge_base::input_sections_end,
10204 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10205 (Output_merge_base::bool keeps_input_sections_,
10206 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10207 Output_merge_base::input_sections_): New data members.
10208 (Output_merge_data::do_set_keeps_input_sections): New method
10209 defintion.
10210 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10211 * output.cc (Output_section::Input_section::relobj): Move method
10212 defintion from class declaration to here and handle merge sections.
10213 (Output_section::Input_section::shndx): Ditto.
10214 (Output_section::Output_section): Remove initializations of removed
10215 data members and initialize new data member LOOKUP_MAPS_.
10216 (Output_section::add_input_section): Set keeps-input-sections flag
10217 for a newly created merge output section as appropriate. Adjust code
10218 to use Output_section_lookup_maps class.
10219 (Output_section::add_relaxed_input_section): Adjst code for lookup
10220 maps code refactoring.
2e702c99 10221 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10222 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10223 class. If adding input section to a newly created merge output
10224 section fails, remove the new merge section.
10225 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10226 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10227 (Output_section::find_merge_section): Ditto.
0439c796 10228 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10229 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10230 Output_section_lookup_maps class.
10231 (Output_section::get_input_sections): Export merge sections. Adjust
10232 code to use Output_section_lookup_maps class.
10233 (Output_section:::add_script_input_section): Adjust code to use
10234 Output_section_lookup_maps class. Update lookup maps for merge
10235 sections also.
10236 (Output_section::discard_states): Use Output_section_lookup_maps.
10237 (Output_section::restore_states): Same.
10238 * output.h (Merge_section_properties): Move class defintion out of
10239 Output_section.
10240 (Output_section_lookup_maps): New class.
10241 (Output_section::Input_section::is_merge_section): New method
10242 defintion.
10243 (Output_section::Input_section::relobj): Move defintion out of class
10244 defintion. Declare method only.
10245 (Output_section::Input_section::shndx): Ditto.
10246 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10247 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10248 (Output_section::Merge_section_by_properties_map,
10249 Output_section::Output_section_data_by_input_section_map,
10250 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10251 Remove types.
2e702c99 10252 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10253 KEEPS_INPUT_SECTIONS.
10254 (Output_section::build_lookup_maps): New method declaration.
10255 (Output_section::merge_section_map_,
10256 Output_section::merge_section_by_properties_map_,
10257 Output_section::relaxed_input_section_map_,
10258 Output_section::is_relaxed_input_section_map_valid_): Remove data
10259 members.
10260 (Output_section::lookup_maps_): New data member.
10261
76295588
L
102622010-05-21 Doug Kwan <dougkwan@google.com>
10263
10264 PR gold/11619
10265 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10266 avoid a compilation error.
10267
d103a984
RÁE
102682010-05-19 Rafael Espindola <espindola@google.com>
10269
10270 * script-sections.cc (Output_section_definition::allocate_to_segment):
10271 Update the phdrs_list even when the output section is NULL.
10272 * testsuite/Makefile.am: Add test.
10273 * testsuite/Makefile.in: Regenerate.
10274 * testsuite/script_test_9.cc: New.
10275 * testsuite/script_test_9.sh: New.
10276 * testsuite/script_test_9.t: New.
10277
6625d24e
DK
102782010-05-19 Doug Kwan <dougkwan@google.com>
10279
10280 * arm.cc (Arm_input_section::original_size): New method.
10281 (Arm_input_section::do_addralign): Add a cast.
10282 (Arm_input_section::do_output_offset): Remove static cast.
10283 (Arm_input_section::original_addralign,
10284 Arm_input_section::original_size_): Change type to uint32_t.
10285 (Arm_input_section::init): Add safe casts for section alignment
10286 and size.
10287 (Arm_input_section::set_final_data_size): Do not set address and
10288 offset of stub table.
10289 (Arm_output_section::fix_exidx_coverage): Change use of of
10290 Output_section::Simple_input_section to that of
10291 Output_section::Input_section.
10292 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10293 except for the first pass.
10294 * output.cc (Output_section::get_input_sections): Change type of
10295 input_sections to std::list<Input_section>.
10296 (Output_section::add_script_input_section): Rename from
10297 Output_section::add_simple_input_section. Change type of SIS
10298 parameter from Simple_input_section to Input_section.
10299 * output.h (Output_section::Simple_input_section): Remove class.
10300 (Output_section::Input_section): Change class visibility to public.
10301 (Output_section::Input_section::addralign): Use stored alignments
10302 for special input sections if set.
10303 (Output_section::Input_section::set_addralign): New method.
10304 (Output_section::get_input_sections): Change parameter type from
10305 list of Simple_input_section to list of Input_section.
10306 (Output_section::add_script_input_section): Rename from
10307 Output_section::add_simple_input_section. Change first parameter's
10308 type from Simple_input_section to Input_section and remove the
10309 second and third parameters.
10310 * script-sections.cc (Input_section::Input_section_list): Change
10311 type to list of Output_section::Input_section/
10312 (Input_section_info::Input_section_info): Change parameter type of
10313 INPUT_SECTION to Output_section::Input_section.
10314 (Input_section_info::input_section): Change return type.
10315 (Input_section_info::input_section_): Change type to
10316 Output_section::Input_section.
10317 (Output_section_element_input::set_section_addresses): Adjust code
10318 to use Output_section::Input_section instead of
10319 Output_section::Simple_input_section. Adjust code for renaming
10320 of Output_section::add_simple_input_section.
10321 (Orphan_output_section::set_section_addresses): Ditto.
10322
e1e82ea4
RW
103232010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10324
10325 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10326 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10327
91e75c8a
RÁE
103282010-05-18 Rafael Espindola <espindola@google.com>
10329
10330 * options.cc (General_options::finalize): Handle -nostdlib.
10331 * options.h (nostdlib): New option.
10332 * script.cc (script_add_search_dir): Handle -nostdlib.
10333
da59ad79
DK
103342010-05-12 Doug Kwan <dougkwan@google.com>
10335
10336 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10337 attributes section only if there no attributes section after merging.
10338 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10339 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10340 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10341 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10342 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10343 and arm_attr_merge_7.stdout.
10344 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10345 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10346 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10347 arm_attr_merge_7b.o): New rules.
10348 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10349 arm_attr_merge_7
10350 * testsuite/Makefile.in: Regenerate.
10351 * testsuite/arm_attr_merge.sh: New file.
10352 * testsuite/arm_attr_merge_[67][ab].s: Same.
10353
3e01a7fd
NC
103542010-05-05 Nick Clifton <nickc@redhat.com>
10355
10356 * po/es.po: Updated Spanish translation.
10357
7ad2014a
L
103582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10359
10360 * Makefile.am (install-exec-local): Properly install gold as
10361 default cross linker.
10362 * Makefile.in: Regenerated.
10363
4fda8867
NC
103642010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10365 Nick Clifton <nickc@redhat.com>
10366
10367 * configure.ac (install_as_default): Define and set to false
10368 unless --enable-gold or --enable-gold=both/gold has been
10369 specified.
10370 * configure: Regenerate.
10371
10372 * Makefile.am (install-exec-local): Install the executable as
10373 'ld.gold'. If install_as_default is true then also install it as
10374 'ld'.
10375 * Makefile.in: Regenerated.
10376
bd288ea2
ILT
103772010-04-24 Ian Lance Taylor <iant@google.com>
10378
10379 * layout.cc (Layout::layout_reloc): In relocatable link don't
10380 combine reloc sections for grouped sections.
10381
ef38fd8a
ST
103822010-04-23 Sriraman Tallam <tmsriram@google.com>
10383
10384 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10385 sections that are not ordinary to icf.
10386 * icf.cc (get_section_contents): Handle relocation pointing to section
10387 with no object or shndx information.
10388 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10389 * testsuite/Makefile.in: Regenerate.
10390 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10391 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10392
f6973bdc
ILT
103932010-04-22 Ian Lance Taylor <iant@google.com>
10394
10395 * expression.cc (Expression::Expression_eval_info): Add
10396 result_alignment_pointer field.
10397 (Expression::eval_with_dot): Add result_alignment_pointer
10398 parameter. Change all callers.
10399 (Expression::eval_maybe_dot): Likewise.
10400 (class Binary_expression): Add alignment_pointer parameter to
10401 left_value and right_value. Change all callers.
10402 (BINARY_EXPRESSION): Set result alignment.
10403 (class Trinary_expression): Add alignment_pointer parameter to
10404 arg2_value and arg3_value. Change all callers.
10405 (Trinary_cond::value): Set result alignment.
10406 (Max_expression::value, Min_expression::value): Likewise.
10407 (Align_expression::value): Likewise.
10408 * script-sections.cc (class Sections_element): Add dot_alignment
10409 parameter to set_section_addresses virtual function. Update
10410 instantiations.
10411 (class Output_section_element): Likewise.
10412 (Script_sections::create_segments): Add dot_alignment parameter.
10413 Change all callers.
10414 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10415 (Script_sections::set_phdrs_clause_addresses): Likewise.
10416 * script-sections.h: Update declarations.
10417 * script.h: Update declarations.
10418 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10419 min_p_align.
10420 * testsuite/script_test_3.t: Set large alignment.
10421 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10422 segment has expected alignment.
10423
9c9c98a5
NC
104242010-04-22 Nick Clifton <nickc@redhat.com>
10425
10426 * po/gold.pot: Updated by the Translation project.
10427 * po/vi.po: Updated Vietnamese translation.
10428
2253bfba
L
104292010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10430
10431 * testsuite/Makefile.am (check_PROGRAMS): Add
10432 icf_virtual_function_folding_test.
10433 * testsuite/Makefile.in: Regenerated.
10434
85fdf906
AH
104352010-04-15 Andrew Haley <aph@redhat.com>
10436
10437 * options.h (merge_exidx_entries): New option.
10438 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10439 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10440 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10441 (Target_arm::merge_exidx_entries): New function.
10442 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10443 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10444 to Arm_exidx_fixup constructor.
10445 Add new arg, merge_exidx_entries.
10446 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10447 Arm_output_section::fix_exidx_coverage.
10448
ce97fa81
ST
104492010-04-18 Sriraman Tallam <tmsriram@google.com>
10450
10451 * icf.cc (get_section_contents): Check for preemptible functions.
10452 Ignore addend when appropriate.
10453 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10454 section folded.
10455 (add_from_relobj): Check for section folded.
10456 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10457 * symtab.h (should_add_dynsym_entry): Add new parameter.
10458 * target-reloc.h (scan_relocs): Check for section folded.
10459 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10460 Check reloc types for function pointers in shared objects.
10461 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10462 case.
10463 (icf_preemptible_functions_test): New test case.
10464 (icf_string_merge_test): New test case.
10465 * testsuite.Makefile.in: Regenerate.
10466 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10467 bar_glob. Refactor code.
10468 * testsuite/icf_preemptible_functions_test.cc: New file.
10469 * testsuite/icf_preemptible_functions_test.sh: New file.
10470 * testsuite/icf_string_merge_test.cc: New file.
10471 * testsuite/icf_string_merge_test.sh: New file.
10472 * testsuite/icf_virtual_function_folding_test.cc: New file.
10473 * testsuite/icf_virtual_function_folding_test.sh: New file.
10474
04ceb17c
DK
104752010-04-14 Doug Kwan <dougkwan@google.com>
10476
10477 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10478 for local symbol recounting if we remove a section due to ICF.
10479 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10480 there are no regular objects in input.
10481
153e7da4
DK
104822010-04-13 Doug Kwan <dougkwan@google.com>
10483
10484 * arm.cc (Arm_input_section::set_final_data_size): Compute
10485 accurate final data size instead of using current data size.
10486
4dbd9faf
DK
104872010-04-09 Doug Kwan <dougkwan@google.com>
10488
10489 * layout.cc (Layout::choose_output_section): Handle script section
10490 types.
10491 (Layout::make_output_section_for_script): Add section type parameter.
10492 Handle script section types.
10493 * layout.h (Layout::make_output_section_for_script): Add section
10494 type parameter.
10495 * output.cc (Output_section::Output_section): Initialize data member
10496 is_noload_.
10497 (Output_section::do_reset_address_and_file_offset): Do not set address
10498 to 0 if section is a NOLOAD section.
10499 * output.h (Output_section::is_noload): New method.
10500 (Output_section::set_is_noload): Ditto.
10501 (Output_section::is_noload_): New data member.
10502 * script-c.h (Script_section_type): New enum type.
10503 (struct Parser_output_section_header): Add new file section_type.
10504 * script-sections.cc (Sections_element::output_section_name): Add
10505 parameter for returning script section type.
10506 (Output_section_definition::output_section_name): Ditto.
10507 (Output_section_definition::section_type)P; New method.
10508 (Output_section_definiton::script_section_type_name): Ditto.
10509 (Output_section_definition::script_section_type_): New data member.
10510 (Output_section_definition::Output_section_definition): Initialize
10511 data member Output_section_definition::script_section_type_.
10512 (Output_section_definition::create_sections): Pass script section type
10513 to Layout::make_output_section_for_script.
10514 (Output_section_definition::output_section_name): Return script
10515 section type to caller.
10516 (Output_section_definition::set_section_address): Do not advance
10517 dot value and load address if section type is NOLOAD. Set address
10518 of NOLOAD sections regardless of section flags.
10519 (Output_section_definition::print): Print section type if it is
10520 not SCRIPT_SECTION_TYPE_NONE.
10521 (Output_section_definition::section_type): New method.
10522 (Output_section_definition::script_section_type_name): Ditto.
10523 (Script_sections::output_section_name): Add new parameter
10524 PSECTION_TYPE for returning script section type. Pass it to
10525 section elements. Handle discard sections.
10526 (Sort_output_sections::operator()): Handle NOLOAD sections.
10527 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10528 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10529 returning script section type.
10530 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10531 INFO and NOLOAD.
10532 * yyscript.y (union): Add new field SECTION_TYPE.
10533 (COPY, DSECT, INFO, NOLOAD): New tokens.
10534 (opt_address_and_section_type): Change type to output_section_header.
10535 (section_type): New non-terminal
10536 (section_header): Handle section type.
2253bfba 10537 (opt_address_and_section_type): Return section type value.
4dbd9faf 10538
721ea635
L
105392010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10540
10541 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10542 * testsuite/plugin_common_test_2.c (foo): Likewise.
10543
6bf924b0
DK
105442010-04-08 Doug Kwan <dougkwan@google.com>
10545
10546 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10547 Output_merge_data.
10548 * output.cc (Output_section::add_merge_input_section): Simplify
10549 code and return status of Output_merge_base::add_input_section.
e1df38aa 10550 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10551 returns true.
10552
24af6f92
DK
105532010-04-07 Doug Kwan <dougkwan@google.com>
10554
10555 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10556 if section is marked as containing instructions but has no mapping
10557 symbols.
10558 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10559 correct section index.
10560 (Arm_relobj::find_linked_text_section): Ditto.
10561
00698fc5
CC
105622010-04-07 Cary Coutant <ccoutant@google.com>
10563
10564 * archive.cc (include_member): Destroy Read_symbols_data object before
10565 releasing file.
10566 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10567 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10568 (Read_symbols_data::~Read_symbols_data) New destructor.
10569 (Section_relocs::Section_relocs) New constructor.
10570 (Section_relocs::~Section_relocs) New destructor.
10571 (Read_relocs_data::Read_relocs_data) New constructor.
10572 (Read_relocs_data::~Read_relocs_data) New destructor.
10573 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10574 pointers to NULL after deleting.
10575
7296d933
DK
105762010-04-07 Doug Kwan <dougkwan@google.com>
10577
10578 * arm.cc: Replace "endianity" with "endianness" in comments.
10579 (Arm_exidx_cantunwind): Ditto.
10580 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10581 (Arm_relobj::merge_flags_and_attributes): New method.
10582 (Arm_relobj::merge_flags_and_attributes_): New data member.
10583 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10584 (Arm_relobj::scan_sections_for_stubs): Ditto.
10585 (Arm_relobj::do_read_symbols): Check to see if we really want to
10586 merge processor-specific flags and attributes. Exit early if
10587 an object is empty except for section names and the undefined symbol.
10588 (Target_arm::do_finalize_sections): Move check for ELF format to
10589 Arm_relobj::do_read_symbols. Merge processor specific flags and
10590 attributes from a regular object only when we have determined that
10591 it is aapropriate. Do not create an .ARM.attributes section in
10592 output if there is no regular input object.
10593 (Target_arm::merge_processor_specific_flags): Check
10594 --warn-mismatch before printing any error.
10595 (Target_arm::merge_object_attributes): Ditto.
10596 * gold.cc (queue_middle_tasks): Handle the case in which there is
10597 no regular object in input.
10598 * options.cc (General_options::parse_EB): New method.
10599 (General_options::parse_EL): Same.
10600 (General_options::General_options): Initialize endianness_.
10601 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10602 New options.
10603 (General_options::Endianness): New enum.
10604 (General_options::endianness): New method.
10605 (General_options::endianness_): New data member.
10606 * parameters.cc (Parameters::set_options): Check target endianness.
10607 (Parameters::set_target_once): Ditto.
10608 (Parameters::check_target_endianness): New method.
10609 (parameters_force_valid_target): If either -EL or -EB is specified,
10610 use it to define endianness of default target.
10611 * parameters.h (Parameters::check_target_endianness): New method
10612 declaration.
10613 * target.h (class Target): Change "endianity" to "endianness"
10614 in comments.
10615
efc8d4f2
RW
106162010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10617
10618 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10619 * configure: Regenerate.
10620 * Makefile.in: Regenerate.
10621 * testsuite/Makefile.in: Regenerate.
10622
be234d88
CC
106232010-04-06 Cary Coutant <ccoutant@google.com>
10624
10625 gcc PR lto/42757
10626 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10627 prevailing definitions of common symbols.
10628 * testsuite/plugin_test_6.sh: New test case.
10629 * testsuite/plugin_common_test_1.c: New test case.
10630 * testsuite/plugin_common_test_2.c: New test case.
10631 * testsuite/Makefile.am (plugin_test_6): New test case.
10632 * testsuite/Makefile.in: Regenerate.
10633
bd32c6bd
NC
106342010-04-06 Nick Clifton <nickc@redhat.com>
10635
10636 * po/vi.po: New Vietnamese translation.
10637
323c532f
DK
106382010-03-30 Doug Kwan <dougkwan@google.com>
10639
10640 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10641
4fcd97eb
DK
106422010-03-25 Doug Kwan <dougkwan@google.com>
10643
10644 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10645 to avoid a conversion warning on a 32-bit host.
10646
4ebf39db
ILT
106472010-03-24 Ian Lance Taylor <iant@google.com>
10648
10649 * testsuite/script_test_3.t: Add a TLS segment.
10650 * testsuite/Makefile.am (check_PROGRAMS): Add
10651 tls_phdrs_script_test.
10652 (tls_phdrs_script_test_SOURCES): Define.
10653 (tls_phdrs_script_test_DEPENDENCIES): Define.
10654 (tls_phdrs_script_test_LDFLAGS): Define.
10655 (tls_phdrs_script_test_LDADD): Define.
10656 * testsuite/Makefile.in: Rebuild.
10657
4a599bdd
CC
106582010-03-23 Cary Coutant <ccoutant@google.com>
10659
10660 * fileread.cc (find_or_make_view): Fix comment.
10661
6c93b22c
ILT
106622010-03-23 Ian Lance Taylor <iant@google.com>
10663
10664 * script-sections.cc (class Orphan_section_placement): Define
10665 PLACE_TLS and PLACE_TLS_BSS.
10666 (Orphan_section_placement::Orphan_section_placement): Initialize
10667 new places.
10668 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10669 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10670 (tls_script_test_SOURCES): Define.
10671 (tls_script_test_DEPENDENCIES): Define.
10672 (tls_script_test_LDFLAGS): Define.
10673 (tls_script_test_LDADD): Define.
10674 * testsuite/Makefile.in: Rebuild.
10675
a2c7281b
DK
106762010-03-22 Doug Kwan <dougkwan@google.com>
10677
10678 * arm.cc (Arm_relocate_functions::abs8,
10679 Arm_relocate_functions::abs16): Use correct check for overflow
10680 specified in the ARM ELF specs.
10681 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10682 target of a BLX instruction specially.
10683 (Reloc_stub::stub_type_for_reloc): Ditto.
10684 (Relocate::relocate): Use symbolic names instead of numeric relocation
10685 codes to report error.
10686 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10687 workaround.
10688 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10689 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10690 thumb2_blx_out_of_range.stdout
10691 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10692 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10693 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10694 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10695 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10696 thumb2_blx_in_range, thumb2_blx_in_range.o,
10697 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10698 thumb2_blx_out_of_range.o): New rules.
2e702c99 10699 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10700 thumb2_blx_in_range and thumb2_blx_out_of_range.
10701 * testsuite/Makefile.in: Regenerate.
10702 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10703 * testsuite/thumb_blx_in_range.s: New file.
10704 * testsuite/thumb_blx_out_of_range.s: New file.
10705
b0193076
RÁE
107062010-03-22 Rafael Espindola <espindola@google.com>
10707
10708 * archive.cc (Should_include): Move to archive.h.
10709 (should_include_member): Make it a member of Archive.
10710 (Lib_group): New.
10711 (Add_lib_group_symbols): New.
10712 * archive.h: Include options.h.
10713 (Archive_member): Moved from Archive.
10714 (Should_include): Moved from archive.cc.
10715 (Lib_group): New.
10716 (Add_lib_group_symbols): New.
10717 * dynobj.cc (do_should_include_member): New.
10718 * dynobj.h (do_should_include_member): New.
10719 * gold.cc (queue_initial_tasks): Update call to queue.
10720 * main.cc (main): Print lib group stats.
10721 * object.cc (do_should_include_member): New.
10722 * object.h: Include archive.h.
10723 (Object::should_include_member): New.
10724 (Object::do_should_include_member): New.
10725 (Sized_relobj::do_should_include_member): New.
10726 * options.cc (General_options::parse_start_lib): New.
10727 (General_options::parse_end_lib): New.
10728 (Input_arguments::add_file): Handle lib groups.
10729 (Input_arguments::start_group): Check we are not in a lib.
10730 (Input_arguments::start_lib): New.
10731 (Input_arguments::end_lib): New.
10732 * options.h (General_options): Add start_lib and end_lib.
10733 (Input_argument::lib_): New.
10734 (Input_argument::lib): New.
10735 (Input_argument::is_lib): New.
10736 (Input_file_lib): New.
10737 (Input_arguments::in_lib_): New.
10738 (Input_arguments::in_lib): New.
10739 (Input_arguments::start_lib): New.
10740 (Input_arguments::end_lib_): New.
10741 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10742 in unused members as preempted.
10743 (Sized_pluginobj::do_should_include_member): New.
10744 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10745 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10746 return the blocker.
10747 (Read_symbols::do_whole_lib_group): New.
10748 (Read_symbols::do_lib_group): New.
10749 (Read_symbols::do_read_symbols): Handle lib groups.
10750 (Read_symbols::get_name): Handle lib groups.
10751 * readsyms.h (Read_symbols): Add an archive member pointer.
10752 (Read_symbols::do_whole_lib_group): New.
10753 (Read_symbols::do_lib_group): New.
10754 (Read_symbols::member_): New.
10755 * script.cc (read_input_script): Update call to queue_soon.
10756
d099120c
DK
107572010-03-19 Doug Kwan <dougkwan@google.com>
10758
10759 * arm.cc (Stub_table::Stub_table): Initialize new data members
10760 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10761 (Stub_table::add_reloc_stub): Assign stub offset and update
10762 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10763 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10764 New data members.
2e702c99 10765 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10766 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10767 instead of going over all reloc stubs.
2e702c99 10768 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10769 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10770 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10771 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10772 Stringpool_template::offset_.
10773 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10774 Stringpool_template::offset_ to zero.
10775
1aa37384
DK
107762010-03-15 Doug Kwan <dougkwan@google.com>
10777
10778 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10779 offset_.
10780 (Stringpool_template::new_key_offset): New method.
10781 (Stringpool_template::add_string): Assign offsets when adding new
10782 strings.
10783 (Stringpool_template::set_string_offsets): Do not set string offsets
10784 when not optimizing.
10785 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10786 member size_.
2e702c99
RM
10787 (Chunked_vector::clear): Clear size_.
10788 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10789 (Chunked_vector::size): Return size_.
10790 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10791 (Chunked_vector::size_): New data member.
1aa37384
DK
10792 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10793 (Stringpool_template::new_key_offset): New method declaration.
10794 (Stringpool_template::offset_): New data member.
10795
b672b057
RÁE
107962010-03-15 Rafael Espindola <espindola@google.com>
10797
10798 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10799 Add_symbols' constructor.
10800 * readsyms.h (Add_symbols): Remove the input_group member.
10801
b6848d3c
ILT
108022010-03-10 Ian Lance Taylor <iant@google.com>
10803
10804 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10805 target to ask whether a reference to a symbol requires a stack
10806 split.
10807 * target.h (Target::is_call_to_non_split): New function.
10808 (Target::do_is_call_to_non_split): Declare virtual function.
10809 * target.cc: Include "symtab.h".
10810 (Target::do_is_call_to_non_split): New function.
10811 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10812
a2a5469e
CC
108132010-03-10 Cary Coutant <ccoutant@google.com>
10814
10815 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10816 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10817 (File_read::open[2]): Add whole_file_view_ to list of views.
10818 (File_read::make_view): Remove test of whole_file_view_.
10819 (File_read::find_or_make_view): Create whole_file_view_ if
10820 necessary.
10821 (File_read::clear_views): Replace bool parameter with enum;
10822 adjust all callers. Don't delete views with permanent data;
10823 do delete cached views and views from archives if
10824 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10825 if clearing the corresponding view.
10826 * fileread.h (File_read::Clear_views_mode): New enum.
10827 (File_read::View::is_permanent_view): New method.
10828 (File_read::clear_views): Replace bool parameter
10829 with enum; adjust all callers.
10830 * options.h (General_options): Change keep_files_mapped option;
10831 add map_whole_files.
10832 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10833 releasing the file.
10834 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10835 the file.
10836
8861f32b
DM
108372010-03-10 David S. Miller <davem@davemloft.net>
10838
10839 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10840
d62d0f5f
ST
108412010-03-09 Sriraman Tallam <tmsriram@google.com>
10842
10843 * icf.cc (get_section_contents): Add '@' marker after processing the
10844 merge reloc.
10845
9177756d
DK
108462010-03-08 Doug Kwan <dougkwan@google.com>
10847
10848 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10849 due to a conversion warning.
10850 (Arm_relobj::update_output_local_symbol_count): Check for local
10851 symbol with unset output index.
10852
9e9e071b
ILT
108532010-03-05 Ian Lance Taylor <iant@google.com>
10854
10855 * options.h (class General_options): Add --spare-dynamic-tags.
10856 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10857 --spare-dynamic-tags.
10858
a81ee015
ILT
108592010-03-05 Ian Lance Taylor <iant@google.com>
10860
10861 * incremental.cc: Include "libiberty.h".
10862
44ec90b9
RO
108632010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10864
10865 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10866 function, is_info_ member.
10867 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10868 (Versions::Versions): Update caller.
10869 (Versions::define_base_version): Likewise.
10870 (Versions::add_def): Likewise.
10871
0897ed3b
ST
108722010-03-03 Sriraman Tallam <tmsriram@google.com>
10873
10874 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10875 (Scan::possible_function_pointer_reloc): New function.
10876 (Scan::local_reloc_may_be_function_pointer): Change to call
10877 possible_function_pointer_reloc.
10878 (Scan::global_reloc_may_be_function_pointer): Ditto.
10879 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10880 relocations in ".data.rel.ro._ZTV" section.
10881 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10882 * testsuite/icf_safe_so_test.cc: Ditto.
10883 * testsuite/icf_safe_test.cc: Ditto.
10884 * testsuite/icf_safe_test.sh: Ditto.
10885
d3bbad62
ILT
108862010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10887 Ian Lance Taylor <iant@google.com>
10888
10889 * target-reloc.h (relocate_section): Check the symbol table index
10890 for -1U before setting the local symbol index.
10891 (scan_relocatable_relocs): If copying the relocation, record that
10892 the local symbol is required.
10893 * object.h (Symbol_value::is_output_symtab_index_set): New
10894 function.
10895 (Symbol_value::may_be_discarded_from_output_symtab): New
10896 function.
10897 (Symbol_value::has_output_symtab_entry): New function.
10898 (Symbol_value::needs_output_symtab_entry): Remove.
10899 (Symbol_value::output_symtab_index): Make sure the symbol index is
10900 set.
10901 (Symbol_value::set_output_symtab_index): Make sure the symbol
10902 index is not set. Make sure the new index is valid.
10903 (Symbol_value::set_must_have_output_symtab_entry): New function.
10904 (Symbol_value::has_output_dynsym_entry): New function.
10905 (Symbol_value::set_output_dynsym_index): Make sure the new index
10906 is valid.
10907 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10908 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10909 local symbol if permitted.
10910 (Sized_relobj::do_finalize_local_symbols): Call
10911 is_output_symtab_index_set rather than needs_output_symtab_entry.
10912 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10913 rather than needs_output_symtab_entry. Call
10914 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10915 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10916 is_output_symtab_index_set rather than needs_output_symtab_entry.
10917 * testsuite/discard_locals_relocatable_test.c: New file.
10918 * testsuite/discard_locals_test.sh: Test -r.
10919 * testsuite/Makefile.am (check_DATA): Add
10920 discard_locals_relocatable_test1.syms,
10921 discard_local_relocatable_test2.syms.
10922 (MOSTLYCLEANFILES): Likewise. Also add
10923 discard_locals_relocatable_test1.lout and
10924 discard_locals_relocatable_test2.out.
10925 (discard_locals_relocatable_test1.syms): New target.
10926 (discard_locals_relocatable_test.o): New target.
10927 (discard_locals_relocatable_test1.out): New target.
10928 (discard_locals_relocatable_test2.syms): New target.
10929 (discard_locals_relocatable_test2.out): New target.
10930 (various): Add missing ../ld-new dependencies.
10931 * testsuite/Makefile.in: Rebuild.
10932
7e8ccf26
NC
109332010-03-03 Nick Clifton <nickc@redhat.com>
10934
10935 * po/fi.po: New Finnish translation.
10936
2a0ff005
DK
109372010-03-01 Doug Kwan <dougkwan@google.com>
10938
10939 * layout.cc (Layout::Layout): Force section types of .init_array*,
10940 .preinit_array* and .fini_array* sections.
10941 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10942 Fix check of return value of std::string::find.().
10943 (Output_section::Input_section_sort_compare::operator()): Remove
10944 comment about .init_array.
10945 (Output_section::Input_section_sort_init_fini_compare::operator()):
10946 New method.
10947 (Output_section::sort_attached_input_sections): Handle .init_array
10948 and .fini_array specially.
10949 * output.h (Output_section::Inut_section_sort_compare): Update
10950 comment.
10951 (Output_section::Input_section_sort_init_fini_compare): New struct.
10952
c3e4ae29
DK
109532010-02-26 Doug Kwan <dougkwan@google.com>
10954
10955 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10956 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10957 * testsuite/debug_msg.sh: Avoid matching source line number for
10958 use of global variable undef_int.
10959
2fd9ae7a
DK
109602010-02-26 Doug Kwan <dougkwan@google.com>
10961
10962 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10963 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10964 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10965 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10966 * options.cc (General_options::General_options): Initialize member
10967 fix_v4bx_.
10968 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10969 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10970 and rm_no_fix_v4bx.stdout
10971 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10972 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10973 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10974 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10975 and arm_no_fix_v4bx.
10976 * Makefile.in: Regenerate.
10977 * testsuite/arm_fix_v4bx.s: New file.
10978 * testsuite/arm_fix_v4bx.sh: Ditto.
10979
67ec7d0b
DK
109802010-02-24 Doug Kwan <dougkwan@google.com>
10981
10982 * arm.cc (Target_arm::got_section): Make the .got section the first
10983 non RELRO section in the data segment.
10984 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10985 suffixes of section names.
10986
10165461
DK
109872010-02-24 Doug Kwan <dougkwan@google.com>
10988
10989 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10990 flags and attributes merging if an input file is a binary file.
10991 * fileread.cc (Input_file::open): Record format of original file.
10992 * fileread.h (Input_file::Format): New enum type.
2e702c99 10993 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10994 (Input_file::format): New method definition.
10995 (Input_file::format_):: New data member.
10996
4a54abbb
DK
109972010-02-24 Doug Kwan <dougkwan@google.com>
10998
10999 * arm.cc (Arm_output_data_got): New class.
11000 (ARM_TCB_SIZE): New constant
11001 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11002 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11003 If user uses a script with a SECTIONS clause, issue only a warning
11004 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 11005 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
11006 garbage collection.
11007 (Target_arm::got_mode_index_entry): Handle static linking.
11008 (Target_arm::Scan::local): Ditto.
11009 (Target_arm::Scan::global): Ditto.
11010 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11011 all incorrectly implemented relocations.
e1df38aa 11012 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
11013 Arm_output_section::fix_exidx_coverage.
11014 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11015 from ".ARM.exidx." and ".ARM.extab.".
11016
ca419a6f
ILT
110172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11018
11019 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11020 section if it does not already exist.
11021 * attributes.cc (Attributes_section_data::Attributes_section_data):
11022 Don't crash if size is zero.
11023
135b9c78
ILT
110242010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11025 Ian Lance Taylor <iant@google.com>
11026
11027 * gold.cc (queue_middle_tasks): If no input files were opened,
11028 exit.
11029 * workqueue.h (Task_function::Task_function): Assert that there is
11030 a blocker.
11031
bb0bfe4f
DK
110322010-02-22 Doug Kwan <dougkwan@google.com>
11033
11034 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11035 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11036 types to avoid warnings due to different uint64_t implementations
11037 on different hosts.
11038
2a2b6d42
DK
110392010-02-21 Doug Kwan <dougkwan@google.com>
11040
11041 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11042 handling of the maximum backward branch offset.
2e702c99 11043 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11044 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11045 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11046 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11047 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11048 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11049 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11050 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11051 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11052 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11053 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11054 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11055 thumb2_bl_out_of_range.o): New rules.
11056 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11057 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11058 thumb2_bl_out_of_range
11059 * testsuite/Makefile.in: Regenerate.
11060 * testsuite/arm_bl_in_range.s: New file.
11061 * testsuite/arm_bl_out_of_range.s: Ditto.
11062 * testsuite/arm_branch_in_range.sh: Ditto.
11063 * testsuite/arm_branch_range.t: Ditto.
11064 * testsuite/thumb2_branch_range.t: Ditto.
11065 * testsuite/thumb_bl_in_range.s: Ditto.
11066 * testsuite/thumb_bl_out_of_range.s: Ditto.
11067 * testsuite/thumb_branch_range.t: Ditto.
11068
b487ad64
ST
110692010-02-20 Sriraman Tallam <tmsriram@google.com>
11070
11071 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11072 Add reloc offset information.
11073 * icf.cc (get_section_contents): Change iterators to point to the new
11074 vectors. Add reloc offset information to the contents.
11075 * icf.h (Icf::Sections_reachable_info): New typedef.
11076 (Icf::Sections_reachable_list): New typedef.
11077 (Icf::Offset_info): New typedef.
11078 (Icf::Reloc_info): New struct typedef.
11079 (Icf::Reloc_info_list): New typedef.
11080 (Icf::symbol_reloc_list): Delete method.
11081 (Icf::addend_reloc_list): Delete method.
11082 (Icf::section_reloc_list): Delete method.
11083 (Icf::reloc_info_list): New method.
11084 (Icf::reloc_info_list_): New member.
11085
f96accdf
DK
110862010-02-19 Doug Kwan <dougkwan@google.com>
11087
11088 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11089 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11090 * arm.cc (Arm_relocation_functions): New forward declaration.
11091 (Target_arm::Target_arm): Initialize new data members
11092 got_mod_index_offset_ and tls_base_symbol_defined_.
11093 (Target_arm::Relocate::relocate_tls): New method.
11094 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11095 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11096 New methods.
2e702c99 11097 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11098 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11099 (Target_arm::got_mod_index_offset_,
11100 Target_arm::tls_base_symbol_defined_): New data members.
11101 (Target_arm::Scan::local, Target::Scan::global,
11102 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11103 relocations.
11104
c8761b9a
DK
111052010-02-18 Doug Kwan <dougkwan@google.com>
11106
11107 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11108 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11109 text section as a parameter becuase some broken tools may not set
11110 the link in section header.
11111 (Target_arm::has_got_section): New method.
11112 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11113 without any mapping symbol as data only. Remove warning.
11114 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11115 link in its section header, try to discover the link by inspecting the
11116 REL31 relocation at the beginning of the section.
11117 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11118 in error message.
11119 (Target_arm::Scan::global): Treat any reference to the symbol
11120 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11121
21bb3914
ST
111222010-02-12 Sriraman Tallam <tmsriram@google.com>
11123
11124 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11125 (Scan::global_reloc_may_be_function_pointer): New function.
11126 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11127 (Scan::global_reloc_may_be_function_pointer): New function.
11128 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11129 (Scan::global_reloc_may_be_function_pointer): New function.
11130 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11131 (Scan::global_reloc_may_be_function_pointer): New function.
11132 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11133 (Scan::global_reloc_may_be_function_pointer): New function.
11134 (Scan::possible_function_pointer_reloc): New function.
11135 (Target_x86_64::can_check_for_function_pointers): New function.
11136 * gc.h (gc_process_relocs): Scan relocation types to determine if
11137 function pointers were taken for targets that support it.
11138 * icf.cc (Icf::find_identical_sections): Include functions for
11139 folding in safe ICF whose pointer is not taken.
11140 * icf.h (Secn_fptr_taken_set): New typedef.
11141 (fptr_section_id_): New member.
11142 (section_has_function_pointers): New function.
11143 (set_section_has_function_pointers): New function.
11144 (check_section_for_function_pointers): New function.
11145 * options.h: Fix comment for safe ICF option.
11146 * target.h (can_check_for_function_pointers): New function.
11147 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11148 Modify icf_safe_test for X86-64.
11149 * testsuite/Makefile.in: Regenerate.
11150 * testsuite/icf_safe_so_test.cc: New file.
11151 * testsuite/icf_safe_so_test.sh: New file.
11152 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11153 (main): Change to take pointer to function kept_func_3.
11154 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11155 folding is done correctly for X86-64.
11156
0da6fa6c
DM
111572010-02-12 David S. Miller <davem@davemloft.net>
11158
11159 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11160 is_symbolless parameter.
11161 (Output_reloc<SHT_REL>::is_symbolless): New.
11162 (Output_reloc<SHT_REL>::is_symbolless_): New.
11163 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11164 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11165 (Output_reloc<SHT_RELA>::is_symbolless): New.
11166 (Output_data_reloc::add_global): Handle is_symbolless.
11167 (Output_data_reloc::add_global_relative): Likewise.
11168 (Output_data_reloc::add_local): Likewise.
11169 (Output_data_reloc::add_local_relative): Likewise.
11170 (Output_data_reloc::add_symbolless_global_addend): New.
11171 (Output_data_reloc::add_symbolless_local_addend): New.
11172 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11173 is_symbolless.
11174 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11175 instead of ->is_relative_
11176 (Output_reloc::write): Likewise.
11177 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11178 (Output_reloc::write_rel): Simplify.
11179
11180 * sparc.cc (Target_sparc::Scan::local): Use
11181 ->add_symbolless_local_addend as needed.
11182 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11183 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11184 based upon relocation offset.
11185
e4782e83
DK
111862010-02-11 Doug Kwan <dougkwan@google.com>
11187
11188 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11189 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11190 beginning of function.
11191 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11192 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11193 parameter is_32bit in calls to should_apply_static_reloc.
11194 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11195 (check_DATA): Add arm_abs_global.stdout.
11196 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11197 arm_abs_global.stdout): New rules.
11198 (MOSTLLYCLEANFILES): Add arm_abs_global
11199 * Makefile.in: Regenerate.
11200 * testsuite/arm_abs_global.s: New file.
11201 * testsuite/arm_abs_global.sh: Ditto.
11202 * testsuite/arm_abs_lib.s: Ditto.
11203
93ceb764
ILT
112042010-02-11 Ian Lance Taylor <iant@google.com>
11205
11206 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11207 Read_relocs task.
11208 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11209 Allocate_commons_task first.
11210 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11211 task, rather than symtab_lock_.
11212 (Gc_process_relocs::~Gc_process_relocs): New function.
11213 (Gc_process_relocs::is_runnable): Check this_blocker_.
11214 (Gc_process_relocs::locks): Use next_blocker_ rather than
11215 blocker_.
11216 (Scan_relocs::~Scan_relocs): New function.
11217 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11218 symtab_lock_.
11219 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11220 next_blocker_.
11221 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11222 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11223 constructor accordingly.
11224 (class Gc_process_relocs): Likewise.
11225 (class Scan_relocs): Likewise.
11226 * common.h (class Allocate_commons_task): Remove symtab_lock_
11227 field, and corresponding constructor parameter.
11228 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11229 symtab_lock_.
11230 (Allocate_commons_task::locks): Likewise.
11231
114dfbe1
ILT
112322010-02-11 Ian Lance Taylor <iant@google.com>
11233
11234 * gold-threads.h (class Once): Define.
11235 (class Initialize_lock): Rewrite as child of Once.
11236 * gold-threads.cc (class Once_initialize): Define.
11237 (once_pointer_control): New static variable.
11238 (once_pointer, once_arg): New static variables.
11239 (c_run_once): New static function.
11240 (Once::Once, Once::run_once, Once::internal_run): New functions.
11241 (class Initialize_lock_once): Remove.
11242 (initialize_lock_control): Remove.
11243 (initialize_lock_pointer): Remove.
11244 (initialize_lock_once): Remove.
11245 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11246 (Initialize_lock::initialize): Rewrite.
11247 (Initialize_lock::do_run_once): New function.
11248 * archive.cc (Archive::interpret_header): Only clear name if it is
11249 not already empty.
11250 * fileread.cc: Include "gold-threads.h"
11251 (file_counts_lock): New static variable.
11252 (file_counts_initialize_lock): Likewise.
11253 (File_read::release): Only increment counts when using --stats.
11254 Use a lock around the increment.
11255 * parameters.cc (class Set_parameters_target_once): Define.
11256 (set_parameters_target_once): New static variable.
11257 (Parameters::Parameters): Move here from parameters.h.
11258 (Parameters::set_target): Rewrite.
11259 (Parameters::set_target_once): New function.
11260 (Parameters::clear_target): Move here and rewrite.
11261 * parameters.h (class Parameters): Update declarations. Add
11262 set_parameters_target_once_ field.
11263 (Parameters::Parameters): Move to parameters.cc.
11264 (Parameters::clear_target): Likewise.
11265 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11266 task.
11267 (Start_group::~Start_group): New function.
11268 (Start_group::is_runnable): New function.
11269 (Start_group::locks, Start_group::run): New functions.
11270 (Finish_group::run): Change saw_undefined to size_t.
11271 * readsyms.h (class Start_group): Define.
11272 (class Finish_group): Change saw_undefined_ field to size_t.
11273 (Finish_group::Finish_group): Remove saw_undefined and
11274 this_blocker parameters. Change all callers.
11275 (Finish_group::set_saw_undefined): New function.
11276 (Finish_group::set_blocker): New function.
11277 * symtab.h (class Symbol_table): Change saw_undefined to return
11278 size_t. Change saw_undefined_ field to size_t.
11279 * target-select.cc (Set_target_once::do_run_once): New function.
11280 (Target_selector::Target_selector): Initialize set_target_once_
11281 field. Don't initialize lock_ and initialize_lock_ fields.
11282 (Target_selector::instantiate_target): Rewrite.
11283 (Target_selector::set_target): New function.
11284 * target-select.h (class Set_target_once): Define.
11285 (class Target_selector): Update declarations. Make
11286 Set_target_once a friend. Remove lock_ and initialize_lock_
11287 fields. Add set_target_once_ field.
11288
fa17a3f4
ILT
112892010-02-10 Ian Lance Taylor <iant@google.com>
11290
11291 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11292 queueing any tasks.
11293 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11294 (queue_middle_tasks): Add all blockers before queueing any tasks.
11295 (queue_final_tasks): Likewise.
11296 * token.h (Task_token::add_blockers): New function.
11297 * object.h (Input_objects::number_of_relobjs): New function.
11298
c7177d31
ILT
112992010-02-10 Ian Lance Taylor <iant@google.com>
11300
5de0e392
ILT
11301 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11302 shared, not if not position independent.
11303 * x86_64.cc (Relocate::relocate_tls): Likewise.
11304 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11305 (tls_pie_pic_test): New target.
11306 * testsuite/Makefile.in: Rebuild.
11307
c7177d31
ILT
11308 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11309 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11310 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11311 * testsuite/Makefile.in: Rebuild.
11312
684b268a
DM
113132010-02-09 David S. Miller <davem@davemloft.net>
11314
11315 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11316 R_SPARC_RELATIVE using ->add_local_relative().
11317 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11318
612a8d3d
DM
11319 * output.h (Output_data_dynamic::add_section_size): New method
11320 that takes two Output_data objects.
11321 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11322 entry param. Handle it in initializers.
11323 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11324 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11325 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11326 arg.
11327 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11328 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11329 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11330 for dynrel_includes_plt.
11331 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11332 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11333 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11334 before .rela.plt
11335 (Target_sparc::do_finalize_sections): Update to pass true for
11336 dynrel_includes_plt.
11337 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11338 output before .rela.plt
11339 (Target_powerpc::do_finalize_sections): Update to pass true for
11340 dynrel_includes_plt when 32-bit.
11341
cb1be87e
DK
113422010-02-08 Doug Kwan <dougkwan@google.com>
11343
11344 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11345 method.
11346 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11347 Arm_relobj::scan_section_for_cortex_a8_stubs,
11348 Arm_relobj::do_relocation_section): Instead of calling
11349 Output_section::output_address, use faster
11350 Arm_relobj::simple_input_section_output_address.
11351
705b5121
DM
113522010-02-08 David S. Miller <davem@davemloft.net>
11353
11354 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11355 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11356 relocation helper function.
11357
024c4466
DM
11358 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11359 just like R_SPARC_GOT{10,13,22}.
11360 (Target_sparc::Scan::local): Likewise.
11361 (Target_sparc::Relocate:relocate): Likewise.
11362
9109c078
ILT
113632010-02-06 Ian Lance Taylor <iant@google.com>
11364
11365 * configure.ac: Rewrite targetobjs duplicate removal code to use
11366 only shell constructs.
11367 * configure: Rebuild.
11368
cf846138
DK
113692010-02-05 Doug Kwan <dougkwan@google.com>
11370
11371 PR 11247
11372 * arm.cc (Arm_relobj::section_is_scannable): New method.
11373 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11374 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11375
6cfaf60b
DK
113762010-02-04 Doug Kwan <dougkwan@google.com>
11377
11378 PR 11247
11379 * arm-reloc-property.cc (cstdio): Include.
11380 * configure.ac (targetobjs): Remove duplicates.
11381 * configure: Regenerate.
11382 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11383 big and little endian version for a given address size.
11384
5c57f1be
DK
113852010-02-03 Doug Kwan <dougkwan@google.com>
11386
11387 * arm-reloc-property.cc
11388 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11389 definition.
11390 * arm-reloc-property.h
11391 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11392 New method definition.
11393 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11394 declaration.
11395 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11396 overflow to N.
11397 (GOT_PREL): Change implemented to Y.
11398 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11399 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11400 (Arm_relocate_functions::movw_abs_nc): Remove method.
11401 (Arm_relocate_functions::movt_abs): Ditto.
11402 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11403 (Arm_relocate_functions::thm_movt_abs): Ditto.
11404 (Arm_relocate_functions::movw_rel_nc): Ditto.
11405 (Arm_relocate_functions::movw_rel): Ditto.
11406 (Arm_relocate_functions::movt_rel): Ditto.
11407 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11408 (Arm_relocate_functions:thm_movw_rel): Ditto.
11409 (Arm_relocate_functions:thm_movt_rel): Ditto.
11410 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11411 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11412 New method definitions.
11413 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11414 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11415 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11416 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11417 (Target_arm::Relocate::relocate): Check for non-static or
11418 unimplemented relocation code and exit early. Change calls to
11419 Target_arm::reloc_uses_thumb_bit and
11420 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11421 instead. Refactor code to handle similar relocations to increase
11422 code sharing. Remove check for unsupported relocation code in switch
11423 statement.
11424 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11425 relocation property table to find out size. Change error message to
11426 print out the name of a relocation code instead of the numeric value.
11427 (Target_arm::scan_reloc_for_stub): Use relocation property table
11428 instead of calling Target_arm::reloc_uses_thumb_bit().
11429
218c5831
DK
114302010-02-02 Doug Kwan <dougkwan@google.com>
11431
11432 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11433 types of relaxed input section.
11434
0d31c79d
DK
114352010-02-02 Doug Kwan <dougkwan@google.com>
11436
11437 * Makefile.am (HFILES): Add arm-reloc-property.h.
11438 (DEFFILES): New.
2e702c99
RM
11439 (TARGETSOURCES): Add arm-reloc-property.cc
11440 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11441 (libgold_a_SOURCES): $(DEFFILES)
11442 * Makefile.in: Regenerate.
11443 * arm-reloc-property.cc: New file.
11444 * arm-reloc-property.h: New file.
11445 * arm-reloc.def: New file.
11446 * arm.cc: Update comments.
11447 (arm-reloc-property.h): New included header.
11448 (arm_reloc_property_table): New global variable.
11449 (Target_arm::do_select_as_default_target): New method definition.
11450 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11451 arm-reloc-property to targ_extra_obj.
11452 * parameters.cc (set_parameters_target): Call
11453 Target::select_as_default_target().
11454 * target.h (Target::select_as_default_target): New method definition.
11455 (Target::do_select_as_default_target): Same.
11456
546c7457
DK
114572010-02-01 Doug Kwan <dougkwan@google.com>
11458
11459 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11460 first_output_text_section_.
11461 (Arm_exidx_fixup::first_output_text_section): New method definition.
11462 (Arm_exidx_fixup::first_output_text_section_): New data member.
11463 (Arm_exidx_fixup::process_exidx_section): Record the first text
11464 output section seen.
11465 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11466 and entsize in output section header.
11467
11b861d5
DK
114682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11469
11470 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11471 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11472 (Arm_relocate_functions::thm_alu11): New Method.
11473 (Arm_relocate_functions::thm_pc8): New Method.
11474 (Arm_relocate_functions::thm_pc12): New Method.
11475 (Target_arm::Scan::local): Handle the relocations.
11476 (Target_arm::Scan::global): Likewise.
11477 (Target_arm::Relocate::relocate): Likewise.
11478 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11479
c9a2c125
DK
114802010-01-29 Doug Kwan <dougkwan@google.com>
11481
11482 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11483 of relocation types as ld.
11484
1521477a
DK
114852010-01-29 Doug Kwan <dougkwan@google.com>
11486
11487 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11488 to public.
11489 (Arm_relocate_functions::thumb_branch_common): Ditto.
11490 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11491 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11492 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11493 Arm_relocate_functions::jump24): Remove.
11494 (Target_arm::Relocate::relocate): Adjust code to call
11495 Arm_relocation_functions::arm_branch_common and
11496 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11497 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11498
e7eca48c
DK
114992010-01-29 Doug Kwan <dougkwan@google.com>
11500
11501 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11502 output_local_symbol_count_needs_update_.
11503 (Arm_relobj::output_local_symbol_count_needs_update,
11504 Arm_relobj::set_output_local_symbol_count_needs_update,
11505 Arm_relobj::update_output_local_symbol_count): New methods.
11506 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11507 member.
11508 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11509 of pointed function as in a R_ARM_PREL31 relocation.
11510 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11511 for output local symbol count updating.
11512 (Target_arm::do_relax): Update output local symbol counts in objects
11513 if necessary.
11514 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11515
02961d7e
ILT
115162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11517
11518 * arm.cc: Added support for the ARM relocations:
11519 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11520 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11521 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11522 movw_prel_nc).
11523 (Arm_relocate_functions::movw_rel): New method.
11524 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11525 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11526 thm_movw_prel_nc).
11527 (Arm_relocate_functions::thm_movw_rel): New method.
11528 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11529 thm_movt_prel).
11530 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11531 relocations.
11532 (Target_arm::Scan::global): Likewise.
11533 (Target_arm::Relocate::relocate): Likewise.
11534 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11535 Likewise.
11536
b10d2873
ILT
115372010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11538
11539 * arm.cc: Added support for ARM group relocations.
11540 (Target_arm::reloc_needs_sym_origin): New method.
11541 (Arm_relocate_functions::calc_grp_kn): New method.
11542 (Arm_relocate_functions::calc_grp_residual): New method.
11543 (Arm_relocate_functions::calc_grp_gn): New method.
11544 (Arm_relocate_functions::arm_grp_alu): New Method.
11545 (Arm_relocate_functions::arm_grp_ldr): New Method.
11546 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11547 (Arm_relocate_functions::arm_grp_ldc): New Method.
11548 (Target_arm::Scan::local): Handle the ARM group relocations.
11549 (Target_arm::Scan::global): Likewise.
11550 (Target_arm::Relocate::relocate): Likewise.
11551 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11552 Likewise.
11553
2b328d4e
DK
115542010-01-26 Doug Kwan <dougkwan@google.com>
11555
11556 * arm.cc (set): Include.
11557 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11558 pointer type.
2e702c99 11559 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11560 (Arm_output_section::append_text_sections_to_list): New method.
11561 (Arm_output_section::fix_exidx_coverage): Ditto.
11562 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11563 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11564 Relobj::set_section_offset() instead of
11565 Sized_relobj::invalidate_section_offset().
2e702c99 11566 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11567 parameter for section headers. Ignore relocation sections for
11568 unallocated sections and EXIDX sections.
11569 (Target_arm::fix_exidx_coverage): New method.
11570 (Target_arm::output_section_address_less_than): New type.
11571 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11572 linked text section instead of the EXIDX section.
11573 (Arm_output_section::create_stub_group): Add an assertion to check
11574 that this is not an EXIDX output section.
11575 (Arm_output_section::append_text_sections_to_list): New method.
11576 (Arm_output_section::fix_exidx_coverage): Ditto.
11577 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11578 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11579 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11580 first pass.
11581 (Target_arm::fix_exidx_coverage): New method.
11582 * object.h (Relobj::set_output_section): New method.
11583 (Sized_relobj::invalidate_section_offset): Remove method.
11584 (Sized_relobj::do_invalidate_section_offset): Remove method.
11585 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11586
c7f3c371
DK
115872010-01-25 Doug Kwan <dougkwan@google.com>
11588
11589 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11590 Fix warning due to signed and unsigned comparison on a 32-bit host.
11591
8923b24c
DK
115922010-01-22 Doug Kwan <dougkwan@google.com>
11593
11594 * arm.cc (Target_arm::do_relax): Record an output section for section
11595 offset adjustment it contains any stub table that has changed.
11596 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11597 offsets in an output section if necessary.
11598 * output.cc (Output_section::Output_section): Initialize
11599 section_offsets_need_adjustments_.
11600 (Output_section::add_input_section_for_script): Renamed to
11601 Output_section::add_simple_input_section.
11602 (Output_section::save_states): Add a comment.
11603 (Output_section::discard_states): New method defintion.
11604 (Output_section::adjust_section_offsets): Same.
11605 * output.h (Output_section::add_input_section_for_script): Renamed to
11606 Output_section::add_simple_input_section.
11607 (Output_section::discard_states): New method declaration.
11608 (Output_section::adjust_section_offsets): Same.
11609 (Output_section::section_offsets_need_adjustment,
11610 Output_section::set_section_offsets_need_adjustment): New method
11611 definitions.
11612 (Output_section::section_offsets_need_adjustment_): New data member.
11613 * script-sections.cc
11614 (Output_section_element_input::set_section_address): Adjust code for
11615 renaming of Output_section::add_input_section_for_script.
11616 (Orphan_output_section::set_section_address): Same.
11617
9b2fd367
DK
116182010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11619
11620 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11621 Fix_v4bx enum values .
11622 * gold/options.h (General_options): New option definitions.
11623 (General_options::fix_v4bx): New method.
11624 (General_options::Fix_v4bx): New enum.
11625 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11626 (General_options::parse_fix_v4bx_interworking): New method.
11627
80d0d023
DK
116282010-01-22 Doug Kwan <dougkwan@google.com>
11629
11630 * arm.cc (Arm_exidx_fixup): New class.
11631
af2cdeae
DK
116322010-01-21 Doug Kwan <dougkwan@google.com>
11633
11634 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11635 classes.
11636 (Arm_exidx_section_offset_map): New type.
11637
993d07c1
DK
116382010-01-21 Doug Kwan <dougkwan@google.com>
11639
11640 * arm.cc (Arm_exidx_input_section): New class.
11641 (Arm_relobj::exidx_input_section_by_link,
11642 Arm_relobj::exidx_input_section_by_shndx,
11643 Arm_relobj::make_exidx_input_section): New methods.
11644 (read_arm_attributes_section): Remove.
11645 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11646 information about them.
11647 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11648 to here.
11649
5ac169d4
DK
116502010-01-20 Doug Kwan <dougkwan@google.com>
11651
11652 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11653 Input_section_specifier to Section_id.
11654 (Target_arm::new_arm_input_section: Adjust code for change of key
11655 type.
11656 (Target_arm::find_arm_input_section): Ditto.
11657 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11658 (Section_id): Remove.
11659 (Garbage_collection::Section_id_hash): Remove.
11660 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11661 (Section_id): Remove.
11662 (Icf::Section_id_hash): Remove.
11663 * object.h (Section_id, Const_section_id, Section_id_hash,
11664 Const_section_id_hash): New type definitions.
11665 * output.cc (Output_section::add_relaxed_input_section): Change to
11666 use Const_section_id instead of Input_section_specifier as key type.
11667 (Output_section::add_merge_input_section): Ditto.
11668 (Output_section::build_relaxation_map): Change to use Section_id
11669 instead of Input_section_specifier as key type.
2e702c99 11670 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11671 Ditto.
11672 (Output_section::convert_input_sections_to_relaxed_sections): Change
11673 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11674 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11675 (Output_section::find_relaxed_input_section): Ditto.
11676 * output.h (Input_section_specifier): Remove class.
11677 (Output_section::Output_section_data_by_input_section_map): Change
11678 key type to Const_section_id.
11679 (Output_section::Output_relaxed_input_section_by_input_section_map):
11680 Ditto.
11681 (Output_section::Relaxation_map): Change key type to Section_id.
11682
a2162063
ILT
116832010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11684
11685 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11686 (class Arm_v4bx_stub): New class.
11687 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11688 (Stub_factory::make_arm_v4bx_stub): New method.
11689 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11690 (Stub_table::empty): Handle v4bx stubs.
11691 (Stub_table::add_arm_v4bx_stub): New method.
11692 (Stub_table::find_arm_v4bx_stub): New method.
11693 (Arm_relocate_functions::v4bx): New method.
11694 (Target_arm::fix_v4bx): New method.
11695 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11696 (Stub_table::relocate_stubs): Likewise.
11697 (Stub_table::do_write): Likewise.
11698 (Stub_table::update_data_size_and_addralign): Likewise.
11699 (Stub_table::finalize_stubs): Likewise.
11700 (Target_arm::Scan::local): Likewise.
11701 (Target_arm::Scan::global): Likewise.
11702 (Target_arm::do_finalize_sections): Likewise.
11703 (Target_arm::Relocate::relocate): Likewise.
11704 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11705 Likewise.
11706 (Target_arm::scan_reloc_for_stub): Likewise.
11707 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11708
5696ab0b
ILT
117092010-01-19 Ian Lance Taylor <iant@google.com>
11710
11711 * output.cc (Output_section_headers::do_sized_write): Write large
11712 segment count to sh_info field.
11713 (Output_file_header::do_sized_write): For large segment count,
11714 write PN_XNUM to e_phnum field.
11715
800d0f56
ILT
117162010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11717
11718 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11719 (Arm_relocate_functions::thm_jump8): New function.
11720 (Arm_relocate_functions::thm_jump11): New function.
11721 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11722 R_ARM_THM_JUMP11.
11723 (Target_arm::Scan::global): Likewise.
11724 (Target_arm::Relocate::relocate): Likewise.
11725 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11726 Likewise.
11727
41263c05
DK
117282010-01-14 Doug Kwan <dougkwan@google.com>
11729
11730 * arm.cc (map, utility): Include headers.
11731 (Target_arm::apply_cortex_a8_workaround): New method.
11732 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11733 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11734 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11735 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11736 the --[no-]fix-cortex-a8 command line options.
11737 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11738 (Target_arm::relocate_stub): Use addend in instruction template.
11739 * options.h (DEFINE_bool): Set the user-set flag.
11740 (General_options): Add --[no-]-fix-cortex options.
11741 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11742 : Update fast look-up map after conversion.
41263c05 11743
459e9b03
ST
117442010-01-14 Sriraman Tallam <tmsriram@google.com>
11745
11746 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11747 in the first pass of do_layout.
11748
b521dfe4
DK
117492010-01-13 Doug Kwan <dougkwan@google.com>
11750
11751 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11752 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11753 apparent compiler problem of not folding static constant integral
11754 data members of elfcpp::Elf_sizes<32>.
11755
44272192
DK
117562010-01-13 Doug Kwan <dougkwan@google.com>
11757
11758 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11759 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11760 Arm_relobj::scan_section_for_cortex_a8_erratum,
11761 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11762 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11763 sections to scan for relocation stubs into a new method
11764 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11765 relocation and Cortex-A8 stub scanning.
11766 (Target_arm::do_relax): Force stubs to be after stubbed sections
11767 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11768 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11769 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11770
44b71ece
ILT
117712010-01-12 Ian Lance Taylor <iant@google.com>
11772
11773 * target-reloc.h (visibility_error): New inline function.
11774 (relocate_section): Call visibility_error.
11775 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11776 (MOSTLYCLEANFILES): Likewise.
11777 (protected_4_pic.o, protected_3.err): New targets.
11778 * testsuite/protected_4.cc: New file.
11779
a120bc7f
DK
117802010-01-12 Doug Kwan <dougkwan@google.com>
11781
11782 * arm.cc (Cortex_a8_reloc): New class.
11783 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11784 and cortex_a8_relocs_info_.
11785 (Target_arm::fix_cortex_a8): New method definition.
11786 (Target_arm::Cortex_a8_relocs_info): New type.
11787 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11788 New data member declarations.
11789 (Target_arm::scan_reloc_for_stub): Record information about
11790 relocations for THUMB branches that might be exempted from the
11791 Cortex-A8 workaround.
11792 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11793 at the beginning of a relaxation pass.
11794
20138696
DK
117952010-01-12 Doug Kwan <dougkwan@google.com>
11796
11797 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11798 (Arm_relobj::Mapping_symbol_position,
11799 Arm_reloj::Mapping_symbol_position_less,
11800 Arm_relobj::Mapping_symbols_info): New types.
11801 (Target_arm::is_mapping_symbol_name): New method definition.
11802 (Arm_relobj::do_count_local_symbols): Save information about mapping
11803 symbols.
11804
089d69dc
DK
118052010-01-11 Doug Kwan <dougkwan@google.com>
11806
11807 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11808 Arm_relocate_functions::thumb32_branch_upper,
11809 Arm_relocate_functions::thumb32_branch_lower,
11810 Arm_relocate_functions::thumb32_cond_branch_offset,
11811 Arm_relocate_functions::thumb32_cond_branch_upper,
11812 Arm_relocate_functions::thumb32_cond_branch_lower,
11813 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11814 branch offset encoding.
11815 (Arm_relocate_functions::thumb_branch_common): Use new branch
11816 offset encoding methods to avoid code duplication.
11817 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11818 (Stub_addend_reader::operator()): Use new branch encoding method
11819 to avoid code duplication.
11820
99e5bff2
DK
118212010-01-11 Doug Kwan <dougkwan@google.com>
11822
11823 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11824 (Target_arm::do_finalize_sections): Define special EXIDX section
11825 symbols only if referenced.
11826 * gc.h (Garbage_collection::add_reference): New method.
11827 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11828 code duplication.
11829
98e090bd
ILT
118302010-01-11 Ian Lance Taylor <iant@google.com>
11831
d0a91bd8
ILT
11832 * script.cc (Version_script_info::build_expression_list_lookup):
11833 Change complaing about duplicate wildcard match from error to
11834 warning.
11835
98e090bd
ILT
11836 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11837 of 2009-12-30.
11838 (Version_script_info::Version_script_info): Initialize globs_,
11839 default_version_, default_is_global_, and exact_. Don't
11840 initialize globals_ or locals_.
11841 (Version_script_info::build_lookup_tables): Build local symbols
11842 first.
11843 (Version_script_info::unquote): New function.
11844 (Version_script_info::add_exact_match): New function.
11845 (Version_script_info::build_expression_list_lookup): Remove lookup
11846 parameter. Add is_global parameter. Change all callers. Handle
11847 wildcard pattern specially. Unquote pattern. Call
11848 add_exact_match.
11849 (Version_script_info::get_name_to_match): New function.
11850 (Version_script_info::get_symbol_version): New function.
11851 (Version_script_info::get_symbol_version_helper): Remove.
11852 (Version_script_info::check_unmatched_names): Call unquote.
11853 * script.h (class Version_script_info): Change get_symbol_version
11854 to be non-inline and add is_global parameter; change all callers.
11855 Rewrite symbol_is_local. Update declarations. Define struct
11856 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11857 Remove globals_ and locals_ members. Add exact_, globs_,
11858 default_version_, is_global_.
11859 (Version_script_info::Glob): Remove pattern, add expression and
11860 is_global. Update constructor. Change all callers.
11861 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11862 default version.
11863 (Versions::symbol_section_contents): If a symbol is undefined, or
11864 defined in a dynamic object, set the version index to
11865 VER_NDX_LOCAL.
11866 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11867 symbol_is_local.
11868 (Symbol_table::add_from_pluginobj): Likewise.
11869 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11870
d56962d3
DK
118712010-01-11 Doug Kwan <dougkwan@google.com>
11872
11873 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11874 (incremental_dump_LDADD): Add linking option for libintl.
11875 * Makefile.in: Regenerate.
11876
94e6ee91
L
118772010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11878
11879 PR gold/11144
11880 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11881 instead of -Ds.
11882 * testsuite/Makefile.in: Regenerated.
11883
e96c574b
DK
118842010-01-10 Doug Kwan <dougkwan@google.com>
11885
11886 * options.h (DEFINE_var): Use parentheses around argument varname__
11887 in macro body to avoid any unintended subsequent substitutions.
11888
7198066b
ILT
118892010-01-10 Ian Lance Taylor <iant@google.com>
11890
ba4d53bf
ILT
11891 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11892 candidates before doing symbol resolution.
11893
7198066b
ILT
11894 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11895 ODR candidates if only one is weak.
11896
a2beed37
ILT
118972010-01-08 Ian Lance Taylor <iant@google.com>
11898
11899 * script.cc (Version_script_info::build_expression_list_lookup):
11900 Don't warn about ambiguous version, just record the ambiguity.
11901 (Version_script_info::get_symbol_version_helper): Give error if
11902 version is ambiguous.
11903
2fb7225c
DK
119042010-01-08 Doug Kwan <dougkwan@google.com>
11905
11906 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11907 prev_data_size_ and prev_addralign_. Remove initializer for
11908 deleted data member has_been_changed_.
11909 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11910 to determine if the table is empty.
11911 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11912 Remove.
11913 (Stub_table::add_reloc_stub): Define method in class definition
11914 instead of just declaring it there.
11915 (Stub_table::add_cortex_a8_stub): New method definition.
11916 (Stub_table::update_data_size_and_addralign): Ditto.
11917 (Stub_table::finalize_stubs): Ditto.
11918 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11919 (Stub_table::do_addralign_): Return address alignment in the
11920 (Stub_table::do_reset_address_and_file_offset): Define method in
11921 class definition instead of declaring it there. Set current data
11922 size to be the data size of the previous pass.
11923 (Stub_table::set_final_data_size): Use current data size as the
11924 final data size.
11925 (Stub_table::relocate_stub): Change parameter type of stub from
11926 Reloc_stub pointer to Stub pointer.
11927 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11928 (Stub_table::Cortex_a8_stub_list): New typedef.
11929 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11930 Stub_table::prev_addralign_): New data member.
11931 (Arm_relobj::Arm_relobj): Initialize data member
11932 section_has_cortex_a8_workaround_.
11933 (Arm_relobj::section_has_cortex_a8_workaround,
11934 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11935 definitions.
11936 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11937 declarations.
11938 (Target_arm::relocate_stub): Change parameter type of stub from
11939 Reloc_stub pointer to Stub pointer.
11940 (Insn_template::size, Insn_template::alignment): Handle
11941 THUMB16_SPECIAL_TYPE.
11942 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11943 Stub_table::update_data_size_and_addralign,
11944 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11945 definitions.
11946 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11947 (Stub_table::do_write): Ditto.
11948 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11949
880cd20d
ILT
119502010-01-08 Ian Lance Taylor <iant@google.com>
11951
11952 PR 11108
11953 * symtab.h (class Symbol): Remove fields is_target_special_ and
11954 has_plt_offset_. Add field is_defined_in_discarded_section_.
11955 (Symbol::is_defined_in_discarded_section): New function.
11956 (Symbol::set_is_defined_in_discarded_section): New function.
11957 (Symbol::has_plt_offset): Rewrite.
11958 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11959 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11960 Don't initialize is_target_special_ or has_plt_offset_.
11961 Initialize is_defined_in_discarded_section_.
11962 (Symbol_table::add_from_relobj): If appropriate, set
11963 is_defined_in_discarded_section.
11964 * resolve.cc (Symbol::override_base_with_special): Don't test
11965 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11966 * target-reloc.h (relocate_section): Do special handling for
11967 symbols defined in discarded sections for global symbols as well
11968 as local symbols.
11969
2703e3eb
ILT
119702010-01-08 Ian Lance Taylor <iant@google.com>
11971
11972 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11973 the SHT_SYMTAB case.
11974
339d40a3
ILT
119752010-01-08 Ian Lance Taylor <iant@google.com>
11976
11977 * object.cc (Sized_relobj::do_layout): Don't get confused if
11978 layout_eh_frame returns NULL.
11979
abecea76
ILT
119802010-01-08 Ian Lance Taylor <iant@google.com>
11981
11982 PR 11084
11983 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11984 dynamic symbol table, use the normal symbol table.
11985 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11986 symbol table.
11987
6b7dd3f3
ILT
119882010-01-08 Ian Lance Taylor <iant@google.com>
11989
11990 PR 11072
11991 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11992 sections.
11993
36c50e63
L
119942010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11995
11996 * version.cc (print_version): Change to "Copyright 2010".
11997
e291e7b9
ILT
119982010-01-08 Ian Lance Taylor <iant@google.com>
11999
12000 PR 10287
12001 PR 11063
12002 * i386.cc (class Target_i386): Change return type of plt_section
12003 to be non-const.
12004 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12005 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12006 tls_desc_rel_ field.
12007 (Output_data_plt_i386::rel_tls_desc): New function.
12008 (Target_i386::rel_tls_desc_section): New function.
12009 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12010 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12011 R_386_TLS_DESC reloc in rel_tls_desc_section.
12012 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12013 Define struct Tlsdesc_info.
12014 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12015 (Target_x86_64::do_reloc_symbol_index): New function.
12016 (Target_x86_64::add_tlsdesc_info): New function.
12017 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12018 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12019 tlsdesc_rel_ field.
12020 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12021 all callers.
12022 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12023 (Target_x86_64::rela_tlsdesc_section): New function.
12024 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12025 handling.
12026 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12027 (Target_x86_64::do_reloc_addend): New function.
12028 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12029 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12030 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12031 (Output_reloc::type): New function.
12032 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12033 (Output_reloc::is_target_specific): New function.
12034 (Output_reloc::target_arg): New function.
12035 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12036 absolute relocs and target specific relocs.
12037 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12038 add_target_specific.
12039 (class Output_data_reloc) [SHT_RELA]: Likewise.
12040 * output.cc (Output_reloc::Output_reloc): Add four new versions
12041 for absolute relocs and target specific relocs.
12042 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12043 (Output_reloc::get_symbol_index): Likewise.
12044 (Output_reloc::local_section_offset): Check that local_sym_index_
12045 is not TARGET_CODE or 0.
12046 (Output_reloc::symbol_value): Likewise.
12047 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12048 reloc.
12049 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12050 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12051 functions.
12052 * layout.cc (add_target_dynamic_tags): Use output section for
12053 DT_PLTRELSZ and DT_JMPREL.
12054
3a44184e
ILT
120552010-01-07 Ian Lance Taylor <iant@google.com>
12056
12057 PR 11061
12058 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12059 function.
12060 (class Output_data_reloc_generic): Define.
12061 (class Output_data_reloc_base): Change base class to
12062 Output_data_reloc_generic. Change add() method to call
12063 bump_relative_reloc_count for a relative reloc. Remove
12064 sort_relocs_ field.
12065 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12066 to sort_relocs().
12067 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12068 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12069 appropriate.
12070 * layout.h (class Layout): Update declaration.
12071
ea715a34
ILT
120722010-01-07 Ian Lance Taylor <iant@google.com>
12073
12074 * output.h (class Output_data): Add const version of
12075 output_section and do_output_section.
12076 (class Output_section_data): Add const version of
12077 do_output_section.
12078 (class Output_section): Likewise.
12079 * layout.cc (Layout::add_target_dynamic_tags): New function.
12080 * layout.h (class Layout): Update declarations.
12081 * arm.cc (Target_arm::do_finalize_sections): Use
12082 add_target_dynamic_tags.
12083 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12084 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12085 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12086 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12087
659948a4
ILT
120882010-01-07 Ian Lance Taylor <iant@google.com>
12089
12090 PR 11042
12091 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12092 object as needed.
12093
9d3b86f6
ILT
120942010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12095 Ian Lance Taylor <iant@google.com>
12096
12097 PR 11019
12098 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12099 Xindex::read_symtab_xindex.
12100
bb0d3eb0
DK
121012010-01-07 Doug Kwan <dougkwan@google.com>
12102
12103 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12104 (Insn_template::thumb16_bcond_insn): New method declaration.
12105 (Insn_template): Fix spelling.
12106 (Stub::thumb16_special): New method declaration.
12107 (Stub::do_write): Define virtual method which was previously pure
12108 virtual.
12109 (Stub::do_thumb16_special): New method declaration.
12110 (Stub::do_fixed_endian_write): New template member.
12111 (Reloc_stub::do_write): Remove.
12112 (Reloc_stub::do_fixed_endian_write): Remove.
12113 (Cortex_a8_stub): New class definition.
12114 (Stub_factory::make_cortex_a8_stub): New method definition.
12115 (Stub_factory::Stub_factory): Add missing static storage class
12116 qualifier for elf32_arm_stub_a8_veneer_blx.
12117
ffeef7df
ILT
121182010-01-07 Ian Lance Taylor <iant@google.com>
12119
dc3f80fe
ILT
12120 PR 10980
12121 * options.h (class General_options): Add --warn-unresolved-symbols
12122 and --error-unresolved-symbols.
12123 * errors.cc (Errors::undefined_symbol): Implement
12124 --warn-unresolved-symbols.
12125
ffeef7df
ILT
12126 * options.h (class General_options): Add -z text and -z textoff.
12127 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12128
f1ec9ded
ST
121292010-01-06 Sriraman Tallam <tmsriram@google.com>
12130
12131 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12132 (Garbage_collection::cident_sections): New function.
12133 (Garbage_collection::add_cident_section): New function.
12134 (Garbage_collection::cident_sections_): New member.
12135 (gc_process_relocs): Add references to sections whose names are C
12136 identifiers.
12137 * gold.h (cident_section_start_prefix): New constant.
12138 (cident_section_stop_prefix): New constant.
12139 (is_cident): New function.
12140 * layout.cc (Layout::define_section_symbols): Replace string constants
12141 with the newly defined constants.
12142 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12143 C identifiers.
12144 * testsuite/Makefile.am: Add gc_orphan_section_test.
12145 * testsuite/Makefile.in: Regenerate.
12146 * testsuite/gc_orphan_section_test.cc: New file.
12147 * testsuite/gc_orphan_section_test.sh: New file.
12148
6eda8c29
ILT
121492010-01-06 Ian Lance Taylor <iant@google.com>
12150
b9674e17
ILT
12151 PR 10980
12152 * options.h (class General_options): Add --warn-shared-textrel.
12153 * layout.cc (Layout::finish_dynamic_section): Implement
12154 --warn-shared-textrel.
12155
6eda8c29
ILT
12156 PR 10980
12157 * options.h (class General_options): Add --warn-multiple-gp.
12158
32dcd44e
ILT
121592010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12160
12161 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12162 $(THREADSLIB) and $(LIBDL).
12163 * Makefile.in: Rebuild.
12164
a192ba05
ILT
121652010-01-06 Ian Lance Taylor <iant@google.com>
12166
12167 PR 10980
12168 * options.cc (General_options::parse_section_start): New function.
12169 (General_options::section_start): New function.
12170 (General_options::General_options): Initialize all members.
12171 * options.h: Include <map>
12172 (class General_options): Add --section-start. Add section_starts_
12173 member.
12174 * layout.cc (Layout::attach_allocated_section_to_segment): If
12175 --section-start was used, set the address of the segment. Remove
12176 local sort_sections.
12177 (Layout::relaxation_loop_body): If the address of the load segment
12178 has been set by --section-start, don't use it.
12179 * output.h (Output_segment::update_flags_for_output_section): New
12180 function.
12181 * output.cc (Output_segment::add_output_section): Call
12182 update_flags_for_output_section.
12183
dde3f402
ILT
121842010-01-05 Ian Lance Taylor <iant@google.com>
12185
62dfdd4d
ILT
12186 PR 10980
12187 * options.h (class General_options): Add --undefined-version.
12188 * script.cc (struct Version_expression): Add was_matched_by_symbol
12189 field.
12190 (Version_script_info::matched_symbol): New function.
12191 (Version_script_info::get_symbol_version_helper): Call
12192 matched_symbol.
12193 (Version_script_info::check_unmatched_names): New function.
12194 * script.h (class Version_script_info): Update declarations.
12195 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12196
9c4ae156
ILT
12197 * options.h (class General_options): Use DEFINE_bool_alias for
12198 allow_multiple_definition.
12199 * resolve.cc (Symbol_table::should_override): Don't test
12200 allow_multiple_definition.
12201
dde3f402
ILT
12202 PR 10980
12203 * options.h (class General_options): Add --cref.
12204 * main.cc (main): Print cref table if --cref. Don't close mapfile
12205 until after printing cref table.
12206 * cref.cc: Include "symtab.h".
12207 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12208 (Cref_table_compare::operator()): New function.
12209 (Cref_inputs::gather_cref): New function.
12210 (filecol): New static const.
12211 (Cref_inputs::print_cref): New function.
12212 (Cref::print_cref): New function.
12213 * cref.h: Include <cstdio>.
12214 (class Cref): Update declarations.
12215 * mapfile.h (Mapfile::file): New function.
12216 * object.h (class Object): Define Symbols. Declare virtual
12217 do_get_global_symbols.
12218 (Object::get_global_symbols): New function.
12219 * object.cc (Input_objects::add_object): Pass object to cref_ if
12220 --cref.
12221 (Input_objects::archive_start): Likewise.
12222 (Input_objects::archive_stop): Likewise.
12223 (Input_objects::print_cref): New function.
12224 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12225 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12226 --cref.
12227 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12228 function.
12229 * plugin.h (class Sized_pluginobj): Update declarations.
12230
8781f709
ILT
122312010-01-05 Ian Lance Taylor <iant@google.com>
12232
12233 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12234 to is_default_version. Rename insdef to insdefault.
12235 (Symbol_table::add_from_relobj): Rename def to is_default_version
12236 and local to is_forced_local.
12237 (Symbol_table::add_from_pluginobj): Likewise.
12238 (Symbol_table::add_from_dynobj): Likewise.
12239 (Symbol_table::define_special_symbol): Rename insdef to
12240 insdefault.
12241
fe35d28d
ILT
122422010-01-04 Ian Lance Taylor <iant@google.com>
12243
30bc8c46
ILT
12244 PR 10980
12245 * options.h (class General_options): Add
12246 --allow-multiple-definition and -z muldefs.
12247 * resolve.cc (Symbol_table::should_override): Don't warn about a
12248 multiple symbol definition if --allow-multiple-definition or -z
12249 muldefs.
12250
7eaea549
ILT
12251 PR 10980
12252 * options.h (class General_options): Add --add-needed and
12253 --copy-dt-needed-entries. Tweak --as-needed help entry.
12254 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12255 error if --copy-dt-needed-entries aka --add-needed is used and
12256 would cause a change in behaviour.
12257
fe35d28d
ILT
12258 PR 10980
12259 * options.h (class General_options): Add -G as a short version of
12260 --shared. Add no-op options -assert, -g, and -i.
12261
55a2bb35
ST
122622010-01-04 Sriraman Tallam <tmsriram@google.com>
12263
12264 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12265 check for .text or .gnu.linkonce.t sections.
12266 * icf.cc (Icf::find_identical_sections): Ditto.
12267 Change the detection for mangled function name within the section
12268 name.
12269 * icf.h (is_section_foldable_candidate): New function.
12270
719328e1
ILT
122712009-12-30 Ian Lance Taylor <iant@google.com>
12272
12273 PR 10980
12274 * options.h (class General_options): Permit two dashes with
12275 --retain-symbols-file.
12276
d7bb5745
ILT
122772009-12-30 Ian Lance Taylor <iant@google.com>
12278
403a15dd
ILT
12279 PR 10979
12280 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12281 don't put the file header and segment headers in the text
12282 segment.
12283
eda294df
ILT
12284 PR 10979
12285 * common.cc (Sort_commons::operator()): Stabilize sort when both
12286 entries are NULL.
12287 (Symbol_table::do_allocate_commons_list): When allocating common
12288 symbols, skip a symbol which is no longer common.
12289 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12290 an object before checking its type.
12291 * testsuite/common_test_2.c: New file.
12292 * testsuite/common_test_3.c: New file.
12293 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12294 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12295 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12296 (common_test_2_pic.o, common_test_2.so): New targets.
12297 (common_test_3_pic.o, common_test_3.so): New targets.
12298 * testsuite/Makefile.in: Rebuild.
12299
d7bb5745
ILT
12300 PR 10979
12301 * script.cc (read_input_script): If we see a new SECTIONS clause,
12302 and we have added an input section, give an error.
12303 * layout.h (class Layout): Add have_added_input_section function.
12304 Add have_added_input_section_ field.
12305 * layout.cc (Layout::Layout): Initialize
12306 have_added_input_section_.
12307 (Layout::layout): Set have_added_input_section_.
12308 (Layout::layout_eh_frame): Likewise.
12309
fc59c572
ILT
123102009-12-30 Ian Lance Taylor <iant@google.com>
12311
12312 PR 10931
12313 * options.h (class General_options): Add --sort-common option.
12314 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12315 * common.cc (Sort_common): Add sort_order parameter to
12316 constructor. Add sort_order_ field.
12317 (Sort_commons::operator): Check sort_order_.
12318 (Symbol_table::allocate_commons): Determine the sort order.
12319 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12320 Change all callers.
12321 (Symbol_table::do_allocate_commons_list): Likewise.
12322
1c74fab0
ILT
123232009-12-30 Ian Lance Taylor <iant@google.com>
12324
12325 PR 10916
12326 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12327 symbols from this object, don't change the visibility of an
12328 undefined symbol.
12329 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12330
6affe781
ILT
123312009-12-30 Ian Lance Taylor <iant@google.com>
12332
12333 PR 10861
12334 * script.h (class Version_script_info): Define Language enum.
12335 Update declarations. Define Glob, Exact, and Lookup types. Add
12336 new fields globals_, locals_, and is_finalized_.
12337 * script.cc: Various formatting fixes.
12338 (class Parser_closure): Change language_stack_ from a vector of
12339 std::string to one of Version_script_info::Language. Adjust all
12340 uses accordingly.
12341 (class Lazy_demangler): Remove.
12342 (struct Version_expression): Change language from std::string to
12343 Version_script_info::Language.
12344 (Version_script_info::Version_script_info): New function.
12345 (Version_script_info::~Version_script_info): Don't call clear.
12346 (Version_script_info::finalize): New function.
12347 (Version_script_info::build_lookup_tables): New function.
12348 (Version_script_info::build_expression_list_lookup): New
12349 function.
12350 (Version_script_info::get_symbol_version_helper): Rewrite to use
12351 lookup tables.
12352 (Version_script_info::print_expression_list): Adjust to use
12353 Version_script_info::Language.
12354 (script_push_lex_into_version_mode): Check that the version script
12355 has not been finalized.
12356 (version_script_push_lang): Change language string to
12357 Version_script_info::Language.
12358 * options.cc (Command_line::version_script): New function.
12359 * options.h (class General_options): Add finalize_dynamic_list
12360 function. Change version_script from declaration to definition.
12361 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12362 * testsuite/version_script.map: Remove duplicate def of foo.
12363 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12364 version_script.map.
12365 * testsuite/Makefile.in: Rebuild.
12366
818bf354
ILT
123672009-12-30 Ian Lance Taylor <iant@google.com>
12368
12369 PR 10843
12370 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12371 if the input symbol index is 0, make the output symbol index 0.
12372
ebcc8304
ILT
123732009-12-30 Ian Lance Taylor <iant@google.com>
12374
12375 PR 10670
12376 * options.h (class General_options): Add -x/--discard-all.
12377 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12378 --discard-all. If the local symbol needs a dynamic entry, check
12379 that before handling --discard-locals.
12380
176fe33f
ILT
123812009-12-30 Ian Lance Taylor <iant@google.com>
12382
bb321bb1
ILT
12383 PR 10450
12384 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12385 flags to PF_R.
12386 (Output_segment::add_output_section): Don't change the flags if
12387 the type is PT_TLS.
12388
176fe33f
ILT
12389 PR 10450
12390 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12391 GNU hash table if they need a dynamic value. Otherwise, don't add
12392 them if they are defined in a dynamic object or are forced local.
12393
e8cd95c7
ILT
123942009-12-29 Ian Lance Taylor <iant@google.com>
12395
1b81fb71
ILT
12396 PR 10450
12397 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12398 .gnu.hash table for a 32-bit target.
12399
8d6d383d
ILT
12400 PR 10450
12401 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12402 regular and a dynamic object only needs a dynamic symbol table
12403 entry if it is externally visible.
12404
e785ec03
ILT
12405 PR 10450
12406 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12407 constructor. Add global_offset_table_ field.
12408 (Target_i386::got_section): Set global_offset_table_.
12409 (Target_i386::do_finalize_sections): Set global_offset_table_
12410 size.
12411 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12412 in constructor. Add global_offset_table_ field.
12413 (Target_x86_64::got_section): Set global_offset_table_.
12414 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12415 size.
12416
1a2dff53
ILT
12417 * layout.cc (Layout::Layout): Initialize increase_relro_.
12418 (Layout::get_output_section): Add is_relro, is_last_relro, and
12419 is_first_non_relro parameters. Change all callers.
12420 (Layout::choose_output_section): Likewise.
12421 (Layout::add_output_section_data): Likewise.
12422 (Layout::make_output_section): Likewise.
12423 (Layout::set_segment_offsets): Clear increase_relro when using a
12424 linker script.
12425 * layout.h (class Layout): Add increase_relro method. Add
12426 increase_relro_ field. Update declarations.
12427 * output.cc (Output_section::Output_section): Initialize
12428 is_last_relro_ and is_first_non_relro_.
12429 (Output_segment::add_output_section): Group relro sections is
12430 do_sort is true. Handle is_last_relro and is_first_non_relro.
12431 (Output_segment::maximum_alignment): Remove relro handling.
12432 (Output_segment::set_section_addresses): Add increase_relro
12433 parameter. Change all callers. Add initial alignment to align
12434 relro sections on separate page. Remove old relro handling.
12435 (Output_segment::set_section_list_addresses): Remove in_relro
12436 parameter. Change all callers.
12437 (Output_segment::set_offset): Add increase parameter. Change all
12438 callers. Remove old relro handling.
12439 * output.h (class Output_section): Add new methods: is_last_relro,
12440 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12441 Add is_last_relro_ and is_first_non_relro_ fields.
12442 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12443 Create separate .got.plt section. Call increase_relro.
12444 * x86_64.cc (Target_x86_64::got_section): Likewise.
12445 * testsuite/relro_script_test.t: Add .got.plt.
12446
f0ba79e2
ILT
12447 PR 10450
12448 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12449 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12450 (Layout::finalize): Call set_dynamic_symbol_size.
12451 (Layout::set_dynamic_symbol_size): New function.
12452 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12453 set_dynamic_symbol_size.
12454
e8cd95c7
ILT
12455 PR 10450
12456 * output.h (class Output_section): Add is_entsize_zero_ field.
12457 * output.cc (Output_section::Output_section): Initialize
12458 is_entsize_zero_.
12459 (Output_section::set_entsize): If two different entsizes are
12460 requested, force it to zero.
12461 (Output_section::add_input_section): Set flags for .debug_str
12462 before updating section flags. Set entsize.
12463 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12464 and SHF_STRING if all input sections have those flags.
12465
3e1b9a8a
RÁE
124662009-12-29 Rafael Espindola <espindola@google.com>
12467
12468 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12469 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12470 reporting.
3e1b9a8a 12471
3dcad376
ST
124722009-12-29 Sriraman Tallam <tmsriram@google.com>
12473
12474 * options.cc (General_options::parse_version): Allow -v to exit
12475 without an error if there is nothing to link.
12476
084e2665
ILT
124772009-12-29 Ian Lance Taylor <iant@google.com>
12478
12479 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12480 using a version of gcc before 4.1.
12481 * configure: Rebuild.
12482
250acde3
CD
124832009-12-28 Chris Demetriou <cgd@google.com>
12484
12485 * attributes.cc (Output_attributes_section_data::do_write): Use
12486 std::vector::front rather than std::vector::data.
12487
99fff23b
ILT
124882009-12-28 Ian Lance Taylor <iant@google.com>
12489
12490 * symtab.h (class Symbol_table): Add enum Defined.
12491 * resolve.cc (Symbol_table::should_override): Add defined
12492 parameter. Change all callers. Test whether object is NULL
12493 before calling a method on it.
12494 (Symbol_table::report_resolve_problem): Add defined parameter.
12495 Change all callers.
12496 (Symbol_table::should_override_with_special): Likewise.
12497 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12498 parameter. Change all callers.
12499 (Symbol_table::do_define_in_output_data): Likewise.
12500 (Symbol_table::define_in_output_segment): Likewise.
12501 (Symbol_table::do_define_in_output_segment): Likewise.
12502 (Symbol_table::define_as_constant): Likewise.
12503 (Symbol_table::do_define_as_constant): Likewise.
12504 * script.h (class Symbol_assignment): Add is_defsym parameter to
12505 constructor; change all callers.
12506 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12507 parameter. Change all callers. Add is_defsym_ field.
12508 (class Parser_closure): Add parsing_defsym parameter to
12509 constructor; change all callers. Add parsing_defsym accessor
12510 function. Add parsing_defsym_ field.
12511
556bd683
ILT
125122009-12-28 Ian Lance Taylor <iant@google.com>
12513
12514 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12515 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12516
1782c879
ILT
125172009-12-23 Ian Lance Taylor <iant@google.com>
12518
12519 * i386.cc (Target_i386::do_calls_non_split): Recognize
12520 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12521 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12522 -fsplit-stack prologue when using %r11.
1782c879 12523
329ca2b1
ST
125242009-12-21 Sriraman Tallam <tmsriram@google.com>
12525
12526 * options.cc (General_options::parse_version): Make -v continue and do
12527 the link like GNU ld does.
12528
d675ff46
RÁE
125292009-12-17 Rafael Avila de Espindola <espindola@google.com>
12530
12531 * Makefile.am (CCFILES): Add timer.cc.
12532 (HFILES): Add timer.h.
12533 * configure.ac: Check for sysconf and times.
12534 * main.cc: include timer.h.
12535 (main): Use Timer instead of get_run_time.
12536 * timer.cc: New.
12537 * timer.h: New.
12538 * workqueue.cc: include timer.h.
12539 (Workqueue::find_and_run_task):
12540 Report user, sys and wall time.
12541 * Makefile.in: Regenerate.
12542 * config.in: Regenerate.
12543 * configure: Regenerate.
12544
d6344fb5
DK
125452009-12-16 Doug Kwan <dougkwan@google.com>
12546
12547 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12548 sections.
12549 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12550 relaxed input sections.
12551 * output.cc (Output_section::find_relaxed_input_section): Change
12552 return type to Output_relaxed_input_section pointer. Adjust code
12553 for new type of relaxed_input_section_map_.
12554 * output.h (Output_section::find_relaxed_input_section): Change
12555 return type to Output_relaxed_input_section pointer.
12556 (Output_section::Output_relaxed_input_section_by_input_section_map):
12557 New type.
12558 (Output_section::relaxed_input_section_map_): Change type to
12559 Output_section::Output_relaxed_input_section_by_input_section_map.
12560 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12561 input section.
12562
0e0d5469
ILT
125632009-12-15 Ian Lance Taylor <iant@google.com>
12564
12565 * layout.cc (Layout::create_shstrtab): Only write out after input
12566 sections if we are compressing debug sections.
12567
0649a889
ILT
125682009-12-15 Ian Lance Taylor <iant@google.com>
12569
12570 * archive.cc (Archive::add_symbols): Only look up a symbol without
12571 a version if there is, in fact, a version.
12572
2ea97941
ILT
125732009-12-14 Ian Lance Taylor <iant@google.com>
12574
12575 Revert -Wshadow changes, all changes from:
12576 2009-12-11 Doug Kwan <dougkwan@google.com>
12577 2009-12-11 Nick Clifton <nickc@redhat.com>
12578 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12579
b0eec2cc
DK
125802009-12-11 Doug Kwan <dougkwan@google.com>
12581
12582 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12583 due to -Wshadow.
12584 * attributes.cc (Object_attribute::size): Ditto.
12585 (Attributes_section_data::size): Ditto.
12586 (Attributes_section_data::Attributes_section_data): Ditto.
12587 (Output_attributes_section_data::do_write): Ditto.
12588 * attributes.h (Object_attribute::set_type): Ditto.
12589 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12590
91d6fa6a
NC
125912009-12-11 Nick Clifton <nickc@redhat.com>
12592
12593 * archive.cc: Fix shadowed variable warnings.
12594 * arm.cc: Likewise.
12595 * compressed_output.cc: Likewise.
12596 * compressed_output.h: Likewise.
12597 * configure: Likewise.
12598 * dwarf_reader.cc: Likewise.
12599 * dynobj.cc: Likewise.
12600 * dynobj.h: Likewise.
12601 * ehframe.cc: Likewise.
12602 * ehframe.h: Likewise.
12603 * errors.cc: Likewise.
12604 * expression.cc: Likewise.
12605 * fileread.cc: Likewise.
12606 * fileread.h: Likewise.
12607 * freebsd.h: Likewise.
12608 * i386.cc: Likewise.
12609 * icf.cc: Likewise.
12610 * incremental.h: Likewise.
12611 * layout.cc: Likewise.
12612 * layout.h: Likewise.
12613 * mapfile.cc: Likewise.
12614 * merge.cc: Likewise.
12615 * merge.h: Likewise.
12616 * object.cc: Likewise.
12617 * object.h: Likewise.
12618 * options.h: Likewise.
12619 * output.cc: Likewise.
12620 * output.h: Likewise.
12621 * parameters.cc: Likewise.
12622 * plugin.cc: Likewise.
12623 * powerpc.cc: Likewise.
12624 * reduced_debug_output.cc: Likewise.
12625 * reduced_debug_output.h: Likewise.
12626 * reloc.cc: Likewise.
12627 * reloc.h: Likewise.
12628 * resolve.cc: Likewise.
12629 * script-sections.cc: Likewise.
12630 * script.cc: Likewise.
12631 * script.h: Likewise.
12632 * sparc.cc: Likewise.
12633 * symtab.cc: Likewise.
12634 * symtab.h: Likewise.
12635 * target-select.cc: Likewise.
12636 * target-select.h: Likewise.
12637 * token.h: Likewise.
12638 * workqueue.cc: Likewise.
12639 * workqueue.h: Likewise.
12640 * x86_64.cc: Likewise.
12641
a0351a69
DK
126422009-12-10 Doug Kwan <dougkwan@google.com>
12643
12644 * arm.cc (attributes.h): New include.
12645 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12646 (Arm_relobj::~Arm_relobj): Delete object pointed by
12647 attributes_section_data_.
12648 (Arm_relobj::attributes_section_data): New method definition.
12649 (Arm_relobj::attributes_section_data_): New data member declaration.
12650 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12651 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12652 attributes_section_data_.
12653 (Arm_dynobj::attributes_section_data): New method definition.
12654 (Arm_dynobj::attributes_section_data_): New data member declaration.
12655 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12656 initialization value of may_use_blx_ to false.
2e702c99 12657 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12658 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12659 object attributes to compute results instead of hard-coding.
12660 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12661 Target_arm::get_secondary_compatible_arch,
12662 Target_arm::set_secondary_compatible_arch
12663 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12664 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12665 New method declarations.
12666 (Target_arm::get_aeabi_object_attribute): New method definition.
12667 (Target_arm::attributes_section_data_): New data member declaration.
12668 (read_arm_attributes_section): New template definition.
12669 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12670 (Arm_dynobj::do_read_symbols): Ditto.
12671 (Target_arm::do_finalize_sections): Merge attributes sections from
12672 input. Check for BLX use after attributes section merging.
12673 Fix __exidx_start and __exidx_end visibility. Create an
12674 .ARM.attributes section if necessary.
12675 (Target_arm::get_secondary_compatible_arch,
12676 Target_arm::set_secondary_compatible_arch,
12677 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12678 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12679 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12680 New method definitions.
12681
b59befec
ILT
126822009-12-09 Ian Lance Taylor <iant@google.com>
12683
12684 * plugin.cc (Plugin::load): Don't cast from void* to a function
12685 pointer.
12686
1276bc89
ILT
126872009-12-09 Ian Lance Taylor <iant@google.com>
12688
12689 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12690 information fields.
12691
2f2de248
L
126922009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12693
12694 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12695 Replace two_file_shared_1.so with two_file_shared_2.so.
12696 * testsuite/Makefile.in: Regenerated.
12697
4f787271
DK
126982009-12-08 Doug Kwan <dougkwan@google.com>
12699
12700 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12701 (HFILES): Add attributes.h and int_encoding.h.
12702 * Makefile.in: Regenerate.
12703 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12704 function definitions to int_encoding.cc
12705 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12706 prototypes to int_encoding.h
12707 * reduced_debug_output.cc (int_encoding.h): New include.
12708 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12709 function definitions to int_encoding.cc
12710 (insert_into_vector, read_from_pointer): Move template definitions to
12711 int_encoding.h
12712 * attributes.cc: New file.
12713 * attributes.h: New file.
12714 * int_encoding.cc: New file.
12715 * int_encoding.h: New file.
12716
20b52f1a
RÁE
127172009-12-07 Rafael Avila de Espindola <espindola@google.com>
12718
12719 PR gold/11055
12720 * incremental-dump.cc (dump_incremental_inputs): New.
12721 (main): Use dump_incremental_inputs.
12722
53d7974c
L
127232009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12724
12725 PR gold/10893
12726 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12727 checking elfcpp::STT_FUNC.
12728 (Target_i386::Relocate::relocate): Likewise.
12729 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12730
12731 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12732 symbols from shared libraries into normal FUNC symbols.
12733
12734 * symtab.h (Symbol): Add is_func and use it.
12735
05a352e6
DK
127362009-12-05 Doug Kwan <dougkwan@google.com>
12737
12738 * arm.cc (Target_arm::arm_info): Initialize new fields
12739 attributes_section and attributes_vendor.
12740 * i386.cc (Target_i386::i386_info): Same.
12741 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12742 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12743 fields attributes_section and attributes_vendor.
53d7974c 12744 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12745 * target.h (Target::attributes_section, Target::attributes_vendor,
12746 Target::is_attributes_section, Target::attribute_arg_type,
12747 Target::attributes_order): New method definitions.
12748 (Target::Target_info::attributes_section,
12749 Target::Target_info::attributes_vendor): New fields.
12750 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12751 virtual method definitions.
12752 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12753 attributes_section and attributes_vendor.
12754 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12755
f4e5969c
DK
127562009-12-05 Doug Kwan <dougkwan@google.com>
12757
12758 * arm.cc: Update comments about interworking and stub generation.
12759 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12760 considered as non-PIC.
12761 (Arm_relocate_functions::base_abs): Fix formatting.
12762 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12763 of function to use GOT entry address instead of offset.
12764 (Target_arm::Scan::global): Issue an error if a symbol would need a
12765 PLT does not get one because it is untyped. Remove code to create
12766 dynamic symbols for relative branches.
12767 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12768 takes unsigned integer instead of boolean.
12769
1abce4a6
L
127702009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12771
12772 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12773 (two_file_test_LDADD): Likewise.
12774 (common_test_1_LDADD): Likewise.
12775 (exception_test_LDADD) Likewise.
12776 (weak_test_LDADD): Likewise.
12777 (many_sections_test_LDADD): Likewise.
12778 (initpri1_LDADD): Likewise.
12779 (script_test_1_LDADD): Likewise.
12780 (script_test_2_LDADD): Likewise.
12781 (justsyms_LDADD): Likewise.
12782 (binary_test_LDADD): Likewise.
12783 (large_LDADD): Likewise.
12784 * testsuite/Makefile.in: Regenerated.
12785
adcf2816 127862009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12787
adcf2816
L
12788 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12789 (Symbol_table::override_with_special): Likewise.
12790 (Symbol_table::add_from_object): Likewise.
12791
28e67f5d
RÁE
127922009-12-04 Rafael Avila de Espindola <espindola@google.com>
12793
12794 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12795 Don't set the data_offset twice.
12796
ae10a101
RÁE
127972009-12-04 Rafael Avila de Espindola <espindola@google.com>
12798
12799 * testsuite/Makefile.in: Regenerate.
12800
f59f41f3
DK
128012009-12-03 Doug Kwan <dougkwan@google.com>
12802
12803 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12804 (Target_arm::do_finalize_sections): Add parameter for symbol table
12805 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12806 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12807 parameter for symbol table pointer.
12808 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12809 an additional parameter for a pointer to symbol table.
12810 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12811 parameter for a symbol table pointer.
12812 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12813 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12814 Ditto.
12815 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12816 parameter for a symbol table pointer.
12817
ca55d848
RÁE
128182009-12-03 Rafael Avila de Espindola <espindola@google.com>
12819
12820 * incremental.cc (Incremental_inputs_header)
12821 (Incremental_inputs_header_write, Incremental_inputs_entry)
12822 (Incremental_inputs_entry_write): Move ...
12823 * incremental.h (Incremental_inputs_header)
12824 (Incremental_inputs_header_write, Incremental_inputs_entry)
12825 (Incremental_inputs_entry_write): here.
12826
3aec4f9c
RÁE
128272009-12-02 Rafael Avila de Espindola <espindola@google.com>
12828
12829 * incremental.cc (make_sized_incremental_binary): Set the target.
12830 Error if it is incompatible.
12831 * output.h (Output_file): Add filename method.
12832
9c0ae74d
RÁE
128332009-12-02 Rafael Avila de Espindola <espindola@google.com>
12834
12835 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12836 from the get_* methods.
12837
a45500ae
RÁE
128382009-12-02 Rafael Avila de Espindola <espindola@google.com>
12839
12840 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12841 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12842 Write 0 for the data_offset of scripts.
12843
325e6408
RÁE
128442009-12-02 Rafael Avila de Espindola <espindola@google.com>
12845
12846 * testsuite/Makefile.am: Add the incremental_test.sh test.
12847 * testsuite/incremental_test.sh: New.
12848 * testsuite/incremental_test_1.c: New.
12849 * testsuite/incremental_test_2.c: New.
12850
954c3e2e
RÁE
128512009-12-01 Rafael Avila de Espindola <espindola@google.com>
12852
703d02da 12853 * incremental-dump.cc (main): Fix typos.
954c3e2e 12854
f8086623
RÁE
128552009-11-27 Rafael Avila de Espindola <espindola@google.com>
12856
12857 PR gold/11025
12858 * incremental-dump.cc (main): Use llu to print 64 bit values.
12859
3b0dd6ac
L
128602009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12861 H.J. Lu <hongjiu.lu@intel.com>
12862
12863 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12864 $(LIBDL).
12865 (incremental_dump_LDADD): Likewise.
12866 * Makefile.in: Regenerated.
12867
a6d1ef57 128682009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12869
a6d1ef57
DK
12870 Revert:
12871
12872 2009-11-25 Doug Kwan <dougkwan@google.com>
12873
12874 * arm.cc (Target_arm::Target_arm): Move method definition
12875 outside of class definition. Add code to handle
12876 --target1-rel, --target1-abs and --target2= options.
12877 (Target_arm::get_reloc_reloc_type): Change method to be
12878 non-static and const.
12879 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12880 New data member declaration.
12881 (Target_arm::Scan::local, Target_arm::Scan::global,
12882 Target_arm::Relocate::relocate,
12883 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12884 Adjust call to Target_arm::get_real_reloc_type.
12885 (Target_arm::get_real_reloc_type): Use command line options
12886 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12887 * options.h (--target1-rel, --target1-abs, --target2): New
12888 ARM-only options.
12889
50aeb7d4
DK
128902009-11-25 Doug Kwan <dougkwan@google.com>
12891
12892 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12893 class definition. Add code to handle --target1-rel, --target1-abs
12894 and --target2= options.
12895 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12896 and const.
12897 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12898 member declaration.
12899 (Target_arm::Scan::local, Target_arm::Scan::global,
12900 Target_arm::Relocate::relocate,
12901 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12902 call to Target_arm::get_real_reloc_type.
12903 (Target_arm::get_real_reloc_type): Use command line options to
12904 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12905 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12906 options.
12907
51938283
DK
129082009-11-25 Doug Kwan <dougkwan@google.com>
12909
12910 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12911 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12912 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12913 formatting.
12914 (Arm_relocate_functions::thm_call): Replace body with a call to
12915 Arm_relocate_functions::thumb_branch_common.
12916 (Arm_relocate_functions::thm_jump24,
12917 Arm_relocate_functions::thm_xpc22): New method definitions.
12918 (Arm_relocate_functions::thumb_branch_common): New method definition.
12919 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12920 operator.
12921 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12922 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12923
e2b8f3c4
RÁE
129242009-11-24 Rafael Avila de Espindola <espindola@google.com>
12925
12926 * Makefile.am: Build incremental-dump
12927 * Makefile.in: Regenerate.
12928 * incremental-dump.cc: New.
12929 * incremental.cc (Incremental_inputs_header_data,
12930 Incremental_inputs_entry_data): Move to incremental.h
12931 * incremental.h: (Incremental_inputs_header_data,
12932 Incremental_inputs_entry_data): Move from incremental.cc
12933
bcba9aec
RÁE
129342009-11-24 Rafael Avila de Espindola <espindola@google.com>
12935
12936 * incremental.cc (Incremental_inputs_header,
12937 Incremental_inputs_header_write, Incremental_inputs_entry,
12938 Incremental_inputs_entry_write): Add a typedef with the data type.
12939
7c3afe08
RÁE
129402009-11-24 Rafael Avila de Espindola <espindola@google.com>
12941
12942 * incremental.cc (Incremental_inputs_header,
12943 Incremental_inputs_header_write, Incremental_inputs_entry,
12944 Incremental_inputs_entry_write): Update comment about which
12945 type has the filed descriptions.
12946
d204b6e9
DK
129472009-11-15 Doug Kwan <dougkwan@google.com>
12948
12949 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12950 (Arm_relocate_functions::arm_branch_common): Change method defintion
12951 in class definition to a method declaration and update list of formal
12952 parameters.
12953 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12954 Arm_relocation_functions::jump24): Adjust call to
12955 Arm_relocate_functions::arm_branch_common. Update list of formal
12956 parameters.
12957 (Arm_relocate_functions::xpc25): New method definition.
12958 (Arm_relocate_functions::arm_branch_common): Move method defintion
12959 out from class definition. Use stubs for mode-switching and extending
12960 branch ranges.
12961 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12962 specially. Change code to enable use of stubs in ARM branches.
12963
43d12afe
DK
129642009-11-10 Doug Kwan <dougkwan@google.com>
12965
12966 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12967 in method declaration.
12968 (Target_arm::relocate_stub): New method declaration.
12969 (Target_arm::default_target): Change to return a pointer instead of
12970 a const reference.
12971 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12972 Target_arm::default_target.
12973 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12974 method definition.
12975 (Target_arm::relocate_section): Adjust view.
12976 (Target_arm::relocate_stub): New method definition.
12977
ac33a407
DK
129782009-11-10 Doug Kwan <dougkwan@google.com>
12979
12980 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12981 a format warning.
12982 * incremental.cc (open_incremental_binary): Initialized local
12983 variables to avoid warnings.
12984 * object.cc (make_elf_object): Ditto.
12985 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12986 a format warning.
e1df38aa 12987
88ee28e9
L
12988009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12989
12990 PR gold/10930
12991 * testsuite/plugin_test.c: Include "config.h".
12992
2daedcd6
DK
129932009-11-09 Doug Kwan <dougkwan@google.com>
12994
12995 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12996 (arm_symbol_value): Remove.
12997 (Arm_relocate_functions::arm_branch_common,
12998 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12999 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13000 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13001 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13002 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13003 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13004 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13005 Arm_relocate_functions::thm_mobw_abs_nc,
13006 Arm_relocate_functions::thm_mov_abs,
13007 Arm_relocate_functions::movw_prel_nc,
13008 Arm_relocate_functions::thm_movt_abs,
13009 Arm_relocate_functions::movt_prel,
13010 Arm_relocate_functions::thm_movw_prel_nc,
13011 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13012 (Target_arm::Relocate::relocate): Only decompose address into two
13013 parts if relocation type uses the thumb-bit and pass the actual
13014 bit instead of a flag indicating that the thumb-bit is used. Adjust
13015 calls to methods in Arm_relocate_functions for this change.
13016
1276bc89 130172009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
13018
13019 PR 10925
13020 * reloc.cc: Instantiate
13021 Sized_relobj::initialize_input_to_output_maps and
13022 Sized_relobj:free_input_to_output_maps.
13023
e53ad1b5
ILT
130242009-11-06 Ian Lance Taylor <iant@google.com>
13025
13026 PR 10876
13027 * defstd.cc (in_segment): Set only_if_ref true for "end".
13028
eb44217c
DK
130292009-11-06 Doug Kwan <dougkwan@google.com>
13030
13031 * arm.cc (class Reloc_stub): Correct a comment.
13032 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13033 (Target_arm::scan_section_for_stubs): New method declaration.
13034 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13035 Change methods from private to protected.
13036 (Target_arm::do_may_relax): New method definition.
13037 (Target_arm::do_relax, Target_arm::group_sections,
13038 Target_arm::scan_reloc_for_stub,
13039 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13040 (Target_arm::arm_input_section_map_): New data member declaration.
13041 (Target_arm::scan_reloc_for_stub,
13042 Target_arm::scan_reloc_section_for_stubs,
13043 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13044 Target_arm::do_relax): New method definitions.
13045
5d329b7d
ILT
130462009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13047
13048 * configure.ac: Check for (struct stat)::st_mtim
13049 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13050 * config.in: Regenerate.
13051 * configure: Regenerate.
13052
96a0d71b
ILT
130532009-11-05 Ian Lance Taylor <iant@google.com>
13054
13055 PR 10910
13056 * output.cc (Output_segment::add_output_section): Add missing
13057 return statement.
13058
594c8e5e
ILT
130592009-11-04 Ian Lance Taylor <iant@google.com>
13060
13061 PR 10880
13062 * object.h (class Object): Add is_needed and set_is_needed
13063 methods. Add is_needed_ field. Make bool fields into bitfields.
13064 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13065 defined in a dynamic object and referenced by a regular object,
13066 set is_needed for the dynamic object.
13067 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13068 if the file is marked with as_needed and it is not needed.
13069
22b127cc
ILT
130702009-11-04 Ian Lance Taylor <iant@google.com>
13071
13072 PR 10887
13073 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13074 tags if data is discarded by linker script.
13075 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13076 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13077 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13078 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13079
f5c870d2
ILT
130802009-11-04 Ian Lance Taylor <iant@google.com>
13081
13082 * layout.cc (Layout::get_output_section): Add is_interp and
13083 is_dynamic_linker_section parameters. Change all callers.
13084 (Layout::choose_output_section): Likewise.
13085 (Layout::make_output_section): Likewise.
13086 (Layout::add_output_section_data): Add is_dynamic_linker_section
13087 parameter. Change all callers.
13088 * layout.h (class Layout): Update declarations.
13089 * output.h (class Output_section): Add is_interp, set_is_interp,
13090 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13091 Add is_interp_, is_dynamic_linker_section_ fields. Change
13092 generate_code_fills_at_write_ to a bitfield.
13093 * output.cc (Output_section::Output_sections): Initialize new
13094 fields.
13095 (Output_segment::add_output_section): Add do_sort parameter.
13096 Change all callers.
13097
1ae4d23b
ILT
130982009-11-03 Ian Lance Taylor <iant@google.com>
13099
13100 PR 10860
13101 * options.h (class General_options): Add --warn-common.
13102 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13103 merging two common symbols.
13104 (Symbol_table::should_override): Handle --warn-common when merging
13105 a common symbol with a defined symbol. Use report_resolve_problem
13106 for multiple definitions.
13107 (Symbol_table::report_resolve_problem): New function.
13108 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13109
55da9579
DK
131102009-11-03 Doug Kwan <dougkwan@google.com>
13111
13112 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13113 stub_factory_.
13114 (Target_arm::stub_factory): New method definition.
13115 (Target_arm::new_arm_input_section,
13116 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13117 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13118 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13119 New type definitions.
13120 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13121 member declarations.
13122 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13123 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13124 New method definitions.
13125
37a9ac43
ILT
131262009-11-03 Ian Lance Taylor <iant@google.com>
13127
13128 * options.h (class General_options): Add --warn_constructors.
13129
b3d6a3d4
ILT
131302009-11-03 Ian Lance Taylor <iant@google.com>
13131
13132 PR 10893
13133 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13134 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13135
934b01dd
ILT
131362009-11-03 Ian Lance Taylor <iant@google.com>
13137
13138 PR 10895
13139 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13140 --msgid-bugs-address.
13141 (install-pdf): New target.
13142 (install-data_yes): Look up one directory to find mkinstalldirs.
13143
03c1939b
L
131442009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13145
13146 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13147 tree.
13148
ebd95253
DK
131492009-10-30 Doug Kwan <dougkwan@google.com>
13150
13151 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13152
e9bbb538
DK
131532009-10-30 Doug Kwan <dougkwan@google.com>
13154
13155 * arm.cc (Stub_addend_reader): New struct template definition
13156 and partial specializations.
13157 (Stub_addend_reader::operator()): New method definition for a
13158 partially specialized template.
13159
d5b40221
DK
131602009-10-30 Doug Kwan <dougkwan@google.com>
13161
13162 * arm.cc (Arm_relobj::processor_specific_flags): New method
13163 definition.
13164 (Arm_relobj::do_read_symbols): New method declaration.
13165 (Arm_relobj::processor_specific_flags_): New data member declaration.
13166 (Arm_dynobj): New class definition.
13167 (Target_arm::do_finalize_sections): Add input_objects parameter.
13168 (Target_arm::do_adjust_elf_header): New method declaration.
13169 (Target_arm::are_eabi_versions_compatible,
13170 (Target_arm::merge_processor_specific_flags): New method declaration.
13171 (Target_arm::do_make_elf_object): New overloaded method definitions
13172 and declaration.
13173 (Arm_relobj::do_read_symbols): New method definition.
13174 (Arm_dynobj::do_read_symbols): Ditto.
13175 (Target_arm::do_finalize_sections): Add input_objects parameters.
13176 Merge processor-specific flags from all input objects.
13177 (Target_arm::are_eabi_versions_compatible,
13178 Target_arm::merge_processor_specific_flags,
13179 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13180 New method definitions.
13181 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13182 Input_objects pointer type parameter.
13183 * layout.cc (Layout::finalize): Pass input objects to target's.
13184 finalize_sections function.
13185 * output.cc (Output_file_header::do_sized_write): Set ELF file
13186 header's processor-specific flags.
13187 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13188 Input_objects pointer type parameter.
13189 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13190 * target.h (Input_objects): New forward class declaration.
13191 (Target::processor_specific_flags,
13192 Target::are_processor_specific_flags_sect): New method definitions.
13193 (Target::finalize_sections): Add input_objects parameter.
13194 (Target::Target): Initialize processor_specific_flags_ and
13195 are_processor_specific_flags_set_.
13196 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13197 parameter.
13198 (Target::set_processor_specific_flags): New method definition.
13199 (Target::processor_specific_flags_,
13200 Target::are_processor_specific_flags_set_): New data member
13201 declarations.
13202 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13203 Input_objects pointer type parameter.
13204
ebabffbd
DK
132052009-10-30 Doug Kwan <dougkwan@google.com>
13206
13207 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13208
ad0f2072
ILT
132092009-10-28 Ian Lance Taylor <iant@google.com>
13210
13211 * object.h (class Relobj): Drop options parameter from
13212 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13213 do_scan_relocs, do_relocate. Change all callers.
13214 (class Sized_relobj): Drop options parameters from
13215 do_gc_process_relocs, do_scan_relocs, do_relocate,
13216 do_relocate_sections, relocate_sections, emit_relocs_scan,
13217 emit_relocs_scan_reltype. Change all callers.
13218 (struct Relocate_info): Remove options field and all references to
13219 it.
13220 * reloc.h (class Read_relocs): Remove options constructor
13221 parameter and options_ field. Change all callers.
13222 (class Gc_process_relocs, class Scan_relocs): Likewise.
13223 (class Relocate_task): Likewise.
13224 * target-reloc.h (scan_relocs): Remove options parameter. Change
13225 all callers.
13226 (scan_relocatable_relocs): Likewise.
13227 * target.h (class Sized_target): Remove options parameter from
13228 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13229 all callers.
13230 * gc.h (gc_process_relocs): Remove options parameter. Change all
13231 callers.
13232 * arm.cc: Update functions to remove options parameters.
13233 * i386.cc: Likewise.
13234 * powerpc.cc: Likewise.
13235 * sparc.cc: Likewise.
13236 * x86_64.cc: Likewise.
13237 * testsuite/testfile.cc: Likewise.
13238
8ffa3667
DK
132392009-10-28 Doug Kwan <dougkwan@google.com>
13240
13241 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13242 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13243 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13244 New method definitions.
13245
40f36857
CC
132462009-10-28 Cary Coutant <ccoutant@google.com>
13247
13248 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13249 (Plugin::cleanup_done_): New member.
13250 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13251 (Plugin_manager::cleanup_done_): Remove.
13252 (Plugin_manager::add_input_file): Edit error message.
13253 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13254 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13255
2c849493
ILT
132562009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13257
13258 * fileread.cc: (File_read::View::~View): Use the new
13259 data_ownership_ filed.
13260 (File_read::~File_read): Dispose the new whole_file_view_.
13261 (File_read::open): Mmap the whole file if needed.
13262 (File_read::open): Use whole_file_view_ instead of contents_.
13263 (File_read::find_view): Use whole_file_view_ if applicable.
13264 (File_read::do_read): Use whole_file_view_ instead of contents_.
13265 (File_read::make_view): Use whole_file_view_ instead of contents_,
13266 update File_read::View::View call.
13267 (File_read::find_or_make_view): Update File_read::View::View
13268 call.
13269 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13270 remove contents_
13271 (File_read::View::Data_ownership): New enum.
13272 (File_read::View::View): Replace bool mapped_ with Data_ownership
13273 argument.
13274 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13275 (File_read::View::data_ownership_): New field.
13276 (File_read::contents_): Remove (replaced by whole_file_view_).
13277 (File_read::whole_file_view_): New field.
13278 * options.h (class General_options): Add --keep-files-mapped.
13279
24998053
CC
132802009-10-27 Cary Coutant <ccoutant@google.com>
13281
13282 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13283 * testsuite/Makefile.am (plugin_test_5): New test case.
13284 * testsuite/Makefile.in: Regenerate.
13285
72adc4fa
DK
132862009-10-25 Doug Kwan <dougkwan@google.com>
13287
13288 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13289 from private to protected to allow access by child class.
13290 (Sized_relobj::do_relocate_sections): New method declaration.
13291 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13292 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13293 Sized_relobj::relocate_sections. Instantiate template explicitly
13294 for different target sizes and endianity.
13295
07f508a2
DK
132962009-10-24 Doug Kwan <dougkwan@google.com>
13297
13298 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13299 (Arm_input_section::as_arm_input_section): New method.
13300 (Arm_output_section): New class definition.
13301 (Arm_output_section::create_stub_group,
13302 Arm_output_section::group_sections): New method definitions.
13303
10ad9fe5
DK
133042009-10-22 Doug Kwan <dougkwan@google.com>
13305
13306 * arm.cc (Arm_input_section): New class definition.
13307 (Arm_input_section::init, Arm_input_section:do_write,
13308 Arm_input_section::set_final_data_size,
13309 Arm_input_section::do_reset_address_and_file_offset): New method
13310 definitions.
13311
56ee5e00
DK
133122009-10-21 Doug Kwan <dougkwan@google.com>
13313
13314 * arm.cc (Stub_table, Arm_input_section): New forward class
13315 declarations.
13316 (Stub_table): New class defintion.
13317 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13318 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13319 New method definition.
13320
b569affa
DK
133212009-10-21 Doug Kwan <dougkwan@google.com>
13322
13323 * arm.cc: Update copyright comments.
13324 (Target_arm): New forward class template declaration.
13325 (Arm_address): New type.
13326 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13327 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13328 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13329 constants.
13330 (Insn_template): Same.
13331 (DEF_STUBS): New macro.
13332 (Stub_type): New enum type.
13333 (Stub_template): New class definition.
13334 (Stub): Same.
13335 (Reloc_stub): Same.
13336 (Stub_factory): Same.
13337 (Target_arm::Target_arm): Initialize may_use_blx_ and
13338 should_force_pic_veneer_.
13339 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13340 Target_arm::should_force_pic_veneer,
13341 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13342 Target_arm::using_thumb_only, Target_arm:;default_target): New
13343 method defintions.
13344 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13345 New data member declarations.
13346 (Insn_template::size, Insn_template::alignment): New method defintions.
13347 (Stub_template::Stub_template): New method definition.
13348 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13349 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13350 (Stub_factory::Stub_factory): New method definition.
13351 * gold.h (string_hash): New template.
13352 * output.h (Input_section_specifier::hash_value): Use
13353 gold::string_hash.
13354 (Input_section_specifier::string_hash): Remove.
13355 * stringpool.cc (Stringpool_template::string_hash): Use
13356 gold::string_hash.
13357
6c172549
DK
133582009-10-20 Doug Kwan <dougkwan@google.com>
13359
13360 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13361 symbols of relaxed input sections.
13362 * output.h (Output_section::find_relaxed_input_section): Make
13363 method public.
13364
c5617f2f
DK
133652009-10-16 Doug Kwan <dougkwan@google.com>
13366
13367 * dynobj.cc (Versions::Versions): Initialize version_script_.
13368 Only insert base version symbol definition for a shared object
13369 if version script defines any version versions.
13370 (Versions::define_base_version): New method definition.
13371 (Versions::add_def): Check that base version is not needed.
13372 (Versions::add_need): Define base version lazily.
13373 * dynobj.h (Versions::define_base_version): New method declaration.
13374 (Versions::needs_base_version_): New data member declaration.
13375 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13376 (check_DATA): Add no_version_test.stdout.
13377 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13378 New make rules.
13379 * testsuite/Makefile.in: Regenerate.
13380 * testsuite/no_version_test.c: New file.
13381 * testsuite/no_version_test.sh: Ditto.
13382
3c12dcdb
DK
133832009-10-16 Doug Kwan <dougkwan@google.com>
13384
13385 * expression.cc (class Segment_start_expression): New class definition.
13386 (Segment_start_expression::value): New method definition.
13387 (script_exp_function_segment_start): Return a new
13388 Segment_start_expression.
13389 * gold/script-c.h (script_saw_segment_start_expression): New function
13390 prototype.
13391 * script-sections.cc (Script_sections::Script_sections): Initialize
13392 SAW_SEGMENT_START_EXPRESSION_ to false.
13393 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13394 and -Tbbs options to specify section addresses if given in
13395 command line and no SEGMENT_START expression is seen in a script.
13396 * script-sections.h (Script_sections::saw_segment_start_expression,
13397 Script_sections::set_saw_segment_start_expression): New method
13398 definition.
13399 (Script_sections::saw_segment_start_expression_): New data member
13400 declaration.
13401 * script.cc (script_saw_segment_start_expression): New function.
13402 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13403 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13404 script_test_7.sh and script_test_8.sh.
13405 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13406 script_test_8.stdout.
13407 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13408 (script_test_6, script_test_6.stdout, script_test_7,
13409 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13410 * Makefile.in: Regenerate.
13411 * testsuite/script_test_6.sh: New file.
13412 * testsuite/script_test_6.t: Same.
13413 * testsuite/script_test_7.sh: Same.
13414 * testsuite/script_test_7.t: Same.
13415 * testsuite/script_test_8.sh: Same.
13416
64b1ae37
DK
134172009-10-16 Doug Kwan <dougkwan@google.com>
13418
13419 * output.cc (Output_segment::set_section_list_address): Cast
13420 expressions to unsigned long long type to avoid format warnings.
13421
661be1e2
ILT
134222009-10-15 Ian Lance Taylor <iant@google.com>
13423
12edd763 13424 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13425 dot assignment to script_sections_.
12edd763
ILT
13426 * script-sections.cc (Script_sections::add_dot_assignment):
13427 Initialize if necessary.
13428
68b6574b
ILT
13429 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13430 program headers with no load segment if there is a linker script.
13431
661be1e2
ILT
13432 * layout.cc (Layout::set_segment_offsets): Align the file offset
13433 to the segment aligment for -N or -n with no load segment.
13434 * output.cc (Output_segment::add_output_section): Don't crash if
13435 the first section is a TLS section.
13436 (Output_segment::set_section_list_addresses): Print an error
13437 message if the address moves backward in a linker script.
13438 * script-sections.cc
13439 (Output_section_element_input::set_section_addresses): Don't
13440 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13441 (Orphan_output_section::set_section_addresses): Likewise.
13442
f15f61a7
DK
134432009-10-15 Doug Kwan <dougkwan@google.com>
13444
13445 * layout.cc (Layout::finish_dynamic_section): Generate tags
13446 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13447 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13448 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13449
82bb573a
ILT
134502009-10-14 Ian Lance Taylor <iant@google.com>
13451
13452 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13453 fields.
13454 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13455 data_shdr fields of relinfo.
13456 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13457 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13458 R_386_TLS_LDO_32, adjust based on section flags.
13459 (Target_i386::Relocate::fix_up_ldo): Remove.
13460
374ad285
ILT
134612009-10-13 Ian Lance Taylor <iant@google.com>
13462
13463 Add support for -pie.
13464 * options.h (class General_options): Add -pie and
13465 --pic-executable.
13466 (General_options::output_is_position_independent): Test -pie.
13467 (General_options::output_is_executable): Return true if not shared
13468 and not relocatable.
13469 (General_options::output_is_pie): Remove.
13470 * options.cc (General_options::finalize): Reject incompatible uses
13471 of -pie.
13472 * gold.cc (queue_middle_tasks): A -pie link is not static.
13473 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13474 * symtab.cc (Symbol::final_value_is_known): Return false if
13475 output_is_position_independent.
13476 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13477 output_is_position_independent.
13478 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13479 output_is_position_independent.
13480 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13481 output_is_position_independent.
13482 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13483 two_file_pie_test.
13484 (basic_pie_test.o, basic_pie_test): New targets.
13485 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13486 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13487 (two_file_pie_test): New target.
13488 * testsuite/Makefile.in: Rebuild.
13489 * README: Remove note saying that -pie is not supported.
13490
c6585162
ILT
134912009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13492
13493 * options.h (class General_options): Add -init and -fini.
13494 * layout.cc (Layout::finish_dynamic_section): Emit
13495 given init and fini functions.
13496
032ce4e9
ST
134972009-10-13 Sriraman Tallam <tmsriram@google.com>
13498
13499 * gc.h (gc_process_relocs): Check if icf is enabled using new
13500 function.
13501 * gold.cc (queue_initial_tasks): Likewise.
13502 (queue_middle_tasks): Likewise.
13503 * object.cc (do_layout): Likewise.
13504 * symtab.cc (is_section_folded): Likewise.
13505 * main.cc (main): Likewise.
13506 * reloc.cc (Read_relocs::run): Likewise.
13507 (Sized_relobj::do_scan_relocs): Likewise.
13508 * icf.cc (is_function_ctor_or_dtor): New function.
13509 (Icf::find_identical_sections): Check if function is ctor or dtor when
13510 safe icf is chosen.
13511 * options.h (General_options::icf): Change option to be an enum.
13512 (Icf_status): New enum.
13513 (icf_enabled): New method.
13514 (icf_safe_folding): New method.
13515 (set_icf_status): New method.
13516 (icf_status_): New variable.
13517 * (options.cc) (General_options::finalize): Set icf_status_.
13518 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13519 icf_test and icf_keep_unique_test to use the --icf enum flag.
13520 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13521 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13522
f345227a
ST
135232009-10-12 Sriraman Tallam <tmsriram@google.com>
13524
13525 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13526 includes to gc.h and icf.h.
13527 * arm.cc: Include gc.h.
13528 * gold.cc: Likewise.
13529 * i386.cc: Likewise.
13530 * powerpc.cc: Likewise.
13531 * sparc.cc: Likewise.
13532 * x86_64.cc: Likewise.
13533 * gc.h: Include icf.h.
13534
1c7814ed
ILT
135352009-10-11 Ian Lance Taylor <iant@google.com>
13536
13537 * plugin.cc: Include "gold.h" before other header files.
13538
ae3b5189
CD
135392009-10-10 Chris Demetriou <cgd@google.com>
13540
13541 * options.h (Input_file_argument::Input_file_type): New enum.
13542 (Input_file_argument::is_lib_): Replace with...
13543 (Input_file_argument::type_): New member.
13544 (Input_file_argument::Input_file_argument): Take Input_file_type
13545 'type' rather than boolean 'is_lib' as second argument.
13546 (Input_file_argument::is_lib): Use type_.
13547 (Input_file_argument::is_searched_file): New function.
13548 (Input_file_argument::may_need_search): Handle is_searched_file.
13549 * options.cc (General_options::parse_library): Support -l:filename.
13550 (General_options::parse_just_symbols): Update for Input_file_argument
13551 changes.
13552 (Command_line::process): Likewise.
13553 * archive.cc (Archive::get_file_and_offset): Likewise.
13554 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13555 * script.cc (read_script_file, script_add_file): Likewise.
13556 * fileread.cc (Input_file::Input_file): Likewise.
13557 (Input_file::will_search_for): Handle is_searched_file.
13558 (Input_file::open): Likewise.
13559 * readsyms.cc (Read_symbols::get_name): Likewise.
13560 * testsuite/Makefile.am (searched_file_test): New test.
13561 * testsuite/Makefile.in: Regenerate.
13562 * testsuite/searched_file_test.cc: New file.
13563 * testsuite/searched_file_test_lib.cc: New file.
13564
f3048a1d
ILT
135652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13566 Ian Lance Taylor <iant@google.com>
13567
13568 * descriptor.cc: Include <cstdio> and "binary-io.h".
13569 (Descriptors::open): Open the files in binary mode always.
13570 * script.cc (Lex::get_token): Treat \r as whitespace.
13571
d4780e57
ILT
135722009-10-09 Ian Lance Taylor <iant@google.com>
13573
13574 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13575
d9a893b8
ILT
135762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13577 Ian Lance Taylor <iant@google.com>
13578
13579 * configure.ac: Check for readv function also.
13580 * fileread.cc (readv): Define if not HAVE_READV.
13581 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13582 does not exist.
13583 * config.in: Regenerate.
13584 * configure: Regenerate.
13585
c0a62865
DK
135862009-10-09 Doug Kwan <dougkwan@google.com>
13587
13588 * layout.cc (Layout::make_output_section): Call target hook to make
13589 ordinary output section.
13590 (Layout::finalize): Adjust parameter list of call the
13591 Target::may_relax().
13592 * layout.h (class Layout::section_list): New method.
13593 * merge.h (Output_merge_base::entsize): Change visibility to public.
13594 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13595 New methods.
13596 (Output_merge_string::do_is_string): New method.
13597 * object.cc (Sized_relobj::do_setup): renamed from
13598 Sized_relobj::set_up.
13599 * object.h (Sized_relobj::adjust_shndx,
13600 Sized_relobj::initializ_input_to_output_maps,
13601 Sized_relobj::free_input_to_output_maps): Change visibilities to
13602 protected.
13603 (Sized_relobj::setup): Virtualize.
13604 (Sized_relobj::do_setup): New method declaration.
13605 (Sized_relobj::invalidate_section_offset,
13606 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13607 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13608 * options.cc (parse_int): New function.
13609 * options.h (parse_int): New declaration.
13610 (DEFINE_int): New macro.
13611 (stub_group_size): New option.
13612 * output.cc (Output_section::Output_section): Initialize memebers
13613 merge_section_map_, merge_section_by_properties_map_,
13614 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13615 (Output_section::add_input_section): Handled deferred code-fill
13616 generation and remove an old comment.
13617 (Output_section::add_relaxed_input_section): New method definition.
13618 (Output_section::add_merge_input_section): Use merge section by
13619 properties map to speed to search. Update merge section maps
13620 as appropriate.
13621 (Output_section::build_relaxation_map): New method definition.
13622 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13623 Same.
13624 (Output_section::relax_input_section): Renamed to
13625 Output_section::convert_input_sections_to_relaxed_sections and change
13626 interface to take a vector of pointers to relaxed sections.
13627 (Output_section::find_merge_section,
13628 Output_section::find_relaxed_input_section): New method definitions.
13629 (Output_section::is_input_address_mapped,
13630 Output_section::output_offset, Output_section::output_address):
13631 Use output section data maps to speed up searching.
13632 (Output_section::find_starting_output_address): Add comments.
13633 (Output_section::do_write,
13634 Output_section::write_to_postprocessing_buffer): Do code-fill
13635 generation as appropriate.
13636 (Output_section::get_input_sections): Invalidate relaxed input section
13637 map.
13638 (Output_section::restore_states): Adjust type of checkpoint .
13639 Invalidate relaxed input section map.
13640 * output.h (Output_merge_base): New class declaration.
13641 (Input_section_specifier): New class defintion.
13642 (class Output_relaxed_input_section) Change base class to
13643 Output_section_data_build.
13644 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13645 base class initializer.
13646 (Output_section::add_relaxed_input_section): New method declaration.
13647 (Output_section::Input_section): Change visibility to protected.
2e702c99 13648 (Output_section::Input_section::relobj,
c0a62865
DK
13649 Output_section::Input_section::shndx): Handle relaxed input sections.
13650 Output_section::input_sections) Change visibility to protected. Also
13651 define overload to return a non-const pointer.
13652 (Output_section::Merge_section_properties): New class defintion.
13653 (Output_section::Merge_section_by_properties_map,
13654 Output_section::Output_section_data_by_input_section_map,
13655 Output_section::Relaxation_map): New types.
13656 (Output_section::relax_input_section): Rename method to
13657 Output_section::convert_input_sections_to_relaxed_sections and change
13658 interface to take a vector of relaxed section pointers.
13659 (Output_section::find_merge_section,
13660 Output_section::find_relaxed_input_section,
13661 Output_section::build_relaxation_map,
13662 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13663 New method declarations.
13664 (Output_section::merge_section_map_
13665 Output_section::merge_section_by_properties_map_,
13666 Output_section::relaxed_input_section_map_,
13667 Output_section::is_relaxed_input_section_map_valid_,
13668 Output_section::generate_code_fills_at_write_): New data members.
13669 * script-sections.cc
13670 (Output_section_element_input::set_section_addresses): Call
13671 current_data_size and addralign methods of relaxed input sections.
13672 (Orphan_output_section::set_section_addresses): Call current_data_size
13673 and addralign methods of relaxed input sections.
13674 * symtab.cc (Symbol_table::compute_final_value): Extract template
13675 from the body of Symbol_table::sized_finalize_symbol.
13676 (Symbol_table::sized_finalized_symbol): Call
13677 Symbol_table::compute_final_value.
13678 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13679 (Symbol_table::compute_final_value): New templated method declaration.
13680 * target.cc (Target::do_make_output_section): New method defintion.
13681 * target.h (Target::make_output_section): New method declaration.
13682 (Target::relax): Add more parameters for input objects, symbol table
13683 and layout. Adjust call to do_relax.
13684 (Target::do_make_output_section): New method declaration.
13685 (Target::do_relax): Add parameters for input objects, symbol table
13686 and layout.
13687
d446d6c4
ILT
136882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13689
13690 * pread.c: Include stdio.h.
13691
bc06c745
ILT
136922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13693
13694 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13695 defined.
13696
75aea3d0
ILT
136972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13698
13699 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13700 Change read_shndx type to unsigned int.
13701 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13702 int.
13703 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13704 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13705 Change read_shndx type to unsigned int.
13706 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13707 int.
13708 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13709 * layout.cc (Layout::create_symtab_sections): Cast the result of
13710 local_symcount * symsize to off_t in the gold_assert.
13711
be8fcb75
ILT
137122009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13713
13714 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13715 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13716 R_ARM_BASE_ABS.
13717 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13718 (Arm_relocate_functions::thm_abs5): New function.
13719 (Arm_relocate_functions::abs12): New function.
13720 (Arm_relocate_functions::abs16): New function.
13721 (Arm_relocate_functions::base_abs): New function.
13722 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13723 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13724 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13725 R_ARM_BASE_ABS.
13726 (Scan::global): Likewise.
13727 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13728 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13729 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13730 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13731 R_ARM_BASE_ABS.
13732
c2a122b6
ILT
137332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13734
13735 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13736 (Arm_relocate_functions::movt_prel): New function.
13737 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13738 (Arm_relocate_functions::thm_movt_prel): New function.
13739 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13740 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13741 (Scan::global, Relocate::relocate): Likewise.
13742 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13743
c4aa1e2d
ILT
137442009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13745
13746 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13747 Incremental_checker.
13748 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13749 unsigned int.
13750 (class Incremental_inputs_header): New class.
13751 (Incremental_inputs_header_writer): Edit comment.
13752 (Incremental_inputs_entry): New class.
13753 (Incremental_inputs_entry_writer): Edit comment.
13754 (Sized_incremental_binary::do_find_incremental_inputs_section):
13755 Add *strtab_shndx parameter, fill it.
13756 (Sized_incremental_binary::do_check_inputs): New method.
13757 (Incremental_checker::can_incrementally_link_output_file): Use
13758 Sized_incremental_binary::check_inputs.
13759 (Incremental_inputs::report_command_line): Save command line in
13760 command_line_.
13761 * incremental.h:
13762 (Incremental_binary::find_incremental_inputs_section): New
13763 method.
13764 (Incremental_binary::do_find_incremental_inputs_section): Add
13765 strtab_shndx parameter.
13766 (Incremental_binary::do_check_inputs): New pure virtual method.
13767 (Sized_incremental_binary::do_check_inputs): Declare.
13768 (Incremental_checker::Incremental_checker): Add incremental_inputs
13769 parameter, use it to initialize incremental_inputs_.
13770 (Incremental_checker::incremental_inputs_): New field.
13771 (Incremental_checker::command_line): New method.
13772 (Incremental_checker::inputs): New method.
13773 (Incremental_checker::command_line_): New field.
13774
c549a694
ILT
137752009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13776
13777 * incremental.cc: Include <cstdarg> and "target-select.h".
13778 (vexplain_no_incremental): New function.
13779 (explain_no_incremental): New function.
13780 (Incremental_binary::error): New method.
13781 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13782 method.
13783 (make_sized_incremental_binary): New function.
13784 (open_incremental_binary): New function.
13785 (can_incrementally_link_file): Add checks if output is ELF and has
13786 inputs section.
13787 * incremental.h: Include "elfcpp_file.h" and "output.h".
13788 (Incremental_binary): New class.
13789 (Sized_incremental_binary): New class.
13790 (open_incremental_binary): Declare.
13791 * object.cc (is_elf_object): Use
13792 elfcpp::Elf_recognizer::is_elf_file.
13793 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13794 * output.h (Output_file::filesize): New method.
13795
fd3c5f0b
ILT
137962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13797
13798 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13799 New function.
13800 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13801 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13802 function.
13803 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13804 function.
13805 (Arm_relocate_functions::movw_abs_nc): New function.
13806 (Arm_relocate_functions::movt_abs): New function.
13807 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13808 (Arm_relocate_functions::thm_movt_abs): New function.
13809 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13810 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13811 (Scan::global): Likewise.
13812 (Relocate::relocate): Likewise.
13813 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13814
7f5309a5
ILT
138152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13816
13817 * arm.cc (Arm_relocate_functions::got_prel) New function.
13818 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13819 (Relocate::relocate): Likewise.
13820 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13821
364c7fa5
ILT
138222009-10-06 Ian Lance Taylor <iant@google.com>
13823
13824 * options.h (class General_options): Define
13825 split_stack_adjust_size parameter.
13826 * object.h (class Object): Add uses_split_stack_ and
13827 has_no_split_stack_ fields. Add uses_split_stack and
13828 has_no_split_stack accessor functions. Declare
13829 handle_split_stack_section.
13830 (class Reloc_symbol_changes): Define.
13831 (class Sized_relobj): Define Function_offsets. Declare
13832 split_stack_adjust, split_stack_adjust_reltype, and
13833 find_functions.
13834 * object.cc (Object::handle_split_stack_section): New function.
13835 (Sized_relobj::do_layout): Call handle_split_stack_section.
13836 * dynobj.cc (Sized_dynobj::do_layout): Call
13837 handle_split_stack_section.
13838 * reloc.cc (Sized_relobj::relocate_sections): Call
13839 split_stack_adjust for executable sections in split_stack
13840 objects. Pass reloc_map to relocate_section.
13841 (Sized_relobj::split_stack_adjust): New function.
13842 (Sized_relobj::split_stack_adjust_reltype): New function.
13843 (Sized_relobj::find_functions): New function.
13844 * target-reloc.h: Include "object.h".
13845 (relocate_section): Add reloc_symbol_changes parameter. Change
13846 all callers.
13847 * target.h (class Target): Add calls_non_split method. Declare
13848 do_calls_non_split virtual method. Declare match_view and
13849 set_view_to_nop.
13850 * target.cc: Include "elfcpp.h".
13851 (Target::do_calls_non_split): New function.
13852 (Target::match_view): New function.
13853 (Target::set_view_to_nop): New function.
13854 * gold.cc (queue_middle_tasks): Give an error if mixing
13855 split-stack and non-split-stack objects with -r.
13856 * i386.cc (Target_i386::relocate_section): Add
13857 reloc_symbol_changes parameter.
13858 (Target_i386::do_calls_non_split): New function.
13859 * x86_64.cc (Target_x86_64::relocate_section): Add
13860 reloc_symbol_changes parameter.
13861 (Target_x86_64::do_calls_non_split): New function.
13862 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13863 parameter.
13864 * powerpc.cc (Target_powerpc::relocate_section): Add
13865 reloc_symbol_changes parameter.
13866 * sparc.cc (Target_sparc::relocate_section): Add
13867 reloc_symbol_changes parameter.
13868 * configure.ac: Call AM_CONDITIONAL for the default target.
13869 * configure: Rebuild.
13870 * testsuite/Makefile.am (TEST_AS): New variable.
13871 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13872 (check_DATA): Add split_i386 and split_x86_64 files.
13873 (SPLIT_DEFSYMS): Define.
13874 (split_i386_[1234n].o): New targets.
13875 (split_i386_[124]): New targets.
13876 (split_i386_[1234r].stdout): New targets.
13877 (split_x86_64_[1234n].o): New targets.
13878 (split_x86_64_[124]): New targets.
13879 (split_x86_64_[1234r].stdout): New targets.
13880 (MOSTLYCLEANFILES): Add new executables.
13881 * testsuite/split_i386.sh: New file.
13882 * testsuite/split_x86_64.sh: New file.
13883 * testsuite/split_i386_1.s: New file.
13884 * testsuite/split_i386_2.s: New file.
13885 * testsuite/split_i386_3.s: New file.
13886 * testsuite/split_i386_4.s: New file.
13887 * testsuite/split_i386_n.s: New file.
13888 * testsuite/split_x86_64_1.s: New file.
13889 * testsuite/split_x86_64_2.s: New file.
13890 * testsuite/split_x86_64_3.s: New file.
13891 * testsuite/split_x86_64_4.s: New file.
13892 * testsuite/split_x86_64_n.s: New file.
13893 * testsuite/testfile.cc (Target_test): Update relocation_section
13894 function.
13895 * testsuite/Makefile.in: Rebuild.
13896
e8a9fcda
ILT
138972009-10-06 Ian Lance Taylor <iant@google.com>
13898
13899 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13900 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13901 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13902 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13903 the address on ldo_addrs_.
13904 (Target_i386::Relocate::fix_up_ldo): New function.
13905
e99daf92
ILT
139062009-10-06 Rafael Espindola <espindola@google.com>
13907
13908 * plugin.cc (add_input_library): New.
13909 (Plugin::load): Add add_input_library to tv.
13910 (Plugin_manager::add_input_file): Add the is_lib argument.
13911 (add_input_file): Update call to Plugin_manager::add_input_file.
13912 (add_input_library): New.
13913 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13914
966d4097
DK
139152009-09-30 Doug Kwan <dougkwan@google.com>
13916
13917 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13918 symbol and call Symbol::may_need_copy_reloc to determine if
13919 a copy reloc is needed.
13920 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13921 nocopyreloc is given in command line.
13922 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13923 given in command line.
13924 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13925 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13926 of the removed Target_i386::may_need_copy_reloc.
13927 * options.h (copyreloc): New option with default value false.
13928 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13929 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13930 instead of the removed Target_powerpc::may_need_copy_reloc.
13931 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13932 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13933 instead of the removed Target_sparc::may_need_copy_reloc.
13934 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13935 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13936 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13937 instead of the removed Target_x86_64::may_need_copy_reloc.
13938
029ba973
ILT
139392009-09-30 Ian Lance Taylor <iant@google.com>
13940
13941 * object.h (class Object): Remove target_ field, and target,
13942 sized_target, and set_target methods.
13943 (Object::sized_target): Remove.
13944 (class Sized_relobj): Update declarations. Remove sized_target.
13945 * object.cc (Sized_relobj::setup): Remove target parameter.
13946 Change all callers.
13947 (Input_objects::add_object): Don't do anything with the target.
13948 (make_elf_sized_object): Add punconfigured parameter. Change all
13949 callers. Set or test parameter target.
13950 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13951 Change all callers.
13952 * parameters.cc (Parameters::set_target): Change parameter type to
13953 be non-const.
13954 (Parameters::default_target): Remove.
13955 (set_parameters_target): Change parameter type to be non-const.
13956 (parameters_force_valid_target): New function.
13957 (parameters_clear_target): New function.
13958 * parameters.h (class Parameters): Update declarations. Remove
13959 default_target method. Add sized_target and clear_target
13960 methods. Change target_ to be non-const.
13961 (set_parameters_target): Update declaration.
13962 (parameters_force_valid_target): Declare.
13963 (parameters_clear_target): Declare.
13964 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13965 as NULL if we aren't searching.
13966 (Add_symbols::run): Don't check for compatible target.
13967 * fileread.cc (Input_file::open_binary): Call
13968 parameters_force_valid_target.
13969 * gold.cc (queue_middle_tasks): Likewise.
13970 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13971 set_target on object.
13972 * dynobj.h (class Sized_dynobj): Update declarations.
13973 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13974 make_elf_object returns NULL.
13975 (Archive::include_member): Don't check whether object target is
13976 compatible.
13977 * output.cc (Output_section::add_input_section): Get target from
13978 parameters.
13979 (Output_section::relax_input_section): Likewise.
13980 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13981 parameters.
13982 (Sized_relobj::do_scan_relocs): Likewise.
13983 (Sized_relobj::relocate_sections): Likewise.
13984 * resolve.cc (Symbol_table::resolve): Likewise.
13985 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13986 parameter. Change all callers.
13987 (Symbol_table::add_from_object): Get target from parameters.
13988 (Symbol_table::add_from_relobj): Don't check object target.
13989 (Symbol_table::add_from_dynobj): Likewise.
13990 (Symbol_table::define_special_symbol): Get target from
13991 parameters.
13992 * symtab.h (class Symbol_table): Update declaration.
13993 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13994 parameter. Change all callers. Clear parameter target.
13995 (Binary_test): Test target here.
13996 * testsuite/object_unittest.cc (gold_testsuite): Remove
13997 target_test_pointer parameter. Change all callers.
13998 (Object_test): Test target here.
13999
a6a22b83
ILT
140002009-09-26 Ian Lance Taylor <iant@google.com>
14001
14002 * testsuite/initpri1.c: Don't try to use constructor priorities if
14003 compiling with gcc before 4.3.
14004
6a8f49fe
ILT
140052009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14006
14007 * testsuite/retain_symbols_file_test.sh (check_present): Change
14008 output file name to retain_symbols_file_test.stdout.
14009 (check_absent): Likewise.
14010
8c604651
CS
140112009-09-18 Craig Silverstein <csilvers@google.com>
14012
14013 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14014 * options.cc: Include <cerrno> and <fstream>.
14015 (General_options::finalize): Parse -retain-symbols-file tag.
14016 * options.h: New flag.
14017 (General_options): New method should_retain_symbol, new
14018 variable symbols_to_retain.
14019 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14020 should_retain_symbol map.
14021 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14022 * testsuite/Makefile.in: Regenerate.
14023 * testsuite/retain_symbols_file_test.sh: New file.
14024
ca58b19f
NC
140252009-09-18 Nick Clifton <nickc@redhat.com>
14026
14027 * po/es.po: Updated Spanish translation.
14028
20e6d0d6
DK
140292009-09-17 Doug Kwan <dougkwan@google.com>
14030
14031 * debug.h (DEBUG_RELAXATION): New constant.
14032 (DEBUG_ALL): Add DEBUG_RELAXATION.
14033 (debug_string_to_enum): Add relaxation debug option.
14034 * layout.cc
14035 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14036 Layout::Relaxation_debug_check::read_sections,
14037 Layout::Relaxation_debug_check::read_sections): New method definitions.
14038 (Layout::Layout): Initialize data members
14039 record_output_section_data_from_scrips_,
14040 script_output_section_data_list_ and relaxation_debug_check_.
14041 (Layout::save_segments, Layout::restore_segments,
14042 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14043 Layout::relaxation_loop_body): New method definitions.
14044 (Layout::finalize): Support relaxation. Move section layout code to
14045 Layout::relaxation_loop_body.
14046 (Layout::set_asection_address_from_script): Move code for orphan
14047 section placement out.
14048 (Layout::place_orphan_sections_in_script): New method definition.
14049 * layout.h (Output_segment_headers, Output_file_header):
14050 New forward class declarations.
14051 (Layout::~Layout): Define.
14052 (Layout::new_output_section_data_from_script): New method definition.
14053 (Layout::place_orphan_sections_in_script): New method declaration.
14054 (Layout::Segment_states): New type declaration.
14055 (Layout::save_segments, Layout::restore_segments,
14056 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14057 Layout::relaxation_loop_body): New method declarations.
14058 (Layout::Output_section_data_list): New type declaration.
14059 (Layout::Relaxation_debug_check): New class definition.
14060 (Layout::record_output_section_data_from_script_,
14061 Layout::script_output_section_data_list_, Layout::segment_states_,
14062 Layout::relaxation_debug_check_): New data members.
14063 * output.cc: (Output_section_headers::do_size): New method definition.
14064 (Output_section_headers::Output_section_headers): Move size
14065 computation to Output_section_headers::do_size.
14066 (Output_segment_headers::do_size): New method definition.
e1df38aa 14067 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14068 Output_file_header::do_size and call it.
14069 (Output_file_header::do_size): New method definition.
14070 (Output_data_group::Output_data_group): Adjust call to
14071 Output_section_data.
14072 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14073 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14074 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14075 RELAXED_INPUT_SECTION_CODE.
14076 (Output_section::Output_section): Initialize data member checkpoint_.
14077 (Output_section::~Output_section): Delete checkpoint object pointed
14078 by checkpoint_.
14079 (Output_section::add_input_section): Always add an Input_section if
14080 relaxing.
14081 (Output_section::add_merge_input_section): Add assert.
14082 (Output_section::relax_input_section): New method definition.
14083 (Output_section::set_final_data_size): Set load address to zero for
14084 an unallocated section.
14085 (Output_section::do_address_and_file_offset_have_reset_values):
14086 New method definition.
14087 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14088 Handle relaxed input section.
14089 (Output_section::sort_attached_input_sections): Checkpoint input
14090 section list lazily.
14091 (Output_section::get_input_sections): Change type of input_sections to
14092 list of Simple_input_section pointers. Checkpoint input section list
14093 lazily. Also handle relaxed input sections.
14094 (Output_section::add_input_section_for_script): Take a reference to
14095 a Simple_input_section object instead of Relobj pointer and section
14096 index as parameter. Handle relaxed input sections.
14097 (Output_section::save_states, Output_section::restore_states): New
14098 method definitions.
14099 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14100 (Output_data::is_data_size_fixed): New method definition.
14101 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14102 if it is fixed.
14103 (Output_data::address_and_file_offset_have_reset_values): New method
14104 definition.
14105 (Output_data::do_address_and_file_offset_have_reset_values): New method
14106 definition.
14107 (Output_data::set_data_size): Check that data size is not fixed.
14108 (Output_data::fix_data_size): New method definition.
14109 (Output_data::is_data_size_fixed_): New data member.
14110 (Output_section_headers::set_final_data_size): New method definition.
14111 (Output_section_headers::do_size): New method declaration.
14112 (Output_segment_headers::set_final_data_size): New method definition.
14113 (Output_segment_headers::do_size): New method declaration.
14114 (Output_file_header::set_final_data_size)::New method definition.
14115 (Output_file_header::do_size)::New method declaration.
14116 (Output_section_data::Output_section_data): Add new parameter
14117 is_data_size_fixed and use it to fix data size.
14118 (Output_data_const::Output_data_const): Adjust call to base class
14119 constructor and fix data size.
14120 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14121 base class constructor and fix data size.
14122 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14123 base class constructor and fix data size.
14124 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14125 class constructor and fix data size.
14126 (Output_data_group::set_final_data_size): New method definition.
14127 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14128 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14129 class constructor and fix data size.
14130 (Output_relaxed_input_section): New class definition.
14131 (Output_section::Simple_input_section): New class definition.
14132 (Output_section::get_input_sections): Adjust parameter list.
14133 (Output_section::add_input_section_for_script): Same.
14134 (Output_section::save_states, Output_section::restore_states,
14135 Output_section::do_address_and_file_offset_have_reset_values,
14136 (Output_section::Input_section::Input_section): Handle
14137 RELAXED_INPUT_SECTION_CODE. Add new overload for
14138 Output_relaxed_input_section.
14139 (Output_section::Input_section::is_input_section,
14140 Output_section::Input_section::set_output_section): Handle relaxed
14141 input section.
14142 (Output_section::Input_section::is_relaxed_input_section,
14143 Output_section::Input_section::output_section_data,
14144 Output_section::Input_section::relaxed_input_section): New method
14145 definitions.
14146 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14147 value.
14148 (Output_section::Input_section::u1_): Update comments.
14149 (Output_section::Input_section::u2_): Add new union member poris.
14150 (Output_section::Checkpoint_output_section): New classs definition.
14151 (Output_section::relax_input_section): New method declaration.
14152 (Output_section::checkpoint_): New data member.
14153 (Output_segment): Update comments.
14154 (Output_segment::Output_segment): Un-privatize copy constructor.
14155 (Output_segment::operator=): Un-privatize.
14156 * script-sections.cc (Output_section_element::Input_section_list):
14157 Change element type to Output_section::Simple_input_section.
14158 (Output_section_element_dot_assignment::set_section_addresses):
14159 Register output section data for relaxation clean up.
14160 (Output_data_exression::Output_data_expression): Adjust call to base
14161 constructor to fix data size.
14162 (Output_section_element_data::set_section_addresses): Register
14163 Output_data_expression object for relaxation clean up.
14164 (struct Input_section_info): Replace Relobj pointer and section index
14165 pair with Output_section::Simple_input_section and Convert struct to a
14166 class.
14167 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14168 Input_section_info data member to use accessors.
20e6d0d6
DK
14169 (Output_section_element_input::set_section_addresses): Use layout
14170 parameter. Adjust code to use Output_section::Simple_input_section
14171 and Input_secction_info classes. Register filler for relaxation
14172 clean up.
14173 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14174 and section index pair with Output_section::Simple_input_section
14175 class. Adjust code accordingly.
14176 (Phdrs_element::release_segment): New method definition.
14177 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14178 segment list.
14179 (Script_sections::release_segments): New method definition.
14180 * gold/script-sections.h (Script_sections::release_segments): New
14181 method declaration.
14182 * gold/target.h (Target::may_relax, Target::relax,
14183 Target::do_may_relax, Target::do_relax): New method definitions.
14184
5e445df6
ILT
141852009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14186
14187 * arm.cc (has_signed_unsigned_overflow): New function.
14188 (Arm_relocate_functions::abs8): New function.
14189 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14190 (Target_arm::Scan::global): Likewise.
14191 (Target_arm::relocate::relocate): Likewise.
14192 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14193 Likewise.
14194
8c604651 141952009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14196
14197 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14198 * testsuite/Makefile.in: Regenerate.
14199
1e9cc1c2
NC
142002009-09-11 Nick Clifton <nickc@redhat.com>
14201
14202 * po/gold.pot: Updated by the Translation project.
14203
6a89f575
CC
142042009-09-08 Cary Coutant <ccoutant@google.com>
14205
14206 * output.cc (Output_file::open): Add execute permission to empty file.
14207 * testsuite/Makefile.am (permission_test): New test.
14208 * testsuite/Makefile.in: Regenerate.
14209
fdcac5af
ILT
142102009-09-02 Ian Lance Taylor <iant@google.com>
14211
14212 * output.cc (Output_file::resize): Call map_no_anonymous rather
14213 than map.
14214
44453f85
ILT
142152009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14216
14217 * gold.cc: Include "incremental.h".
14218 (queue_initial_tasks): Call Incremental_checker methods.
14219 * incremental.cc: Include "output.h".
14220 (Incremental_checker::can_incrementally_link_output_file): New
14221 method.
14222 * incremental.h (Incremental_checker): New class.
14223
14224 * output.cc (Output_file::open_for_modification): New method.
14225 (Output_file::map_anonymous): Changed return type to bool. Record
14226 map in base_ field.
14227 (Output_file::map_no_anonymous): New method, broken out of map.
14228 (Output_file::map): Use map_no_anonymous and map_anonymous.
14229 * output.h (class Output_file): Update declarations.
14230
293c1386
CC
142312009-08-24 Cary Coutant <ccoutant@google.com>
14232
14233 * options.h (Command_line::Pre_options): New class.
14234 (Command_line::pre_options): New member.
14235 * options.cc (gold::options::ready_to_register): New variable.
14236 (One_option::register_option): Do nothing if not registering options.
14237 Assert if same short option registered twice.
14238 (General_options::General_options): Turn off option registration when
14239 done constructing.
14240 (Command_line::Pre_options::Pre_options): New constructor.
14241
f773f3d2
CC
142422009-08-24 Cary Coutant <ccoutant@google.com>
14243
06a73cfe
CC
14244 * options.h (General_options::no_keep_memory): Remove incorrect
14245 short option.
f773f3d2 14246
a15af8e2
RW
142472009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14248
14249 * Makefile.am (am__skiplex, am__skipyacc): New.
14250 * Makefile.in: Regenerate.
14251
c462b41b
RW
142522009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14253
14ec8efd
RW
14254 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14255 (INCLUDES): ... this.
14256 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14257 (AM_CPPFLAGS): Renamed from ...
14258 (INCLUDE): ... this.
14259 * Makefile.in, testsuite/Makefile.in: Regenerate.
14260
81ecdfbb
RW
14261 * Makefile.in: Regenerate.
14262 * aclocal.m4: Likewise.
14263 * config.in: Likewise.
14264 * configure: Likewise.
14265 * testsuite/Makefile.in: Likewise.
14266
c462b41b
RW
14267 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14268 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14269 * Makefile.in: Regenerate.
14270 * testsuite/Makefile.in: Regenerate.
14271
2da73f13
CC
142722009-08-19 Cary Coutant <ccoutant@google.com>
14273
14274 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14275 symbols in shared libraries overridden by hidden or internal symbols
14276 in the main program.
14277
2db70501
CD
142782009-08-19 Chris Demetriou <cgd@google.com>
14279
14280 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14281 checking source file names in error messages.
14282
f733487b
DK
142832009-08-18 Doug Kwan <dougkwan@google.com>
14284
14285 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14286 an elcpp::Ehdr as parameter. Adjust call to set_target.
14287 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14288 an elfcpp::Ehdr as parameter.
14289 * object.cc (Object::set_target): Remove the version that looks up
14290 a target and sets it.
14291 (Sized_relobj::setup): Take a Target object instead of
14292 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14293 (make_elf_sized_object): Find target and ask target to
14294 make an ELF object.
14295 * object.h: (Object::set_target): Remove the version that looks up
14296 a target and sets it.
14297 (Sized_relobj::setup): Take a Target object instead of
14298 an elfcpp:Ehdr as parameter.
14299 * target.cc: Include dynobj.h.
14300 (Target::do_make_elf_object_implementation): New.
2e702c99 14301 (Target::do_make_elf_object): New.
f733487b
DK
14302 * target.h (Target::make_elf_object): New template declaration.
14303 (Target::do_make_elf_object): New method declarations.
14304 (Target::do_make_elf_object_implementation): New template declaration.
14305
cc70f101
ILT
143062009-08-14 Ian Lance Taylor <iant@google.com>
14307
14308 * gold.h (FUNCTION_NAME): Define.
14309 (gold_unreachable): Use FUNCTION_NAME.
14310
ef5e0cb1
ST
143112009-08-12 Sriraman Tallam <tmsriram@google.com>
14312
14313 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14314 symbol in the --keep-unique list is not found.
14315
48c187ce
ST
143162009-08-12 Sriraman Tallam <tmsriram@google.com>
14317
14318 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14319 been maked as --keep-unique.
14320 (Icf::unfold_section): New function.
14321 * icf.h (Icf::unfold_section): New function.
14322 * options.h (General_options::keep_unique): New option.
14323 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14324 * testsuite/Makefile.in: Regenerate.
14325 * testsuite/icf_keep_unique_test.sh: New file.
14326 * testsuite/icf_keep_unique_test.cc: New file.
14327
645afe0c
CC
143282009-08-12 Cary Coutant <ccoutant@google.com>
14329
14330 PR 10471
14331 * resolve.cc (Symbol_table::resolve): Check for references from
14332 dynamic objects to hidden and internal symbols.
14333 * testsuite/Makefile.am (hidden_test.sh): New test.
14334 * testsuite/Makefile.in: Regenerate.
14335 * testsuite/hidden_test.sh: New script.
14336 * testsuite/hidden_test_1.c: New test source.
14337 * testsuite/hidden_test_main.c: New test source.
14338
11af873f
DK
143392009-08-11 Doug Kwan <dougkwan@google.com>
14340
14341 * arm.cc: Update comments.
14342 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14343 segment to locate the .ARM.exidx section if present.
14344
b9f7d72d
DK
143452009-08-09 Doug Kwan <dougkwan@google.com>
14346
14347 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14348 patch.
14349
ddd3c53c
ST
143502009-08-07 Sriraman Tallam <tmsriram@google.com>
14351 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14352 compiler warnings.
14353
27721062
ST
143542009-08-06 Sriraman Tallam <tmsriram@google.com>
14355
14356 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14357 valid tls_segment only for non-debug-section relocations.
14358 * testsuite/Makefile.am: Add gc_tls_test.
14359 * testsuite/Makefile.in: Regenerate.
14360 * testsuite/gc_tls_test.cc: New file.
14361 * testsuite/gc_tls_test.sh: New file.
14362
ef15dade 143632009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14364
ef15dade
ST
14365 * icf.cc: New file.
14366 * icf.h: New file.
14367 * Makefile.am (CCFILES): Add icf.cc.
14368 (HFILES): Add icf.h
14369 * Makefile.in: Regenerate.
14370 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14371 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14372 section, symbol and addend information for the relocs.
14373 * gold.cc (queue_middle_tasks): Call identical code folding.
14374 * gold.h: Add defines for multimap.
14375 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14376 to the call of finalize_local_symbols.
14377 * main.cc (main): Create object of class Icf.
14378 * object.cc (Sized_relobj::do_layout): Allow this function to be
14379 called twice during icf.
14380 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14381 to sections marked as identical by icf.
14382 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14383 when available.
14384 (Sized_relobj::do_section_entsize): New function.
14385 * object.h (Object::section_entsize): New function.
14386 (Object::do_section_entsize): New pure virtual function.
14387 (Relobj::finalize_local_symbols): Add new parameter.
14388 (Relobj::do_section_entsize): New function.
14389 * options.h (General_options::icf): New option.
14390 (General_options::icf_iterations): New option.
14391 (General_options::print_icf_sections): New option.
14392 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14393 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14394 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14395 icf.
14396 * symtab.cc (Symbol_table::is_section_folded): New function.
14397 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14398 to sections marked as identical by icf.
14399 * symtab.h (Symbol_table::set_icf): New function.
14400 (Symbol_table::icf): New function.
14401 (Symbol_table::is_section_folded): New function.
14402 (Symbol_table::icf_): New data member.
14403 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14404 * testsuite/Makefile.am: Add commands to build icf_test.
14405 * testsuite/Makefile.in: Regenerate.
14406 * testsuite/icf_test.sh: New file.
14407 * testsuite/icf_test.cc: New file.
14408
c3b65ac4
CD
144092009-07-24 Chris Demetriou <cgd@google.com>
14410
14411 * layout.cc (is_compressible_debug_section): Fix incorrect
14412 comment about compressed section names.
14413
1caf2c51
ILT
144142009-07-20 Ian Lance Taylor <ian@airs.com>
14415
14416 PR 10419
14417 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14418
1ef4d87f
ILT
144192009-07-16 Ian Lance Taylor <iant@google.com>
14420
14421 PR 10400
14422 * layout.h: #include <map>.
14423 (class Kept_section): Change from struct to class. Add accessors
14424 and setters. Add section size to Comdat_group mapping. Change
14425 Comdat_group to std::map. Add is_comdat_ field. Add
14426 linkonce_size field in union.
14427 (class Layout): Update declaration of find_or_add_kept_section.
14428 Don't declare find_kept_object.
14429 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14430 parameter. Add object, shndx, is_comdat, and is_group_name
14431 parameters. Change all callers. Adjust for new Kept_section.
14432 (Layout::find_kept_object): Remove.
14433 * object.cc (Sized_relobj::include_section_group): Update use of
14434 Kept_section. Rename secnum to shndx. Only record
14435 Kept_comdat_section if sections are the same size.
14436 (Sized_relobj::include_linkonce_section): Update use of
14437 Kept_section. Only record Kept_comdat_section if sections are the
14438 same size. Set size of linkonce section.
14439 (Sized_relobj::map_to_kept_section): Update call to
14440 get_kept_comdat_section.
14441 * object.h (class Sized_relobj): Rename fields in
14442 Kept_comdat_section to drop trailing underscores; change object
14443 field to Relobj*. Change Kept_comdat_section_table to store
14444 struct rather than pointer.
14445 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14446 Add kept_object and kept_shndx parameters. Change all callers.
14447 (Sized_relobj::get_kept_comdat_section): Change return type to
14448 bool. Add kept_object and kept_shndx parameters. Change all
14449 callers.
14450 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14451 Layout::find_or_add_kept_section.
14452
37c3b7b0
ILT
144532009-07-09 Ian Lance Taylor <iant@google.com>
14454
14455 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14456 Reserve space in the hash table.
14457
98fa85cb
ILT
144582009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14459
14460 * fileread.cc (File_read::get_mtime): New method.
14461 * fileread.h (Timespec): New structure.
14462 (File_read::get_mtime): New method.
14463 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14464 Renamed from timestamp_nsec.
14465 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14466 Elf_Xword.
e1df38aa 14467 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14468 timestamp_nsec.
e1df38aa 14469 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14470 (Incremental_inputs::report_obejct): Save mtime; style fix.
14471 (Incremental_inputs::report_script): Save mtime; style fix.
14472 (Incremental_inputs::finalize_inputs): Style fix.
14473 (Incremental_inputs::finalize): Style fix.
14474 (Incremental_inputs::create_input_section_data): Store inputs
14475 mtime.
14476 * incremental.h (Incremental_inputs::report_script): Add mtime
14477 argument.
14478 (Incremental_inputs::Input_info::Input_info): Intialize only one
14479 union member.
14480 (Incremental_inputs::Input_info::archive): Move to nameless
14481 union.
14482 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14483 (Incremental_inputs::Input_info::script): Move to nameless union.
14484 (Incremental_inputs::mtime): New field.
14485 * script.cc (read_input_script): Pass file mtime to
14486 Incremental_input.
14487 * script.h (Script_info::inputs): Style fix.
14488
c9d70757
ILT
144892009-07-01 Ian Lance Taylor <ian@airs.com>
14490
14491 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14492 instead of 32.
14493
9c547ec3
ILT
144942009-06-24 Ian Lance Taylor <iant@google.com>
14495
14496 PR 10156
14497 * layout.cc (Layout::choose_output_section): If we find an
14498 existing section, update the flags.
14499 (Layout::create_notes): New function, broken out of
14500 Layout::finalize.
14501 (Layout::finalize): Don't create note sections.
14502 (Layout::create_note): Don't crash if linker script discards
14503 section.
14504 (Layout::create_gold_note): Likewise.
14505 (Layout::create_build_id): Likewise. Don't set
14506 after_input_sections on the section.
14507 (Layout::create_executable_stack_info): Remove target parameter.
14508 Change caller.
14509 * layout.h (class Layout): Declare create_notes. Update
14510 declaration of create_executable_stack_info.
14511 * gold.cc (queue_middle_tasks): Call create_notes.
14512 * output.cc (Output_section::update_flags_for_input_section): Move
14513 here from output.h. If SHF_ALLOC flag is newly set, mark address
14514 invalid.
14515 * output.h (Output_data::mark_address_invalid): New function.
14516 (class Output_section): Only declare, not define,
14517 update_flags_for_input_section. Remove set_flags.
14518
55458500
ILT
145192009-06-24 Ian Lance Taylor <iant@google.com>
14520
14521 * script-sections.cc (Output_section_definition::
14522 set_section_addresses): Rename shadowing local load_address to
14523 laddr.
14524
1307d6cd
ILT
145252009-06-24 Ian Lance Taylor <iant@google.com>
14526
14527 PR 10244
14528 * reloc.cc (relocate_sections): Skip empty relocation sections.
14529
ec3f783e
ILT
145302009-06-23 Ian Lance Taylor <iant@google.com>
14531
14532 PR 10156
14533 * layout.cc (Layout::create_note): Use choose_output_section
14534 rather than make_output_section.
14535
459c9f1c
ILT
145362009-06-23 Ian Lance Taylor <iant@google.com>
14537
14538 PR 10237
14539 * options.cc (General_options::parse_V): Set printed_version_.
14540 (General_options::General_options): Initialize printed_version_.
14541 * options.h (class General_options): Add printed_version_ field.
14542 * gold.cc (queue_initial_tasks): If there are no input files,
14543 don't give a fatal error if we printed the version information.
14544 (queue_middle_tasks): If using -r with a shared object, give a
14545 fatal error rather than an ordinary error.
14546
1518dc8f
ILT
145472009-06-23 Ian Lance Taylor <iant@google.com>
14548
14549 PR 10219
14550 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14551 (Layout::make_output_section): Set have_stabstr_section_ if we see
14552 a .stab*str section.
14553 (Layout::finalize): Call link_stabs_sections.
14554 (Layout::link_stabs_sections): New file.
14555 * layout.h (class Layout): Add have_stabstr_section_ field.
14556 Declare link_stabs_sections.
14557
3d857b98
DK
145582009-06-23 Doug Kwan <dougkwan@google.com>
14559
14560 * Makefile.am (libgold_a_LIBADD): New.
14561 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14562 * Makefile.in: Regenerate.
3d857b98
DK
14563 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14564 * configure: Regenerate.
14565 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14566 * fileread.cc: Include sys/state.h
14567 * gold.h: Declare memmem and strndup if found missing.
14568 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14569
0639a6f6
ILT
145702009-06-23 Ian Lance Taylor <iant@google.com>
14571
14572 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14573 * configure: Rebuild.
14574
8d63875c
ILT
145752009-06-23 Ian Lance Taylor <iant@google.com>
14576
14577 PR 10147
14578 * object.cc (Object::section_contents): Don't try to get a view if
14579 the section has length zero.
14580 (Object::handle_gnu_warning_section): If the section is empty, use
14581 the name of the section as the warning.
14582
f7c8a183
ILT
145832009-06-23 Ian Lance Taylor <iant@google.com>
14584
14585 PR 10133
14586 * stringpool.h (class Stringpool_template): Add optimize_ field.
14587 (Stringpool_template::set_optimize): New function.
14588 * stringpool.cc (Stringpool_template::Stringpool_template):
14589 Initialize optimize_ field.
14590 (Stringpool_template::set_string_offsets): Test local optimize
14591 fild rather than parameter.
14592 * layout.cc (Layout::Layout): Call set_optimize on the section
14593 name stringpool.
14594
e6a307ba
ILT
145952009-06-22 Ian Lance Taylor <iant@google.com>
14596
14597 PR 10030
14598 * yyscript.y: Parse TARGET.
14599 * script.cc (script_set_target): New function.
14600 * script-c.h (script_set_target): Declare.
14601 * options.cc (General_options::string_to_object_format): Rename
14602 from string_to_object_format in anonymous namespace. Change
14603 callers.
14604 * options.h (class General_options): Declare
14605 string_to_object_format.
14606
3ee173de
ILT
146072009-06-22 Ian Lance Taylor <iant@google.com>
14608
14609 * script-sections.cc (Script_sections::create_segments): Don't put
14610 program headers in a PT_LOAD segment if -n or -N.
14611
146122009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14613
14614 PR 10141
14615 * options.h (class General_options): Add -z lazy and -z now. Sort
14616 -z options into alphabetical order.
14617 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14618
cd6739a1 146192009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14620
14621 * layout.cc (Layout::make_output_section): Call
14622 Target::new_output_section.
14623 (Layout::attach_allocated_section_to_segment): Put large section
14624 sections in a separate load segment with the large segment flag
14625 set.
14626 (Layout::segment_precedes): Sort large data segments after other
14627 load segments.
14628 (align_file_offset): New static function.
14629 (Layout::set_segment_offsets): Use align_file_offset.
14630 * output.h (class Output_section): Add is_small_section_ and
14631 is_large_section_ fields.
14632 (Output_section::is_small_section): New function.
14633 (Output_section::set_is_small_section): New function.
14634 (Output_section::is_large_section): New function.
14635 (Output_section::set_is_large_section): New function.
14636 (Output_section::is_large_data_section): New function.
14637 (class Output_segment): Add is_large_data_segment_ field.
14638 (Output_segment::is_large_data_segment): New function.
14639 (Output_segment::set_is_large_data_segment): New function.
14640 * output.cc (Output_section::Output_section): Initialize new
14641 fields.
14642 (Output_segment::Output_segment): Likewise.
14643 (Output_segment::add_output_section): Add assertion that large
14644 data sections always go in large data segments. Force small data
14645 sections to the end of the list of data sections. Force small BSS
14646 sections to the start of the list of BSS sections. For large BSS
14647 sections to the end of the list of BSS sections.
14648 * symtab.h (class Symbol): Declare is_common_shndx.
14649 (Symbol::is_defined): Check Symbol::is_common_shndx.
14650 (Symbol::is_common): Likewise.
14651 (class Symbol_table): Define enum Commons_section_type. Update
14652 declarations. Add small_commons_ and large_commons_ fields.
14653 * symtab.cc (Symbol::is_common_shndx): New function.
14654 (Symbol_table::Symbol_table): Initialize new fields.
14655 (Symbol_table::add_from_object): Put small and large common
14656 symbols in the right list.
14657 (Symbol_table::sized_finalized_symbol): Check
14658 Symbol::is_common_shndx.
14659 (Symbol_table::sized_write_globals): Likewise.
14660 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14661 common symbol lists. Don't call do_allocate_commons_list if the
14662 list is empty.
14663 (Symbol_table::do_allocate_commons_list): Remove is_tls
14664 parameter. Add comons_section_type parameter. Change all
14665 callers. Handle small and large common symbols.
14666 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14667 Symbol::is_common_shndx.
14668 * resolve.cc (symbol_to_bits): Likewise.
14669 * target.h (Target::small_common_shndx): New function.
14670 (Target::small_common_section_flags): New function.
14671 (Target::large_common_shndx): New function.
14672 (Target::large_common_section_flags): New function.
14673 (Target::new_output_section): New function.
14674 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14675 small_common_section_flags, and large_common_section_flags
14676 fields.
14677 (Target::do_new_output_section): New virtual function.
14678 * arm.cc (Target_arm::arm_info): Initialize new fields.
14679 * i386.cc (Target_i386::i386_info): Likewise.
14680 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14681 Likewise.
14682 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14683 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14684 (Target_x86_64::do_new_output_section): New function.
14685 * configure.ac: Define conditional MCMODEL_MEDIUM.
14686 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14687 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14688 (large_LDFLAGS): Define.
14689 * testsuite/large.c: New file.
14690 * testsuite/testfile.cc (Target_test::test_target_info):
14691 Initialize new fields.
14692 * configure, testsuite/Makefile.in: Rebuild.
14693
bb04269c
DK
146942009-06-05 Doug Kwan <dougkwan@google.com>
14695
14696 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14697 * Makefile.in: Regenerate.
bb04269c
DK
14698 * i386.cc (class Target_i386): Define new virtual method to
14699 override do_is_local_label_name in parent.
14700 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14701 local symbols if --discard-locals or -X is given.
14702 * options.h (class General_options): Declare new options
14703 '--discard-locals' and '-X' for discarding locals.
14704 * target.h (class Target): Define new methods is_local_label_name.
14705 Declare new virtual method do_is_local_label_name.
14706 * target.cc: New file.
14707 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14708 (check_SCRIPTS): Add discard_locals_test.sh.
14709 (check_DATA): Add discard_local_tests.syms.
14710 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14711 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14712 * testsuite/Makefile.in: Regenerate.
14713 * testsuite/discard_locals_test.c: New file.
14714 * testsuite/discard_locals_test.sh: Same.
14715
805bb01c
DK
147162009-06-05 Doug Kwan <dougkwan@google.com>
14717
14718 * object.cc (Sized_relobj::Sized_relobj): Initialize
14719 discarded_eh_frame_shndx_ to -1U.
14720 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14721 section.
14722 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14723 a discarded .eh_frame section.
14724 (Sized_relobj::do_finalize_local_symbols): Ditto.
14725 * object.h (class Sized_relobj): Declare new member
14726 discarded_eh_frame_shndx_.
14727 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14728 (local_labels_test.o, local_labels_test): New rules.
14729 * testsuite/Makefile.in: Regenerate.
14730
1dcd334d
DK
147312009-06-04 Doug Kwan <dougkwan@google.com>
14732
14733 * layout.cc (Layout::section_name_mapping): Add mapping for
14734 special ARM sections.
14735
96d49306
DK
147362009-06-03 Doug Kwan <dougkwan@google.com>
14737
14738 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14739 (utils::has_overflow): Same.
14740
dff16297
ILT
147412009-06-03 Ian Lance Taylor <iant@google.com>
14742
14743 * layout.cc (Layout::section_name_mapping): New array, replacing
14744 Layout::linkonce_mapping.
14745 (Layout::section_name_mapping_count): New variable, replacing
14746 Layout::linkonce_mapping_count.
14747 (Layout::linkonce_output_name): Remove.
14748 (Layout::output_section_name): Rewrite.
14749 * layout.h (class Layout): Rename Linkonce_mapping to
14750 Section_name_mapping, linkonce_mapping to section_name_mapping,
14751 linkonce_mapping_count to section_name_mapping_count. Don't
14752 declare linkonce_output_name.
14753
c121c671
DK
147542009-06-03 Doug Kwan <dougkwan@google.com>
14755
14756 * gold/arm.cc (namespace utils): New.
14757 (Target_arm::reloc_is_non_pic): Define new method.
14758 (class Arm_relocate_functions): New.
14759 (Target_arm::Relocate::relocate): Handle relocation types used by
14760 Android.
14761
07800fab
ILT
147622009-06-03 Ian Lance Taylor <iant@google.com>
14763
14764 * arm.cc (Target_arm::scan::global): Use || instead of |.
14765
c121c671
DK
147662009-06-02 Doug Kwan <dougkwan@google.com>
14767
14768 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14769 issued_non_pic_error_.
14770 (class Target_arm::Scan): Declare new method check_non_pic.
14771 Define new method symbol_needs_plt_entry.
14772 Declare new data member issued_non_pic_error_.
14773 (class Target_arm::Relocate): Declare new method
14774 should_apply_static_reloc.
14775 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14776 (Target_arm::Scan::check_non_pic): Define new method.
14777 (Target_arm::Scan::local): Handle a small subset of reloc types used
14778 by Android.
14779 (Target_arm::Scan::local): Same.
14780 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14781
b19b0c6d
ILT
147822009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14783
14784 * incremental.cc (Incremental_inputs::report_command_line): Filter
14785 out --incremental-* options.
14786
94cdfcff
DK
147872009-05-29 Doug Kwan <dougkwan@google.com>
14788
14789 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14790 template class.
14791 (class Target_arm): Update comment.
14792 (Target_arm::Target_arm): Initialize new data members GOT_,
14793 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14794 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14795 and Target_arm::rel_dyn_section.
14796 Declare new_enum Target_arm::Got_type.
14797 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14798 and DYNBSS_.
14799 Update commments for member do_dynsym_value.
14800 (Target_arm::got_size, Target_arm::plt_section,
14801 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14802 new methods inside class defintion.
14803 (Target_arm::got_section): Define new method.
14804 (Target_arm::rel_dyn_section): Same.
14805 (Output_data_plt_arm): New template class.
14806 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14807 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14808 (Output_data_plt_arm::add_entry): Same.
14809 (Output_data_plt_arm::first_plt_entry): Define new
14810 static data member for PLT instruction template.
14811 (Output_data_plt_arm::plt_entry): Same.
14812 (Output_data_plt_arm::do_write): Define new method.
14813 (Target_arm::make_plt_entry): Same.
14814 (Target_arm::do_finalize_sections): Same.
14815 (Target_arm::do_dynsym_value): Same.
14816
4a657b0d
DK
148172009-05-28 Doug Kwan <dougkwan@google.com>
14818
14819 * Makefile.am (TARGETSOURCES): Add arm.cc.
14820 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14821 * Makefile.in: Regenerate.
14822 * arm.cc: New file.
14823 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14824
e7ae8c36
DK
148252009-05-26 Doug Kwan <dougkwan@google.com>
14826
14827 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14828 (General_options::check_excluded_libs): Strip off directories in
14829 archive name before matching like GNU ld does.
14830 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14831 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14832 (exclude_libs_test_LDFLAGS): Add linker option
14833 -Wl,--exclude-libs,libexclude_libs_test_3
14834 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14835 an explicit archive without using -l.
14836 (alt/libexclude_libs_test_3.a): New make rule.
14837 * testsuite/Makefile.in: Regenerate.
14838 * testsuite/exclude_libs_test.c : Declare lib3_default().
14839 (main): Call it.
14840 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14841 * exclude_libs_test_3.c: New file.
14842
f12e7348
NC
148432009-05-26 Nick Clifton <nickc@redhat.com>
14844
14845 * po/id.po: New Indonesian translation.
14846 * po/gold.pot: Updated template file.
14847
4daadc0d
ST
148482009-05-22 Sriraman Tallam <tmsriram@google.com>
14849
e1df38aa 14850 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14851 gc_comdat_test files. Add -Wl,--gc-sections to build
14852 gc_comdat_test.
14853 * testsuite/Makefile.in: Regenerate.
14854 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14855
531813ad
ST
148562009-05-21 Sriraman Tallam <tmsriram@google.com>
14857
14858 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14859 kept comdat section was garbage collected.
14860 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14861 * testsuite/Makefile.in: Regenerate.
14862 * testsuite/gc_comdat_test.sh: New file.
14863 * testsuite/gc_comdat_test_1.cc: New file.
14864 * testsuite/gc_comdat_test_2.cc: New file.
14865
65514900
CC
148662009-05-19 Doug Kwan <dougkwan@google.com>
14867
14868 * archive.cc (Archive::Archive): Move constructor from archive.h
14869 to here. Initialize no_export_.
14870 (Archive::get_elf_object_for_member): Set no_export flag of object.
14871 * archive.h (Archive::Archive): Move constructor body to
14872 archive.cc.
14873 (Archive::no_export): New method.
14874 (Archive::no_export_): New field.
14875 * object.h (Object::Object): Initialize no_export_ to false.
14876 (Object::no_export, Object::set_no_export): New methods.
14877 (Object::no_export_): New field.
14878 * options.cc (General_options::parse_exclude_libs): New method.
14879 (General_options::check_excluded_libs) Same.
14880 * options.h (exclude_libs): New option.
14881 (General_options::check_excluded_libs): New method declaration.
14882 (General_options::excluded_libs_): New field.
14883 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14884 default or protected visibility if an object has no-export flag set.
14885 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14886 (check_SCRIPTS): Add exclude_libs_test.sh.
14887 (check_DATA): Add exclude_libs_test.syms.
14888 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14889 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14890 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14891 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14892 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14893 libexclude_libs_test_2.a): New rules.
14894 * testsuite/Makefile.in: Regenerate.
14895 * testsuite/exclude_libs_test.c: New file.
14896 * testsuite/exclude_libs_test.sh: Ditto.
14897 * testsuite/exclude_libs_test_1.c: Ditto.
14898 * testsuite/exclude_libs_test_2.c: Ditto.
14899
1b77ea50
ILT
149002009-05-15 Ian Lance Taylor <iant@google.com>
14901
14902 * configure.ac: Check for declarations for cases where libiberty.h
14903 checks HAVE_DECL_xxx.
14904 * configure, config.in: Rebuild.
14905
072fe7ce
ILT
149062009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14907
14908 * gold.h (Incremental_argument_list): Remove (invalid) forward
14909 declaration.
14910 * incremental.cc (Incremental_inputs::report_achive): New method.
14911 (Incremental_inputs::report_object): New method.
14912 (Incremental_inputs::report_script): New method.
14913 (Incremental_inputs::finalize_inputs): New method.
14914 (Incremental_inputs::finalize): Call finalize_inputs().
14915 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14916 Create inputs entries.
14917 * incremental.h (Incremental_input_type): New enum.
14918 (Incremental_inputs::Incremental_input): Initialize new fields.
14919 (Incremental_inputs::report_inputs): New method.
14920 (Incremental_inputs::report_achive): New method.
14921 (Incremental_inputs::report_object): New method.
14922 (Incremental_inputs::report_script): New method.
14923 (Incremental_inputs::finalize_inputs): New method.
14924 (Incremental_inputs::Input_info): New struct.
14925 (Incremental_inputs::Input_info_map): New typedef.
14926 (Incremental_inputs::lock_): New field.
14927 (Incremental_inputs::Inputs_): New field.
14928 (Incremental_inputs::Inputs_map): New field.
14929 * main.cc (main): Call Incremental_input::report_inputs.
14930 * options.h (Input_argument_list): Typedef moved from
14931 Input_arguments.
14932 (Input_file_group::Files): Remove, use ::Input_argument_list.
14933 (Input_file_group::Input_argument_list): Remove, use
14934 ::Input_argument_list.
14935 * plugin.cc (Plugin_manager::add_input_file): Add error in
14936 incremental build.
14937 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14938 functions.
14939 * script.cc (read_input_script): Call
14940 Incremental_input::report_script.
14941 * script.h (Script_info): New class.
14942
b0481b0b
ILT
149432009-04-27 Ian Lance Taylor <iant@google.com>
14944
14945 * x86_64.cc (do_adjust_output_section): Set entsize to
14946 plt_entry_size.
14947
b22a5a41 149482009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14949
14950 * output.cc (Output_file::close): After short writes, continue
14951 writing from the correct offset in the buffer being written.
14952
40fde488
CD
149532009-04-23 Chris Demetriou <cgd@google.com>
14954
14955 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14956 * configure: Regenerate.
14957 * config.in: Regenerate.
14958 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14959 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14960
3ce2c28e
ILT
149612009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14962
14963 * incremental.cc (Incremental_inputs_header_data): Renamed from
14964 Incremental_input_header_data.
14965 (Incremental_inputs_header_data::data_size): New field.
14966 (Incremental_inputs_header_data::put_input_file_count): Renamed
14967 from input_file_count.
14968 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14969 from command_line_offset.
14970 (Incremental_inputs_header_data::put_reserved): Renamed from
14971 put_reserved.
14972 (Incremental_inputs_entry_data): Renamed from
14973 Incremental_input_entry_data.
14974 (Incremental_inputs_entry_data::data_size): New field.
14975 (Incremental_inputs::report_command_line): New method.
14976 (Incremental_inputs::finalize): New method.
14977 (Incremental_inputs::create_incremental_inputs_data): New method.
14978 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14979 * incremental.h: New file.
14980 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14981 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14982 incremental builds.
703d02da 14983 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14984 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14985 (Layout::create_incremental_info_sections): New method.
14986 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14987 * main.cc (main): Notify Incremental_input of the command line.
14988
e55bde5e
ILT
149892009-04-01 Ian Lance Taylor <iant@google.com>
14990 Mikolaj Zalewski <mikolajz@google.com>
14991
14992 * gold.h (reserve_unordered_map): Define, three versions, one for
14993 each version of Unordered_map.
14994 * layout.cc (Layout::Layout): Remove options parameter. Add
14995 number_of_input_files parameter. Don't initialize options_.
14996 Initialize number_of_input_files_ and resized_signatures_. Move
14997 sections_are_attached_.
14998 (Layout::layout_group): Reserve space for group_signatures_.
14999 (Layout::find_or_add_kept_section): Change name parameter to be a
15000 reference. Resize signatures_ map when it gets large enough.
15001 (Layout::layout_eh_frame): Use parameters->options() instead of
15002 this->options_.
15003 (Layout::make_output_section): Likewise.
15004 (Layout::attach_allocated_section_to_segment): Likewise.
15005 (Layout::finalize, Layout::create_executable_stack): Likewise.
15006 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15007 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15008 * layout.h (class Layout): Update declarations. Remove options_
15009 field. Add number_of_input_files_ and resized_signatures_
15010 fields. Move sections_are_attached_ field.
15011 * main.cc (main): Pass number of input files to Layout
15012 constructor. Don't pass options.
15013
154b857c
ILT
150142009-03-30 Ian Lance Taylor <iant@google.com>
15015
15016 * ffsll.c (ffsll): Correct implementation.
15017
2f35ab9b
ILT
150182009-03-27 Ian Lance Taylor <iant@google.com>
15019
fd03461a
ILT
15020 * ffsll.c: New file.
15021 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15022 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15023 * ftruncate.c (ftruncate): Declare before definition.
15024 * mremap.c (mremap): Likewise.
15025 * pread.c (pread): Likewise.
15026 * configure, Makefile.in, config.in: Rebuild.
15027
2f35ab9b
ILT
15028 * mremap.c: New file.
15029 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15030 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15031 (mremap): Declare if HAVE_MREMAP is not defined.
15032 * configure, Makefile.in, config.in: Rebuild.
15033
33aea2fd
CC
150342009-03-27 Cary Coutant <ccoutant@google.com>
15035
15036 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15037 position independent.
15038 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15039 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15040
6d479619
CC
150412009-03-24 Cary Coutant <ccoutant@google.com>
15042
15043 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15044 an executable.
15045 (needs_dynamic_reloc): Likewise.
15046
afc06bb8
ILT
150472009-03-24 Ian Lance Taylor <iant@google.com>
15048
15049 * yyscript.y (file_cmd): Recognize EXTERN.
15050 (extern_name_list, extern_name_list_body): New nonterminals.
15051 * script.cc (script_add_extern): Define.
15052 * script-c.h (script_add_extern): Declare.
15053
f6060a4d
ILT
150542009-03-24 Rafael Avila de Espindola <espindola@google.com>
15055
15056 * object.cc (is_elf_object): Define.
15057 * object.h (is_elf_object): Declare.
15058 * archive.cc (Archive::get_elf_object_for_member): Call
15059 is_elf_object.
33aea2fd 15060 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15061
26736d8e
ILT
150622009-03-24 Elliott Hughes <enh@google.com>
15063
15064 * output.cc (Output_file::map_anonymous): Define.
15065 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15066 try an anonymous one. Report the size if the mmap fails.
15067 * output.h (class Output_file): Declare map_anonymous.
15068
22fd9730
ILT
150692009-03-24 Ian Lance Taylor <iant@google.com>
15070
15071 * target-select.cc (instantiate_target): Don't acquire the lock if
15072 the instantiated_target_ field has already been set.
15073
cb010894
ILT
150742009-03-23 Ian Lance Taylor <iant@google.com>
15075
7f055c20
ILT
15076 * gold-threads.h (class Initialize_lock): Define.
15077 * gold-threads.cc (class Initialize_lock_once): Define.
15078 (initialize_lock_control): New static variable.
15079 (initialize_lock_pointer): New static variable.
15080 (initialize_lock_once): New static function.
15081 (Initialize_lock::Initialize_lock): Define.
15082 (Initialize_lock::initialize): Define.
15083 * target-select.h: Include "gold-threads.h".
15084 (class Target_selector): Add lock_ and initialize_lock_ fields.
15085 Don't define instantiate_target, just declare it.
15086 * target-select.cc (Target_selector::Target_selector): Initialize
15087 new fields.
15088 (Target_selector::instantiate_target): Define.
15089 * descriptors.h: Include "gold-threads.h".
15090 (class Descriptors): Add initialize_lock_ field.
15091 * descriptors.cc (Descriptors::Descriptors): Initialize new
15092 field.
15093 (Descriptors::open): Use initialize_lock_ field
15094 * errors.h (class Errors): Add initialize_lock_ field.
15095 * errors.cc (Errors::Errors): Initialize new field.
15096 (Errors::initialize_lock): Use initialize_lock_ field.
15097 * powerpc.cc (class Target_selector_powerpc): Remove
15098 instantiated_target_ field. In do_recognize call
15099 instantiate_target rather than do_instantiate_target. In
15100 do_instantiate_target just allocate a new target.
15101 * sparc.cc (class Target_selector_sparc): Likewise.
15102
36959681
ILT
15103 * freebsd.h: New file.
15104 * i386.cc: Include "freebsd.h".
15105 (Target_i386): Derive from Target_freebsd rather than
15106 Sized_target.
15107 (Target_selector_i386): Derive from Target_selector_freebsd rather
15108 than Target_selector.
15109 * x86_64.cc: Include "freebsd.h".
15110 (Target_x86_64): Derive from Target_freebsd rather than
15111 Sized_target.
15112 (Target_selector_x86_64): Derive from Target_selector_freebsd
15113 rather than Target_selector.
15114 * target.h (class Target): Add adjust_elf_header and
15115 do_adjust_elf_header.
15116 * output.cc (Output_file_header:: do_sized_write): Call target
15117 adjust_elf_header routine.
15118 * configure.tgt: Set targ_osabi.
15119 * configure.ac: Define GOLD_DEFAULT_OSABI.
15120 * parameters.cc (Parameters::default_target): Pass
15121 GOLD_DEFAULT_OSABI to select_target.
15122 * target-select.h (class Target_selector): Make instantiate_target
15123 protected rather than private.
15124 * Makefile.am (HFILES): Add freebsd.h.
15125 * configure, Makefile.in, config.in: Rebuild.
15126
cb010894
ILT
15127 * merge.cc (do_add_input_section): Correct pend value. Change
15128 message about last entry not being null terminated from error to
15129 warning.
15130
0e879927
ILT
151312009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15132
15133 * incremental.cc: New file.
15134 * Makefile.am (CCFILES): Add incremental.cc.
15135 * Makefile.in: Rebuild.
15136
41105937
PP
151372009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15138
15139 * layout.cc (Layout::output_section_name): Preserve names
15140 of '.note.' sections.
e1df38aa 15141
60439920
ILT
151422009-03-19 Ian Lance Taylor <iant@google.com>
15143
15144 * descriptors.cc (Descriptors::open): Check that the options are
15145 valid before using them.
15146
0d371ad3
ILT
151472009-03-18 Ian Lance Taylor <iant@google.com>
15148
15149 * script-sections.h: Include <list>.
15150 (class Script_sections): Change Sections_elements from std::vector
15151 to std::list. Typedef public Elements_iterator. Add
15152 orphan_section_placement_, data_segment_align_start_, and
15153 saw_data_segment_align_ fields. Remove data_segment_align_index_
15154 field.
15155 * script-sections.cc (class Orphan_section_placement): New class.
15156 (class Sections_element): Add virtual functions is_relro and
15157 orphan_section_init. Remove virtual function place_orphan_here.
15158 (class Output_section_definition): Add is_relro and
15159 orphan_section_init. Remove place_orphan_here.
15160 (class Orphan_output_section): Likewise.
15161 (Script_sections::Script_sections): Update for field changes.
15162 (Script_sections::data_segment_align): Set saw_data_segment_align_
15163 and data_segment_align_start_, not data_segment_align_index.
15164 (Script_sections::data_segment_relro_end): Check
15165 saw_data_segment_align_. Use data_segment_align_start_ rather
15166 than data_segment_align_index_.
15167 (Script_sections::place_orphan): Rewrite to use
15168 Orphan_section_placement.
15169
9201d894
ILT
151702009-03-17 Ian Lance Taylor <iant@google.com>
15171
9c5b8369
ILT
15172 * archive.cc (Archive::add_symbols): Check for a version attached
15173 to the symbol name in the archive map.
15174 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15175 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15176 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15177 (ver_test_11.a): New target.
15178 * testsuite/Makefile.in: Rebuild.
15179
9201d894
ILT
15180 * configure.ac: Check for chsize and posix_fallocate. Replace
15181 ftruncate.
15182 * ftruncate.c: New file, from gnulib.
15183 * output.cc (posix_fallocate): Define dummy version if not
15184 HAVE_POSIX_FALLOCATE.
15185 (Output_file::map): Call posix_fallocate rather than lseek and
15186 write.
15187 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15188 * configure, Makefile.in, config.in: Rebuild.
15189
ef4ab7a8 151902009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15191
ef4ab7a8
PP
15192 * layout.h (Layout::create_note): Add section_name parameter.
15193 * layout.cc (Layout::create_note): Likewise.
15194 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15195
8c500701
ILT
151962009-03-17 Ian Lance Taylor <iant@google.com>
15197
e85b18e1
ILT
15198 * descriptors.cc: Include "options.h".
15199 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15200 (Descriptors::open): Always use O_CLOEXEC when opening a new
15201 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15202 then set FD_CLOEXEC.
15203
9efe6174
ILT
15204 * sparc.cc (class Target_sparc): Add has_got_section.
15205 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15206 make sure we have a GOT section.
15207
15208 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15209 (Target_sparc::Scan::local): Likewise.
15210 (Target_sparc::Scan::global): Likewise.
15211 (Target_sparc::Relocate::relocate): Likewise.
15212 (Target_sparc::Relocate::relocate_tls): Likewise.
15213
8c500701
ILT
15214 * symtab.cc (Symbol_table::define_default_version): New function,
15215 broken out of add_from_object.
15216 (Symbol_table::add_from_object): Call define_default_version.
15217 (Symbol_table::define_special_symbol): Add resolve_oldsym
15218 parameter. Change all callers. If the version for a symbol comes
15219 from a version script, resolve it with the symbol with the same
15220 name with no version. Also add the symbol without a version if
15221 appropriate.
15222 (do_define_in_output_data): If resolving with oldsym, don't delete
15223 sym.
15224 (do_define_in_output_segment): Likewise.
15225 (do_define_as_constant): Likewise.
15226 * symtab.h (class Symbol_table): Update declarations.
15227
f1ed28fb
ILT
152282009-03-13 Ian Lance Taylor <iant@google.com>
15229
15f8229b
ILT
15230 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15231 (Read_symbols::requeue): New function.
15232 (Read_symbols::do_read_symbols): If make_elf_object fails because
15233 the target type is not configured, and the file was searched for,
15234 issue a warning and retry with the next directory.
15235 (Add_symbols::run): If the file has an incompatible format, and
15236 it was searched for, requeue the Read_symbols task. On error,
15237 release the object.
15238 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15239 dirindex parameter to constructor. Change all callers. Declare
15240 incompatible_warning and requeue.
15241 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15242 input_argument_ and input_group_ fields. Add them to
15243 constructor. Change all callers.
15244 (class Read_script): Add dirindex_ field. Add it to constructor.
15245 Change all callers.
15246 * archive.cc (Archive::setup): Remove input_objects parameter.
15247 Change all callers.
15248 (Archive::get_file_and_offset): Likewise.
15249 (Archive::read_all_symbols): Likewise.
15250 (Archive::read_symbols): Likewise.
15251 (Archive::get_elf_object_for_member): Remove input_objects
15252 parameter. Add punconfigured parameter. Change all callers.
15253 (Archive::add_symbols): Change return type to bool. Check return
15254 value of include_member.
15255 (Archive::include_all_members): Likewise.
15256 (Archive::include_member): Change return type to bool. Return
15257 false if first included object has incompatible target. Set
15258 included_member_ field.
15259 (Add_archive_symbols::run): If add_symbols returns false, requeue
15260 Read_symbols task.
15261 * archive.h (class Archive): Add included_member_ field.
15262 Initialize it in constructor. Add input_file and searched_for
15263 methods. Update declarations.
15264 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15265 input_argument_ fields. Add them to constructor. Change all
15266 callers.
15267 * script.cc: Include "target-select.h".
15268 (class Parser_closure): Add skip_on_incompatible_target_ and
15269 found_incompatible_target_ fields. Add
15270 skip_on_incompatible_target parameter to constructor. Change all
15271 callers. Add methods skip_on_incompatible_target,
15272 clear_skip_on_incompatible_target, found_incompatible_target, and
15273 set_found_incompatible_target.
15274 (read_input_script): Add dirindex parameter. Change all callers.
15275 If parser finds an incompatible target, requeue Read_symbols
15276 task.
15277 (script_set_symbol): Clear skip_on_incompatible_target in
15278 closure.
15279 (script_add_assertion, script_parse_option): Likewise.
15280 (script_start_sections, script_add_phdr): Likewise.
15281 (script_check_output_format): New function.
15282 * script.h (read_input_script): Update declaration.
15283 * script-c.h (script_check_output_format): Declare.
15284 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15285 (ignore_cmd): Remove OUTPUT_FORMAT.
15286 * fileread.cc (Input_file::Input_file): Add explicit this.
15287 (Input_file::will_search_for): New function.
15288 (Input_file::open): Add pindex parameter. Change all callers.
15289 * fileread.h (class Input_file): Add input_file_argument method.
15290 Declare will_search_for. Update declarations.
15291 * object.cc (make_elf_object): Add punconfigured parameter.
15292 Change all callers.
15293 * object.h (class Object): Make input_file public. Add
15294 searched_for method.
15295 (make_elf_object): Update declaration.
15296 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15297 restart search.
15298 * dirsearch.h (class Dirsearch): Update declaration.
15299 * options.h (class General_options): Add --warn-search-mismatch.
15300 * parameters.cc (Parameters::is_compatible_target): New function.
15301 * parameters.h (class Parameters): Declare is_compatible_target.
15302 * workqueue.cc (Workqueue::add_blocker): New function.
15303 * workqueue.h (class Workqueue): Declare add_blocker.
15304
f1ed28fb
ILT
15305 * fileread.cc (Input_file::open): Remove options parameter.
15306 Change all callers.
15307 (Input_file::open_binary): Likewise.
15308 * script.cc (read_input_script): Likewise.
15309 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15310 options parameter from constructor. Change all callers.
15311 (class Read_script): Likewise.
15312 * fileread.h (class Input_file): Update declarations.
15313 * script.h (read_input_script): Update declaration.
15314
34dd024a
NC
153152009-03-10 Nick Clifton <nickc@redhat.com>
15316
15317 * po/es.po: New Spanish translation.
15318
6d71b17c
CC
153192009-03-06 Cary Coutant <ccoutant@google.com>
15320
15321 * options.cc (parse_short_option): Keep dash_z from registering itself.
15322
031cdbed
ILT
153232009-03-03 Ian Lance Taylor <iant@google.com>
15324
15325 PR 9918
15326 * target-reloc.h (relocate_section): Pass output_section to
15327 relocate.
15328 * i386.cc (Target_i386::should_apply_static_reloc): Add
15329 output_section parameter. Change all callers.
15330 (Target_i386::Relocate::relocate): Add output_section parameter.
15331 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15332 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15333 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15334 * testsuite/two_file_shared.sh: New script.
15335 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15336 (check_DATA): Add two_file_shared.dbg.
15337 (two_file_shared.dbg): New target.
15338 * testsuite/Makefile.in: Rebuild.
15339
15d5fa16
ILT
153402009-03-01 Ian Lance Taylor <iant@google.com>
15341
15342 * configure.ac: Check for byteswap.h.
15343 * configure: Rebuild.
15344 * config.in: Rebuild.
15345
8a4c0b0d
ILT
153462009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15347
15348 * layout.cc (Layout::find_or_add_kept_section): New function.
15349 (Layout::add_comdat): Removed.
15350 * layout.h (struct Kept_section): Move out of class Layout.
15351 Remove trailing underscores from field names. Add group_sections
15352 field. Rename group_ field to is_group. Change all uses.
15353 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15354 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15355 comdat_groups_ field.
15356 (Sized_relobj::include_section_group): Use
15357 find_or_add_kept_section and Kept_section::group_sections.
15358 (Sized_relobj::include_linkonce_section): Likewise.
15359 * object.cc (class Sized_relobj): Don't define Comdat_group or
15360 Comdat_group_table. Remove find_comdat_group and
15361 add_comdat_group. Remove comdat_groups_ field.
15362 * plugin.cc (include_comdat_group): Use
15363 Layout::find_or_add_kept_section.
15364
b4ecf66b
ILT
153652009-02-28 Ian Lance Taylor <iant@google.com>
15366
14359ca0
ILT
15367 * README: --gc-sections and map files are now supported. Document
15368 some build requirements.
15369
b4ecf66b
ILT
15370 PR 6992
15371 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15372 relocatable link set the value of the section symbol to zero.
15373 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15374 relocatable link don't include the section address in the local
15375 symbol value.
15376
0602e05a
ILT
153772009-02-27 Ian Lance Taylor <iant@google.com>
15378
fd9d194f
ILT
15379 PR 6811
15380 * options.h (class Search_directory): Add is_system_directory.
15381 (class General_options): Declare is_in_system_directory.
15382 * options.cc (get_relative_sysroot): Make static.
15383 (get_default_sysroot): Make static.
15384 (General_optoins::is_in_system_directory): New function.
15385 * fileread.cc (Input_file::is_in_system_directory): New function.
15386 * fileread.h (class Input_file): Declare is_in_system_directory.
15387 * object.h (class Object): Add is_in_system_directory.
15388 (class Input_objects): Remove system_library_directory_ field.
15389 * object.cc (Input_objects::add_object): Don't set
15390 system_library_directory_.
15391 (input_objects::found_in_system_library_directory): Remove.
15392 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15393 parameter. Change all callers.
15394 (Symbol_table::sized_write_globals): Likewise.
15395 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15396 Call Object::is_in_system_directory.
15397 * symtab.h (class Symbol_table): Update declarations.
15398
61edd21f
ILT
15399 PR 5990
15400 * descriptors.h (Open_descriptor): Add is_on_stack field.
15401 * descriptors.cc (Descriptors::open): If the descriptor is on the
15402 top of the stack, remove it. Initialize is_on_stack field.
15403 (Descriptors::release): Only add pod to stack if it is not on the
15404 stack already.
15405 (Descriptors::close_some_descriptor): Clear stack_next and
15406 is_on_stack fields.
15407
e29e076a
ILT
15408 PR 7091
15409 * output.cc (Output_section::find_starting_output_address): Rename
15410 from starting_output_address; add PADDR parameter; change return
15411 type.
15412 * output.h (class Output_section): Declare
15413 find_starting_output_address instead of starting_output_address.
15414 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15415 section symbol for which we can't find a merge section.
15416
0602e05a
ILT
15417 PR 9836
15418 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15419 hidden or internal, force the symbol to be local.
15420 * resolve.cc (Symbol::override_visibility): Define.
15421 (Symbol::override_base): Use override_visibility.
15422 (Symbol_table::resolve): Likewise.
15423 (Symbol::override_base_with_special): Likewise.
15424 (Symbol_table::override_with_special): If the visibility is hidden
15425 or internal, force the symbol to be local.
15426 * symtab.h (class Symbol): Add set_visibility and
15427 override_visibility.
15428 * testsuite/ver_test_1.sh: New file.
15429 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15430 (check_DATA): Add ver_test_1.syms.
15431 (ver_test_1.syms): New target.
15432 * testsuite/Makefile.in: Rebuild.
15433
401a9a73
CC
154342009-02-25 Cary Coutant <ccoutant@google.com>
15435
15436 * layout.cc (Layout::choose_output_section): Don't rename sections
15437 when using a linker script that has a SECTIONS clause.
15438 * Makefile.in: Regenerate.
15439
15440 * testsuite/Makefile.am (script_test_5.sh): New test case.
15441 * testsuite/Makefile.in: Regenerate.
15442 * testsuite/script_test_5.cc: New file.
15443 * testsuite/script_test_5.sh: New file.
15444 * testsuite/script_test_5.t: New file.
15445
f488e4b0
CC
154462009-02-13 Rafael Avila de Espindola <espindola@google.com>
15447
15448 * archive.cc (Archive::include_member): Update calls to add_symbols.
15449 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15450 the Layout argument.
15451 * dynobj.h (do_add_symbols): Add the Layout argument.
15452 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15453 Layout argument.
15454 * object.h (Object::add_symbols): Add the Layout argument.
15455 (Object::do_add_symbols): Add the Layout argument.
15456 (Sized_relobj::do_add_symbols): Add the Layout argument.
15457 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15458 Unify the two versions.
15459 (Add_plugin_symbols): Remove.
15460 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15461 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15462 (Add_plugin_symbols): Remove.
15463 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15464 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15465 (Add_symbols::run): Make it work with Pulginobj.
15466
89dd1680
ILT
154672009-02-06 Ian Lance Taylor <iant@google.com>
15468
15469 * object.cc (Sized_relobj::do_layout): Make info message start
15470 with lower case letter.
15471
266d0a74
ILT
154722009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15473
602b464e
ILT
15474 * binary.cc: Fix file comment.
15475
266d0a74
ILT
15476 * options.h (enum Incremental_disposition): Define.
15477 (class General_options): Add new options: --incremental,
15478 --incremental_changed, --incremental_unchanged,
15479 --incremental_unknown. Add incremental_disposition_ and
15480 implicit_incremental_ fields.
15481 (General_options::incremental_disposition): New function.
15482 (class Position_dependent_options): Add incremental_disposition
15483 option.
15484 (Position_dependent_options::copy_from_options): Set incremental
15485 dispositions.
15486 * options.cc (General_options::parse_incremental_changed): New
15487 function.
2e702c99
RM
15488 (General_options::parse_incremental_unchanged): New function.
15489 (General_options::parse_incremental_unknown): New function.
15490 (General_options::General_options): Initialize new fields
266d0a74 15491 incremental_disposition_ and implicit_incremental_.
2e702c99 15492 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15493 without --incremental.
15494
f073bbf7
CD
154952009-02-06 Chris Demetriou <cgd@google.com>
15496
15497 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15498 pointer and to report location as the file name associated with
15499 the symbol.
15500 (gold_undefined_symbol_at_location): New function to replace the
15501 old gold_undefined_symbol functionality.
15502 * target-reloc.h (relocate_section): Update to use
15503 gold_undefined_symbol_at_location.
15504 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15505 Call gold_undefined_symbol function rather than gold_error.
15506 * errors.h (Errors::undefined_symbol): Take location as a
15507 string, rather than calculating it from a relocation.
15508 * errors.cc (Errors::fatal): Print "fatal error:" before the
15509 formatted message.
15510 (Errors::error, Errors::error_at_location): Print "error: "
15511 before the formatted message.
15512 (Errors::undefined_symbol): Take location as a string, rather
15513 than calculating it from a relocation.
15514 (gold_undefined_symbol_at_location): New function akin to
15515 old gold_undefined_symbol, calculates location from relocation.
15516 (gold_undefined_symbol): Change to take only a Symbol pointer
15517 and to report location as the file name associated with the symbol.
15518 * testsuite/debug_msg.sh: Update for changed error messages.
15519 * testsuite/undef_symbol.sh: Likewise.
15520
8e94a90c
ILT
155212009-02-04 Duncan Sands <baldrick@free.fr>
15522
15523 PR 9812
15524 * reduced_debug_output.h
15525 (Output_reduced_debug_abbrev_section::failed): Use format for
15526 gold_warning.
15527 (Output_reduced_debug_info_section::faild): Likewise.
15528
88a0e15b
ILT
155292009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15530
15531 * script.cc (Lazy_demangler): New class.
2e702c99 15532 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15533 symbol only once.
15534
5efc7cd2
CC
155352009-01-29 Cary Coutant <ccoutant@google.com>
15536
15537 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15538 to __tls_get_addr.
15539 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15540
e0ebcf42
ILT
155412009-01-28 Ian Lance Taylor <iant@google.com>
15542
5efc7cd2 15543 * version.cc (version_string): Bump to 1.9.
75fe7426 15544
e0ebcf42
ILT
15545 * gold.h: Include <cstring> and <stdint.h>.
15546 * version.cc: Include <cstdio>.
15547 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15548 warning.
15549 * reduced_debug_output.cc (insert_into_vector): Rename from
15550 Insert_into_vector; change all callers. Use Swap_unaligned to
15551 avoid aliasing issue; remove union since it is unnecessary.
15552
8e2813be 155532009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15554
15555 * Makefile.am (CCFILES): Add gc.cc.
15556 (HFILES): Add gc.h.
15557 * Makefile.in: Regenerate.
15558 * gold.cc (Gc_runner): New class.
15559 (queue_initial_tasks): Call garbage collection related tasks
15560 when corresponding options are invoked.
15561 (queue_middle_gc_tasks): New function.
15562 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15563 processed early before laying out sections during garbage collection.
15564 * gold.h (queue_middle_gc_tasks): New function.
15565 (is_prefix_of): Move from "layout.cc".
15566 * i386.cc (Target_i386::gc_process_relocs): New function.
15567 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15568 * main.cc (main): Create object of class "Garbage_collection".
15569 * object.cc (Relobj::copy_symbols_data): New function.
15570 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15571 (Sized_relobj::do_layout): Allow this function to be called twice
15572 during garbage collection and defer layout of section during the
6d03d481
ST
15573 first call.
15574 * object.h (Relobj::get_symbols_data): New function.
15575 (Relobj::is_section_name_included): New function.
15576 (Relobj::copy_symbols_data): New function.
15577 (Relobj::set_symbols_data): New function.
15578 (Relobj::get_relocs_data): New function.
15579 (Relobj::set_relocs_data): New function.
15580 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15581 (Relobj::gc_process_relocs): New function.
15582 (Relobj::do_gc_process_relocs): New pure virtual function.
15583 (Relobj::sd_): New data member.
15584 (Sized_relobj::is_output_section_offset_invalid): New function.
15585 (Sized_relobj::do_gc_process_relocs): New function.
15586 * options.h (General_options::gc_sections): Modify to not be a no-op.
15587 (General_options::print_gc_sections): New option.
15588 * plugin.cc (Plugin_finish::run): Remove function call to
15589 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15590 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15591 * reloc.cc (Read_relocs::run): Add task to process relocs and
15592 determine unreferenced sections when doing garbage collection.
15593 (Gc_process_relocs): New class.
15594 (Sized_relobj::do_gc_process_relocs): New function.
15595 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15596 sections that are garbage collected.
15597 * reloc.h (Gc_process_relocs): New class.
15598 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15599 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15600 symbols whose corresponding sections are garbage collected.
15601 (Symbol_table::Symbol_table): Add new parameter for the garbage
15602 collection object.
15603 (Symbol_table::gc_mark_undef_symbols): New function.
15604 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15605 (Symbol_table::gc_mark_dyn_syms): New function.
15606 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15607 as garbage.
15608 (Symbol_table::add_from_object): Likewise.
15609 (Symbol_table::add_from_relobj): When building shared objects, do not
15610 treat externally visible symbols as garbage.
15611 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15612 table information for static and relocatable links.
15613 * symtab.h (Symbol_table::set_gc): New function.
15614 (Symbol_table::gc): New function.
15615 (Symbol_table::gc_mark_undef_symbols): New function.
15616 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15617 (Symbol_table::gc_mark_dyn_syms): New function.
15618 (Symbol_table::gc_): New data member.
e1df38aa 15619 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15620 function.
15621 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15622 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15623
3b293544
CF
156242009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15625
15626 * options.h (General_options::gc_sections): Define as a no-op for now.
15627 (General_options::no_keep_memory): Ditto.
15628 (General_options::Bshareable): Define.
15629 * options.cc (General_options::finalize): Honor -Bshareable.
15630
83d22aa8
AS
156312009-01-20 Andreas Schwab <schwab@suse.de>
15632
15633 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15634 read the value in the contents, since we don't use it. Use the
15635 template endianness when writing.
15636 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15637
cd536b21
AS
156382009-01-19 Andreas Schwab <schwab@suse.de>
15639
15640 * configure.tgt (powerpc64-*): Fix targ_obj.
15641
99e9a495
ILT
156422009-01-15 Ian Lance Taylor <iant@google.com>
15643
15644 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15645 local symbols when stripping all symbols.
15646
bbbfea06
CC
156472009-01-14 Cary Coutant <ccoutant@google.com>
15648
99e9a495 15649 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15650
0f7c0701
CC
156512009-01-14 Cary Coutant <ccoutant@google.com>
15652
15653 * archive.cc (Archive::get_elf_object_for_member): Remove call
15654 to File_read::claim_for_plugin.
15655 * descriptors.cc (Descriptors::open): Remove reference to
15656 is_claimed.
15657 (Descriptors::claim_for_plugin): Remove.
15658 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15659 (Descriptors::is_claimed): Remove.
15660 (claim_descriptor_for_plugin): Remove.
15661 * fileread.cc (File_read::claim_for_plugin): Remove.
15662 * fileread.h (File_read::claim_for_plugin): Remove.
15663 (File_read::descriptor): Reopen descriptor if necessary.
15664 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15665 (Plugin_manager::all_symbols_read): Add task parameter. Change
15666 all callers.
15667 (Plugin_manager::get_input_file): New function.
15668 (Plugin_manager::release_input_file): New function.
15669 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15670 corresponding data member.
15671 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15672 and pass to base constructor. Change all callers.
15673 (get_input_file, release_input_file): New functions.
15674 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15675 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15676 (Plugin_manager::all_symbols_read): Add task parameter.
15677 (Plugin_manager::get_input_file): New function.
15678 (Plugin_manager::release_input_file): New function.
15679 (Plugin_manager::task_): New data member.
15680 (Pluginobj::Pluginobj): Add filesize parameter.
15681 (Pluginobj::filename): New function.
15682 (Pluginobj::descriptor): New function.
15683 (Pluginobj::filesize): New function.
15684 (Pluginobj::filesize_): New data member.
15685 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15686 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15687 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15688
15689 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15690 with archive libraries.
15691 * testsuite/Makefile.in: Regenerate.
15692 * testsuite/plugin_test.c (struct sym_info): New type.
15693 (get_input_file, release_input_file): New static variables.
15694 (onload): Capture new transfer vector entries.
15695 (claim_file_hook): Stop reading at end of file according to filesize.
15696 Factor out parsing of readelf output into separate function.
15697 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15698 APIs and get the source file name from the symbol table. Convert
15699 source file name to corresponding object file name. Print info
15700 message when adding new input files.
15701 (parse_readelf_line): New function.
15702 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15703 * testsuite/plugin_test_2.sh: Likewise.
15704 * testsuite/plugin_test_3.sh: Likewise.
15705 * testsuite/plugin_test_4.sh: New test case.
15706
62a6d109
ILT
157072009-01-07 Ian Lance Taylor <iant@google.com>
15708
15709 * version.cc (version_string): Bump to 1.8.
15710
483620e8
CC
157112008-12-23 Cary Coutant <ccoutant@google.com>
15712
15713 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15714 * plugin.cc (Plugin_manager::finish): Rename as
15715 layout_deferred_objects. Move cleanup to separate function.
15716 (Plugin_manager::cleanup): New function.
15717 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15718 separately.
15719 * plugin.h (Plugin_manager::finish): Rename as
15720 layout_deferred_objects.
15721 (Plugin_manager::cleanup): New function.
15722 (Plugin_manager::cleanup_done): New field.
15723
d66a9eb3
CC
157242008-12-23 Cary Coutant <ccoutant@google.com>
15725
15726 * plugin.cc (is_visible_from_outside): New function.
15727 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15728 so we don't return "IR only" status for exported symbols or -r links.
15729
15730 * testsuite/Makefile.am (plugin_test_3): New test case.
15731 * testsuite/Makefile.in: Regenerate.
15732 * testsuite/plugin_test_3.sh: New file.
15733
5995b570
CC
157342008-12-22 Cary Coutant <ccoutant@google.com>
15735
15736 * object.cc (Sized_relobj::layout_section): New function.
15737 (Sized_relobj::do_layout): Defer layout of input sections until after
15738 plugin has provided replacement files.
15739 (Sized_relobj::do_layout_deferred_sections): New function.
15740 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15741 (Relobj::layout_deferred_sections): New function.
15742 (Relobj::do_layout_deferred_sections): New function.
15743 (Sized_relobj::do_layout_deferred_sections): New function.
15744 (Sized_relobj::layout_section): New function.
15745 (Sized_relobj::Deferred_layout): New structure.
15746 (Sized_relobj::deferred_layout_): New field.
15747 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15748 Change all callers. Layout deferred sections.
15749 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15750 references.
15751 (Plugin_hook::run): Move code from do_plugin_hook inline.
15752 (Plugin_hook::do_plugin_hook): Remove.
15753 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15754 (Plugin_manager::finish): Renamed, was cleanup.
15755 (Plugin_manager::should_defer_layout): New function.
15756 (Plugin_manager::add_deferred_layout_object): New function.
15757 (Plugin_manager::Deferred_layout_list): New type.
15758 (Plugin_manager::deferred_layout_objects_): New field.
15759 (Plugin_hook::do_plugin_hook): Remove.
15760
ee769c88
ILT
157612008-12-17 Ian Lance Taylor <iant@google.com>
15762
15763 * options.h (class General_options): Add --no case for
15764 --export-dynamic.
15765
abc8dcba
CC
157662008-12-16 Cary Coutant <ccoutant@google.com>
15767
15768 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15769 vector.
15770 (Plugin_manager::claim_file): Create plugin object even if
15771 plugin did not call the add_symbols callback.
15772 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15773 asking for more symbols than were added.
15774 * testsuite/Makefile.am (plugin_test_1): Add test case with
15775 no global symbols.
15776 (empty.syms): New target.
15777 * testsuite/Makefile.in: Regenerate.
15778 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15779 message. Don't call add_symbols if no globals.
15780 (all_symbols_read_hook): Don't provide replacement for empty
15781 claimed file.
15782
b0074644
ILT
157832008-12-12 Ian Lance Taylor <iant@google.com>
15784
68943102
ILT
15785 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15786 r_type == 0 for a local symbol with r_sym == 0.
15787 (scan_relocatable_relocs): Pass r_sym to
15788 local_non_section_strategy.
15789 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15790 r_sym parameter.
15791
b0074644
ILT
15792 * configure.ac: Update test for TLS descriptors: they are
15793 supported as of glibc 2.9.
15794 * configure: Rebuild.
15795
c2508178
ILT
157962008-12-11 Ian Lance Taylor <iant@google.com>
15797
15798 PR 7091
15799 * target-reloc.h (Default_scan_relocatable_relocs): For each
15800 function, map r_type == 0 to RELOC_DISCARD.
15801
2756a258
CC
158022008-12-10 Cary Coutant <ccoutant@google.com>
15803
15804 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15805 object to override a kept COMDAT group from a plugin object.
15806
bb6f53d3
ILT
158072008-12-09 Ian Lance Taylor <iant@google.com>
15808
fbc558e1
ILT
15809 PR 7088
15810 * yyscript.y (file_cmd): Handle INPUT.
15811
bb6f53d3
ILT
15812 * testsuite/initpri1.c: Change all declarations to be full
15813 prototypes by adding void, to avoid compiler warnings.
15814
4674ecfc
CC
158152008-12-05 Rafael Avila de Espindola <espindola@google.com>
15816
15817 * options.cc (General_options::parse_plugin_opt): New.
15818 (General_options::add_plugin): The argument now is just the filename.
15819 (General_options::add_plugin_option): New.
15820 * options.h (plugin_opt): New.
15821 (add_plugin): Change argument name.
15822 (add_plugin_option): New.
15823 * plugin.cc (Plugin::load): Don't parse the plugin option.
15824 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15825 (Plugin::add_option): New.
15826 (Plugin::args_): Change type.
15827 (Plugin::filename_): New.
15828 (Plugin_manager::add_plugin_option): New.
15829 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15830 * testsuite/Makefile.in: Regenerate.
15831
fd06b4aa
CC
158322008-12-05 Cary Coutant <ccoutant@google.com>
15833
15834 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15835 Handle --strip-lto-sections option.
15836 * options.h (strip_lto_sections): New option.
15837
6c52134c
CC
158382008-12-01 Cary Coutant <ccoutant@google.com>
15839
15840 * plugin.cc (ld_plugin_message): Change format parameter to const.
15841 Fix mismatch between new[] and delete.
15842
a45248e0
CC
158432008-11-14 Cary Coutant <ccoutant@google.com>
15844
15845 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15846 instead of -1U.
15847
c82fbeee
CS
158482008-11-05 Craig Silverstein <csilvers@google.com>
15849
15850 * options.cc (General_options::parse_dynamic_list): New function.
15851 * options.h (General_options): New flags dynamic_list,
15852 dynamic_list_data, dynamic_list_cpp_new, and
15853 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15854 (General_options::in_dynamic_list): New function.
15855 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15856 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15857 (Lex::can_continue_name): Likewise.
15858 (yylex): Likewise.
15859 (read_script_file): New parameter script_options.
15860 (read_dynamic_list): New function.
15861 (Script_options::define_dynamic_list): New function.
15862 (dynamic_list_keyword_parsecodes): New variable.
15863 (dynamic_list_keywords): New variable.
15864 * script.h (Script_options::define_dynamic_list): New function
15865 prototype.
15866 (read_dynamic_list): New function prototype.
15867 * symtab.cc (strprefix): New macro.
15868 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15869 dynamic_list_data, dynamic_list_cpp_new, and
15870 dynamic_list_cpp_typeinfo.
15871 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15872 (dynamic_list_expr): New rule.
15873 (dynamic_list_nodes): Likewise.
15874 (dynamic_list_node): Likewise.
15875 * testsuite/Makefile.am (dynamic_list): New test.
15876 * testsuite/Makefile.in: Regenerated.
15877 * testsuite/dynamic_list.t: New file.
15878 * testsuite/dynamic_list.sh: New file.
15879
e0bb29a5
CS
158802008-11-05 Craig Silverstein <csilvers@google.com>
15881
15882 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15883 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15884 (t11_last): Likewise.
15885 * testsuite/ver_test_6.c (main): Likewise.
15886
4e1e25e0
CC
158872008-10-07 Cary Coutant <ccoutant@google.com>
15888
15889 * options.c (General_options::finalize): Add check for -static and
15890 -shared.
15891 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15892 is not empty.
15893
92f03fcb
CC
158942008-10-02 Cary Coutant <ccoutant@google.com>
15895
15896 * plugin.cc (make_sized_plugin_object): Fix conditional
15897 compilation to work when not all targets are enabled.
15898
fbd8a257
CC
158992008-09-29 Cary Coutant <ccoutant@google.com>
15900
15901 * archive.cc (Archive::get_file_and_offset): Use filename instead
15902 of name to get library path.
15903 (Archive::include_member): Unlock external member of a thin archive.
15904
15905 * testsuite/Makefile.am (TEST_AR): New variable.
15906 (thin_archive_test_1): New test.
15907 (thin_archive_test_2): New test.
81636b3f
CC
15908 * testsuite/Makefile.in: Regenerate.
15909 * testsuite/thin_archive_main.cc: New file.
15910 * testsuite/thin_archive_test_1.cc: New file.
15911 * testsuite/thin_archive_test_2.cc: New file.
15912 * testsuite/thin_archive_test_3.cc: New file.
15913 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15914
eff45813
CC
159152008-09-29 Cary Coutant <ccoutant@google.com>
15916
15917 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15918 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15919 instead of -1U.
15920 (Sized_relobj::do_finalize_local_symbols): Likewise.
15921 (Sized_relobj::map_to_kept_section): Likewise.
15922 * object.h (Sized_relobj::invalid_address): New constant.
15923 (Sized_relobj::do_output_section_offset): Check for invalid_address
15924 and return -1ULL.
15925 * output.cc (Output_reloc::local_section_offset): Use constant
15926 invalid_address instead of -1U.
15927 (Output_reloc::get_address): Likewise.
15928 (Output_section::output_address): Change -1U to -1ULL.
15929 * output.h (Output_reloc::invalid_address): New constant.
15930 * reloc.cc (Sized_relobj::write_sections): Use constant
15931 invalid_address instead of -1U.
15932 (Sized_relobj::relocate_sections): Likewise.
15933 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15934 values for merge sections.
15935 * target-reloc.h (relocate_for_relocatable): Use constant
15936 invalid_address instead of -1U.
15937
89fc3421
CC
159382008-09-19 Cary Coutant <ccoutant@google.com>
15939
15940 Add plugin functionality for link-time optimization (LTO).
15941 * configure.ac (plugins): Add --enable-plugins option.
15942 * configure: Regenerate.
15943 * config.in: Regenerate.
15944 * Makefile.am (LIBDL): New variable.
15945 (CCFILES): Add plugin.cc.
15946 (HFILES): Add plugin.h.
15947 (ldadd_var): Add LIBDL.
15948 * Makefile.in: Regenerate.
15949
15950 * archive.cc: Include "plugin.h".
15951 (Archive::setup): Don't preread archive symbols when using a plugin.
15952 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15953 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15954 files.
15955 (Archive::include_member): Add symbols from plugin objects.
15956 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15957 * descriptors.cc (Descriptors::open): Check for file descriptors
15958 abandoned by plugins.
15959 (Descriptors::claim_for_plugin): New function.
15960 * descriptors.h (Descriptors::claim_for_plugin): New function.
15961 (Open_descriptor::is_claimed): New field.
15962 (claim_descriptor_for_plugin): New function.
15963 * fileread.cc (File_read::claim_for_plugin): New function.
15964 * fileread.h (File_read::claim_for_plugin): New function.
15965 (File_read::descriptor): New function.
15966 * gold.cc: Include "plugin.h".
15967 (queue_initial_tasks): Add task to call plugin hooks for generating
15968 new object files.
15969 * main.cc: Include "plugin.h".
15970 (main): Load plugin libraries.
15971 * object.h (Pluginobj): Declare.
15972 (Object::pluginobj): New function.
15973 (Object::do_pluginobj): New function.
15974 (Object::set_target): New function.
15975 * options.cc: Include "plugin.h".
15976 (General_options::parse_plugin): New function.
15977 (General_options::General_options): Initialize plugins_ field.
15978 (General_options::add_plugin): New function.
15979 * options.h (Plugin_manager): Declare.
15980 (General_options): Add --plugin option.
15981 (General_options::has_plugins): New function.
15982 (General_options::plugins): New function.
15983 (General_options::add_plugin): New function.
15984 (General_options::plugins_): New field.
15985 * plugin.cc: New file.
15986 * plugin.h: New file.
15987 * readsyms.cc: Include "plugin.h".
15988 (Read_symbols::do_read_symbols): Check for archive before checking
15989 for ELF file. Call plugin hooks to claim files.
15990 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15991 from a real object file; force override when processing replacement
15992 files.
15993 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15994 (Symbol::init_base_object): Likewise.
15995 (Symbol::init_base_output_data): Likewise.
15996 (Symbol::init_base_output_segment): Likewise.
15997 (Symbol::init_base_constant): Likewise.
15998 (Symbol::init_base_undefined): Likewise.
15999 (Symbol::output_section): Assert that object is not a plugin.
16000 (Symbol_table::add_from_pluginobj): New function.
16001 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16002 undefined.
16003 (Symbol_table::sized_write_globals): Likewise.
16004 (Symbol_table::add_from_pluginobj): Instantiate template.
16005 * symtab.h (Sized_pluginobj): Declare.
16006 (Symbol::in_real_elf): New function.
16007 (Symbol::set_in_real_elf): New function.
16008 (Symbol::in_real_elf_): New field.
16009 (Symbol_table::add_from_pluginobj): New function.
16010
16011 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16012 (LIBDL): New variable.
16013 (LDADD): Add LIBDL.
16014 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16015 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16016 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16017 (MOSTLYCLEANFILES): Likewise.
16018 * testsuite/Makefile.in: Regenerate.
16019 * testsuite/plugin_test.c: New file.
16020 * testsuite/plugin_test_1.sh: New file.
16021 * testsuite/plugin_test_2.sh: New file.
16022
de31bda5
ILT
160232008-09-16 Ian Lance Taylor <iant@google.com>
16024
9c2d0ef9
ILT
16025 * target-reloc.h (relocate_section): Check whether a symbol is
16026 defined by the ABI before reporting an undefined symbol error.
16027 * target.h (Target::is_defined_by_abi): Make parameter const.
16028 (Target::do_is_defined_by_abi): Likewise.
16029 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16030 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16031 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16032 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16033 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16034 * testsuite/Makefile.in: Rebuild.
16035
de31bda5
ILT
16036 * fileread.cc (make_view): Add casts to avoid warning.
16037
9fa33bee
AO
160382008-09-16 Alexandre Oliva <aoliva@redhat.com>
16039
16040 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16041 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16042
183fd0e3
AO
160432008-09-16 Alexandre Oliva <aoliva@redhat.com>
16044
16045 * options.h (General_options::output_is_executable): New.
16046 (General_options::output_is_pie): New.
16047 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16048 for shared libraries.
16049 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16050
7be8330a
CD
160512008-09-11 Chris Demetriou <cgd@google.com>
16052
16053 * options.h (origin): New -z option.
16054 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16055 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16056 in DT_FLAGS_1.
16057
a9caad02
CC
160582008-09-05 Cary Coutant <ccoutant@google.com>
16059
16060 * fileread.cc (File_read::make_view): Add check for attempt to map
16061 beyond end of file.
16062
ae6dce4d
CC
160632008-09-05 Cary Coutant <ccoutant@google.com>
16064
16065 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16066 explicit instantiations.
16067
d7ab2a47
KVH
160682008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16069
16070 PR gold/6858
16071 * options.cc (General_options::finalize): Allow undefined symbols
16072 in shlibs if linking -shared.
16073
16074 PR gold/6859
16075 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16076 symbols as not needing a dynsym entry.
16077
1e52a9c1
CS
160782008-08-20 Craig Silverstein <csilvers@google.com>
16079
16080 * fileread.cc (File_read::open): Do not lock the file unless it
16081 was successfully opened.
16082
d85c80a3
CC
160832008-08-14 Cary Coutant <ccoutant@google.com>
16084
16085 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16086 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16087 * testsuite/tls_test.cc (struct int128): 128-bit struct
16088 for testing TLS relocs with non-zero addend.
16089 (v12): New TLS variable.
16090 (t12): New test.
16091 (t_last): Add check for v12.
16092 * testsuite/tls_test.h (t12): New function.
16093 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16094
2d924fd9
ILT
160952008-08-13 Ian Lance Taylor <iant@google.com>
16096
16097 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16098 set tls_segment_ or relro_segment_.
16099 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16100 when appropriate.
16101 * output.h (Output_section::clear_is_relro): New function.
16102 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16103 sections specially even when output_data_ is empty.
16104 (Output_segment::maximum_alignment): When first section is relro,
16105 only force alignment for PT_LOAD segments.
16106 * script.cc (script_data_segment_align): New function.
16107 (script_data_segment_relro_end): New function.
16108 * script-c.h (script_data_segment_align): Declare.
16109 (script_data_segment_relro_end): Declare.
16110 * script-sections.h (class Script_sections): Declare
16111 data_segment_align and data_segment_relro_end. Add fields
16112 segment_align_index_ and saw_relro_end_.
16113 * script-sections.cc (class Sections_element): Add set_is_relro
16114 virtual function. Add new bool* parameter to place_orphan_here.
16115 Add get_output_section virtual function.
16116 (class Output_section_definition): Add set_is_relro. Add new
16117 bool* parameter to place_orphan_here. Add get_output_section.
16118 Add is_relro_ field.
16119 (Output_section_definition::Output_section_definition): Initialize
16120 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16121 and is_relro_ fields.
16122 (Output_section_definition::place_orphan_here): Add is_relro
16123 parameter.
16124 (Output_section_definition::set_section_addresses): Set relro for
16125 output section.
16126 (Output_section_definition::alternate_constraint): Likewise.
16127 (class Orphan_output_section): Add new bool* parameter to
16128 place_orphan_here. Add get_output_section.
16129 (Orphan_output_section::place_orphan_here): Add is_relro
16130 parameter.
16131 (Script_sections::Script_sections): Initialize
16132 data_segment_align_index_ and saw_relro_end_.
16133 (Script_sections::data_segment_align): New function.
16134 (Script_sections::data_segment_relro_end): New function.
16135 (Script_sections::place_orphan): Set or clear is_relro.
16136 (Script_sections::set_section_addresses): Force alignment of first
16137 TLS section.
16138 * yyscript.y (exp): Call script_data_segment_align and
16139 script_data_segment_relro_end.
16140 * testsuite/relro_script_test.t: New file.
16141 * testsuite/relro_test.cc (using_script): Declare.
16142 (t1, t2): Test using_script.
16143 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16144 (relro_script_test_SOURCES): Define.
16145 (relro_script_test_DEPENDENCIES): Define.
16146 (relro_script_test_LDFLAGS): Define.
16147 (relro_script_test_LDADD): Define.
16148 (relro_script_test.so): New target.
16149 * testsuite/Makefile.in: Rebuild.
16150
f827c9a9
CC
161512008-08-06 Cary Coutant <ccoutant@google.com>
16152
16153 * archive.cc (Archive::total_archives, Archive::total_members)
16154 (Archive::total_members_loaded): New variables.
16155 (Archive::setup): Add parameter. Add option to preread
16156 archive symbols.
16157 (Archive::read_armap): Add counter.
16158 (Archive::get_file_and_offset): New function.
16159 (Archive::get_elf_object_for_member): New function.
16160 (Archive::read_all_symbols): New function.
16161 (Archive::read_symbols): New function.
16162 (Archive::add_symbols): Add counters.
16163 (Archive::include_all_members): Use armap to find members if it's
16164 already built.
16165 (Archive::include_member): Skip reading symbols if already read.
16166 Factored code into Archive::get_file_and_offset and
16167 Archive::get_elf_object_for_member. Changed call to
16168 Mapfile::report_include_archive_member.
16169 (Archive::print_stats): New function.
16170 * archive.h: Declare Object and Read_symbols_data classes.
16171 (Archive::Archive): Add initializers for new members.
16172 (Archive::setup): Add parameter.
16173 (Archive::print_stats): New function.
16174 (Archive::total_archives, Archive::total_members)
16175 (Archive::total_members_loaded): New variables.
16176 (Archive::get_file_and_offset): New function.
16177 (Archive::get_elf_object_for_member): New function.
16178 (Archive::read_all_symbols): New function.
16179 (Archive::read_symbols): New function.
16180 (Archive::Archive_member): New class.
16181 (Archive::members_): New member.
16182 (Archive::num_members_): New member.
16183 * main.cc: Include archive.h.
16184 (main): Call Archive::print_stats.
16185 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16186 archive parameter; member_name is now the fully-decorated name.
16187 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16188 * options.h: (General_options): Add --preread-archive-symbols option.
16189 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16190 Archive::setup.
16191
de4c45bd
ILT
161922008-08-04 Ian Lance Taylor <iant@google.com>
16193
16194 * symtab.h (Symbol::use_plt_offset): New function.
16195 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16196 * powerpc.cc (Relocate::relocate): Likewise.
16197 * sparc.cc (Relocate::relocate): Likewise.
16198 * x86_64.cc (Relocate::relocate): Likewise.
16199 * testsuite/weak_plt.sh: New test.
16200 * testsuite/weak_plt_main.cc: New test.
16201 * testsuite/weak_plt_shared.cc: New test.
16202 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16203 (check_PROGRAMS): Add weak_plt.
16204 (check_DATA): Add weak_plt_shared.so.
16205 (weak_plt_main_pic.o, weak_plt): New targets.
16206 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16207 * testsuite/Makefile.in: Rebuild.
16208
16209 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16210 gcctestdir/ld.
16211 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16212 * testsuite/Makefile.in: Rebuild.
16213
323ee3f4
AM
162142008-08-04 Alan Modra <amodra@bigpond.net.au>
16215
16216 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16217 * Makefile.in: Regenerate.
16218 * po/POTFILES.in: Regenerate.
16219
7c07ecec
ILT
162202008-07-29 Ian Lance Taylor <iant@google.com>
16221
16222 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16223 symbols before other symbols.
16224 * testsuite/script_test_2.cc (test_addr): Declare.
16225 (test_addr_alias): Declare.
16226 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16227 values.
7c07ecec
ILT
16228 * testsuite/script_test_2.t: Define test_addr_alias and
16229 test_addr.
16230
5778530e
ILT
162312008-07-24 Ian Lance Taylor <iant@google.com>
16232
2a00e4fb
ILT
16233 PR 5990
16234 * descriptors.cc: New file.
16235 * descriptors.h: New file.
16236 * gold-threads.h (class Hold_optional_lock): New class.
16237 * fileread.cc: Include "descriptors.h".
16238 (File_read::~File_read): Release descriptor rather than closing
16239 it.
16240 (File_read::open) [file]: Call open_descriptor rather than open.
16241 Set is_descriptor_opened_.
16242 (File_read::open) [memory]: Assert that descriptor is not open.
16243 (File_read::reopen_descriptor): New function.
16244 (File_read::release): Release descriptor.
16245 (File_read::do_read): Make non-const. Reopen descriptor.
16246 (File_read::read): Make non-const.
16247 (File_read::make_view): Reopen descriptor.
16248 (File_read::do_readv): Likewise.
16249 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16250 Update declarations.
16251 * layout.cc: Include "descriptors.h".
16252 (Layout::create_build_id): Use open_descriptor rather than open.
16253 * output.cc: Include "descriptors.h".
16254 (Output_file::open): Use open_descriptor rather than open.
16255 * archive.cc (Archive::const_iterator): Change Archive to be
16256 non-const.
16257 (Archive::begin, Archive::end): Make non-const.
16258 (Archive::count_members): Likewise.
16259 * archive.h (class Archive): Update declarations.
16260 * object.h (Object::read): Make non-const.
16261 * Makefile.am (CCFILES): Add descriptors.cc.
16262 (HFILES): Add descriptors.h.
16263 * Makefile.in: Rebuild.
16264
801647d1
ILT
16265 PR 6716
16266 * gold.h: Always include <clocale>. Add Solaris workarounds
16267 following code in binutils/sysdep.h.
16268
5edd166e
ILT
16269 PR 6048
16270 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16271 this->eh_frame_hdr_ is NULL before using it.
16272
c89ad728
ILT
16273 * dynobj.cc (Versions::Versions): Update comment.
16274
aa86f06b
ILT
16275 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16276 the base version name.
16277
5778530e
ILT
16278 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16279 array size plus one.
16280 (Stringpool_template::set_string_offsets): Subtract one from key
16281 before using it as an array index.
16282 (Stringpool_template::get_offset_with_length): Likewise.
16283 (Stringpool_template::write_to_buffer): Likewise.
16284 * stringpool.h (Stringpool_template::get_offset_from_key):
16285 Likewise.
16286
057ead22
ILT
162872008-07-23 Ian Lance Taylor <iant@google.com>
16288
7f649c59
ILT
16289 PR 6658
16290 * object.h (Merged_symbol_value::value): Do our best to handle a
16291 negative addend.
16292
057ead22
ILT
16293 PR 6647
16294 * script.cc (Version_script_info::get_versions): Don't add empty
16295 version tag to return value.
16296 (Version_script_info::get_symbol_version_helper): Change return
16297 type to bool. Add pversion parameter. Change all callers.
16298 (script_register_vers_node): Don't require a non-NULL tag.
16299 * script.h (class Version_script_info): Update declarations.
16300 (Version_script_info::get_symbol_version): Change return type to
16301 bool. Add version parameter. Change all callers.
16302 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16303 handling. Handle an empty version from a version script.
16304 (Symbol_table::define_special_symbol): Likewise.
16305 * testsuite/ver_test_10.script: New file.
16306 * testsuite/ver_test_10.sh: New file.
16307 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16308 (check_DATA): Add ver_test_10.syms.
16309 (ver_test_10.syms, ver_test_10.so): New target.
16310 * testsuite/Makefile.in: Rebuild.
16311
58e54ac2
CD
163122008-07-23 Simon Baldwin <simonb@google.com>
16313
16314 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16315 to zero for undefined symbols from dynamic libraries.
16316
95d14cd3
ILT
163172008-07-23 Ian Lance Taylor <iant@google.com>
16318
16319 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16320 Change all callers.
16321 * symtab.h (class Symbol_table): Update declaration.
16322 * testsuite/ver_test_9.cc: New file.
16323 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16324 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16325 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16326 (ver_test_9.so, ver_test_9.o): New targets.
16327 * testsuite/Makefile.in: Rebuild.
16328
92de84a6
ILT
163292008-07-22 Ian Lance Taylor <iant@google.com>
16330
34810851
ILT
16331 * options.h (class General_options): Define --check-sections.
16332 * layout.cc (Layout::set_segment_offsets): Handle
16333 --check-sections.
16334
af6156ef
ILT
16335 * options.h (class General_options): Define -n/--nmagic and
16336 -N/--omagic.
16337 * options.cc (General_options::finalize): For -n/--nmagic or
16338 -N/--omagic, set -static.
16339 * layout.cc (Layout::attach_allocated_section_to_segment): If
16340 -N/--omagic, don't put read-only and read-write sections in
16341 different segments.
16342 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16343 finding a read-only segment.
16344 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16345 don't set the minimum segment alignment to the common page size,
16346 and don't set the file offset to the address modulo the page size.
16347 * script-sections.cc (Script_sections::create_segments): If
16348 -n/--omagic, don't put read-only and read-write sections in
16349 different segments.
16350
92de84a6
ILT
16351 * cref.cc: New file.
16352 * cref.h: New file.
16353 * options.h (class General_options): Add --print-symbol-counts.
16354 * main.cc (main): Issue defined symbol report if requested.
16355 * archive.cc (Archive::interpret_header): Make into a const member
16356 function.
16357 (Archive::add_symbols): Call Input_objects::archive_start and
16358 archive_stop.
16359 (Archive::const_iterator): Define new class.
16360 (Archive::begin, Archive::end): New functions.
16361 (Archive::include_all_members): Rewrite to use iterator.
16362 (Archive::count_members): New function.
16363 * archive.h (class Archive): Update declarations.
16364 (Archive::filename): New function.
16365 * object.cc: Include "cref.h".
16366 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16367 (Sized_relobj::do_get_global_symbol_counts): New function.
16368 (Input_objects::add_object): Add object to cross-referencer.
16369 (Input_objects::archive_start): New function.
16370 (Input_objects::archive_stop): New function.
16371 (Input_objects::print_symbol_counts): New function.
16372 * object.h: Declare Cref and Archive.
16373 (Object::get_global_symbol_counts): New function.
16374 (Object::do_get_global_symbol_counts): New pure virtual function.
16375 (class Sized_relobj): Add defined_count_ field. Update
16376 declarations.
16377 (class Input_objects): Add cref_ field. Update constructor.
16378 Update declarations.
16379 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16380 defined_count_.
16381 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16382 symbol counts.
16383 (Sized_dynobj::do_get_global_symbol_counts): New function.
16384 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16385 defined_count_. Update declarations. Define Symbols typedef.
16386 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16387 parameter. Change all callers.
16388 (Symbol_table::add_from_dynobj): Add sympointers and defined
16389 parameters. Change all callers.
16390 * symtab.h (class Symbol_table): Update declarations.
16391 * Makefile.am (CCFILES): Add cref.cc.
16392 (HFILES): Add cref.h.
16393 * Makefile.in: Rebuild.
16394
3f7c5e1d
CD
163952008-07-22 Simon Baldwin <simonb@google.com>
16396
16397 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16398 to zero when writing undefined symbols.
16399
e0b64032
ILT
164002008-07-22 Ian Lance Taylor <iant@google.com>
16401
16402 * output.cc (Output_section::add_input_section): Don't try to
16403 merge empty merge sections.
16404
096b02cf
CS
164052008-07-21 Craig Silverstein <csilvers@google.com>
16406
16407 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16408 Include symbol version in error message.
cd536b21 16409
1d1f116d
CD
164102008-07-20 Chris Demetriou <cgd@google.com>
16411
cd536b21 16412 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16413 (RANDOM_SEED_CFLAGS): New substituted variable.
16414 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16415 * configure: Rebuild.
16416 * Makefile.in: Likewise.
16417 * testsuite/Makefile.in: Likewise.
16418
a18f591e
ILT
164192008-07-18 Ian Lance Taylor <iant@google.com>
16420
16421 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16422 where we see NAME/NULL and NAME/VERSION as separate symbols.
16423 * testsuite/ver_test_main.cc (main): Call t4.
16424 (t4, t4_2a): Define.
16425 * testsuite/ver_test_2.cc (t4_2): Define.
16426 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16427 * testsuite/ver_test_4.cc (t4_2a): Define.
16428 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16429 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16430
c6e3f6ed
ILT
164312008-07-17 Ian Lance Taylor <iant@google.com>
16432
16433 * dynobj.cc (Versions::add_def): If we give an error about a
16434 missing version, go ahead and create the version anyhow.
16435
ef9beddf
ILT
164362008-07-10 Ian Lance Taylor <iant@google.com>
16437
16438 Handle output sections with more than 0x7fffffff bytes.
16439 * object.h (class Relobj): Change map_to_output_ to
16440 output_sections_, and just keep a section pointer. Change all
16441 uses. Move comdat group support to Sized_relobj.
16442 (Relobj::is_section_specially_mapped): Remove.
16443 (Relobj::output_section): Remove poff parameter. Change all
16444 callers.
16445 (Relobj::output_section_offset): New function.
16446 (Relobj::set_section_offset): Rewrite.
16447 (Relobj::map_to_output): Remove.
16448 (Relobj::output_sections): New function.
16449 (Relobj::do_output_section_offset): New pure virtual function.
16450 (Relobj::do_set_section_offset): Likewise.
16451 (class Sized_relobj): Add section_offsets_ field. Add comdat
16452 group support from Relobj. Update declarations.
16453 (Sized_relobj::get_output_section_offset): New function.
16454 (Sized_relobj::do_output_section_offset): New function.
16455 (Sized_relobj::do_set_section_offset): New function.
16456 * object.cc (Relobj::output_section_address): Remove.
16457 (Sized_relobj::Sized_relobj): Initialize new fields.
16458 (Sized_relobj::include_section_group): Cast find_kept_object to
16459 Sized_relobj.
16460 (Sized_relobj::include_linkonce_section): Likewise.
16461 (Sized_relobj::do_layout): Use separate arrays for output section
16462 and output offset.
16463 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16464 output_sections.
16465 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16466 output_sections and section_offsets.
16467 (Sized_relobj::write_local_symbols): Likewise.
16468 (map_to_kept_section): Compute output address directly.
16469 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16470 output_sections and section_offsets.
16471 (Sized_relobj::write_sections): Likewise.
16472 (Sized_relobj::relocate_sections): Likewise.
16473 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16474 * output.h (class Output_reloc): Update declarations. Change
16475 u2_.relobj to Sized_relobj*.
16476 (class Output_data_reloc): Change add functions to use
16477 Sized_relobj*.
16478 * output.cc (Output_reloc::Output_reloc): Change relobj to
16479 Sized_relobj*.
16480 (Output_reloc::local_section_offset): Change return type to
16481 Elf_Addr. Use get_output_section_offset.
16482 (Output_reloc::get_address): Likewise.
16483 (Output_section::is_input_address_mapped): Don't call
16484 is_section_specially_mapped.
16485 (Output_section::output_offset): Likewise.
16486 (Output_section::output_address): Likewise.
16487 (Output_section::starting_output_address): Likewise.
16488 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16489 parameter to Sized_relobj*.
16490 (Copy_relocs::need_copy_reloc): Likewise.
16491 (Copy_relocs::save): Likewise.
16492 * copy-relocs.h (class Copy_relocs): Update declarations.
16493 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16494 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16495 * target-reloc.h (relocate_for_relocatable): Change
16496 offset_in_output_section type to Elf_Addr. Change code that uses
16497 it as well.
16498 * layout.cc (Layout::layout): Always set *off.
16499 * mapfile.cc (Mapfile::print_input_section): Use
16500 output_section_offset.
16501 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16502 Sized_relobj*.
16503 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16504 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16505 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16506
5cb66f97
ILT
165072008-07-03 Ian Lance Taylor <iant@google.com>
16508
16509 * layout.cc (Layout::include_section): Do not discard unrecognized
16510 SHT_STRTAB sections.
16511
afe47622
CS
165122008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16513
16514 * script.cc (Lex::can_continue_name): Make '?' allowable in
16515 version-script names.
16516 * testsuite/version_script.map: Change glob pattern to use '?'
16517
5adf9721
ILT
165182008-06-30 Manish Singh <yosh@gimp.org>
16519
16520 PR 6585
16521 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16522 Correct typo.
16523
e6fde208
ILT
165242008-06-30 Ian Lance Taylor <iant@google.com>
16525
16526 PR 6660
16527 PR 6682
16528 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16529 versions]: Don't try to read the value in the contents, since we
16530 don't use it. Use the template endianness when writing.
16531
3f2e6a2d
CC
165322008-06-25 Cary Coutant <ccoutant@google.com>
16533
16534 * fileread.cc (File_read::make_view): Assert on zero-length view.
16535 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16536 symbol table when there are no symbols to read.
16537
c43d3a48
CS
165382008-06-23 Craig Silverstein <csilvers@google.com>
16539
16540 * version.cc (version_string): Bump to 1.7
16541
5f494ea0
CS
165422008-06-18 Craig Silverstein <csilvers@google.com>
16543
16544 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16545 constant 0xFFFF to type Valtype.
16546 (Powerpc_relocate_functions::rel16_ha): Likewise.
16547
c42e122e
ILT
165482008-06-17 Ian Lance Taylor <iant@google.com>
16549
f34787f8
ILT
16550 * output.h (Output_section::Input_section): Initialize p2align_ to
16551 zero for Output_section_data constructors.
16552 (Output_section::Input_section::addralign): If not an input
16553 section, return the alignment of the Output_section_data.
16554 * testsuite/copy_test.cc: New file.
16555 * testsuite/copy_test_1.cc: New file.
16556 * testsuite/copy_test_2.cc: New file.
16557 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16558 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16559 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16560 (copy_test_1_pic.o, copy_test_1.so): New targets.
16561 (copy_test_2_pic.o, copy_test_2.so): New targets.
16562 * testsuite/Makefile.in: Rebuild.
16563
c42e122e
ILT
16564 * script-sections.cc (Script_sections::place_orphan): Initialize
16565 local variable exact.
16566
ce3ac18a
DE
165672008-06-13 David Edelsohn <edelsohn@gnu.org>
16568
16569 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16570
42cacb20
DE
165712008-06-12 David Edelsohn <edelsohn@gnu.org>
16572 David S. Miller <davem@davemloft.net>
16573
16574 * powerpc.cc: New file.
16575 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16576 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16577 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16578 * Makefile.in: Rebuild.
16579
7b308235
ILT
165802008-06-09 Ian Lance Taylor <iant@google.com>
16581
16582 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16583 <exception>.
16584 (throwing, orig_terminate): New static variables.
16585 (terminate_handler): New static function.
16586 (t2): Set terminate handler.
16587
f0b886e3
ILT
165882008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16589
16590 PR 6584
cd536b21 16591 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16592 alignment.
16593
3e90f135
CC
165942008-05-30 Cary Coutant <ccoutant@google.com>
16595
16596 * archive.cc (Archive::include_all_members) Correct to step
16597 over symbol table and extended name table in thin archives.
16598
e09ad04a
ILT
165992008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16600
16601 PR 6407
16602 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16603 calculation.
16604
62b01cb5
ILT
166052008-05-28 Caleb Howe <cshowe@google.com>
16606
16607 * reduced_debug_output.cc: New file.
16608 * reduced_debug_output.h: New file.
92de84a6 16609 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16610 * options.cc (General_options::finalize): Add strip_debug_non_line
16611 to the strip heirarchy.
16612 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16613 fields.
16614 * layout.cc: Include "reduced_debug_output.h".
16615 (Layout::Layout): Initialize new fields.
16616 (line_only_debug_sections): New static array.
16617 (is_lines_only_debug_sections): New static inline function.
16618 (Layout::include_section): Handle --strip-debug-non-line.
16619 (Layout::make_output_section): If --strip-debug-non-line, build
16620 new output sections for .debug_abbrev and .debug_info.
16621 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16622 gold. Warn about possible overflow.
16623 (read_signed_LEB_128): Likewise.
16624 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16625 (read_signed_LEB_128): Declare.
16626 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16627 (HFILES): Add reduced_debug_output.h.
16628 * Makefile.in: Rebuild.
16629
7d9e3d98
ILT
166302008-05-21 Ian Lance Taylor <iant@google.com>
16631
16632 * mapfile.cc: New file.
16633 * mapfile.h: New file.
16634 * options.h (class General_options): Add -M/--print-map and -Map.
16635 * options.cc (General_options::finalize): Make -M equivalent to
16636 -Map -.
16637 * main.cc: Include <cstdio> and "mapfile.h".
16638 (main): Open mapfile if requested.
16639 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16640 constructor. Change caller.
16641 (queue_initial_tasks): Add mapfile parameter. Change caller.
16642 (queue_middle_tasks): Likewise.
16643 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16644 declarations.
16645 * archive.cc: Include "mapfile.h".
16646 (Archive::add_symbols): Add mapfile parameter. Change all
16647 callers. Pass mapfile, symbol, and reason to include_member.
16648 (Archive::include_all_members): Add mapfile parameter. Change all
16649 callers.
16650 (Archive::include_member): Add mapfile, sym, and why parameters.
16651 Change all callers. Report inclusion to map file.
16652 * archive.h: Include "fileread.h".
16653 (class Archive): Update declarations.
16654 (Archive::file): New const method.
16655 (class Add_archive_symbols): Add mapfile_ field. Update
16656 constructor. Change all callers.
16657 * readsyms.h (class Read_symbols): Likewise.
16658 (class Finish_group): Likewise.
16659 (class Read_script): Likewise.
16660 * common.cc: Include "mapfile.h".
16661 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16662 all callers.
16663 (Symbol_table::do_allocate_commons): Likewise.
16664 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16665 symbol allocation to mapfile.
16666 * common.h (class Allocate_commons_task): Add mapfile_ field.
16667 Update constructor. Change all callers.
16668 * symtab.h (class Symbol_table): Update declarations.
16669 * layout.cc: Include "mapfile.h".
16670 (Layout_task_runner::run): Print information to mapfile.
16671 (Layout::create_gold_note): Change Output_data_fixed_space to
16672 Output_data_zero_fill.
16673 (Layout::create_build_id): Likewise.
16674 (Layout::print_to_mapfile): New function.
16675 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16676 constructor. Change caller.
16677 (class Layout): Declare print_to_mapfile.
16678 * output.cc (Output_section::Input_section::print_to_mapfile): New
16679 function.
16680 (Output_section::add_input_section): If producing a map, always
16681 add to input_sections_ list.
16682 (Output_section::do_print_to_mapfile): New function.
16683 (Output_segment::print_sections_to_mapfile): New function.
16684 (Output_segment::print_section_list_to_mapfile): New function.
16685 * output.h: Include "mapfile.h".
16686 (Output_data::print_to_mapfile): New function.
16687 (Output_data::do_print_to_mapfile): New virtual function.
16688 (Output_segment_headers::do_print_to_mapfile): New function.
16689 (Output_file_header::do_print_to_mapfile): New function.
16690 (Output_data_const::do_print_to_mapfile): New function.
16691 (class Output_data_const_buffer): Add map_name_ field. Update
16692 constructor. Change all callers. Add do_print_to_mapfile
16693 function.
16694 (class Output_data_fixed_space): Likewise.
16695 (class Output_data_space): Likewise.
16696 (class Output_data_zero_fill): New class.
16697 (Output_data_strtab::do_print_to_mapfile): New function.
16698 (Output_data_reloc_base::do_print_to_mapfile): New function.
16699 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16700 (Output_data_group::do_print_to_mapfile): New function.
16701 (Output_data_got::do_print_to_mapfile): New function.
16702 (Output_data_dynamic::do_print_to_mapfile): New function.
16703 (Output_symtab_xindex::do_print_to_mapfile): New function.
16704 (class Output_section): Declare do_print_to_mapflie. Declare
16705 print_to_mapfile in Input_section.
16706 (class Output_segment): Declare new functions.
16707 * object.h (Sized_relobj::symbol_count): New function.
16708 * script-sections.cc
16709 (Output_section_element_dot_assignment::set_section_addresses):
16710 Change Output_data_fixed_space to Output_data_zero_fill.
16711 (Output_data_expression::do_print_to_mapfile): New function.
16712 * script.cc (read_input_script): Add mapfile parameter. Change
16713 all callers.
16714 * script.h (read_input_script): Update declaration.
16715 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16716 (Eh_frame::do_print_to_mapfile): New function.
16717 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16718 (Output_merge_string::do_print_to_mapfile): New function.
16719 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16720 function.
16721 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16722 function.
16723 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16724 function.
16725 * Makefile.am (CCFILES): Add mapfile.cc.
16726 (HFILES): Add mapfile.h.
16727 * Makefile.in: Rebuild.
16728
9f1d377b
ILT
167292008-05-19 Ian Lance Taylor <iant@google.com>
16730
16731 * options.h (class General_options): Add -z relro.
16732 * layout.cc (Layout::Layout): Initialize relro_segment_.
16733 (Layout::add_output_section_data): Return the output section.
16734 (Layout::make_output_section): Rcognize relro sections and mark
16735 them appropriately.
16736 (Layout::attach_allocated_section_to_segment): Put relro sections
16737 in a PT_GNU_RELRO segment.
16738 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16739 section as relro.
16740 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16741 PT_TLS segments.
16742 (Layout::linkonce_mapping): Map d.rel.ro.local to
16743 .data.rel.ro.local.
16744 (Layout::output_section_name): Us .data.rel.ro.local for any
16745 section which begins with that.
16746 * layout.h (class Layout): Update add_output_section_data
16747 declaration. Add relro_segment_ field.
16748 * output.cc (Output_section::Output_section): Initialize is_relro_
16749 and is_relro_local_ fields.
16750 (Output_segment::add_output_section): Group relro sections.
16751 (Output_segment::is_first_section_relro): New function.
16752 (Output_segment::maximum_alignment): If there is a relro section,
16753 align the segment to the common page size.
16754 (Output_segment::set_section_addresses): Track whether we are
16755 looking at relro sections. If the last section is a relro
16756 section, align to the common page size.
16757 (Output_segment::set_section_list_addresses): Add in_relro
16758 parameter. Change all callers. Align to the page size when
16759 moving from relro to non-relro section.
16760 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16761 segment.
16762 * output.h (class Output_section): Add is_relro_ and
16763 is_relro_local_ fields.
16764 (Output_section::is_relro): New function.
16765 (Output_section::set_is_relro): New function.
16766 (Output_section::is_relro_local): New function.
16767 (Output_section::set_is_relro_local): New function.
16768 (class Output_segment): Update declarations.
16769 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16770 * sparc.cc (Target_sparc::got_section): Likewise.
16771 * x86_64.cc (Target_x86_64::got_section): Likewise.
16772 * testsuite/relro_test_main.cc: New file.
16773 * testsuite/relro_test.cc: New file.
16774 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16775 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16776 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16777 (relro_test.so, relro_test_pic.o): New targets.
16778 * testsuite/Makefile.in: Rebuild.
16779
a984ee1d
ILT
167802008-05-16 Ian Lance Taylor <iant@google.com>
16781
01676dcd
ILT
16782 * output.cc (Output_segment::add_output_section): Remove front
16783 parameter.
16784 * output.h (class Output_segment): Remove
16785 add_initial_output_section and overloaded add_output_section.
16786 Update declaration of remaining add_output_section.
16787 * layout.cc (Layout::create_interp): Call add_output_section
16788 rather than add_initial_output_section.
16789 (Layout::finish_dynamic_section): Likewise.
16790
497897f9
ILT
16791 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16792 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16793 know the dynamic type.
16794 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16795 field. Initialize it in constructor.
16796 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16797 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16798 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16799 reloc.
16800
a984ee1d
ILT
16801 * output.cc (Output_reloc::get_address): Change return type to
16802 Elf_Addr.
16803 * output.h (class Output_reloc): Update get_address declaration.
16804 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16805 for section addresses.
16806
55ba0940
ILT
168072008-05-09 Ian Lance Taylor <iant@google.com>
16808
16809 PR 6493
16810 * gold.cc (gold_nomem): Use return value of write.
16811
75517b77
ILT
168122008-05-08 Ian Lance Taylor <iant@google.com>
16813
16814 * symtab.c (Symbol::init_base_output_data): Add version
16815 parameter. Change all callers.
16816 (Symbol::init_base_output_segment): Likewise.
16817 (Symbol::init_base_constant): Likewise.
16818 (Symbol::init_base_undefined): Likewise.
16819 (Sized_symbol::init_output_data): Likewise.
16820 (Sized_symbol::init_output_segment): Likewise.
16821 (Sized_symbol::init_constant): Likewise.
16822 (Sized_symbol::init_undefined): Likewise.
16823 (Symbol_table::do_define_in_output_data): If the new symbol has a
16824 version, mark it as the default.
16825 (Symbol_table::do_define_in_output_segment): Likewise.
16826 (Symbol_table::do_define_as_constant): Likewise.
16827 * symtab.h (class Symbol): Update declarations.
16828 (class Sized_symbol): Likewise.
16829 * resolve.cc (Symbol::override_version): New function.
c42e122e 16830 (Symbol::override_base): Call override_version.
75517b77
ILT
16831 (Symbol::override_base_with_special): Likewise.
16832 * testsuite/ver_script_8.script: New file.
16833 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16834 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16835 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16836 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16837
f1f70eae
ILT
168382008-05-06 Ian Lance Taylor <iant@google.com>
16839
f3e9c5c5
ILT
16840 PR 6049
16841 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16842 functions.
16843 (class General_options): Remove existing --undefined, and add
16844 --no-undefined instead. Add new --undefined as synonym for -u.
16845 * archive.cc (Archive::add_symbols): Check whether symbol was
16846 named with -u.
16847 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16848 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16849 all uses. Add IS_UNDEFINED. Update declarations to split
16850 different versions of init_base. Declare init_base_undefined.
16851 (Symbol::is_defined): Handle IS_UNDEFINED.
16852 (Symbol::is_undefined): Likewise.
16853 (Symbol::is_weak_undefined): Call is_undefined.
16854 (Symbol::is_absolute): Handle IS_CONSTANT.
16855 (class Sized_symbol): Update declarations to split different
16856 versions of init. Declare init_undefined.
16857 (class Symbol_table): Declare new functions.
16858 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16859 Change all callers.
16860 (Symbol::init_base_output_data): Likewise.
16861 (Symbol::init_base_output_segment): Likewise.
16862 (Symbol::init_base_constant): Likewise.
16863 (Symbol::init_base_undefined): New function.
16864 (Sized_symbol::init_object): Rename from init. Change all
16865 callers.
16866 (Sized_symbol::init_output_data): Likewise.
16867 (Sized_symbol::init_output_segment): Likewise.
16868 (Sized_symbol::init_constant): Likewise.
16869 (Sized_symbol::init_undefined): New function.
16870 (Symbol_table::add_undefined_symbols_from_command_line): New
16871 function.
16872 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16873 function.
16874 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16875 (Symbol::output_section): Likewise.
16876 (Symbol::set_output_section): Likewise.
16877 (Symbol_table::sized_finalize_symbol): Likewise.
16878 (Symbol_table::sized_write_globals): Likewise.
16879 * resolve.cc (Symbol_table::should_override): Likewise.
16880 (Symbol::override_base_with_special): Likewise.
16881
8bdcdf2c
ILT
16882 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16883 symbol, change it to have default visibility.
16884 * testsuite/protected_1.cc: New file.
16885 * testsuite/protected_2.cc: New file.
16886 * testsuite/protected_3.cc: New file.
16887 * testsuite/protected_main_1.cc: New file.
16888 * testsuite/protected_main_2.cc: New file.
16889 * testsuite/protected_main_3.cc: New file.
16890 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16891 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16892 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16893 (protected_1.so): New target.
16894 (protected_1_pic.o, protected_2_pic.o): New targets.
16895 (protected_3_pic.o): New target.
16896 (check_PROGRAMS): Add protected_2.
16897 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16898 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16899 * testsuite/Makefile.in: Rebuild.
16900
2b706932
ILT
16901 * options.h (DEFINE_var): Add set_user_set_##varname__.
16902 (DEFINE_bool_alias): New macro.
16903 (class General_options): Define -Bstatic using DEFINE_bool_alias
16904 rather than DEFINE_special. Add --undefined as an alias for -z
16905 defs.
16906 * options.cc (General_options::parse_Bstatic): Remove.
16907
d82a5bcc
ILT
16908 * options.h (class General_options): Add --fatal-warnings.
16909 * main.cc (main): Implement --fatal-warnings.
16910 * errors.h (Errors::warning_count): New function.
16911
f1f70eae
ILT
16912 * options.h (class General_options): Add -Bsymbolic-functions.
16913 * symtab.h (Symbol::is_preemptible): Check for
16914 -Bsymbolic-functions.
16915
8825ac63
ILT
169162008-05-05 Ian Lance Taylor <iant@google.com>
16917
d98bc257
ILT
16918 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16919 as noVARNAME rather than no-VARNAME.
16920 (class General_options): Add option -z combreloc.
16921 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16922 get_address.
16923 (Output_reloc::sort_before) [SHT_REL]: New function.
16924 (Output_reloc::sort_before) [SHT_RELA]: New function.
16925 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16926 Sort_relocs_comparison.
16927 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16928 parameter. Change all callers.
16929 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16930 sort_relocs parameter. Change all callers.
16931 * output.cc (Output_reloc::get_address): New function, broken out
16932 of write_rel.
16933 (Output_reloc::write_rel): Call it.
16934 (Output_reloc::compare): New function.
16935 (Output_data_reloc_base::do_write): Optionally sort relocs.
16936
60b2b4e7
ILT
16937 * configure.ac: If targ_extra_obj is set, link it in.
16938 * configure.tgt: Initialize all variables.
16939 (x86_64*): Set targ_extra_obj and targ_extra_size.
16940 * configure: Rebuild.
16941
8825ac63
ILT
16942 * object.cc (Sized_relobj::include_section_group): Adjust section
16943 indexes read from group data. Build vector to pass to
16944 layout_group.
16945 * layout.cc (Layout::layout_group): Add flags and shndxes
16946 parameters. Remove contents parameter. Change caller. Update
16947 explicit instantiations.
16948 * layout.h (class Layout): Update layout_group declaration.
16949 * output.cc (Output_data_group::Output_data_group): Add flags and
16950 input_shndxes parameters. Remove contents parameter. Change
16951 caller.
16952 (Output_data_group::do_write): Change input_sections_ to
16953 input_shndxes_.
16954 * output.h (class Output_data_group): Update constructor
16955 declaration. Rename input_sections_ to input_shndxes_.
16956 * testsuite/many_sections_test.cc: Add template.
16957
e94cf127
CC
169582008-04-30 Cary Coutant <ccoutant@google.com>
16959
4418b2d5
CC
16960 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16961
e94cf127
CC
16962 * layout.cc (Layout::include_section): Refactored check for debug
16963 info section.
16964 (Layout::add_comdat): Add new parameters. Change type
16965 of signature parameter. Add object and shndx to signatures table.
16966 (Layout::find_kept_object): New function.
16967 * layout.h: Include <cstring>.
16968 (Layout::is_debug_info_section): New function.
16969 (Layout::add_comdat): Add new parameters.
16970 (Layout::find_kept_object): New function.
16971 (Layout::Kept_section): New struct.
16972 (Layout::Signatures): Change type of map range.
16973 * object.cc (Relobj::output_section_address): New function.
16974 (Sized_relobj::include_section_group): Add new parameters. Change
16975 calls to Layout::add_comdat. Change to build table of kept comdat
16976 groups and table mapping discarded sections to kept sections.
16977 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16978 (Sized_relobj::do_layout): Change calls to include_section_group and
16979 include_linkonce_section.
16980 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16981 value to zero when section is discarded.
16982 (Sized_relobj::map_to_kept_section): New function.
16983 * object.h (Relobj::output_section_address): New function.
16984 (Relobj::Comdat_group): New type.
16985 (Relobj::find_comdat_group): New function.
16986 (Relobj::Comdat_group_table): New type.
16987 (Relobj::Kept_comdat_section): New type.
16988 (Relobj::Kept_comdat_section_table): New type.
16989 (Relobj::add_comdat_group): New function.
16990 (Relobj::set_kept_comdat_section): New function.
16991 (Relobj::get_kept_comdat_section): New function.
16992 (Relobj::comdat_groups_): New field.
16993 (Relobj::kept_comdat_sections_): New field.
16994 (Symbol_value::input_value): Update comment.
16995 (Sized_relobj::map_to_kept_section) New function.
16996 (Sized_relobj::include_linkonce_section): Add new parameter.
16997 * target-reloc.h (Comdat_behavior): New type.
16998 (get_comdat_behavior): New function.
16999 (relocate_section): Add code to map a discarded section to the
17000 corresponding kept section when applying a relocation.
17001
e4e5049b
CS
170022008-04-30 Craig Silverstein <csilvers@google.com>
17003
17004 * dwarf_reader.cc (next_generation_count): New static var.
17005 (Addr2line_cache_entry): New struct.
17006 (addr2line_cache): New static var.
17007 (Dwarf_line_info::one_addr2line): Added caching.
17008 (Dwarf_line_info::clear_addr2line_cache): New function.
17009 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17010 cache-size parameter.
17011 (Dwarf_line_info::one_addr2line_cache): New function.
17012 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17013 new cache-size argument to one_addr2line(), and clear cache.
17014
d09e9154
CC
170152008-04-28 Cary Coutant <ccoutant@google.com>
17016
17017 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17018 R_386_PC8 relocations.
17019
7ef73768
ILT
170202008-04-23 Ian Lance Taylor <iant@google.com>
17021
55438702
ILT
17022 * object.cc (Sized_relobj::include_section_group): Check for
17023 invalid section group.
17024
c165fb93
ILT
17025 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17026 header size.
17027
7ef73768
ILT
17028 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17029 than read for file header.
17030 * archive.cc (Archive::include_member): Likewise.
17031
6194aaab
L
170322008-04-23 Paolo Bonzini <bonzini@gnu.org>
17033
17034 * aclocal.m4: Regenerate.
17035 * configure: Regenerate.
17036
d491d34e
ILT
170372008-04-19 Ian Lance Taylor <iant@google.com>
17038
5ea2bac6
ILT
17039 * version.cc (version_string): Bump to 1.6.
17040
7bc3e21a
ILT
17041 * testsuite/Makefile.am (many_sections_r_test): New target.
17042 (many_sections_r_test_SOURCES): Remove.
17043 (many_sections_r_test_DEPENDENCIES): Remove.
17044 (many_sections_r_test_LDFLAGS): Remove.
17045 (many_sections_r_test_LDADD): Remove.
17046
7fcd3aa9
ILT
17047 * object.cc (Sized_relobj::do_add_symbols): Always pass
17048 local_symbol_count_ to add_from_relobj.
17049
4c94d6ae
ILT
17050 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17051 every thousand variables.
17052 * testsuite/Makefile.in: Rebuild.
17053
d491d34e
ILT
17054 * object.cc (Xindex::initialize_symtab_xindex): New function.
17055 (Xindex::read_symtab_xindex): New function.
17056 (Xindex::sym_xindex_to_shndx): New function.
17057 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17058 available.
17059 (Sized_relobj::do_initialize_xindex): New function.
17060 (Sized_relobj::do_read_symbols): Adjust section links.
17061 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17062 parameter. Change all callers.
17063 (Sized_relobj::include_section_group): Adjust section links and
17064 symbol section indexes.
17065 (Sized_relobj::do_layout): Adjust section links.
17066 (Sized_relobj::do_count_local_symbols): Adjust section links and
17067 symbol section indexes.
17068 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17069 ordinary and special symbols.
17070 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17071 dynsym_xindex parameters. Change all callers. Adjust section
17072 links. Use SHN_XINDEX when needed.
17073 (Sized_relobj::get_symbol_location_info): Adjust section links.
17074 Don't get fooled by special symbols.
17075 * object.h (class Xindex): Define.
17076 (class Object): Add xindex_ parameter. Declare virtual functoin
17077 do_initialize_xindex.
17078 (Object::adjust_sym_shndx): New function.
17079 (Object::set_xindex): New protected function.
17080 (class Symbol_value): Add is_ordinary_shndx_ field.
17081 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17082 (Symbol_value::value): Assert ordinary section.
17083 (Symbol_value::initialize_input_to_output_map): Likewise.
17084 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17085 Change all callers.
17086 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17087 all callers.
17088 (class Sized_relobj): Update declarations.
17089 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17090 parameter. Change all callers.
17091 (Sized_relobj::adjust_shndx): New function.
17092 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17093 field.
17094 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17095 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17096 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17097 (Sized_dynobj::read_dynsym_section): Adjust section links.
17098 (Sized_dynobj::read_dynamic): Likewise.
17099 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17100 section links.
17101 (Sized_dynobj::do_initialize_xindex): New function.
17102 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17103 do_initialize_xindex.
17104 (Sized_dynobj::adjust_shndx): New function.
17105 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17106 dynsym_xindex_ fields.
17107 (Layout::finalize): Add a call to set_section_indexes before
17108 creating the symtab sections.
17109 (Layout::set_section_indexes): Don't do anything if the section
17110 already has a section index.
17111 (Layout::create_symtab_sections): Add shnum parameter. Change
17112 caller. Create .symtab_shndx section if needed.
17113 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17114 caller.
17115 (Layout::allocated_output_section_count): New function.
17116 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17117 needed.
17118 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17119 fields. Update declarations.
17120 (Layout::symtab_xindex): New function.
17121 (Layout::dynsym_xindex): New function.
17122 (class Write_symbols_task): Add layout_ field.
17123 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17124 Change caller.
17125 * output.cc (Output_section_headers::Output_section_headers): Add
17126 shstrtab_section parameter. Change all callers.
17127 (Output_section_headers::do_sized_write): Store overflow values
17128 for section count and section string table section index in
17129 section header zero.
17130 (Output_file_header::do_sized_write): Check for overflow of
17131 section count and section string table section index.
17132 (Output_symtab_xindex::do_write): New function.
17133 (Output_symtab_xindex::endian_do_write): New function.
17134 * output.h (class Output_section_headers): Add shstrtab_section_.
17135 Update declarations.
17136 (class Output_symtab_xindex): Define.
17137 (Output_section::has_out_shndx): New function.
17138 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17139 field.
17140 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17141 Change all callers.
17142 (Sized_symbol::init): Likewise.
17143 (Symbol::output_section): Check for ordinary symbol.
17144 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17145 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17146 callers.
17147 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17148 Change all callers. Simplify handling of symbols from sections
17149 not included in the link.
17150 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17151 distinction.
17152 (Weak_alias_sorter::operator()): Assert that symbols are
17153 ordinary.
17154 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17155 distinction.
17156 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17157 parameters. Change all callers.
17158 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17159 symbol distinction. Use SHN_XINDEX when needed.
17160 (Symbol_table::write_section_symbol): Add symtab_xindex
17161 parameter. Change all callers.
17162 (Symbol_table::sized_write_section_symbol): Likewise. Use
17163 SHN_XINDEX when needed.
17164 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17165 declarations.
17166 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17167 (Symbol::is_defined): Check is_ordinary.
17168 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17169 (Symbol::is_absolute, Symbol::is_common): Likewise.
17170 (class Sized_symbol): Update declarations.
17171 (class Symbol_table): Update declarations.
17172 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17173 parameters. Change all callers.
17174 (Sized_symbol::override): Likewise.
17175 (Symbol_table::override): Likewise.
17176 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17177 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17178 is_ordinary, and orig_st_shndx parameters. Change all callers.
17179 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17180 to be in an ordinary section.
17181 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17182 object and is_ordinary parameters. Change all callers.
17183 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17184 Change all callers. Don't add undefined or non-ordinary symbols
17185 to reloc_map_.
17186 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17187 Change all callers.
17188 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17189 declarations.
17190 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17191 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17192 (Sized_relobj::relocate_sections): Likewise.
17193 * target-reloc.h (scan_relocs): Adjust section symbol index.
17194 (scan_relocatable_relocs): Likewise.
17195 * i386.cc (Scan::local): Check for ordinary symbols.
17196 * sparc.cc (Scan::local): Likewise.
17197 * x86_64.cc (Scan::local): Likewise.
17198 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17199 to symbol_section_and_value.
17200 * testsuite/many_sections_test.cc: New file.
17201 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17202 (check_PROGRAMS): Add many_sections_test.
17203 (many_sections_test_SOURCES): Define.
17204 (many_sections_test_DEPENDENCIES): Define.
17205 (many_sections_test_LDFLAGS): Define.
17206 (BUILT_SOURCES): Add many_sections_define.h.
17207 (many_sections_define.h): New target.
17208 (BUILT_SOURCES): Add many_sections_check.h.
17209 (many_sections_check.h): New target.
17210 (check_PROGRAMS): Add many_sections_r_test.
17211 (many_sections_r_test_SOURCES): Define.
17212 (many_sections_r_test_DEPENDENCIES): Define.
17213 (many_sections_r_test_LDFLAGS): Define.
17214 (many_sections_r_test_LDADD): Define.
17215 (many_sections_r_test.o): New target.
17216 * testsuite/Makefile.in: Rebuild.
17217
c5818ff1
CC
172182008-04-17 Cary Coutant <ccoutant@google.com>
17219
17220 * errors.cc (Errors::info): New function.
17221 (gold_info): New function.
17222 * errors.h (Errors::info): New function.
17223 * gold.h (gold_info): New function.
17224 * object.cc (Input_objects::add_object): Print trace output.
17225 * options.cc (options::parse_set): New function.
17226 (General_options::parse_wrap): Deleted.
17227 (General_options::General_options): Deleted initializer.
17228 * options.h (options::String_set): New typedef.
17229 (options::parse_set): New function.
17230 (DEFINE_set): New macro.
17231 (General_options::wrap): Changed to use DEFINE_set. Changed
17232 callers of any_wrap_symbols and is_wrap_symbol.
17233 (General_options::trace, General_options::trace_symbol):
17234 New options.
17235 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17236 (General_options::wrap_symbols_): Deleted.
17237 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17238
b5be4a7c
DM
172392008-04-17 David S. Miller <davem@davemloft.net>
17240
17241 * options.cc (General_options::parse_V): New function.
17242 * options.h: Add entries for -V and -Qy.
17243
155a0dd7
ILT
172442008-04-17 Ian Lance Taylor <iant@google.com>
17245
17246 * common.cc (Symbol_table::allocate_commons): Remove options
17247 parameter. Change caller.
17248 (Symbol_table::do_allocate_commons): Remove options parameter.
17249 Change caller. Just call do_allocate_commons_list twice.
17250 (Symbol_table::do_allocate_commons_list): New function, broken out
17251 of do_allocate_commons.
17252 * common.h (class Allocate_commons_task): Remove options_ field.
17253 Update constructor.
17254 * symtab.cc (Symbol_table::Symbol_table): Initialize
17255 tls_commons_.
17256 (Symbol_table::add_from_object): Put TLS common symbols on
17257 tls_commons_ list.
17258 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17259 which are IN_OUTPUT_DATA.
17260 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17261 allocate_commons and do_allocate_commons declarations. Declare
17262 do_allocate_commons_list.
17263 * gold.cc (queue_middle_tasks): Update creation of
17264 Allocate_commons_task to not pass options.
17265 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17266 (TLS_TEST_C_FLAGS): New variable.
17267 (tls_test_c_pic.o): New target.
17268 (tls_test_shared.so): Link in tls_test_c_pic.o.
17269 (tls_test_c_pic_ie.o): New target.
17270 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17271 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17272 (tls_test_c.o): New target.
17273 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17274 (tls_pic_test_LDADD): Likewise.
17275 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17276 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17277 (tls_test_c_gnu2.o): New target.
17278 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17279 tls_test_c_gnu2.o.
17280 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17281 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17282 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17283 * testsuite/tls_test.cc: Include "config.h".
17284 (t_last): Call t11_last.
17285 * testsuite/tls_test.h (t11, t11_last): Declare.
17286 * testsuite/tls_test_c.c: New file.
17287 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17288 * configure.ac: Check for OpenMP support.
17289 * configure, config.in, Makefile.in: Rebuild.
17290 * testsuite/Makefile.in: Rebuild.
17291
edfbb029
CC
172922008-04-16 Cary Coutant <ccoutant@google.com>
17293
17294 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17295 (Target_i386::tls_base_symbol_defined_): New field.
17296 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17297 (Target_i386::Scan::global): Likewise.
17298 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17299 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17300 (Target_x86_64::tls_base_symbol_defined_): New field.
17301 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17302 (Target_x86_64::Scan::global): Likewise.
17303
f3c69fca
CC
173042008-04-16 Cary Coutant <ccoutant@google.com>
17305
17306 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17307 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17308 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17309 building shared libraries.
17310 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17311 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17312 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17313 * testsuite/Makefile.in: Rebuild.
17314 * testsuite/weak_undef.h: New file.
17315 * testsuite/weak_undef_file1.cc: Add extra test cases.
17316 * testsuite/weak_undef_file2.cc: Likewise.
17317 * testsuite/weak_undef_test.cc: Likewise.
17318
7c414435
DM
173192008-04-16 David S. Miller <davem@davemloft.net>
17320
32b769e1
DM
17321 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17322 Add issued_non_pic_error_ field. Declare check_non_pic.
17323 (Target_sparc::Scan::check_non_pic): New function.
17324 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17325 (Target_sparc::Scan::global): Likewise.
17326
11936fb1
DM
17327 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17328 * configure: Rebuild.
17329
7c414435
DM
17330 * options.h (DEFINE_enable): New macro.
17331 (new_dtags): New enable option.
17332 (initfirst, interpose, loadfltr, nodefaultlib,
17333 nodelete, nodlopen, nodump): New -z options.
17334 * layout.cc (Layout:finish_dynamic_section): If new
17335 dtags enabled, emit DT_RUNPATH. Also, emit a
17336 DT_FLAGS_1 containing any specified -z flags.
17337
85c7bf8b
ILT
173382008-04-16 Ian Lance Taylor <iant@google.com>
17339
12c0daef
ILT
17340 * copy-relocs.cc: New file.
17341 * copy-relocs.h: New file.
17342 * reloc.cc: Remove Copy_relocs code.
17343 * reloc.h: Likewise.
17344 * reloc-types.h (struct Reloc_types) [both versions]: Add
17345 get_reloc_addend_noerror.
17346 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17347 variants of add_global which take an addend which must be zero.
17348 * i386.cc: Include "copy-relocs.h".
17349 (class Target_i386): Change type of copy_relocs_ to variable,
17350 update initializer.
17351 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17352 Change all callers.
17353 (Target_i386::do_finalize_sections): Change handling of
17354 copy_relocs_.
17355 * sparc.cc: Include "copy-relocs.h".
17356 (class Target_sparc): Change type of copy_relocs_ to variable,
17357 update initializer.
17358 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17359 Change all callers.
17360 (Target_sparc::do_finalize_sections): Change handling of
17361 copy_relocs_.
17362 * x86_64.cc: Include "copy-relocs.h".
17363 (class Target_x86_64): Change type of copy_relocs_ to variable,
17364 update initializer.
17365 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17366 class. Change all callers.
17367 (Target_x86_64::do_finalize_sections): Change handling of
17368 copy_relocs_.
17369 * Makefile.am (CCFILES): Add copy-relocs.cc.
17370 (HFILES): Add copy-relocs.h.
17371
4f4995b6
ILT
17372 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17373
85c7bf8b
ILT
17374 * testsuite/script_test_4.sh: Permit leading zeroes.
17375
4f2a9edd
ILT
173762008-04-15 Ian Lance Taylor <iant@google.com>
17377
e6188289
ILT
17378 * script-sections.cc (Script_sections::create_segments): Use
17379 header_size_adjustment even when there is enough room for the
17380 headers.
17381 * testsuite/script_test_4.sh: New file.
17382 * testsuite/script_test_4.t: New file.
17383 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17384 (check_DATA): Add script_test_4.stdout.
17385 (MOSTLYCLEANFILES): Likewise.
17386 (script_test_4): New target.
17387 (script_test_4.stdout): New target.
17388 * testsuite/Makefile.in: Rebuild.
17389
4f2a9edd
ILT
17390 * sparc.cc: Add definitions for Output_data_plt_sparc class
17391 constants.
17392
f5314dd5
DM
173932008-04-14 David S. Miller <davem@davemloft.net>
17394
17395 * sparc.cc: New file.
17396 * Makefile.am (TARGETSOURCES): Add sparc.cc
17397 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17398 * configure.tgt: Document targ_extra_size and
17399 targ_extra_big_endian. Add entries for sparc-* and
17400 sparc64-*.
17401 * configure.ac: Handle targ_extra_size and
17402 targ_extra_big_endian.
17403 * Makefile.in: Rebuild.
17404 * configure: Likewise.
17405 * po/POTFILES.in: Likewise.
17406 * po/gold.pot: Likewise.
17407
154e0e9a
ILT
174082008-04-14 Ian Lance Taylor <iant@google.com>
17409
17410 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17411 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17412 in the name/type/flags to section mapping. Don't call
17413 allocate_output_section.
17414 (Layout::choose_output_section): Change parameter from adjust_name
17415 to is_input_section. Don't permit input sections after sections
17416 are attached to segments. Don't call allocate_output_section.
17417 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17418 not write_enable_output_section.
17419 (Layout::make_output_section): Don't push to
17420 unattached_section_list_ nor call attach_to_segment. Call
17421 attach_section_to_segment if sections are attached.
17422 (Layout::attach_sections_to_segments): New function.
17423 (Layout::attach_section_to_segment): New function.
17424 (Layout::attach_allocated_section_to_segment): Rename from
17425 attach_to_segment. Remove flags parameter.
17426 (Layout::allocate_output_section): Remove function.
17427 (Layout::write_enable_output_section): Remove function.
17428 * layout.h (class Layout): Update for above changes. Add new
17429 field sections_are_attached_.
17430 * output.h (Output_section::update_flags_for_input_section): New
17431 function.
17432 * output.cc (Output_section::add_input_section): Call
17433 update_flags_for_input_section.
17434 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17435
009a67a2
CC
174362008-04-11 Cary Coutant <ccoutant@google.com>
17437
17438 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17439 thought unnecessary.
17440 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17441
759b1a24
ILT
174422008-04-11 Ian Lance Taylor <iant@google.com>
17443
17444 * output.h (class Output_section_data): Remove inline definition
17445 of set_addralign.
17446 * output.cc (Output_section_data::set_addralign): New function.
17447
c2b45e22
CC
174482008-04-11 Cary Coutant <ccoutant@google.com>
17449
17450 Add support for TLS descriptors for i386 and x86_64.
17451 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17452 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17453 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17454 GOT_TYPE_TLS_DESC.
17455 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17456 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17457 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17458 relocations.
17459 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17460 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17461 Fix problem with initial-exec relocations.
17462 (Target_i386::Relocate::relocate_tls): Likewise.
17463 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17464 relaxation.
17465 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17466 support for section-plus-offset dynamic table entries.
17467 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17468 (Output_data_dynamic::Dynamic_entry): Add support for
17469 section-plus-offset dynamic table entries.
17470 (Output_data_dynamic::Classification): Likewise.
17471 (Output_data_dynamic::classification_): Renamed offset_.
17472 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17473 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17474 (Target_x86_64::make_plt_section): New function.
17475 (Target_x86_64::reserve_tlsdesc_entries): New function.
17476 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17477 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17478 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17479 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17480 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17481 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17482 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17483 add extra PLT entry for TLS descriptors.
17484 (Output_data_plt_x86_64::got_): New field.
17485 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17486 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17487 fields.
17488 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17489 descriptors.
17490 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17491 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17492 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17493 R_386_TLS_DESC_CALL relocations.
17494 (Target_x86_64::Scan::global): Likewise.
17495 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17496 for TLS descriptors.
17497 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17498 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17499 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17500 GD-to-IE relaxation.
17501 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17502 and TLS_DESCRIPTORS.
17503 * Makefile.in: Rebuild.
17504 * configure: Rebuild.
17505 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17506 (tls_test_shared2.so): New target.
17507 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17508 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17509 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17510 (tls_shared_gd_to_ie_test_LDADD): New variable.
17511 (tls_shared_gnu2_gd_to_ie_test): New target.
17512 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17513 New targets.
17514 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17515 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17516 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17517 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17518 (tls_shared_gnu2_test): New target.
17519 (tls_test_gnu2_shared.so): New target.
17520 (tls_shared_gnu2_test_SOURCES): New variable.
17521 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17522 (tls_shared_gnu2_test_LDFLAGS): New variable.
17523 (tls_shared_gnu2_test_LDADD): New variable.
17524 * testsuite/Makefile.in: Rebuild.
17525 * testsuite/Makefile.
17526
83bfb6b7
ILT
175272008-04-11 Ian Lance Taylor <iant@google.com>
17528
17529 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17530 justsyms.t.
17531 * testsuite/Makefile.in: Rebuild.
17532
17533 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17534 long.
17535 * testsuite/script_test_2.cc (main): Adjust test.
17536
706e1f5e
ILT
175372008-04-11 David S. Miller <davem@davemloft.net>
17538 Ian Lance Taylor <iant@google.com>
17539
17540 * options.h (General_options): Add entries for '-Y' and
17541 '-relax'.
17542 * options.cc (General_options:finalize): If -Y was used, add those
17543 entries to the library path instead of the default "/lib" and
17544 "/usr/lib".
17545
7c98e6bb
DM
175462008-04-11 David S. Miller <davem@davemloft.net>
17547
17548 * testsuite/justsyms.t: Start at 0x100.
17549 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17550 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17551 long.
17552 * testsuite/script_test_2.cc: Adjust string and section length
17553 checks.
7c98e6bb 17554
99a37bfd
ILT
175552008-04-09 Ian Lance Taylor <iant@google.com>
17556
2cefc357
ILT
17557 PR gold/5996
17558 * script-sections.cc (Sections_element::allocate_to_segment): Add
17559 orphan parameter.
17560 (Output_section_definition::allocate_to_segment): Likewise.
17561 (Orphan_output_section::allocate_to_segment): Likewise.
17562 (Script_sections::attach_sections_using_phdrs_clause): Don't
17563 propagate non-PT_LOAD segments to orphan sections.
17564 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17565 readelf rather than objdump.
17566 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17567 .interp section and PT_INTERP segment are the same size.
17568 * testsuite/Makefile.in: Rebuild.
17569
99a37bfd
ILT
17570 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17571 aliases for symbols defined in the same object.
17572 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17573 (weak_alias_test_SOURCES): New variable.
17574 (weak_alias_test_DEPENDENCIES): New variable.
17575 (weak_alias_test_LDFLAGS): New variable.
17576 (weak_alias_test_LDADD): New variable.
17577 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17578 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17579 (weak_alias_test_3.o): New target.
17580 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17581 * testsuite/weak_alias_test_main.cc: New file.
17582 * testsuite/weak_alias_test_1.cc: New file.
17583 * testsuite/weak_alias_test_2.cc: New file.
17584 * testsuite/weak_alias_test_3.cc: New file.
17585
780e49c5
ILT
175862008-04-08 Ian Lance Taylor <iant@google.com>
17587
cdb0b8f5
ILT
17588 * options.h (class General_options): Add --noinhibit-exec option.
17589 * main.cc (main): Check --noinhibit-exec.
17590
0864d551
ILT
17591 * options.h (class General_options): Define --wrap as a special
17592 option. Add wrap_symbols_ field.
17593 (General_options::any_wrap_symbols): New function.
17594 (General_options::is_wrap_symbol): New function.
17595 * options.cc (General_options::parse_wrap): New function.
17596 (General_options::General_options): Initialize wrap_symbols_.
17597 * symtab.cc (Symbol_table::wrap_symbol): New function.
17598 (Symbol_table::add_from_object): Handle --wrap.
17599 * symtab.h (class Symbol_table): Declare wrap_symbol.
17600 * target.h (Target::wrap_char): New function.
17601 (Target::Target_info): Add wrap_char field.
17602 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17603 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17604 * testsuite/testfile.cc (Target_test::test_target_info):
17605 Likewise.
17606
789aa6de
ILT
17607 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17608 there is one.
17609
2c38906f
ILT
17610 * layout.h (class Layout): Add added_eh_frame_data_ field.
17611 * layout.cc (Layout::Layout): Initialize new field.
17612 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17613 output section until we find a section we merged successfully.
17614 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17615 that the size be non-zero.
17616
780e49c5
ILT
17617 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17618 qualifier.
17619
7fcd0256
ILT
176202008-04-08 Craig Silverstein <csilvers@google.com>
17621
17622 * configure.ac: Export new conditional variable HAVE_ZLIB.
17623 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17624 on HAVE_ZLIB.
17625 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17626 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17627
6835af53
ILT
176282008-04-07 Ian Lance Taylor <iant@google.com>
17629
e24f324c
ILT
17630 * version.cc (version_string): Set to "1.5".
17631
a036edd8
ILT
17632 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17633 Add issued_non_pic_error_ field. Declare check_non_pic.
17634 (Target_x86_64::Scan::check_non_pic): New function.
17635 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17636 (Target_x86_64::Scan::global): Likewise.
17637
624f8810
ILT
17638 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17639 addend parameter. Change caller. Handle merge sections.
17640 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17641 Address to Addend. Don't add in the result of
17642 local_section_offset, pass down the addend and use the returned
17643 value.
17644 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17645 Update declarations of local_section_offset and symbol_value.
17646 * testsuite/two_file_test_1.cc (t18): New function.
17647 * testsuite/two_file_test_2.cc (f18): New function.
17648 * testsuite/two_file_test_main.cc (main): Call t18.
17649 * testsuite/two_file_test.h (t18, f18): Declare.
17650
6835af53
ILT
17651 * configure.ac: Don't test for objdump, c++filt, or readelf.
17652 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17653 conditionals.
17654 (TEST_READELF): New variable.
17655 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17656 (check_PROGRAMS): Add two_file_strip_test.
17657 (two_file_strip_test): New target.
17658 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17659 (two_file_same_shared_strip_test_SOURCES): New variable.
17660 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17661 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17662 (two_file_same_shared_strip_test_LDADD): New variable.
17663 (two_file_shared_strip.so): New target.
17664 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17665 (ver_test_5.syms, ver_test_7.syms): Likewise.
17666 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17667 (strip_test_3.stdout): Use TEST_OBJDUMP.
17668 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17669
86925eef
CC
176702008-04-04 Cary Coutant <ccoutant@google.com>
17671
17672 * symtab.h (Symbol::is_weak_undefined): New function.
17673 (Symbol::is_strong_undefined): New function.
17674 (Symbol::is_absolute): New function.
17675 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17676 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17677 absolute symbols.
17678 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17679 (weak_undef_test): New target.
17680 * testsuite/Makefile.in: Rebuild.
17681 * testsuite/weak_undef_file1.cc: New file.
17682 * testsuite/weak_undef_file2.cc: New file.
17683 * testsuite/weak_undef_test.cc: New file.
17684
126f3ece
ILT
176852008-04-03 Craig Silverstein <csilvers@google.com>
17686
17687 * compressed_output.h (class Output_compressed_section): Use
17688 unsigned buffer.
17689 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17690 add zlib header.
17691 (zlib_compressed_suffix): Removed.
17692 (Output_compressed_section::set_final_data_size): Use unsigned
17693 buffers.
17694 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17695 Fix linker invocation.
17696 (flagstest_o_specialfile_and_compress_debug_sections):
17697 Likewise.
17698 * testsuite/Makefile.in: Regenerated.
17699
deae2a14
DM
177002008-04-02 David S. Miller <davem@davemloft.net>
17701
17702 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17703 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17704
70752818
ILT
177052008-04-02 Craig Silverstein <csilvers@google.com>
17706
17707 * TODO: New file.
17708
39d0cb0e
ILT
177092008-04-02 Ian Lance Taylor <iant@google.com>
17710
17711 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17712 parameters. Update for new key type to views_. Change all
17713 callers.
17714 (File_read::read): Adjust for byteshift in returned view.
17715 (File_read::add_view): New function, broken out of
17716 find_and_make_view.
17717 (File_read::make_view): New function, broken out of
17718 find_and_make_view.
17719 (File_read::find_or_make_view): Add offset and aligned
17720 parameters. Rewrite accordingly. Change all callers.
17721 (File_read::get_view): Add offset and aligned parameters. Adjust
17722 for byteshift in return value.
17723 (File_read::get_lasting_view): Likewise.
17724 * fileread.h (class File_read): Update declarations.
17725 (class File_read::View): Add byteshift_ field. Add byteshift to
17726 constructor. Add byteshift method.
17727 * archive.h (Archive::clear_uncached_views): New function.
17728 (Archive::get_view): Add aligned parameter. Change all callers.
17729 * object.h (Object::get_view): Add aligned parameter. Change all
17730 callers.
17731 (Object::get_lasting_view): Likewise.
17732
17733 * fileread.cc (File_read::release): Don't call clear_views if
17734 there are multiple objects.
17735 * fileread.h (File_read::clear_uncached_views): New function.
17736 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17737 on the archive.
17738
a1207466
CC
177392008-03-31 Cary Coutant <ccoutant@google.com>
17740
17741 Add thin archive support.
17742 * archive.cc (Archive::armagt): New const.
17743 (Archive::setup): Remove task parameter and calls to unlock.
17744 (Archive::unlock_nested_archives): New function.
17745 (Archive::read_header): Add nested_off parameter. Change
17746 all callers.
17747 (Archive::interpret_header): Likewise.
17748 (Archive::include_all_members): Change to handle thin
17749 archives.
17750 (Archive::include_member): Likewise.
17751 * archive.h (Archive::Archive): Add new parameters and
17752 initializers.
17753 (Archive::armagt): New const.
17754 (Archive::setup): Remove task parameter.
17755 (Archive::unlock_nested_archives): New function.
17756 (Archive::read_header): Add nested_off parameter.
17757 (Archive::interpret_header): Likewise.
17758 (Archive::Nested_archive_table): New typedef.
17759 (Archive::is_thin_archive_): New field.
17760 (Archive::nested_archives_): New field.
17761 (Archive::options_): New field.
17762 (Archive::dirpath_): New field.
17763 (Archive::task_): New field.
17764 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17765 for thin archives. Pass additional parameters to
17766 Archive::Archive. Unlock the archive file after calling
17767 Archive::setup.
cd536b21 17768
479f6503
ILT
177692008-03-29 Ian Lance Taylor <iant@google.com>
17770
686c8caf
ILT
17771 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17772 version symbol to be local.
17773 * testsuite/ver_test_4.sh: New file.
17774 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17775 (check_DATA): Add ver_test_4.syms.
17776 (ver_test_4.syms): New target.
17777 * testsuite/Makefile.in: Rebuild.
17778
ab794b6b
ILT
17779 * output.cc
17780 (Output_section::Input_section_sort_entry::has_priority): New
17781 function.
17782 (Output_section::Input_section_sort_entry::match_file_name): New
17783 function.
17784 (Output_section::Input_section_sort_entry::match_section_name):
17785 Remove.
17786 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17787 Remove.
17788 (Output_section::Input_section_sort_entry::match_section_file):
17789 Remove.
17790 (Output_section::Input_section_sort_compare::operator()): Rewrite
17791 using new Input_section_sort_entry functions. Sort crtbegin and
17792 crtend first. Sort sections with no priority before sections with
17793 a priority.
17794 * testsuite/initpri1.c (d3): Check j != 4.
17795 (cd5): New constructor/destructor function.
17796 (main): Check j != 2.
17797
479f6503
ILT
17798 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17799 new symbol when resolving, don't call set_is_default.
17800 * testsuite/ver_test_7.cc: New file.
17801 * testsuite/ver_test_7.sh: New file.
17802 * testsuite/Makefile.am (ver_test_7.so): New target.
17803 (ver_test_7.o): New target.
17804 (check_SCRIPTS): Add ver_test_7.sh.
17805 (check_DATA): Add ver_test_7.syms.
17806 (ver_test_7.syms): New target.
17807
2fd32231
ILT
178082008-03-28 Ian Lance Taylor <iant@google.com>
17809
17810 * layout.cc (Layout::layout): If we see an input section with a
17811 name that needs sorting, set the must_sort flag for the output
17812 section.
17813 (Layout::make_output_section): If the name of the output section
17814 indicates that it might require sorting, set the may_sort flag.
17815 * output.h (Output_section::may_sort_attached_input_sections): New
17816 function.
17817 (Output_section::set_may_sort_attached_input_sections): New
17818 function.
17819 (Output_section::must_sort_attached_input_sections): New
17820 function.
17821 (Output_section::set_must_sort_attached_input_sections): New
17822 function.
17823 (class Output_section): Declare Input_section_sort_entry. Define
17824 Input_section_sort_compare. Declare
17825 sort_attached_input_sections. Add new fields:
17826 may_sort_attached_input_sections_,
17827 must_sort_attached_input_sections_,
17828 attached_input_sections_are_sorted_.
17829 * output.cc (Output_section::Output_section): Initialize new
17830 fields.
17831 (Output_section::add_input_section): Add an entry to
17832 input_sections_ if may_sort or must_sort are true.
17833 (Output_section::set_final_data_size): Call
17834 sort_attached_input_sections if necessary.
17835 (Output_section::Input_section_sort_entry): Define new class.
17836 (Output_section::Input_section_sort_compare::operator()): New
17837 function.
17838 (Output_section::sort_attached_input_sections): New function.
17839 * configure.ac: Check whether the compiler supports constructor
17840 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17841 * testsuite/initpri1.c: New file.
17842 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17843 CONSTRUCTOR_PRIORITY.
17844 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17845 (initpri1_LDFLAGS): New variable.
17846 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17847
18e6b24e
ILT
178482008-03-27 Ian Lance Taylor <iant@google.com>
17849
49bdd526
ILT
17850 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17851 * testsuite/common_test_1.c: New file.
17852 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17853 (common_test_1_SOURCES): New variable.
17854 (common_test_1_DEPENDENCIES): New variable.
17855 (common_test_1_LDFLAGS): New variable.
17856
18e6b24e
ILT
17857 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17858 and commons_ correctly when NAME/VERSION does not override
17859 NAME/NULL.
17860 * testsuite/ver_test_6.c: New file.
17861 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17862 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17863 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17864
04bf7072
ILT
178652008-03-26 Ian Lance Taylor <iant@google.com>
17866
5871526f
ILT
17867 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17868 of an undefined symbol from a version script.
17869 * testsuite/Makefile.am (ver_test_5.so): New target.
17870 (ver_test_5.o): New target.
17871 (check_SCRIPTS): Add ver_test_5.sh.
17872 (check_DATA): Add ver_test_5.syms.
17873 (ver_test_5.syms): New target.
17874 * testsuite/ver_test_5.cc: New file.
17875 * testsuite/ver_test_5.script: New file.
17876 * testsuite/ver_test_5.sh: New file.
17877 * Makefile.in, testsuite/Makefile.in: Rebuild.
17878
04bf7072
ILT
17879 PR gold/5986
17880 Fix problems building gold with gcc 4.3.0.
17881 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17882 (gold_error_at_location, gold_warning_at_location): Use it.
17883 * configure.ac: Check whether we can compile and use a template
17884 function with a printf attribute.
17885 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17886 when jumping over bytes.
17887 * object.cc: Instantiate Object::read_section_data.
17888 * debug.h: Include <cstring>
17889 * dwarf_reader.cc: Include <algorithm>
17890 * main.cc: Include <cstring>.
17891 * options.cc: Include <cstring>.
17892 * output.cc: Include <cstring>.
17893 * script.cc: Include <cstring>.
17894 * script.h: Include <string>.
17895 * symtab.cc: Include <cstring> and <algorithm>.
17896 * target-select.cc: Include <cstring>.
17897 * version.cc: Include <string>.
17898 * testsuite/testmain.cc: Include <cstdlib>.
17899 * configure, config.in: Rebuild.
17900
874c5b28
ILT
179012008-03-25 Ian Lance Taylor <iant@google.com>
17902
819d6c3a
ILT
17903 * options.cc: Include "../bfd/bfdver.h".
17904 (options::help): Print bug reporting address.
17905
f4b2c6f5
ILT
17906 * version.cc (print_version): Adjust output for current value of
17907 BFD_VERSION_STRING.
17908
17909 * NEWS: New file.
17910
e96caa79
ILT
17911 * options.cc (options::help): Print list of supported targets.
17912 * target-select.h: Include <vector>.
17913 (class Target_selector): Make machine_, size_, and is_big_endian_
17914 fields const. Add bfd_name_ and instantiated_target_ fields.
17915 (Target_selector::Target_selector): Add bfd_name parameter.
17916 (Target_selector::recognize): Make non-virtual, call
17917 do_recognize.
17918 (Target_selector::recognize_by_name): Make non-virtual, call
17919 do_recognize_by_name.
17920 (Target_selector::supported_names): New function.
17921 (Target_selector::bfd_name): New function.
17922 (Target_selector::do_instantiate_target): New pure virtual
17923 function.
17924 (Target_selector::do_recognize): New virtual function.
17925 (Target_selector::do_recognize_by_name): New virtual function.
17926 (Target_selector::instantiate_target): New private function.
17927 (supported_target_names): Declare.
17928 * target-select.cc (Target_selector::Target_selector): Update for
17929 new parameter and fields.
17930 (select_target_by_name): Check that the name matches before
17931 calling recognize_by_name.
17932 (supported_target_names): New function.
17933 * i386.cc (class Target_selector_i386): Update Target_selector
17934 constructor call. Remove recognize and recognize_by_name. Add
17935 do_instantiate_target.
17936 * x86_64.cc (class Target_selector_x86_64): Likewise.
17937 * testsuite/testfile.cc (class Target_selector_test): Update for
17938 changes to Target_selector.
17939
874c5b28
ILT
17940 * README: Rewrite, with some notes on unsupported features.
17941
0a65a3a7
CC
179422008-03-24 Cary Coutant <ccoutant@google.com>
17943
17944 * i386.cc (Target_i386::Got_type): New enum declaration.
17945 (Target_i386::Scan::local): Updated callers of Output_data_got
17946 member functions.
17947 (Target_i386::Scan::global): Likewise.
17948 (Target_i386::Relocate::relocate): Likewise.
17949 (Target_i386::Relocate::relocate_tls): Likewise.
17950 * object.h (Got_offset_list): New class.
17951 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17952 (Sized_relobj::local_got_offset): Likewise.
17953 (Sized_relobj::set_local_got_offset): Likewise.
17954 (Sized_relobj::local_has_tls_got_offset): Removed.
17955 (Sized_relobj::local_tls_got_offset): Removed.
17956 (Sized_relobj::set_local_tls_got_offset): Removed.
17957 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17958 * output.cc (Output_data_got::add_global): Added got_type parameter.
17959 (Output_data_got::add_global_with_rel): Likewise.
17960 (Output_data_got::add_global_with_rela): Likewise.
17961 (Output_data_got::add_global_pair_with_rel): New function.
17962 (Output_data_got::add_global_pair_with_rela): New function.
17963 (Output_data_got::add_local): Added got_type parameter.
17964 (Output_data_got::add_local_with_rel): Likewise.
17965 (Output_data_got::add_local_with_rela): Likewise.
17966 (Output_data_got::add_local_pair_with_rel): New function.
17967 (Output_data_got::add_local_pair_with_rela): New function.
17968 (Output_data_got::add_global_tls): Removed.
17969 (Output_data_got::add_global_tls_with_rel): Removed.
17970 (Output_data_got::add_global_tls_with_rela): Removed.
17971 (Output_data_got::add_local_tls): Removed.
17972 (Output_data_got::add_local_tls_with_rel): Removed.
17973 (Output_data_got::add_local_tls_with_rela): Removed.
17974 * output.h (Output_data_got::add_global): Added got_type parameter.
17975 (Output_data_got::add_global_with_rel): Likewise.
17976 (Output_data_got::add_global_with_rela): Likewise.
17977 (Output_data_got::add_global_pair_with_rel): New function.
17978 (Output_data_got::add_global_pair_with_rela): New function.
17979 (Output_data_got::add_local): Added got_type parameter.
17980 (Output_data_got::add_local_with_rel): Likewise.
17981 (Output_data_got::add_local_with_rela): Likewise.
17982 (Output_data_got::add_local_pair_with_rel): New function.
17983 (Output_data_got::add_local_pair_with_rela): New function.
17984 (Output_data_got::add_global_tls): Removed.
17985 (Output_data_got::add_global_tls_with_rel): Removed.
17986 (Output_data_got::add_global_tls_with_rela): Removed.
17987 (Output_data_got::add_local_tls): Removed.
17988 (Output_data_got::add_local_tls_with_rel): Removed.
17989 (Output_data_got::add_local_tls_with_rela): Removed.
17990 * resolve.cc (Symbol::override_base_with_special): Removed
17991 reference to has_got_offset_ field.
17992 * symtab.cc (Symbol::init_fields): Replaced initialization
17993 of got_offset_ with got_offsets_. Removed initialization
17994 of has_got_offset_
53fcba31 17995 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17996 (Symbol::got_offset): Likewise.
17997 (Symbol::set_got_offset): Likewise.
17998 (Symbol::has_tls_got_offset): Removed.
17999 (Symbol::tls_got_offset): Removed.
18000 (Symbol::set_tls_got_offset): Removed.
18001 (Symbol::got_offset_): Removed.
18002 (Symbol::tls_mod_got_offset_): Removed.
18003 (Symbol::tls_pair_got_offset_): Removed.
18004 (Symbol::got_offsets_): New field.
18005 (Symbol::has_got_offset): Removed.
18006 (Symbol::has_tls_mod_got_offset): Removed.
18007 (Symbol::has_tls_pair_got_offset): Removed.
18008 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18009 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18010 member functions.
18011 (Target_x86_64::Scan::global): Likewise.
18012 (Target_x86_64::Relocate::relocate): Likewise.
18013 (Target_x86_64::Relocate::relocate_tls): Likewise.
18014
bd52eafb
BE
180152008-03-25 Ben Elliston <bje@au.ibm.com>
18016
18017 * yyscript.y: Fix spelling error in comment.
18018
8b105e34
ILT
180192008-03-24 Ian Lance Taylor <iant@google.com>
18020
8ed814a9
ILT
18021 * options.h (class General_options): Define build_id option.
18022 * layout.h (class Layout): Declare write_build_id, create_note,
18023 create_build_id. Add build_id_note_ member.
18024 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18025 "libiberty.h", "md5.h", "sha1.h".
18026 (Layout::Layout): Initialize eh_frame_data_,
18027 eh_frame_hdr_section_, and build_id_note_.
18028 (Layout::finalize): Call create_build_id.
18029 (Layout::create_note): New function, broken out of
18030 Layout::create_gold_note.
18031 (Layout::create_gold_note): Call create_note.
18032 (Layout::create_build_id): New function.
18033 (Layout::write_build_id): New function.
18034 (Close_task_runner::run): Call write_build_id.
18035
8b105e34
ILT
18036 * x86_64.cc: Correct license to GPLv3.
18037
086a1841
ILT
180382008-03-23 Ian Lance Taylor <iant@google.com>
18039
18040 * options.cc: Include "demangle.h".
18041 (parse_optional_string): New function.
18042 (parse_long_option): Handle takes_optional_argument.
18043 (parse_short_option): Update dash_z initializer. Handle
18044 takes_optional_argument.
18045 (General_options::General_options): Initialize do_demangle_.
18046 (General_options::finalize): Set do_demangle_. Handle demangling
18047 style.
18048 * options.h (parse_optional_string): Declare.
18049 (struct One_option): Add optional_arg field. Update constructor.
18050 Update call constructor calls. Add takes_optional_argument
18051 function.
18052 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18053 (DEFINE_optional_string): Define.
18054 (General_options::demangle): Change from DEFINE_bool to
18055 DEFINE_optional_string.
18056 (General_options::no_demangle): New function.
18057 (General_options::do_demangle): New function.
18058 (General_options::set_do_demangle): New function.
18059 (General_options::execstack_status_): Move definition to end of
18060 class definition.
18061 (General_options::static_): Likewise.
18062 (General_options::do_demangle_): New field.
18063 * object.cc (big_endian>::get_symbol_location_info): Call
18064 Options::do_demangle, not Options::demangle.
18065 * symtab.cc (demangle): Likewise.
18066
cbb93e63
ILT
180672008-03-22 Ian Lance Taylor <iant@google.com>
18068
18069 * gold.h: Include <cstddef> and <sys/types.h>
18070 * options.h: Include <cstring>.
18071
ec531623
ILT
180722008-03-21 Ian Lance Taylor <iant@google.com>
18073
18074 * Added source code to GNU binutils.
752937aa 18075\f
b90efa5b 18076Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18077
18078Copying and distribution of this file, with or without modification,
18079are permitted in any medium without royalty provided the copyright
18080notice and this notice are preserved.
18081
18082Local Variables:
18083mode: change-log
18084left-margin: 8
18085fill-column: 74
18086version-control: never
18087End:
This page took 1.189105 seconds and 4 git commands to generate.