[GOLD] Edit PowerPC64 ELFv2 function entry code
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e3a7574e
AM
12015-12-09 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
4 entry code.
5 (Target_powerpc::relocate_relocs): Edit relocs to suit.
6
91a65d2f
AM
72015-12-09 Alan Modra <amodra@gmail.com>
8
9 * object.h (struct Relocate_info): Add "rr".
10 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
11 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
12 relinfo.rr for relocate_section and relocate_relocs.
13 * powerpc.cc (relocate): Add rel_type and preloc parameters.
14 Delete rela and r_type params, instead recalculate these from
15 preloc.
16 (relocate_relocs): Delete Relocatable_relocs* param, instead
17 use relinfo->rr.
18 * aarch64.cc: Likewise.
19 * arm.cc: Likewise.
20 * i386.cc: Likewise.
21 * mips.cc: Likewise.
22 * s390.cc: Likewise.
23 * sparc.cc: Likewise.
24 * target.h: Likewise.
25 * tilegx.cc: Likewise.
26 * x86_64.cc: Likewise.
27 * testsuite/testfile.cc: Likewise.
28 * target-reloc.h (relocate_section): Adjust to suit.
29 (apply_relocation, relocate_relocs): Likewise.
30
549dba71
AM
312015-12-07 Alan Modra <amodra@gmail.com>
32
33 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
34 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
35 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
36
7ef8ae7c
VR
372015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
38
39 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
40 Local_got_entry_key for searching in local_got_offsets_.
41 * object.h (class Local_got_entry_key): New class.
42 (Relobj::local_has_got_offset): New overloaded method.
43 (Relobj::local_got_offset): Likewise.
44 (Relobj::set_local_got_offset): Likewise.
45 (Relobj::do_local_has_got_offset): Add addend argument.
46 (Relobj::do_local_got_offset): Likewise.
47 (Relobj::do_set_local_got_offset): Likewise.
48 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
49 Local_got_entry_key for searching through local_got_offsets_.
50 (Sized_relobj::do_local_got_offset): Likewise.
51 (Sized_relobj::do_set_local_got_offset): Likewise.
52 (Sized_relobj::Local_got_offsets): Change type of the key from
53 unsigned int to Local_got_entry_key, and add hash and equal_to.
54 * output.cc (Got_entry::write): Take addend into account for
55 calculating value of the local symbol for GOT.
56 (Output_data_got::add_local): New definition of overloaded method.
57 (Output_data_got::add_local_with_rel): Likewise.
58 (Output_data_got::add_local_pair_with_rel): Likewise.
59 * output.h (Output_data_got::add_local): New declaration of overloaded
60 method.
61
74b03b91
CC
622015-11-25 Cary Coutant <ccoutant@gmail.com>
63
64 PR gold/19291
65 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
66 subtract section address from symbol value.
67
751e4d66
AM
682015-11-25 Alan Modra <amodra@gmail.com>
69
70 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
71 to 256 byte boundary.
72
32d849b3
AM
732015-11-19 Alan Modra <amodra@gmail.com>
74
75 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
76 GOT16 and TOC16 relocs to RELATIVE_REF.
77
db1ff028
CC
782015-11-14 Cary Coutant <ccoutant@gmail.com>
79
80 PR gold/19244
81 PR gold/18548
82 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
83 local symbols only for predefined symbols.
84
a680de9a
PB
852015-11-11 Alan Modra <amodra@gmail.com>
86 Peter Bergner <bergner@vnet.ibm.com>
87
88 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
89 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
90 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
91 (Target_powerpc::Scan::global): Likewise.
92 (Target_powerpc::Relocate::relocate): Likewise.
93
cc203475
VR
942015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
95
96 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
97 sections.
98
859d7987
CC
992015-11-09 Cary Coutant <ccoutant@gmail.com>
100 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
101
102 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
103 with type, offset, addend.
104 (Copy_relocs::save): Likewise.
105 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
106 (Copy_relocs::save): Likewise.
107 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
108 and r_addend to Copy_relocs::copy_reloc.
109 * arm.cc (Target_arm::copy_reloc): Likewise.
110 * i386.cc (Target_i386::copy_reloc): Likewise.
111 * mips.cc (Target_mips::copy_reloc): Likewise.
112 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
113 * s390.cc (Target_s390::copy_reloc): Likewise.
114 * sparc.cc (Target_sparc::copy_reloc): Likewise.
115 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
116 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
117
96f9814d
CC
1182015-11-05 Cary Coutant <ccoutant@gmail.com>
119
120 PR gold/19119
121 PR gold/19172
122 PR gold/19197
123 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
124 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
125 * options.h (General_options): Remove "obsolete" from -m.
126 * parameters.cc (set_parameters_target): Check if input target
127 is compatible with output emulation set by "-m emulation".
128
0eccf19f
CC
1292015-11-05 Cary Coutant <ccoutant@gmail.com>
130
131 PR gold/19163
132 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
133 certain relocations if --no-apply-dynamic-relocs is set.
134 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
135
c1e7d6a8
AM
1362015-11-03 Alan Modra <amodra@gmail.com>
137
138 * po/POTFILES.in: Regenerate.
139
26f187cd
NC
1402015-10-30 Nick Clifton <nickc@redhat.com>
141
142 * po/zh_CN.po: New (simplified) Chinese translation.
143
41e83f2b
L
1442015-10-29 H.J. Lu <hongjiu.lu@intel.com>
145
146 PR gold/19184
147 * incremental.cc (Got_plt_view_info): Add got_entry_size.
148 (Local_got_offset_visitor::visit): Replace got_entry_size_
149 with info_.got_entry_size.
150 (Local_got_offset_visitor::got_entry_size_): Removed.
151 (Global_got_offset_visitor::visit): Replace got_entry_size_
152 with info_.got_entry_size.
153 (Global_got_offset_visitor::got_entry_size_): Removed.
154 (Output_section_incremental_inputs::write_got_plt): Initialize
155 view_info.got_entry_size.
156 * target.h (Sized_target::got_entry_size): New virtual function.
157 * x86_64.cc (Target_x86_64::got_entry_size): New function.
158
238830c6
MK
1592015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
160
161 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
162 * testsuite/script_test_12a.c: Likewise.
163 * testsuite/script_test_1a.cc: Likewise.
164 * testsuite/script_test_2.cc: Likewise.
165
bd890911
MK
1662015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
167
168 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
169
a817ff49
MK
1702015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
171
172 PR gold/18959
173 * stringpool.cc (Stringpool_template::new_key_offset): Align all
174 strings, even zero-length.
175 (Stringpool_template::set_string_offsets): Likewise.
176
e79a4bad
MK
1772015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
178
179 * s390.cc: New file.
180 * Makefile.am (TARGETSOURCES): Add s390.cc.
181 (ALL_TARGETOBJS): Add s390.o.
182 * Makefile.in: Regenerate.
183 * configure.ac: Add s390 support.
184 * configure: Regenerate.
185 * configure.tgt: Add s390-*-* and s390x-*-*.
186 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
187 support.
188
6f97897d
MK
1892015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
190
191 * archive.cc (Archive::sym64name): New const.
192 (Archive::setup): Add support for SYM64 armap.
193 (Archive::read_armap): Likewise.
194 (Archive::interpret_header): Likewise.
195 (Archive::const_iterator::read_next_header): Likewise.
196 * archive.h (Archive::sym64name): New const.
197 (Archive::read_armap): Add mapsize template parameter.
198
8d9743bd
MK
1992015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
200
201 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
202 target-specific entry size.
203 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
204 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
205 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
206 hash_entry_size.
207 * target.h (Target::hash_entry_size): New method.
208 (Target::Target_info::hash_entry_size): New data member.
209
210 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
211 * arm.cc (Target_arm::arm_info): Likewise.
212 (Target_arm_nacl::arm_nacl_info): Likewise.
213 * i386.cc (Target_i386::i386_info): Likewise.
214 (Target_i386_nacl::i386_nacl_info): Likewise.
215 (Target_iamcu::iamcu_info): Likewise.
216 * mips.cc (Target_mips::mips_info): Likewise.
217 (Target_mips_nacl::mips_nacl_info): Likewise.
218 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
219 * sparc.cc (Target_sparc::sparc_info): Likewise.
220 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
221 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
222 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
223 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
224
3043c1ab
L
2252015-10-28 H.J. Lu <hongjiu.lu@intel.com>
226
227 PR gold/19177
228 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
229 and R_386_GOT32X relocations without base register.
230
4d2f5d58
HS
2312015-10.27 Han Shen <shenhan@google.com>
232
233 PR gold/19042 - unsupported reloc 311/312.
234
235 * aarch64.cc (Target_aarch64::Scan::local): Add support for
236 reloc 311/312.
237
2891b491
L
2382015-10-22 H.J. Lu <hongjiu.lu@intel.com>
239
240 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
241 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
242 as R_X86_64_GOTPCREL.
243 (Target_x86_64<size>::Scan::local): Likewise.
244 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
245 Likewise.
246 (Target_x86_64<size>::Scan::global): Likewise.
247 (Target_x86_64<size>::Relocate::relocate): Likewise.
248 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
249 Likewise.
250
493d4b48
L
2512015-10-22 H.J. Lu <hongjiu.lu@intel.com>
252
253 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
254 R_386_GOT32X the same as R_386_GOT32.
255 (Target_i386::Scan::local): Likewise.
256 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
257 (Target_i386::Scan::global): Likewise.
258 (Target_i386::Relocate::relocate): Likewise.
259 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
260 Likewise.
261
0fd15345
L
2622015-10-20 H.J. Lu <hongjiu.lu@intel.com>
263
264 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
265 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
266 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
267 x86_64_mov_to_lea1.o.
268 * testsuite/Makefile.in: Regenerated.
269
64571972
L
2702015-10-16 H.J. Lu <hongjiu.lu@intel.com>
271
272 PR gold/19119
273 * options.h (General_options): Remove "obsolete" from -m.
274 * parameters.cc (set_parameters_target): Check if input target
275 is compatible with output emulation set by "-m emulation".
276
01f573ad
L
2772015-10-13 H.J. Lu <hongjiu.lu@intel.com>
278
279 PR gold/19118
280 * i386.cc (Target_iamcu): New class.
281 (Target_selector_iamcu): Likewise.
282 (Target_iamcu::iamcu_info): New variable.
283 (target_selector_iamcu): Likewise.
284
3b0357da
AS
2852015-10-07 Andreas Schwab <schwab@suse.de>
286
287 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
288
9eacb935
CC
2892015-10-06 Cary Coutant <ccoutant@gmail.com>
290
291 PR gold/18855
292 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
293 parameter.
294 (Sparc_relocate_functions::gdop_lox10): Likewise.
295 (Target_sparc::Relocate::relocate): Use addend when computing
296 symbol value for R_SPARC_GOTDATA_OP*.
297
3d4fde69
CC
2982015-09-07 Cary Coutant <ccoutant@gmail.com>
299
300 PR gold/18930
301 PR gold/18886
302 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
303 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
304
358de988
L
3052015-09-02 H.J. Lu <hongjiu.lu@intel.com>
306
307 PR gold/18886
308 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
309 shared libraries into normal FUNC symbols.
310 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
311 symbols aren't from shared libraries.
312
d49044c7
AM
3132015-09-02 Alan Modra <amodra@gmail.com>
314
315 PR 18878
316 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
317 (Target_powerpc::Branch_info::make_stub): Determine whether long
318 branch stub is for save/restore function.
319 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
320 (Stub_table): Add need_save_res_.
321 (Stub_table:clear_stubs): Clear need_save_res_.
322 (Stub_table:set_address_and_size): Add save/restore section size.
323 (Stub_table::add_long_branch_entry): Add save_res param. Set
324 need_save_res_, but don't add space for save/restore stubs.
325 (Stub_table::find_long_branch_entry): Return offset to local copy
326 of save/restore func.
327 (Stub_table::do_write): Don't output save/restore stubs. Instead
328 copy the save/restore functions.
329 (Output_data_save_res:contents): New accessor.
330 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
331
7c61d651
CC
3322015-08-25 Cary Coutant <ccoutant@gmail.com>
333
334 PR gold/18847
335 * script-sections.cc (Memory_region::set_address): New method.
336 (Script_sections::find_memory_region): Add explicit_only parameter.
337 (Output_section_definition::set_section_addresses): Handle case where
338 script specifies both address and vma region.
339 * script-sections.h (Script_sections::find_memory_region): Add
340 explicit_only parameter.
341
4bfacfd3
CC
3422015-08-25 Cary Coutant <ccoutant@gmail.com>
343
344 PR gold/18859
345 * object.cc (Input_objects::add_object): Store objects in a map,
346 indexed by soname; update as-needed flag when necessary.
347 * object.h (Object::clear_as_needed): New method.
348 (Input_objects::so_names_): Change from set to map.
349
1757d35c
CC
3502015-08-25 Cary Coutant <ccoutant@gmail.com>
351
352 PR gold/14746
353 * expression.cc (Expression::Expression_eval_info): Add
354 is_valid_pointer field.
355 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
356 Adjust all callers.
357 (Addr_expression::value_from_output_section): Check whether address
358 is valid.
359 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
360 if evaluation failed due to address that is not yet valid.
361 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
362 parameter.
363
3ac0a36c
CC
3642015-08-25 Cary Coutant <ccoutant@gmail.com>
365
366 PR gold/18866
367 PR gold/18703
368 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
369
9215b98b
AM
3702015-08-20 Alan Modra <amodra@gmail.com>
371
372 PR gold/18846
373 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
374 Subtract os->address() from addend.
375 * powerpc.cc (relocate_relocs): Likewise.
376
40fc1451
SD
3772015-08-12 Simon Dardis <simon.dardis@imgtec.com>
378
379 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
380 lazy_stub_normal_1, lazy_stub_normal_1_n64,
381 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
382 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
383 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
384 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
385 of 'addu/daddu'.
386
37a42ee9
L
3872015-07-27 H.J. Lu <hongjiu.lu@intel.com>
388
389 * configure: Regenerated.
390
ab3b14b0
DK
3912015-07-26 Doug Kwan <dougkwan@google.com>
392
393 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
394 disassembler output format.
395
cdb06167
HS
3962015-07-23 Ian Coolidge <icoolidge@google.com>
397 Plumb --pic-veneer option for gold.
398
399 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
400 generation.
401 * options.h (General_options): Add --pic-veneer option.
402
5b2af7dd
L
4032015-07-22 H.J. Lu <hongjiu.lu@intel.com>
404
405 PR gold/18663
406 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
407 script_test_1a.cc script_test_1b.cc.
408 (script_test_11_r.o): Replace script_test_11.o with
409 script_test_11a.o script_test_11b.o.
410 (script_test_11.o): Removed.
411 (script_test_11a.o): New.
412 (script_test_11b.o): Likewise.
413 * testsuite/Makefile.in: Regenerated.
414 * testsuite/script_test_1.h: New file.
415 * testsuite/script_test_1b.cc: Likewise.
416 * testsuite/script_test_11.h: Likewise.
417 * testsuite/script_test_11b.c: Likewise.
418 * testsuite/script_test_1.cc: Renamed to ...
419 * testsuite/script_test_1a.cc: This.
420 Include "script_test_1.h".
421 (main): Call check_int and check_ptr.
422 * testsuite/script_test_11.c: Renamed to ...
423 * testsuite/script_test_11a.c: This.
424 Include "script_test_11.h".
425 (main): Call ptr_equal.
426
cd78ea77
L
4272015-07-22 H.J. Lu <hongjiu.lu@intel.com>
428
429 PR gold/18628
430 * testsuite/ifuncdep2.c (global): Change protected to hidden.
431 * testsuite/ifuncmod1.c (global): Likewise.
432 * testsuite/ifuncmod5.c (global): Likewise.
433
f945ba50
AM
4342015-07-22 Alan Modra <amodra@gmail.com>
435
436 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
437
5417c94d
CC
4382015-07-21 Cary Coutant <ccoutant@gmail.com>
439
440 PR gold/18548
441 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
442 forced local symbol even when oldsym != NULL.
443 (Symbol_table::do_define_in_output_segment): Likewise.
444 (Symbol_table::do_define_as_constant): Likewise.
445
cb5cf5e2
CC
4462015-07-21 Cary Coutant <ccoutant@gmail.com>
447
b8c6c5ef 448 PR gold/18698
cb5cf5e2
CC
449 * archive.cc (Library_base::should_include_member): Don't use entry
450 point for relocatable links, or if target is not yet valid.
451 * parameters.cc (Parameters::entry): Check target_valid().
452
0ef3814f
HS
4532015-07-20 Han Shen <shenhan@google.com>
454
455 Optimize erratum 843419 fix.
456
457 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
458 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
459 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
460 (E843419_stub): New sub-class of Erratum_stub.
461 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
462 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
463 (AArch64_relobj::create_erratum_stub): Add 1 argument.
464 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
465
2bca0377
HS
4662015-07-20 Han Shen <shenhan@google.com>
467
468 Fix arm elf header flags wrt hardfp bit.
469
470 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
471
f54f5e31
L
4722015-07-20 H.J. Lu <hongjiu.lu@intel.com>
473
474 PR gold/18689
475 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
476 from input group section for relocatable link.
477 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
478 (check_DATA): Add pr18689.stdout.
479 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
480 (pr18689.stdout): New rule.
481 (pr18689a.o): Likewise.
482 (pr18689b.o): Likewise.
483 (pr18689.o): Likewise.
484 * testsuite/pr18689.c: New file.
485 * testsuite/pr18689.sh: Likewise.
486 * testsuite/Makefile.in: Regenerated.
487
c20ceeb2
YW
4882015-07-20 Yiran Wang <yiran@google.com>
489 Cary Coutant <ccoutant@gmail.com>
490
491 PR gold/15574
492 * resolve.cc (Symbol_table): Remove warning about references
493 from shared objects to hidden symbols.
494 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
495 * testsuite/Makefile.in: Regenerate.
496 * testsuite/hidden_test.sh: Check dynamic symbol table; update
497 expected error messages.
498
19a7fe52
L
4992015-07-14 H.J. Lu <hongjiu.lu@intel.com>
500
501 * compressed_output.cc (Output_compressed_section::set_final_data_size):
502 Make --compress-debug-sections=zlib the same as
503 --compress-debug-sections=zlib-gabi.
504 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
505 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
506 ".zdebug_".
507 * testsuite/Makefile.in: Regenerated.
508
fb8b9dbc
L
5092015-07-12 H.J. Lu <hongjiu.lu@intel.com>
510
511 PR gold/18322
512 * compressed_output.cc (zlib_compress): Add argument for
513 compression header size. Set header size to compression header
514 size if it isn't 0. Don't write out the zlib header here.
515 (Output_compressed_section::set_final_data_size): Support
516 zlib-gnu and zlib-gabi compressions. Pass compression header
517 size to zlib_compress and write out compression header. Set
518 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
519 clear the SHF_COMPRESSED bit
520 * options.h (compress_debug_sections): Add zlib-gnu and
521 zlib-gabi.
522 * output.h (Output_section::set_flags): New.
523 * testsuite/Makefile.am (check_PROGRAMS): Add
524 flagstest_compress_debug_sections_none,
525 flagstest_compress_debug_sections_gnu and
526 flagstest_compress_debug_sections_gabi.
527 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
528 flagstest_compress_debug_sections.stdout,
529 flagstest_compress_debug_sections.cmp,
530 flagstest_compress_debug_sections.check,
531 flagstest_compress_debug_sections_gnu.stdout,
532 flagstest_compress_debug_sections_gnu.cmp,
533 flagstest_compress_debug_sections_gnu.check,
534 flagstest_compress_debug_sections_gabi.stdout,
535 flagstest_compress_debug_sections_gabi.cmp and
536 flagstest_compress_debug_sections_gabi.check.
537 (flagstest_compress_debug_sections_none): New.
538 (flagstest_compress_debug_sections_none.stdout): Likewise.
539 (flagstest_compress_debug_sections.stdout): Likewise.
540 (flagstest_compress_debug_sections.check): Likewise.
541 (flagstest_compress_debug_sections.cmp): Likewise.
542 (flagstest_compress_debug_sections_gnu): Likewise.
543 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
544 (flagstest_compress_debug_sections_gnu.check): Likewise.
545 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
546 (flagstest_compress_debug_sections_gabi): Likewise.
547 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
548 (flagstest_compress_debug_sections_gnu.check): Likewise.
549 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
550 * testsuite/Makefile.in: Regenerated.
551
48058663
L
5522015-07-12 H.J. Lu <hongjiu.lu@intel.com>
553
554 PR gold/18321
555 * compressed_output.h (decompress_input_section): Add arguments
556 for ELF class, big endian and sh_flags.
557 * compressed_output.cc (decompress_input_section): Likewise.
558 Support the SHF_COMPRESSED section.
559 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
560 functions.
561 * plugin.h (Pluginobj): Likewise.
562 * layout.cc (Layout::get_output_section_flags): Also clear the
563 SHF_COMPRESSED bit.
564 * object.h (Compressed_section_info): Add flag to store sh_flags.
565 (Object): Add pure virtual elfsize and is_big_endian member
566 functions.
567 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
568 prefix here.
569 (build_compressed_section_map): Check SHF_COMPRESSED for
570 uncompressed size. Store sh_flags in Compressed_section_info.
571 Pass size, big_endian and sh_flags to decompress_input_section.
572 Skip the ".debug"/".zdebug" prefix when passing section name to
573 need_decompressed_section.
574 (Sized_relobj_file<size, big_endian>::do_find_special_section):
575 Don't check ".zdebug_*" sections.
576 (Object::decompressed_section_contents): Pass ELF class, big
577 endian and sh_flags to decompress_input_section.
578 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
579 Likewise.
580 * testsuite/Makefile.am (check_DATA): Add
581 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
582 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
583 gdb_index_test_2_gabi.stdout.
584 (debug_msg_cdebug_gabi.o): New.
585 (odr_violation1_cdebug_gabi.o): Likewise.
586 (odr_violation2_cdebug_gabi.o): Likewise.
587 (debug_msg_cdebug_gabi.err): Likewise.
588 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
589 (gdb_index_test_cdebug_gabi.o): Likewise.
590 (gdb_index_test_2_gabi): Likewise.
591 (gdb_index_test_2_gabi.stdout): Likewise.
592 * testsuite/gdb_index_test_2_gabi.sh: New file.
593 * testsuite/Makefile.in: Regenerated.
594
73854cdd
HS
5952015-07-09 Han Shen <shenhan@google.com>
596
597 Use "gold_info" instead of "gold_warning" for erratum fix.
598
599 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
600 'gold_info'.
601 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
602
61163dfa
HS
6032015-07-09 Han Shen <shenhan@google.com>
604
605 Drop missing symbol warning for arm/aarch64.
606
607 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
608 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
609 symbol warning.
610
b91deca9
HS
6112015-07-07 Han Shen <shenhan@google.com>
612
613 Make gold aarch64 accept long form of mapping symbols.
614
615 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
616 of mapping symbols.
617
15162bef
DK
6182015-06-29 Doug Kwan <dougkwan@google.com>
619
620 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
621 at address expected by test.
622 * testsuite/arm_cortex_a8_b.s: Ditto.
623 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
624 * testsuite/arm_cortex_a8_bl.s: Ditto.
625 * testsuite/arm_cortex_a8_blx.s: Ditto.
626 * testsuite/arm_cortex_a8_local.s: Ditto.
627 * testsuite/arm_fix_v4bx.s: Ditto.
628 * testsuite/arm_unaligned_reloc.s: Ditto.
629 * testsuite/thumb_bl_out_of_range.s: Ditto.
630 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
631 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 632
56b06706
HS
6332015-06-29 Han Shen <shenhan@google.com>
634
635 Patch for erratum 843419 internal error.
636
72f4393d
L
637 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
638 (Erratum_stub::update_erratum_insn): New method.
639 (Stub_table::relocate_stubs): Modified to place relocated insn.
640 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 641
2f0c79aa
HS
6422015-06-12 Han Shen <shenhan@google.com>
643
644 Fix erratum 835769.
645
72f4393d
L
646 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
647 defintion outside class definition.
648 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
649 (AArch64_insn_utilities::aarch64_op31): New member.
650 (AArch64_insn_utilities::aarch64_ra): New member.
651 (AArch64_insn_utilities::aarch64_mac): New member.
652 (AArch64_insn_utilities::aarch64_mlxl): New member.
653 (ST_E_835769): New global enum member.
654 (Stub_table::relocate_stubs): Add 835769 handler.
655 (Stub_template_repertoire::Stub_template_repertoire): Install new
656 stub type.
657 (AArch64_relobj::scan_errata): This func is renamed from
658 scan_erratum_843419.
659 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
660 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
661 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
662 (Target_aarch64::scan_erratum_835769_span): New method.
663 (Target_aarch64::create_erratum_stub): New method.
664 (Target_aarch64::is_erratum_835769_sequence): New method.
665 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
666 code into create_erratum_stub.
667 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 668
5d7908e0
CC
6692015-06-11 Cary Coutant <ccoutant@gmail.com>
670
671 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
672 outside class body.
673 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
674
dd68f8fa
CC
6752015-06-11 Cary Coutant <ccoutant@gmail.com>
676
677 PR gold/17731
678 * layout.cc (corresponding_uncompressed_section_name): New function.
679 (Layout::choose_output_section): Call it.
680 * layout.h (corresponding_uncompressed_section_name): New function.
681 * script-sections.cc (Input_section_info::set_section_name): Check
682 for compressed debug section (.zdebug style).
683
a3a0c391
JY
6842015-06-11 Jing Yu <jingyu@google.com>
685
686 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
687 * testsuite/Makefile.in: Regenerate.
688
970cdef2
DI
6892015-06-11 Davide Italiano <dccitaliano@gmail.com>
690
691 * gold.h (is_cident): Correct typo.
692
a48d0c12
HS
6932015-06-10 Han Shen <shenhan@google.com>
694 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
695
696 Now fixing for 843419 is fully functional.
697
698 The first part of the erratum fix CL is here -
699 https://sourceware.org/ml/binutils/2015-04/msg00229.html
700
701 * aarch64.cc(global enum): New constants representing stub types.
702 (Stub_template): New POD struct.
703 (Stub_template_repertoire): New class.
704 (Stub_base): New class.
705 (Erratum_stub): New class.
706 (Reloc_stub): Refactored to be a subclass of Stub_base.
707 (Reloc_stub::Stub_type): Removed.
708 (Reloc_stub::offset): Moved to Stub_base.
709 (Reloc_stub::set_offset): Moved to Stub_base.
710 (Reloc_stub::destination_address): Moved to Stub_base.
711 (Reloc_stub::set_destination_address): Moved to Stub_base.
712 (Reloc_stub::reset_destination_address): Moved to Stub_base.
713 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
714 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
715 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
716 (Reloc_stub::write): Moved to Stub_base.
717 (Reloc_stub::invalid_offset): Moved to Stub_base.
718 (Reloc_stub::invalid_address): Moved to Stub_base.
719 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
720 (Reloc_stub::stub_insns_): Moved to Stub_base.
721 (Reloc_stub::offset_): Moved to Stub_base.
722 (Reloc_stub::destination_address_): Moved to Stub_base.
723 (Stub_table::The_aarch64_relobj): New typedef.
724 (Stub_table::The_erratum_stub): New typedef.
725 (Stub_table::The_erratum_stub_less): New typedef.
726 (Stub_table::The_erratum_stub_set): New typedef.
727 (Stub_table::The_erratum_stub_set_iter): New typedef.
728 (Stub_table::empty): Added emptiness testing for erratum stubs.
729 (Stub_table::add_erratum_stub): New method to add an erratum stub.
730 (Stub_table::find_erratum_stub): New method.
731 (Stub_table::find_erratum_stubs_for_input_section): New method.
732 (Stub_table::erratum_stub_address): New method.
733 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
734 (Stub_table::do_addralign): Modified to handle erratum stubs.
735 (Stub_table::erratum_stubs_): New member.
736 (Stub_table::erratum_stub_size_): New member.
737 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
738 (Stub_table::do_write): Modified to handle erratum stubs.
739 (AArch64_relobj::The_erratum_stub): New typedef.
740 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
741 (AArch64_relobj::fix_errata): New method.
742 (Target_aarch64::The_reloc_stub_type): Removed.
743 (Target_aarch64::The_erratum_stub): New typede.
744 (AArch64_relocate_functions::construct_b): New method.
745
1e1b2efc
NC
7462015-06-08 Nick Clifton <nickc@redhat.com>
747
748 * po/fr.po: New French Translation.
749
b8cf5075
CC
7502015-06-07 Cary Coutant <ccoutant@gmail.com>
751
752 PR gold/18288
753 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
754 callers. Don't use STT_COMMON to check for common symbols.
755 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
756 symbol that's not in a common section.
757 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
758 common symbols.
759
bdd2d2b7
CC
7602015-06-04 Cary Coutant <ccoutant@gmail.com>
761
762 PR gold/18200
763 * Makefile.am (diststuff): Add target.
764 * Makefile.in: Regenerate.
765
cd3c333f
CC
7662015-06-04 Cary Coutant <ccoutant@gmail.com>
767
768 PR gold/17498
769 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
770 temporary locals in merge sections.
771 * options.cc (General_options::parse_discard_all): New method.
772 (General_options::parse_discard_locals): New method.
773 (General_options::parse_discard_none): New method.
774 (General_options::General_options): Initialize discard_locals_.
775 * options.h (--discard-all): Convert to special option.
776 (--discard-locals): Likewise.
777 (--discard-none): New option.
778 (General_options::discard_all): New method.
779 (General_options::discard_locals): New method.
780 (General_options::discard_sec_merge): New method.
781 (General_options::Discard_locals): New enum.
782 (General_options::discard_locals_): New data member.
783
8086551f
CC
7842015-06-03 Cary Coutant <cary@google.com>
785
786 * script-sections.cc (Script_sections::Script_sections): Initialize
787 segments_created_.
788 (Script_sections::create_note_and_tls_segments): Set flag when
789 segments are created.
790 (Script_sections::expected_segment_count): Count PT_INTERP.
791 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
792 segments are created.
793 * script-sections.h (Script_sections::segments_created_): New data
794 member.
795
374082df
CC
7962015-06-03 Cary Coutant <ccoutant@gmail.com>
797
798 PR gold/15370
799 * script-sections.cc
800 (Output_section_element_input::set_section_addresses): When there
801 are several patterns with no sort spec, put all sections in the same
802 bin.
803 * testsuite/Makefile.am (script_test_12): New testcase.
804 (script_test_12i): New testcase.
805 * testsuite/Makefile.in: Regenerate.
806 * testsuite/script_test_12.t: New test linker script.
807 * testsuite/script_test_12i.t: New test linker script.
808 * testsuite/script_test_12a.c: New test source file.
809 * testsuite/script_test_12b.c: New test source file.
810
775ed62e
CC
8112015-06-02 Cary Coutant <ccoutant@gmail.com>
812
813 * nacl.h (Sniff_file): Switch parameters to get_view to get an
814 aligned view.
815
9c7fe3c5
CC
8162015-06-03 Cary Coutant <ccoutant@gmail.com>
817
72f4393d
L
818 PR gold/17819
819 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
820 separate task to schedule the build id computation.
821 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
822 add Output_file and offset.
823 (Hash_task::run): Get and release the input views.
824 (Hash_task::is_runnable): Always return NULL (always runnable).
825 (Layout::queue_build_id_tasks): Remove.
826 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
827 parameters; use them instead of class members.
828 (Build_id_task_runner::run): New function.
829 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
830 to write_build_id.
831 * layout.h (Layout::queue_build_id_tasks): Remove.
832 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
833 parameters.
834 (Layout::array_of_hashes_): Remove.
835 (Layout::size_of_array_of_hashes_): Remove.
836 (Layout::input_view_): Remove.
837 (Build_id_task_runner): New class.
838 (Close_task_runner::Close_task_runner): Add array_of_hashes and
839 size_of_hashes parameters.
840 (Close_task_runner::array_of_hashes_): New data member.
841 (Close_task_runner::size_of_hashes_): New data member.
842 * testsuite/Makefile.am
843 (flagstest_compress_debug_sections_and_build_id_tree): New test.
844 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 845
400f8944
RÁE
8462015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
847
848 * merge.cc (get_input_merge_map): Update for data structure change.
849 (get_or_make_input_merge_map): Update for data structure change.
850 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
851 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
852
bbec1a5d
AM
8532015-05-16 Alan Modra <amodra@gmail.com>
854
855 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
856 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
857 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
858 (lis_0): Rename from lis_0_0.
859
efc6fa12
CC
8602015-04-29 Cary Coutant <cary@google.com>
861 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
862
863 * gc.h (Garbage_collection::is_section_garbage): Change Object*
864 to Relobj*.
865 (Garbage_collection::add_reference): Likewise.
866 (Garbage_collection::gc_process_relocs): Likewise. Don't push
867 object/shndx pair onto *secvec for dynamic objects. Don't follow
868 relocations pointing to dynamic objects for GC.
869 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
870 (Icf::unfold_section): Likewise.
871 (Icf::is_section_folded): Likewise.
872 (Icf::get_folded_section): Likewise.
873 * icf.h: (Icf::get_folded_section): Likewise.
874 (Icf::unfold_section): Likewise.
875 (Icf::is_section_folded): Likewise.
876 (Icf::section_has_function_pointers): Likewise.
877 (Icf::set_section_has_function_pointers): Likewise.
878 * object.h (Section_id): Likewise.
879 (Const_section_id): Likewise.
880 * output.cc (Output_section::update_section_layout): Likewise.
881 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
882 Likewise.
883 * plugin.cc (update_section_order): Likewise.
884 (unique_segment_for_sections): Likewise.
885 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
886 (Target_powerpc::do_gc_add_reference): Likewise.
887 (Target_powerpc::gc_process_relocs): Likewise.
888 (Target_powerpc::do_gc_add_reference): Likewise.
889 * symtab.cc (Symbol_table::is_section_folded): Likewise.
890 (Symbol_table::gc_mark_symbol): Likewise.
891 * symtab.h: (Symbol_table::is_section_folded): Likewise.
892 * target.h: (Sized_target::gc_add_reference): Likewise.
893 (Sized_target::do_gc_add_reference): Likewise.
894
f9d3ecaa
NC
8952015-04-29 Nick Clifton <nickc@redhat.com>
896
897 * po/fi.po: Updated Finnish translation.
898
faa2211d
AM
8992015-04-28 Alan Modra <amodra@gmail.com>
900
901 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
902 than unsigned int for find_global_entry result temp. Compare
903 against invalid_address.
904 (Target_powerpc::do_plt_address_for_global): Likewise.
905 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
906 on plt call stub existence for debug info. Do assert for plt
907 and global entry stub existence if an alloc section.
908
6ec65f28
AM
9092015-04-28 Alan Modra <amodra@gmail.com>
910
911 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
912 on missing global entry stub due to bogus debug info.
913
7a2a1c79
HS
9142015-04-27 Han Shen <shenhan@google.com>
915
916 * options.h (--fix-cortex-a53-843419): Rename option.
917 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
918 option.
919 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
920
cfbf0e3c
RÁE
9212015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
922
923 PR gold/18327
924 * output.cc (Output_section::is_input_address_mapped): Assume a missing
925 entry is mapped.
926 * testsuite/Makefile.am: Add the eh_test test.
927 * testsuite/Makefile.in: Regenerate.
928 * testsuite/eh_test_a.cc: New test.
929 * testsuite/eh_test_b.cc: New test.
930
6ec65f28
AM
9312015-04-23 Sriraman Tallam <tmsriram@google.com>
932
a100d66f
ST
933 * options.h (--weak-unresolved-symbols): New option.
934 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
935 binding to weak with new option.
936 * symtab.h (is_weak_undefined): Check for new option.
937 (is_strong_undefined): Check for new option.
938 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
939 * testsuite/Makefile.in: Regenerate.
940 * testsuite/weak_unresolved_symbols_test.cc: New file.
941
4b889c30
IC
9422015-04-20 Ian Coolidge <icoolidge@google.com>
943
944 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
945 GNU_UNIQUE.
946
4277535c
RÁE
9472015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
948
949 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
950 push_back.
951 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
952 * object.cc (Sized_relobj_file::do_layout): Use push_back.
953 * powerpc.cc (process_gc_mark): Use push_back.
954 (Target_powerpc::do_gc_mark_symbol): Use push_back.
955 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
956
7a2a1c79 9572015-04-16 Han Shen <shenhan@google.com>
5019d64a 958
6ec65f28
AM
959 * aarch64.cc (AArch64_insn_utilities): New utility class.
960 (AArch64_relobj::Mapping_symbol_position): New struct.
961 (AArch64_relobj::Mapping_symbol_info): New typedef.
962 (AArch64_relobj::do_count_local_symbols): New function overriding
963 parent's implementation.
964 (AArch64_relobj::mapping_symbol_info_): New member
965 (AArch64_relobj::scan_erratum_843419): New method.
966 (Target_aarch64::scan_erratum_843419_span): New method.
967 (Target_aarch64::is_erratum_843419_sequence): New method.
968 * options.h (fix_cortex_a53): New option.
5019d64a 969
a6a17750
CC
9702015-04-09 Cary Coutant <ccoutant@google.com>
971
972 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
973 in a PIE link.
974 * testsuite/Makefile.am (tls_pie_test.sh): New test.
975 * testsuite/Makefile.in: Regenerate.
976 * testsuite/tls_pie_test.sh: New.
977
437ddf0c
CC
9782015-04-09 Cary Coutant <ccoutant@google.com>
979
980 * debug.h (DEBUG_LOCATION): New.
981 (DEBUG_ALL): Include DEBUG_LOCATION.
982 (debug_string_to_enum): Add DEBUG_LOCATION.
983 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
984 output to print correct context.
985 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
986 up to 4 more locations at the beginning of the function.
987 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
988 result before sorting list of line numbers.
989 * testsuite/debug_msg.sh: Allow range of line numbers for
990 canonical results on optimized code.
991
24491327
HS
9922015-04-07 HC Yen <hc.yen@mediatek.com>
993
994 Add AArch32 support for gold linker.
995 gold/
996 * arm.cc: Add V8 arch combine table.
997
7fa5525f
RÁE
9982015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
999
1000 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1001
5368dcf2
RÁE
10022015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1003
1004 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1005 to find by using the return value of insert.
1006
9dbb4b02
RÁE
10072015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1008
1009 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1010 constructor call.
1011
1fa29f10
IT
10122015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1013
1014 PR gold/17641
1015 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1016 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1017 can convert mov to lea.
1018 (Target_x86_64::Scan::global): Ditto.
1019 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1020 %reg to lea foo(%rip), %reg if possible.
1021 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1022 * testsuite/x86_64_mov_to_lea1.s: New.
1023 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1024 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1025 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1026 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1027
39f3de7c
L
10282015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1029
1030 * configure: Regenerated.
1031
c4fc4724
IT
10322015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1033
1034 PR gold/17640
1035 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1036 (Target_i386::Scan::local): Don't create GOT entry, when we
1037 can convert GOT to GOTOFF.
1038 (Target_i386::Scan::global): Ditto.
1039 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1040 lea foo@GOTOFF(%reg), %reg if possible.
1041 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1042 * testsuite/i386_mov_to_lea1.s: New.
1043 * testsuite/i386_mov_to_lea2.s: Ditto.
1044 * testsuite/i386_mov_to_lea3.s: Ditto.
1045 * testsuite/i386_mov_to_lea4.s: Ditto.
1046 * testsuite/i386_mov_to_lea5.s: Ditto.
1047 * testsuite/i386_mov_to_lea.sh: Ditto.
1048
918357b9
L
10492015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1050
1051 * Makefile.am (ZLIB): New.
1052 (ZLIBINC): Likewise.
1053 (AM_CFLAGS): Add $(ZLIBINC).
1054 (AM_CXXFLAGS): Likewise.
1055 (ldadd_varldadd_var): Add $(ZLIB).
1056 (incremental_dump_LDADD): Likewise.
1057 (dwp_LDADD): Likewise.
1058 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1059 <zlib.h>.
1060 (zlib_compress): Don't check HAVE_ZLIB_H.
1061 (zlib_decompress): Likewise.
1062 * options.h (compress_debug_sections): Likewise.
1063 * configure.ac (AM_CONDITIONAL): Removed.
1064 * testsuite/Makefile.am (ZLIB): New.
1065 (LDADD): Add $(ZLIB).
1066 Don't check HAVE_ZLIB.
1067 * Makefile.in: Regenerated.
1068 * config.in: Likewise.
1069 * configure: Likewise.
1070 * testsuite/Makefile.in: Likewise.
1071
6b0ad2eb
JY
10722015-03-30 Jing Yu <jingyu@google.com>
1073
1074 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1075 TLSLD_ADD_DTPREL_LO12_NC.
1076 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1077 _TLS_MODULE_BASE_ point to the start of tls segment.
1078 (Target_aarch64::optimize_tls_reloc): Add cases for
1079 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1080 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1081 (Target_aarch64::Scan::local): Likewise.
1082 (Target_aarch64::Scan::global): Likewise.
1083 (Target_aarch64::Relocate::relocate): Likewise.
1084 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1085 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1086 relocations.
1087
0916f9e7
RÁE
10882015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1089
1090 * merge.cc (Object_merge_map::add_mapping): call
1091 Object_merge_map::Input_merge_map::add_mapping.
1092 (Object_merge_map::Input_merge_map::add_mapping): New.
1093 (Output_merge_data::do_add_input_section): Call
1094 get_or_make_input_merge_map before a loop.
1095 (Output_merge_string<Char_type>::finalize_merged_data): Call
1096 get_or_make_input_merge_map before a loop.
1097 * merge.h (Object_merge_map): Make Input_merge_map public.
1098 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1099 (Relobj::get_or_create_merge_map): New.
1100 * object.h (Relobj::get_or_create_merge_map): New.
1101
282c9750
AM
11022015-03-24 Alan Modra <amodra@gmail.com>
1103
1104 PR 18147
1105 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1106 relocation errors for branches to strong undefined symbols.
1107
67f95b96
RÁE
11082015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1109
1110 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1111 (Object_merge_map::is_merge_section_for): Remove.
1112 (Object_merge_map::find_merge_section): New.
1113 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1114 (Object_merge_map::find_merge_section): New.
1115 (Object_merge_map::get_input_merge_map): Add a const version.
1116 * object.cc (Relobj::is_merge_section_for): Remove.
1117 (Relobj::find_merge_section): New.
1118 * object.h (Relobj::is_merge_section_for): Remove.
1119 (Relobj::find_merge_section): New.
1120 * output.cc
1121 (Output_section::Input_section::is_merge_section_for): Remove.
1122 (Output_section::add_merge_input_section): Don't call
1123 add_merge_input_section.
1124 (Output_section::find_merge_section): Return const. Use
1125 object->find_merge_section.
1126 (Output_section::build_lookup_maps): Don't build a map for
1127 merge sections.
1128 (Output_section::is_input_address_mapped): Return false if
1129 section is not found.
1130 (Output_section::find_starting_output_address): Use
1131 find_merge_section instead of is_merge_section_for.
1132 (Output_section::add_script_input_section): Don't build a map for
1133 merge sections.
1134 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1135 (Output_section_lookup_maps::find_merge_section): Remove.
1136 (Output_section_lookup_maps::add_merge_input_section) Remove.
1137 (Output_section::find_merge_section): Return const.
1138
152f7024
CC
11392015-03-22 Cary Coutant <cary@google.com>
1140
1141 PR gold/18106
1142 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1143 non-SIB form of lea, with nop after the call.
1144
bccffdfd
CC
11452015-03-21 Cary Coutant <cary@google.com>
1146
1147 PR gold/14217
1148 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1149 .tdata section.
1150 (Output_segment::set_section_addresses): Don't align size of relro
1151 segment for .tbss.
1152
1c582fe7
CC
11532015-03-21 Cary Coutant <cary@google.com>
1154
1155 PR gold/18010
1156 * stringpool.cc (Stringpool_template): Don't optimize if section
1157 alignment is greater than sizeof(char).
1158
410da591
CC
11592015-03-21 Cary Coutant <cary@google.com>
1160
1161 PR gold/18048
1162 * script-c.h (script_include_directive): Add first_token parameter.
1163 * script.cc (script_include_directive): Add first_token parameter, and
1164 pass it to read_script_file.
1165 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1166 (PARSING_MEMORY_DEF): New tokens.
1167 (top): Add new productions for INCLUDE files.
1168 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1169 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1170 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1171 (section_cmd): Pass PARSING_SECTION_CMDS.
1172 (file_or_sections_cmd): Remove.
1173 (memory_def): Pass PARSING_MEMORY_DEF.
1174 * testsuite/Makefile.am (memory_test_2): New test.
1175 * testsuite/Makefile.in: Regenerate.
1176 * testsuite/memory_test_inc.t: New script file.
1177 * testsuite/memory_test_inc_1.t.src: New script file.
1178 * testsuite/memory_test_inc_2.t.src: New script file.
1179 * testsuite/memory_test_inc_3.t.src: New script file.
1180
0d5bbdb0
CC
11812015-03-21 Cary Coutant <cary@google.com>
1182
1183 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1184 (Sized_relobj_dwo::setup): Build compressed section map.
1185 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1186 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1187 section map.
1188 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1189 compressed_sections_ field.
1190 (build_compressed_section_map): Take Object instead of
1191 Sized_relobj_file parameter; add decompress_if_needed parameter.
1192 (Sized_relobj_file::do_find_special_sections): Store compressed
1193 section map in parent Object.
1194 (Sized_relobj_file::do_decompressed_section_contents): Move
1195 implementation to Object::decompressed_section_contents.
1196 (Sized_relobj_file::do_discard_decompressed_sections): Move
1197 implementation to Object::discard_decompressed_sections.
1198 * object.h (build_compressed_section_map): Declare.
1199 (Object::Object): Add compressed_sections_ field.
1200 (Object::section_is_compressed): Move implementation here.
1201 (Object::decompressed_section_contents): De-virtualize.
1202 (Object::discard_decompressed_sections): De-virtualize.
1203 (Object::do_section_is_compressed): Delete.
1204 (Object::do_decompressed_section_contents): Delete.
1205 (Object::set_compressed_sections): New method.
1206 (Object::compressed_sections): New method.
1207 (Object::compressed_sections_): New data member.
1208 (Compressed_section_info, Compressed_section_map): Move to top of file.
1209 (Sized_relobj_file::do_section_is_compressed): Delete.
1210 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1211 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1212 (Sized_relobj_file::compressed_sections_): Move to Object class.
1213
bd9e0d46
CC
12142015-03-21 Cary Coutant <ccoutant@google.com>
1215
1216 PR gold/18152
1217 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1218 deferred objects.
1219
943c8b43
CC
12202015-03-11 Cary Coutant <ccoutant@google.com>
1221
1222 * options.cc (General_options::finalize): Don't allow -z relro
1223 with incremental linking.
1224 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1225 (incremental_test_2): Likewise.
1226 (incremental_test_3): Likewise.
1227 (incremental_test_4): Likewise.
1228 (incremental_test_5): Likewise.
1229 (incremental_test_6): Likewise.
1230 (incremental_copy_test): Likewise.
1231 (incremental_common_test_1): Likewise.
1232 (incremental_comdat_test_1): Likewise.
1233 * testsuite/Makefile.in: Regenerate.
1234
e1663197
CC
12352015-03-09 Cary Coutant <ccoutant@google.com>
1236
1237 PR gold/14675
1238 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1239 return enum indicating whether .eh_frame section is empty, optimizable,
1240 unrecognized, or an end marker. Adjust explicit instantiations.
1241 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1242 (Eh_frame::add_ehframe_input_section): Change return type.
1243 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1244 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1245 to the .eh_frame output section until we see the end marker.
1246 (Layout::finalize_eh_frame_section): New.
1247 * layout.h: (Layout::finalize_eh_frame_section): New.
1248
beb8418f
L
12492015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1250
1251 * output.cc (Relobj::initialize_input_to_output_map<size>):
1252 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1253
48c73428
CC
12542015-03-04 Cary Coutant <ccoutant@google.com>
1255
1256 * parameters.cc (Parameters::set_target_once): Call
1257 Target::select_as_default_target just once from here...
1258 (set_parameters_target): ...instead of from here.
1259
12602015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1261
1262 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1263 Output_section_data instead of a Merge_map.
1264 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1265 (Eh_frame::read_cie): Use add_merge_mapping instead of
1266 Merge_map::add_mapping.
1267 (Eh_frame::read_fde): Ditto.
1268 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1269 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1270 merge_map_->get_output_offset.
1271 (Eh_frame::do_is_merge_section_for): Delete.
1272 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1273 instead of a Merge_map.
1274 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1275 Merge_map.
1276 (Eh_frame::do_is_merge_section_for): Delete.
1277 (Eh_frame::merge_map_): Delete.
1278 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1279 and use a Output_section_data instead of a Merge_map.
1280 (Object_merge_map::add_mapping): Ditto.
1281 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1282 (Object_merge_map::is_merge_section_for): Pass in and use a
1283 Output_section_data instead of a Merge_map.
1284 (Merge_map): Delete.
1285 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1286 of merge_map_.get_output_offset.
1287 (Output_merge_base::do_is_merge_section_for): Delete.
1288 (Output_merge_data::do_add_input_section): Use
1289 object->add_merge_mapping instead of add_mapping.
1290 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1291 * merge.h (Merge_map): Delete forward declaration.
1292 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1293 instead of a Merge_map.
1294 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1295 (Object_merge_map::is_merge_section_for): Pass in and use a
1296 Output_section_data instead of a Merge_map.
1297 (Input_merge_map::Object_merge_map::merge_map): Replace with
1298 output_data.
1299 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1300 Output_section_data instead of a Merge_map.
1301 (Merge_map): Delete.
1302 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1303 (Output_merge_base::do_is_merge_section_for): Delete.
1304 (Output_merge_base::add_mapping): Delete.
1305 (Output_merge_base::merge_map_): Delete.
1306 * object.cc (Relobj::initialize_input_to_output_map): New.
1307 (Relobj::initialize_input_to_output_map): New.
1308 (Relobj::merge_output_offset): New.
1309 (Relobj::is_merge_section_for): New.
1310 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1311 bits.
1312 * object.h (Relobj::merge_map): Delete.
1313 (initialize_input_to_output_map): New.
1314 (set_merge_map): Delete.
1315 (add_merge_mapping): New.
1316 (merge_output_offset): New.
1317 (is_merge_section_for): New.
1318 * output.cc (Output_section::Input_section::is_merge_section_for):
1319 Use object->is_merge_section_for.
1320 * output.h (Output_section_data::is_merge_section_for): Delete.
1321 (Output_section_data::do_is_merge_section_for): Delete.
1322 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1323 Use object->initialize_input_to_output_map.
1324 (Merged_symbol_value<size>::value_from_output_section): Use
1325 object->merge_output_offset.
1326
48c73428 13272015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1328 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1329
1330 * output.cc (Output_section::add_merge_input_section): Do not
1331 attempt to merge sections with an entsize of 0.
1332
48c73428 13332015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1334
1335 * attributes.h (class Output_attributes_section_data ): Add
1336 do_print_to_mapfile function.
1337
ec86f434
AM
13382015-02-24 Alan Modra <amodra@gmail.com>
1339
1340 PR 18010
1341 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1342 complain if value is not a multiple of four.
1343 (Target_powerpc::Relocate::relocate): Correct handling of
1344 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1345
be66981e
L
13462015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1347
1348 * configure.ac (default_size): Set to 32 for x32.
1349 * configure: Regenerated.
1350
e3ee8ed4
AM
13512015-02-18 Alan Modra <amodra@gmail.com>
1352
1353 PR 17954
1354 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1355 visibility.
1356
3a935c6c
RÁE
13572015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1358
1359 * gc.h (Garbage_collection::add_reference): Don't use find.
1360
e0a1e121
RÁE
13612015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1362
1363 * object.cc (write_local_symbols): avoid std::vector copy.
1364
45a4fb1a
RÁE
13652015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1366
1367 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1368
2d9afefe
MW
13692015-02-09 Mark Wielaard <mjw@redhat.com>
1370
1371 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1372 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1373
e9c1bdad
CC
13742015-02-16 Cary Coutant <ccoutant@google.com>
1375
1376 PR gold/13577
1377 PR gold/16992
1378 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1379 DF_SYMBOLIC if --dynamic-list option is used.
1380 * options.cc (General_options::finalize): --dynamic-list is not
1381 mutually exclusive with -Bsymbolic.
1382 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1383 listed in --dynamic-list.
1384 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1385 -Bsymbolic-functions.
1386 * testsuite/Makefile.in: Regenerate.
1387
0ed4b0bf
CC
13882015-02-16 Cary Coutant <ccoutant@google.com>
1389
1390 PR gold/17971
1391 * incremental.cc: Remove redundant include of "output.h".
1392
1a920511
JY
13932015-02-12 Jing Yu <jingyu@google.com>
1394
1395 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1396 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1397 New relocation.
1398 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1399 TLSLE_MOVW_* relocations.
1400 (Target_aarch64::Scan::global): Likewise.
1401 (Target_aarch64::Relocate::relocate): Likewise.
1402 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1403 for new TLSLE_MOVW_* relocations.
1404
07f107f3
WN
14052015-02-11 Will Newton <will.newton@linaro.org>
1406
1407 PR gold/13321
1408 * arm.cc (Target_arm::make_plt_section): Create an ARM
1409 state mapping symbol at the start of the PLT.
1410
e051a5b5
L
14112015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1412
1413 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1414 Replace two_file_shared_2.so with two_file_shared_1.so.
1415 * testsuite/Makefile.in: Regenerated.
1416
dddcc5b9
AM
14172015-02-09 Alan Modra <amodra@gmail.com>
1418
1419 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1420 plugin_test_thin.a and defsym_test.
1421 * testsuite/Makefile.in: Regenerate.
1422
b39b8b9d
RÁE
14232015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1424
1425 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1426 body.
1427
b66d1c52
CC
14282015-02-04 Peter Collingbourne <pcc@google.com>
1429
1430 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1431 forwarding symbols when computing symbol resolution info for plugins.
1432 * plugin.h (Plugin_manager::symtab): New method.
1433 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1434
23081de0
CC
14352015-02-03 Cary Coutant <ccoutant@google.com>
1436 Peter Collingbourne <pcc@google.com>
1437
1438 PR gold/15660
1439 * archive.cc (Thin_archive_object_unlocker): New class.
1440 (Archive::include_member): Unlock external members of thin archives.
1441 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1442 (plugin_test_2): Likewise.
1443 (plugin_test_3): Likewise.
1444 (plugin_test_4): Likewise.
1445 (plugin_test_5): Likewise.
1446 (plugin_test_6): Likewise.
1447 (plugin_test_7): Likewise.
1448 (plugin_test_8): Likewise.
1449 (plugin_test_9): Likewise.
1450 (plugin_test_10): Likewise.
1451 (plugin_test_11): New test case.
1452 * testsuite/Makefile.in: Regenerate.
1453 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1454 file to decide whether to claim file.
1455 (all_symbols_read_hook): Likewise.
1456 * testsuite/plugin_test_1.sh: Adjust expected output.
1457 * testsuite/plugin_test_2.sh: Likewise.
1458 * testsuite/plugin_test_3.sh: Likewise.
1459 * testsuite/plugin_test_6.sh: Likewise.
1460 * testsuite/plugin_test_tls.sh: Likewise.
1461 * testsuite/plugin_test_11.sh: New testcase.
1462
14632015-02-03 Cary Coutant <ccoutant@google.com>
1464
1465 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1466 file descriptors when debugging enabled. Add debug output.
1467 (Descriptors::release): Add debug output.
1468 (Descriptors::close_some_descriptor): Likewise.
1469 (Descriptors::close_all): Likewise.
1470 * fileread.cc (File_read::lock): Likewise.
1471 (File_read::unlock): Likewise.
1472
24dd5808
CC
14732015-02-02 Cary Coutant <ccoutant@google.com>
1474
1475 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1476 executable output file.
1477
fa89cc82
HS
14782015-01-22 Han Shen <shenhan@google.com>
1479
1480 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1481 (Target_arm::do_plt_address_for_global): New method.
1482 (Target_arm::do_plt_address_for_local): New method.
1483 (Target_arm::rel_irelative_section): New method.
1484 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1485 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1486 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1487 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1488 (Target_arm::Scan::check_non_pic): Add ifunc support.
1489 (Target_arm::Scan::local): Add ifunc support.
1490 (Target_arm::Scan::global): Add ifunc support.
1491 (Target_arm::make_plt_section): New method.
1492 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1493 (Target_arm::make_local_ifunc_plt_entry): New method.
1494 (Target_arm::got_irelative_): New member.
1495 (Target_arm::rel_irelative_): New member.
1496 (Target_arm::got_section): Add creation for got_irelative_.
1497 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1498 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1499 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1500 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1501 (Output_data_plt_arm::IRelative_data): New type.
1502 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1503 (Output_data_plt_arm::add_entry): Add more parameters.
1504 (Output_data_plt_arm::add_relocation): New method.
1505 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1506 (Output_data_plt_arm::rel_irelative): New method.
1507 (Output_data_plt_arm::entry_count): Modified.
1508 (Output_data_plt_arm::address_for_global): New method.
1509 (Output_data_plt_arm::address_for_local): New method.
23081de0 1510gold/
fa89cc82
HS
1511 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1512 (Output_data_plt_arm::insert_irelative_data): New method.
1513 (Output_data_plt_arm::irelative_rel_): New member.
1514 (Output_data_plt_arm::got_): New member.
1515 (Output_data_plt_arm::got_irelative_): New member.
1516 (Output_data_plt_arm::irelative_count_): New member.
1517 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1518 (Output_data_plt_arm::irelative_data_vec_): New member.
1519 (Output_data_plt_arm::do_write): Write out irelative entries.
1520 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1521 more parameters to ctor.
1522 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1523 more parameters to ctor.
1524 * output.h (Output_data_reloc::add_local_relative): New method.
1525 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1526
0f81d3f0
AM
15272015-01-29 Alan Modra <amodra@gmail.com>
1528
1529 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1530 and GOT_TLSGD to LE optimization.
1531
65d92137
CC
15322015-01-28 Cary Coutant <ccoutant@google.com>
1533
1534 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1535 for undef TLS symbols.
1536 (Target_x86_64::Relocate::relocate_tls): Likewise.
1537 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1538
5485698a
CC
15392015-01-25 Cary Coutant <ccoutant@google.com>
1540
1541 * output.cc (Output_segment::set_section_addresses): Fix calculation
1542 of size of relro segment.
1543
b01a4b04
AM
15442015-01-22 Alan Modra <amodra@gmail.com>
1545
1546 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1547 condition for need of ifunc plt entry.
1548 (Target_powerpc::Scan::global <got relocs>): Likewise.
1549
3d0064a9
CC
15502015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1551
1552 * mips.cc (reloc_high): Add r_sym.
1553 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1554 reloc_high constructor.
1555 (Mips_relocate_functions::relgot16_local): Likewise.
1556 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1557 r_type to decide whether LO16 matches HI16.
1558 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1559 rello16 and relgot16_local.
1560
a5cd8f05
CC
15612015-01-09 Cary Coutant <ccoutant@google.com>
1562
1563 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1564 unless alignment is larger than page size.
1565
4fc1b9d4
L
15662015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1567 Cary Coutant <ccoutant@google.com>
1568
1569 PR gold/17729
1570 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1571 (DEFAULT_TARGET_X32): Set for x32.
1572 * x86_64.cc (cmp_insn_32): New.
1573 (lea_r10_insn_32): Likewise.
1574 (lea_r11_insn_32): Likewise.
1575 (cmp_insn_64): Likewise.
1576 (lea_r10_insn_64): Likewise.
1577 (lea_r11_insn_64): Likewise.
1578 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1579 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1580 (check_DATA): Add split_x32 files.
1581 (split_x32_[1234n].o): New targets.
1582 (split_x32_[124]): New targets.
1583 (split_x32_[1234r].stdout): New targets.
1584 * testsuite/split_x32.sh: New file.
1585 * testsuite/split_x32_1.s: Likewise.
1586 * testsuite/split_x32_2.s: Likewise.
1587 * testsuite/split_x32_3.s: Likewise.
1588 * testsuite/split_x32_4.s: Likewise.
1589 * testsuite/split_x32_n.s: Likewise.
1590 * configure: Regenerated.
1591 * testsuite/Makefile.in: Likewise.
1592
e749cab8
L
15932015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1594
1595 PR gold/17809
1596 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1597 x32.
1598
af759df0
AM
15992015-01-02 Alan Modra <amodra@gmail.com>
1600
1601 * version.cc (print_version): Just print current year.
1602 * dwp.cc (print_version): Likewise.
1603
b90efa5b
AM
16042015-01-01 Alan Modra <amodra@gmail.com>
1605
1606 Update year range in copyright notice of all files.
1607
f12d1e8a
AM
16082014-12-25 Alan Modra <amodra@gmail.com>
1609
1610 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1611 new enums.
1612 (Target_arm::merge_object_attributes, ): Likewise.
1613
5c294fee
TG
16142014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1615
1616 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1617 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1618 AEABI_VFP_args_vfp to check that.
1619 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1620 value and replace hardcoded values by enum values.
1621
e30880c2
CC
16222014-12-22 Cary Coutant <ccoutant@google.com>
1623
1624 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1625
bd040da1
L
16262014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1627
1628 PR gold/14608
1629 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1630 to "return i * i * 3;".
1631
e02a4046
CC
16322014-12-16 Cary Coutant <ccoutant@google.com>
1633
1634 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1635 (Mapfile::print_output_data): Use current_data_size() to avoid
1636 assert for sections requiring postprocessing; if address is not valid,
1637 print 0.
1638 (Mapfile::print_output_section): Use current_data_size(); print note
1639 that addresses and sizes are before compression.
1640
add6016b
L
16412014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1642
1643 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1644 Cast current_group_size to unsigned long when reporting error.
1645
0bf32ea9
JY
16462014-12-10 Jing Yu <jingyu@google.com>
1647
1648 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1649 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1650 Update error message.
1651 (Target_aarch64::do_relax): Use absolute value of option
1652 stub_group_size. Replace local variable with class member
1653 stub_group_size_.
1654
cbcb23fa
AM
16552014-12-04 Alan Modra <amodra@gmail.com>
1656
1657 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1658 addend of PLTREL24 reloc when not generating a plt stub. Make
1659 max_branch_offset an "Address".
fbad6518 1660 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1661 (Target_powerpc::Relocate::relocate): Likewise.
1662
1611bc4a
AM
16632014-12-04 Alan Modra <amodra@gmail.com>
1664
1665 PR 17670
1666 * symtab.cc (Symbol::set_undefined): Remove assertion.
1667 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1668 on symbols defined in discarded sections, instead return false.
1669 Rearrange params, update all callers.
1670 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1671 branches to syms in discarded sections.
1672 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1673 undefined and flag as discarded.
1674 (Target_powerpc::Relocate::relocate): Localize variable.
1675
4759c34e
L
16762014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1677
1678 PR gold/17675
1679 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1680 * testsuite/Makefile.in: Regenerated.
1681
1f98a074
AM
16822014-12-03 Alan Modra <amodra@gmail.com>
1683
1684 PR 17566
1685 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1686 when adding dynamic relocations against section symbols.
1687
fb257835
DI
16882014-12-01 Dimitry Ivanov <dimitry@google.com>
1689
1690 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1691 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1692 * options.h (General_options): New -z option (global).
1693
d8e60314
CC
16942014-12-01 Cary Coutant <ccoutant@google.com>
1695
1696 PR gold/17578
1697 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1698 is given.
1699 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1700 given but some inputs require executable stack.
1701
982bbd97
CC
17022014-11-26 Cary Coutant <ccoutant@google.com>
1703
1704 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1705 .debug_str_offsets; strip .debug_gnu_pubnames and
1706 .debug_gnu_pubtypes.
1707 (lines_only_debug_sections): Strip all four new sections.
1708
bb779192
HS
17092014-11-26 Jing Yu <jingyu@google.com>
1710
1711 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1712 register to be x0 when to relax TLSDESC_LD64_LO12.
1713
a3e60ddb
AM
17142014-11-26 Alan Modra <amodra@gmail.com>
1715
1716 * powerpc.cc (struct Stub_table_owner): New.
1717 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1718 unsigned int vector. Update all references.
1719 (powerpc_relobj::set_stub_table): Take an unsigned int param
1720 rather than a Stub_table. Update callers.
1721 (Powerpc_relobj::clear_stub_table): New function.
1722 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1723 stub_group_size_ vars.
1724 (Target_powerpc::new_stub_table): Delete.
1725 (max_branch_delta): New function, extracted from..
1726 (Target_powerpc::Relocate::relocate): ..here..
1727 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1728 status on whether stub created successfully.
1729 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1730 default sizing to..
1731 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1732 reduce on relax failure.
1733 (Target_powerpc::group_sections): Add "no_size_errors" param.
1734 Use stub_group_size_. Set up group info in a temp vector,
1735 before building Stub_table vector. Account for input sections
1736 possibly already converted to relaxed sections.
1737 (Stub_table::init): Delete. Merge into..
1738 (Stub_table::Stub_table): ..here.
1739 (Stub_table::can_reach_stub): New function.
1740 (Stub_table::add_plt_call_entry): Add "from" parameter and
1741 return true iff stub could be reached.
1742 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1743 param too.
1744 (Stub_table::clear_stubs): Add "all" param.
1745
a20605cf
AM
17462014-11-26 Alan Modra <amodra@gmail.com>
1747
1748 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1749 (Target_powerpc::group_sections): Use it.
1750
43b64deb
CC
17512014-11-25 Cary Coutant <ccoutant@google.com>
1752
1753 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1754 (Binary_to_elf::write_symbol): Add st_size parameter.
1755 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1756
c924eb67
CC
17572014-11-25 Cary Coutant <ccoutant@google.com>
1758
1759 PR gold/17639
1760 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1761 (Sized_relobj_file::do_layout): Handle deferred sections properly
1762 during GC pass 1. Don't add reloc sections to deferred list twice.
1763 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1764 (Sized_relobj_file::is_deferred_layout_): New data member.
1765
9d585188
L
17662014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1767
1768 PR gold/17619
1769 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1770 Check PC-relative offset overflow in PLT entry.
1771
3ffaac20
AM
17722014-11-21 Alan Modra <amodra@gmail.com>
1773
1774 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1775 for undefined weaks.
1776
0cfb0717
AM
17772014-11-20 Alan Modra <amodra@gmail.com>
1778
1779 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1780 from --stub-group-size parameter divided by 1024.
1781 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1782 template parameter. Update all uses.
1783 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1784 has_stub_value. Set for long branches. Don't report overflow for
1785 branch to undefined weak symbols. Print info message on
1786 overflowing branch to stub.
1787
f9dffbf0
AM
17882014-11-20 Alan Modra <amodra@gmail.com>
1789
1790 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1791
e88ba8d5
L
17922014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1793
1794 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1795 entry for R_X86_64_GOTPLT64.
1796 (Target_x86_64<size>::Relocate::relocate): Update comments for
1797 R_X86_64_GOTPLT64.
1798
d37ffe25
ED
17992014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1800
1801 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1802 * plugin.h: add lock definition
1803
9726c3c1
HS
18042014-10-29 Han Shen <shenhan@google.com>
1805 Jing Yu <jingyu@google.com>
1806
1807 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1808 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1809 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1810 Symbol::TLS_REF.
1811 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1812 method.
1813 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1814 (Target_aarch64::tls_ld_to_le): New method.
1815 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1816 for 64bit targets.
1817 (Output_data_plt_aarch64::irelative_rel_): New data member.
1818 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1819 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1820 (Output_data_plt_aarch64::add_relocation): New method.
1821 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1822 offset. Add got_irelative size to got size.
1823 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1824 type string with the new typename.
1825 (AArch64_relocate_functions::update_adr): Replace parameter x with
1826 immed.
1827 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1828 (AArch64_relocate_functions::reloc_common): New method.
1829 (AArch64_relocate_funcsions::rela_general): Extract common part out
1830 into reloc_common method.
1831 (AArch64_relocate_functions::rela_general): Likewise.
1832 (AArch64_relocate_functions::pcrela_general): Likewise.
1833 (AArch64_relocate_functions::adr): New method.
1834 (AArch64_relocate_functions::adrp): Calculate immed before calling
1835 update_adr.
1836 (AArch64_relocate_functions::adrp): Likewise.
1837 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1838 comparing x to 0. Calculate immed from ~x when x < 0.
1839 (Target_aarch64::optimize_tls_reloc): Add new cases for
1840 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1841 TLSLD_MOVW_DTPREL_G0_NC.
1842 (Target_aarch64::possible_function_pointer_reloc): Implement this
1843 method.
1844 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1845 comment.
1846 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1847 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1848 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1849 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1850 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1851 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1852 (Target_aarch64::make_plt_entry): Call add_entry with two more
1853 parameters.
1854 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1855 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1856 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1857 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1858 (Target_aarch64::Relocate::relocate_tls): Add cases for
1859 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1860 TLSLD_MOVW_DTPREL_G0_NC.
1861 * testsuite/icf_safe_so_test.cc: Correct test comment.
1862 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1863
80272b8c
AM
18642014-10-22 Alan Modra <amodra@gmail.com>
1865
1866 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1867 thread_starter.
1868
998a69f4
AS
18692014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1870
1871 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1872
aed56ec5
CC
18732014-10-17 Cary Coutant <ccoutant@google.com>
1874
1875 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1876 Add "typename" keyword.
1877
bb779192 18782014-10-15 Han Shen <shenhan@google.com>
72f4393d 1879 Jing Yu <jingyu@google.com>
83a01957
HS
1880
1881 Patch for gold aarch64 backend to support relaxation.
1882 * aarch64-reloc.def: Change format.
1883 * aarch64.cc (class Reloc_stub): New class.
1884 (class Stub_table): New class.
1885 (class AArch64_relobj): New class.
1886 (class AArch64_input_section): New class.
1887 (class AArch64_output_section): New class.
1888 (Target_aarch64::new_stub_table): New method.
1889 (Target_aarch64::new_aarch64_input_section): New method.
1890 (Target_aarch64::find_aarch64_input_section): New method.
1891 (Target_aarch64::scan_section_for_stubs): New method.
1892 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1893 (Target_aarch64::relocate_stub): New method.
1894 (Target_aarch64::current_target): New method.
1895 (Target_aarch64::do_make_elf_object): New method.
1896 (Target_aarch64::do_may_relax): New method.
1897 (Target_aarch64::do_relax): New method.
1898 (Target_aarch64::group_sections): New method.
1899 (Target_aarch64::scan_reloc_for_stub): New method.
1900 (Target_aarch64::do_make_output_section): New method.
1901 (Target_aarch64::stub_tables_): New data member.
1902 (Target_aarch64::aarch64_input_section_map_): New data member.
1903 (AArch64_relocate_functions::maybe_apply_stub): New method.
1904
db4c9594
CC
19052014-09-30 Cary Coutant <ccoutant@google.com>
1906
1907 PR gold/17432
1908 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1909
cd6da036
KC
19102014-09-30 Kito Cheng <kito@0xlab.org>
1911
1912 PR gold/13597
1913 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1914 hash table before sysv-style hash table.
1915
5f772412
ST
19162014-09-29 Sriraman Tallam <tmsriram@google.com>
1917
1918 * options.h (--pic-executable): Add negative to alias to -no-pie.
1919
5efeedf6
CC
19202014-09-26 Cary Coutant <ccoutant@google.com>
1921
1922 PR gold/16773
1923 * object.cc (Sized_relobj_file): Compute value of section symbols
1924 for TLS sections the same as TLS symbols.
1925
1707f183
CC
19262014-09-25 Cary Coutant <ccoutant@google.com>
1927
1928 PR gold/17432
1929 * resolve.cc (Symbol_table::resolve): Override common placeholder
1930 symbols, but adjust sizes.
1931 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1932 symbols to common lists.
1933
00cac886
AM
19342014-09-24 Alan Modra <amodra@gmail.com>
1935
1936 * po/POTFILES.in: Regenerate.
1937
635aa30e 19382014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1939 Cary Coutant <ccoutant@google.com>
635aa30e 1940
71b9b91b 1941 PR gold/14860
635aa30e
CC
1942 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1943 on input_sections_blocker.
1944 * layout.cc (Write_sections_task::locks): Unblock
1945 input_sections_blocker_.
1946 * layout.h (Write_sections_task::Write_sections_task): Add
1947 input_sections_blocker.
1948 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1949 to DEPENDENCIES.
1950 * testsuite/Makefile.in: Regenerate.
1951
c0c71592
RÁE
19522014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1953
1954 * testsuite/Makefile.am (plugin_test_10): New test.
1955 * testsuite/Makefile.in: Regenerate
1956 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1957 * testsuite/plugin_test_10.sh: New file.
1958
6168c2a1
RÁE
19592014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1960
1961 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1962 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1963 during the replacement phase.
1964
3a531937
JY
19652014-09-17 Han Shen <shenhan@google.com>
1966 Jing Yu <jingyu@google.com>
1967
1968 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1969 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1970 * aarch64.cc (Target_aarch64): Add data members
1971 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1972 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1973 constructor.
1974 (Target_aarch64::do_reloc_symbol_index): New method.
1975 (Target_aarch64::do_reloc_addend): New method.
1976 (Target_aarch64::add_tlsdesc_info): New method.
1977 (Target_aarch64::do_dynsym_value): New method.
1978 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1979 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1980 (Target_aarch64::make_data_plt): Add new parameters: got,
1981 got_irelative. Pass them to do_make_data_plt.
1982 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1983 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1984 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1985 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1986 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1987 (Target_aarch64::got_tlsdesc_section): New method.
1988 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1989 (Target_aarch64::define_tls_base_symbol): New method.
1990 (Target_aarch64::reserve_tlsdesc_entries): New method.
1991 (Target_aarch64::got_mod_index_entry): New method.
1992 (Target_aarch64::rela_tlsdesc_section): New method.
1993 (Target_aarch64::rela_irelative_section): New method.
1994 (Target_aarch64::Tlsdesc_info): New struct.
1995 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1996 relocations and tlsdesc relocations.
1997 (Target_aarch64::optimize_tls_reloc): Implement method.
1998 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1999 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2000 in constructor.
2001 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2002 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2003 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2004 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2005 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2006 (Output_data_plt_aarch64::rela_irelative): New method.
2007 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2008 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2009 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2010 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2011 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2012 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2013 (Output_data_plt_aarch64_standard): New member variables:
2014 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2015 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2016 New parameter: got, got_irelative.
2017 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2018 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2019 (Output_data_plt_aarch64::do_write): Replace got_address with
2020 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2021 (AArch64_relocate_functions::update_movnz): New method.
2022 (AArch64_relocate_functions): Correct format.
2023 (AArch64_relocate_functions::movnz): New method.
2024 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2025 before the switch. Add new cases to switch.
00cac886 2026 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
2027 tlsgd tlsdesc cases.
2028 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2029 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2030 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2031 Call reloc_name_in_error_message to print unsupported reloc.
2032 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2033 make_data_plt.
2034 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2035 relocs. Fill in some more dynamic tags.
2036 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2037 Skip call tls_get_addr when tlsgd is relaxed.
2038 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2039 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2040 tlsdesc->ie relaxation.
2041
62661c93
SS
20422014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2043
2044 * mips.cc (Target_mips_nacl): New class.
2045 (Target_selector_mips_nacl): New class.
2046 (target_selector_mips32): Rename from target_selector_mips32be and use
2047 Target_selector_mips_nacl instead of Target_selector_mips.
2048 (target_selector_mips32el): Rename from target_selector_mips32 and use
2049 Target_selector_mips_nacl instead of Target_selector_mips.
2050 (target_selector_mips64): Rename from target_selector_mips64be and use
2051 Target_selector_mips_nacl instead of Target_selector_mips.
2052 (target_selector_mips64el): Rename from target_selector_mips64 and use
2053 Target_selector_mips_nacl instead of Target_selector_mips.
2054 (Target_mips::mips_info): Add const attribute.
2055
54674d38
CC
20562014-09-02 Cary Coutant <ccoutant@google.com>
2057
2058 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2059 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2060 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2061 (Sized_incr_dynobj::do_section_name): Likewise.
2062 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2063 (Sized_incr_dynobj::do_section_name): Likewise.
2064 * object.h (Object::section_name): Likewise.
2065 (Object::do_section_name): Likewise.
2066 (Sized_relobj_file::do_section_name): Likewise.
2067 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2068 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2069
9860cbcf
CC
20702014-09-02 Cary Coutant <ccoutant@google.com>
2071
2072 PR gold/17005
2073 * ehframe.cc (Fde::write): Add output_offset parameter.
2074 (Cie::write): Likewise.
2075 (Eh_frame::set_final_data_size): Account for offset within output
2076 section.
2077 (Eh_frame::do_sized_write): Likewise.
2078 * ehframe.h (Fde::write): Add output_offset parameter.
2079 (Cie::write): Likewise.
2080 * output.cc (Output_section::Input_section_sort_entry): Remove
2081 section_has_name_; add output_section_name parameter. Use
2082 output section name for non-input sections.
2083 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2084 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2085 (Output_section::Input_section_sort_compare): Remove logic for
2086 sections without names.
2087 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2088 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2089 Likewise.
2090 (Output_section::Input_section_sort_section_name_compare): Likewise.
2091
8e33481e
HS
20922014-08-29 Han Shen <shenhan@google.com>
2093 Jing Yu <jingyu@google.com>
2094
2095 * aarch64-reloc-property.cc
2096 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2097 reference reloc property in the table.
2098 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2099 3 other entries.
2100 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2101 2 new overloaded methods.
2102 (Output_data_got_aarch64::do_write): Add code to write out
2103 static relocs.
2104 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2105 static relocs.
2106 (Output_data_got_aarch64::static_relocs): New vector to
2107 hold static relocs.
2108 (Target_aarch64::TCB_SIZE): New const static memeber.
2109 (Target_aarch64::tcb_size): New method.
2110 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2111 (Target_aarch64::Relocate::relocate_tls): New method.
2112 (Target_aarch64::Scan::local): Add code handling new reloc types.
2113 (Target_aarch64::Scan::global): Add code handling new reloc types.
2114
81233653
ST
21152014-08-13 Sriraman Tallam <tmsriram@google.com>
2116
2117 * options.h (-no-pie): Add option.
2118
9363c7c3
JY
21192014-08-08 Jing Yu <jingyu@google.com>
2120 Han Shen <shenhan@google.com>
2121
2122 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2123 (DEFFILES): add aarch64-reloc.def.
2124 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2125 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2126 * Makefile.in: Regenerate.
2127 * aarch64-reloc-property.cc: New file.
2128 * aarch64-reloc-property.h: New file.
2129 * aarch64-reloc.def: New file.
2130 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2131 with tab to make the format consistent.
2132 (Output_data_got_aarch64::symbol_table_): New method.
2133 (Target_aarch64::do_plt_address_for_global): New method.
2134 (Target_aarch64::do_plt_address_for_local): New method.
2135 (Target_aarch64::do_select_as_default_target): New method.
2136 (Target_aarch64::do_make_data_plt): New method.
2137 (Target_aarch64::make_data_plt): New method.
2138 (Output_data_plt_aarch64::has_irelative_section): New method.
2139 (Output_data_plt_aarch64::address_for_global): New method.
2140 (Output_data_plt_aarch64::address_for_local): New method.
2141 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2142 (Output_data_plt_aarch64::add_entry): Implement contents.
2143 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2144 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2145 the got_pov entry to plt0.
2146 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2147 Implement contents.
2148 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2149 (AArch64_howto): New struct.
2150 (aarch64_howto[]): New static const array.
2151 (AArch64_relocate_functions): New class.
2152 (Target_aarch64::Scan::get_reference_flags): Remove method.
2153 (Target_aarch64::Scan::local): Implement to support a few relocations.
2154 (Target_aarch64::Scan::global): Implement to support a few relocations.
2155 (Target_aarch64::make_plt_section): Implement contents.
2156 (Target_aarch64::make_plt_entry): Implement contents.
2157 (Target_aarch64::do_finalize_sections): Implement contents.
2158 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2159 (Target_aarch64::relocate_section): Implement contents.
2160
ad9fe6c1
AM
21612014-08-06 Alan Modra <amodra@gmail.com>
2162
2163 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2164
7cd4e5b7
AM
21652014-08-06 Alan Modra <amodra@gmail.com>
2166
2167 PR 13227
2168 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2169
5ad9b0a7
ST
21702014-07-21 Sriraman Tallam <tmsriram@google.com>
2171
2172 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2173 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2174
e051745c
CC
21752014-07-08 Cary Coutant <ccoutant@google.com>
2176
2177 * expression.cc (struct Expression::Expression_eval_info): Add
2178 new fields type_pointer, vis_pointer, and nonvis_pointer.
2179 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2180 nonvis_pointer parameters. Adjust all calls.
2181 (Symbol_expression::value): Update type, visibility, and nonvis bits
2182 in caller.
2183 * script.cc (Symbol_assignment::sized_finalize): Update type,
2184 visibility, and remaining st_other bits for new symbol.
2185 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2186 vis_pointer, and nonvis_pointer parameters.
2187 * symtab.h (Symbol::set_type): New method.
2188
2189 * testsuite/Makefile.am (defsym_test): New test.
2190 * testsuite/Makefile.in: Regenerate.
2191 * testsuite/defsym_test.c: New file.
2192 * testsuite/defsym_test.sh: New file.
2193
f35c4853
CC
21942014-07-08 Cary Coutant <ccoutant@google.com>
2195
2196 PR gold/15639
2197 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2198 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2199 (Sized_dynobj::base_read_symbols): ...new method.
2200 * object.h (Sized_relobj_file::base_read_symbols): New method.
2201 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2202 (Sized_relobj_file::base_read_symbols): ...new method.
2203 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2204 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2205 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2206
2900af2d
AM
22072014-07-04 Alan Modra <amodra@gmail.com>
2208
2209 * po/POTFILES.in: Regenerate.
2210
053a4d68
JY
22112014-07-02 Jing Yu <jingyu@google.com>
2212
2213 * aarch64.cc: New file
2214 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2215 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2216 * Makefile.in: Regenerate.
2217 * configure.tgt: Add entries for aarch64*.
2218 * configure.ac: Likewise.
2219 * configure: Likewise.
2220
7b549045
AM
22212014-06-27 Alan Modra <amodra@gmail.com>
2222
2223 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2224
cb818dbf
CC
22252014-06-24 Cary Coutant <ccoutant@google.com>
2226
2227 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2228 sections.
2229 (Dwo_file::sized_read_unit_index): Likewise.
2230
9810d34d
SS
22312014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2232
2233 * mips.cc: New file.
2234 * Makefile.am (TARGETSOURCES): Add mips.cc
2235 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2236 * configure.tgt: Add entries for mips*.
2237 * configure.ac: Likewise.
2238 * Makefile.in: Regenerate.
2239 * configure: Likewise.
2240
9baa787b
CC
22412014-06-09 Cary Coutant <ccoutant@google.com>
2242
2243 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2244 unit_length is within section bounds.
2245
8f89af0a
CC
22462014-06-09 Cary Coutant <ccoutant@google.com>
2247
2248 PR gold/16980
2249 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2250 map.
2251
a47622ac
AM
22522014-06-07 Alan Modra <amodra@gmail.com>
2253
2254 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2255
4320c691
CC
22562014-06-06 Cary Coutant <ccoutant@google.com>
2257
2258 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2259 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2260 (Dwarf_pubnames_table::read_header): Likewise.
2261 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2262 .debug_gnu_pubtypes.
2263
270c9937
JB
22642014-06-05 Joel Brobecker <brobecker@adacore.com>
2265
2266 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2267 * Makefile.in, configure: Regenerate.
2268
397998fc
AM
22692014-06-03 Alan Modra <amodra@gmail.com>
2270
2271 * powerpc.cc (addis_12_2): Define.
2272 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2273
61f5c66f
AM
22742014-06-03 Alan Modra <amodra@gmail.com>
2275
2276 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2277 st_other output.
2278
f6971787
AM
22792014-06-02 Alan Modra <amodra@gmail.com>
2280
2281 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2282 Only ignore relocs on ELFv1.
2283 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2284
f6fb8322
CC
22852014-05-30 Cary Coutant <ccoutant@google.com>
2286
2287 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2288 * testsuite/Makefile.in: Regenerate.
2289 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2290
c23dd342
L
22912014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2292
2293 PR gold/16945
2294 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2295 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2296
5fe7ffdc
AM
22972014-05-15 Alan Modra <amodra@gmail.com>
2298
2299 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2300 Compare FDE contents with DW_CFA_nop rather than 0.
2301
a82bef93
ST
23022014-05-13 Sriraman Tallam <tmsriram@google.com>
2303
2304 * symtab.h (may_need_copy_reloc): Remove check for position independent
2305 code.
2306 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2307 position independence before pc absolute may_need_copy_reloc call.
2308 Add check for executable output befor pc relative may_need_copy_reloc
2309 call.
2310 * i386.cc: Ditto.
2311 * arm.cc: Ditto.
2312 * sparc.cc: Ditto.
2313 * tilegx.cc: Ditto.
2314 * powerpc.cc: Add check for no position independence before
2315 may_need_copy_reloc calls.
2316 * testsuite/pie_copyrelocs_test.cc: New file.
2317 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2318 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2319 * Makefile.in: Regenerate.
a82bef93 2320
53c66605
ML
23212014-05-08 Martin Liška <mliska@suse.cz>
2322
2323 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2324
57b2284c
CC
23252014-05-06 Cary Coutant <ccoutant@google.com>
2326
2327 PR gold/16900
2328 * i386.cc (Output_data_got_plt_i386): New class.
2329 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2330 parameter. Change all callers.
2331 (Output_data_plt_i386::layout_): Remove.
2332 (Output_data_plt_i386::got_plt_): Change type.
2333 (Target_i386::got_plt_): Change type. Change all references.
2334 (Target_i386::got_section): Create instance of new class.
2335 (Output_data_got_plt_i386::do_write): New function.
2336 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2337 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2338 parameter. Change all callers.
2339 (Output_data_plt_x86_64::layout_): Remove.
2340 (Output_data_plt_x86_64::got_plt_): Change type.
2341 (Target_x86_64::got_plt_): Change type. Change all references.
2342 (Target_x86_64::got_section): Create instance of new class.
2343 (Output_data_got_plt_x86_64::do_write): New function.
2344 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2345 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2346 class.
2347
6b97515d 23482014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2349
6b97515d
CC
2350 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2351 if we have pubnames/pubtypes.
2352
d1bddd3c
CC
23532014-05-02 Cary Coutant <ccoutant@google.com>
2354
5fe7ffdc
AM
2355 * defstd.cc (in_segment): Define __ehdr_start here...
2356 * layout.cc (Layout::finalize): ...Instead of here. Set the
2357 output segment when known.
2358 * resolve.cc (Symbol::override_base_with_special): Remember
2359 the original binding.
2360 * symtab.cc (Symbol::set_output_segment): New function.
2361 (Symbol::set_undefined): New function.
2362 * symtab.h (Symbol::is_weak_undefined): Check original undef
2363 binding.
2364 (Symbol::is_strong_undefined): New function.
2365 (Symbol::set_output_segment): New function.
2366 (Symbol::set_undefined): New function.
2367 * target-reloc.h (is_strong_undefined): Remove.
2368 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2369 Check for hidden undefs.
2370 (relocate_section): Call Symbol::is_strong_undefined.
2371
2372 * testsuite/Makefile.am (ehdr_start_test_1)
2373 (ehdr_start_test_2, ehdr_start_test_3)
2374 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2375 * testsuite/Makefile.in: Regenerate.
2376 * testsuite/ehdr_start_def.cc: New source file.
2377 * testsuite/ehdr_start_test.cc: New source file.
2378 * testsuite/ehdr_start_test.t: New linker script.
2379 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2380
7849f6d8
CC
23812014-04-23 Cary Coutant <ccoutant@google.com>
2382
bf2cc635 2383 PR gold/16870
7849f6d8
CC
2384 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2385
99fd8cff
CC
23862014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2387
2388 * layout.cc (Layout::include_section): Allow a target to decide
2389 whether to include a section.
2390 * target.h (Target::should_include_section): New function.
2391 (Target::do_should_include_section): New function.
2392
91f43acd
CC
23932014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2394
2395 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2396 inline into ...
2397 (Copy_relocs::emit): ... here.
2398 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2399 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2400 (Copy_reloc_entry::entries_): Change from private to protected.
2401
c4eb27e1
ST
24022014-04-02 Sriraman Tallam <tmsriram@google.com>
2403
2404 * icf.cc (get_section_contents): Replace copies of reloc
2405 vectors with const references.
2406
ae447ddd
CC
24072014-04-02 Cary Coutant <ccoutant@google.com>
2408
2409 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2410 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2411 * configure: Regenerate.
2412 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2413 -fno-use-linker-plugin.
2414 (LINK1, CXXLINK1): Add it to the link command.
2415 * testsuite/Makefile.in: Regenerate.
2416
fa47fa92
AM
24172014-03-12 Alan Modra <amodra@gmail.com>
2418
2419 * Makefile.in: Regenerate.
2420
9b12c500
CC
24212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2422
2423 * symtab.h (Symbol::set_nonvis): New function.
2424
beacaa96
CC
24252014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2426
2427 * symtab.cc (Sized_symbol<32>::init_output_data):
2428 Instantiate the template.
2429 (Sized_symbol<64>::init_output_data): Likewise.
2430
800d9823
CC
24312014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2432
2433 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2434 adjust dynamic symbol value.
2435 * target.h (Target::adjust_dyn_symbol): New function.
2436 (Target::do_adjust_dyn_symbol): New function.
2437
918fc1f8 24382014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2439
918fc1f8
CC
2440 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2441 Get the value of DYNAMIC_CUSTOM dynamic entry.
2442 * output.h (Output_data_dynamic::add_custom): New function.
2443 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2444 dynamic entry.
2445 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2446 * target.h (Target::dynamic_tag_custom_value): New function.
2447 (Target::do_dynamic_tag_custom_value): New function.
2448
98ff9231
CC
24492014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2450
2451 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2452 dynsym indexes.
2453 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2454 (Target::do_has_custom_set_dynsym_indexes): New function.
2455 (Target::set_dynsym_indexes): New function.
2456 (Target::do_set_dynsym_indexes): New function.
2457
b80eed39
AM
24582014-03-07 Alan Modra <amodra@gmail.com>
2459
2460 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2461 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2462 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2463 (Powerpc_relocate_functions::has_overflow_bitfield,
2464 overflowed): Use the above.
2465 (Target_powerpc::Relocate::relocate): Correct overflow checking
2466 for a number of relocations. Modify overflow test for 16-bit
2467 fields in instructions to signed/unsigned according to whether
2468 the field takes a signed or unsigned value.
2469
4b95cf5c
AM
24702014-03-05 Alan Modra <amodra@gmail.com>
2471
2472 Update copyright years.
2473
45965137
AM
24742014-03-05 Alan Modra <amodra@gmail.com>
2475
2476 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2477 R_PPC64_ADDR64_LOCAL.
2478 (Target_powerpc::Relocate::relocate): Likewise.
2479
2c80b753
AM
24802014-03-03 Alan Modra <amodra@gmail.com>
2481
2482 * dwp.cc (print_version): Update copyright year to current.
2483
c1c69e83
AM
24842014-02-10 Alan Modra <amodra@gmail.com>
2485
2486 * po/gold.pot: Regenerate.
2487
dd0c4e70
CC
24882014-02-06 Cary Coutant <ccoutant@google.com>
2489
2490 Fix problem where -u is ignored when a weak undef is seen.
2491
2492 * archive.cc (Library_base::should_include_member): Reorder
2493 code to check for -u option if a weak undef has already been seen.
2494 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2495 * testsuite/Makefile.in: Regenerate.
2496 * testsuite/weak_undef_file3.cc: New file.
2497 * testsuite/weak_undef_file4.cc: New file.
2498 * testsuite/weak_undef_test_2.cc: New file.
2499
1a221d3d
CC
25002014-02-05 Cary Coutant <ccoutant@google.com>
2501
2502 Fix issues with gold undefined symbol diagnostics.
2503
2504 PR binutils/15435
2505 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2506 check to here.
2507 * target-reloc.h (is_strong_undefined): New function.
2508 (relocate_section): Move undef vtable symbol check from here.
2509 Check for is_strong_undefined.
2510
e889f0a4 25112014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2512
e889f0a4
CC
2513 Fix problems with the --dynamic-list option.
2514
2515 PR gold/13577
2516 * options.cc (General_options::parse_dynamic_list):
2517 Set have_dynamic_list_.
2518 (General_options::General_options): Initialize have_dynamic_list_.
2519 (General_options::finalize): Turn off -Bsymbolic and
2520 -Bsymbolic-functions if --dynamic-list provided.
2521 * options.h (General_options::have_dynamic_list): New function.
2522 (General_options::have_dynamic_list_): New data member.
2523 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2524 correctly.
5fe7ffdc 2525
e889f0a4
CC
2526 PR gold/16530
2527 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2528 in --dynamic-list, mark it.
5fe7ffdc 2529
e889f0a4
CC
2530 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2531 (dynamic_list_2): New test case.
2532 * testsuite/Makefile.in: Regenerate.
2533 * testsuite/dynamic_list_2.cc: New file.
2534 * testsuite/dynamic_list_2.t: New file.
2535 * testsuite/dynamic_list_lib1.cc: New file.
2536 * testsuite/dynamic_list_lib2.cc: New file.
2537 * testsuite/gc_dynamic_list_test.c: New file.
2538 * testsuite/gc_dynamic_list_test.sh: New file.
2539 * testsuite/gc_dynamic_list_test.t: New file.
2540
ec673e64
CC
25412014-01-28 Cary Coutant <ccoutant@google.com>
2542
2543 Add .gdb_index version 7 support.
2544
2545 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2546 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2547 debug sections.
2548 (Dwarf_ranges_table::read_ranges_table): Likewise.
2549 (Dwarf_pubnames_table::read_section): Check for GNU-style
2550 sections, and for compressed debug sections.
2551 (Dwarf_pubnames_table::read_header): Compute end address of table.
2552 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2553 for end of list by offset, not by offset == 0.
2554 (Dwarf_info_reader::do_read_string_table): Check for compressed
2555 debug sections.
2556 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2557 Initialize new data members.
2558 (Dwarf_pubnames_table::next_name): return flag_byte.
2559 (Dwarf_pubnames_table::end_of_table_): New data member.
2560 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2561 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2562 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2563 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2564 read skeleton type unit DIEs.
2565 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2566 (Gdb_index::do_write): Write flag_byte.
2567 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2568 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2569 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2570 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2571
221fd5d5
L
25722014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2573
2574 * version.cc (print_version): Update copyright year to 2014.
2575
6c09fb0b
ILT
25762013-12-19 Dimitry Andric <dimitry@andric.com>
2577
2578 * stringpool.cc (Stringpool_template::reserve): Add
2579 HAVE_UNORDERED_MAP case.
2580 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2581
8356f2d0
CC
25822013-12-18 Cary Coutant <ccoutant@google.com>
2583
2584 * configure.ac: Check for <unordered_set> and <unordered_map>.
2585 * config.in: Regenerate.
2586 * configure: Regenerate.
2587 * system.h: Use <unordered_set> and <unordered_map> if available.
2588
f2c7d7ee
RM
25892013-12-10 Roland McGrath <mcgrathr@google.com>
2590
2591 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2592 with $(INSTALL_PROGRAM_ENV).
2593 * Makefile.in: Regenerate.
2594
6632e8cc
CC
25952013-11-22 Cary Coutant <ccoutant@google.com>
2596
2597 * configure.ac: Add check for which library is needed for
2598 dlopen.
2599 * configure: Regenerate.
2600
0c075858
CC
26012013-11-22 Cary Coutant <ccoutant@google.com>
2602
2603 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2604 assembler.
2605 * testsuite/Makefile.in: Regenerate.
2606
f49fe902
L
26072013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2608
2609 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2610 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2611 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2612 (Target_x86_64<size>::Scan::local): Likewise.
2613 (Target_x86_64<size>::Scan::global): Likewise.
2614 (Target_x86_64<size>::Relocate::relocate): Likewise.
2615 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2616 Likewise.
2617 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2618 R_X86_64_PC32_BND.
2619
2620 * testsuite/Makefile.am (check_PROGRAMS): Add
2621 exception_x86_64_bnd_test.
2622 (exception_x86_64_bnd_test_SOURCES): New macro.
2623 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2624 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2625 (exception_x86_64_bnd_test_LDADD): Likewise.
2626 (exception_x86_64_bnd_1.o): New rule.
2627 (exception_x86_64_bnd_2.o): Likewise.
2628 * testsuite/Makefile.in: Regenerated.
2629
9055360d
AM
26302013-11-15 Alan Modra <amodra@gmail.com>
2631
2632 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2633 accessor.
2634 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2635 Only call ppc64_local_entry_offset for 64-bit. Restrict
2636 symval_for_branch lookup to ELFv1.
2637 (Stub_table::add_plt_call_entry): Use unsigned int off.
2638 (Output_data_glink::Address, invalid_address): New.
2639 (Output_data_glink::add_eh_frame): Move out of line. Add
2640 support for ELFv2.
2641 (Output_data_glink::add_global_entry, find_global_entry,
2642 global_entry_address): New functions.
2643 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2644 ge_size): New variables.
2645 (Output_data_glink::set_final_data_size): Add global entry
2646 stub sizing.
2647 (Output_data_glink::do_write): Write global entry stubs.
2648 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2649 parameter. Return true for ELFv2. Adjust callers.
2650 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2651 ELFv1. Similarly for ifunc and dynamic relocation processing
2652 specific to ELFv1. Recognize that symbols are defined on
2653 their plt entries for ELFv2.
2654 (Target_powerpc::symval_for_branch): Assert if called for
2655 ELFv2 or ppc32.
2656 (Target_powerpc::Relocate::relocate): Use global entry plt
2657 stub for symbol value if such exists on ELFv2.
2658 (Target_powerpc::Relocate::relocate): Don't call
2659 symval_for_branch when ELFv2. Do adjust for local entry
2660 offset when ELFv2.
2661 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2662 plt stub for ELFv2.
2663 (Target_powerpc::do_plt_address_for_global): Similarly.
2664
cafdd569
CC
26652013-11-14 Cary Coutant <ccoutant@google.com>
2666
2667 Revert patch -- this did not fix the problem, and there is
2668 no race there.
2669
2670 2013-11-14 Cary Coutant <ccoutant@google.com>
2671
2672 PR gold/14860
2673 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2674 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2675 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2676 updating fde_offsets_.
2677 (Eh_frame_hdr::lock_): New data member.
2678
94e49e16
CC
26792013-11-14 Cary Coutant <ccoutant@google.com>
2680
2681 * dwp.cc (Dwo_file_entry): New type.
2682 (File_list): Use Dwo_file_entry.
2683 (Dwo_file::verify): New function.
2684 (Dwo_file::verify_dwo_list): New function.
2685 (Dwo_file::sized_verify_dwo_list): New function.
2686 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2687 list.
2688 (Dwp_options): New enum type.
2689 (dwp_options): Add --verify-only.
2690 (usage): Likewise.
2691 (main): Likewise.
2692 * dwp.h (gold_info): Add declaration.
2693
7cdd7d57
CC
26942013-11-14 Cary Coutant <ccoutant@google.com>
2695
2696 PR gold/14860
2697 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2698 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2699 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2700 updating fde_offsets_.
2701 (Eh_frame_hdr::lock_): New data member.
2702
1d946cb3
CC
27032013-11-06 Cary Coutant <ccoutant@google.com>
2704
2705 PR gold/15758
2706 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2707 before reloc sections.
2708
4f65b40e
AM
27092013-11-04 Alan Modra <amodra@gmail.com>
2710
2711 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2712 (Symbol::needs_dynamic_reloc): Test new flag.
2713 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2714 (Target_powerpc::Scan::get_reference_flags): Add target param.
2715 Return FUNC_DESC_ABI for 64-bit ELFv1.
2716 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2717 call.
2718 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2719 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2720
908794a9
CC
27212013-10-31 Cary Coutant <ccoutant@google.com>
2722
2723 Restore support for dwp v2 DWARF package file format.
2724
2725 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2726 tu_length parameter. Adjust all callers.
2727 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2728 * dwp.cc: Include dwarf.h.
2729 (Section_bounds): New struct type.
2730 (Unit_set): New struct type.
2731 (Dwo_file::Dwo_file): Initialize new data member.
2732 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2733 Combine and rename to...
2734 (Dwo_file::read_unit_index): ...this.
2735 (Dwo_file::sized_read_compunit_index)
2736 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2737 (Dwo_file::sized_read_unit_index): ...this.
2738 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2739 parameters; add section_id parameter.
2740 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2741 (Dwo_file::add_unit_set): ...this.
2742 (Dwo_file::shndx_map_): Remove.
2743 (Dwo_file::sect_offsets_): New data member.
2744 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2745 (Dwp_output_file::add_section): Rename to...
2746 (Dwp_output_file::add_contribution): ...this.
2747 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2748 (Dwp_output_file::add_tu_set): Likewise.
2749 (Dwp_output_file::Contribution): New type.
2750 (Dwp_output_file::Section::contributions): New data member.
2751 (Dwp_output_file::Cu_or_tu_set): Remove.
2752 (Dwp_output_file::Section::Section): New ctor.
2753 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2754 (Dwp_output_file::Dwp_index::Section_table): New type.
2755 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2756 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2757 parameter.
2758 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2759 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2760 (Dwp_output_file::Dwp_index::section_table): New member function.
2761 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2762 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2763 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2764 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2765 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2766 (Dwp_output_file::Dwp_index::section_table_): New data member.
2767 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2768 (Dwp_output_file::add_output_section): New member function.
2769 (Dwp_output_file::write_new_section): New member function.
2770 (Dwp_output_file::write_contributions): New member function.
2771 (Dwp_output_file::section_id_map_): New data member.
2772 (class Dwo_id_info_reader): Remove.
2773 (class Unit_reader): New class.
2774 (get_dwarf_section_name): New function.
2775 (Dwo_file::read_executable): Adjust initializations of class data.
2776 (Dwo_file::read): Add support for v2 package file format.
2777 (Dwo_file::read_unit_index): Likewise.
2778 (Dwo_file::sized_read_unit_index): Likewise.
2779 (Dwo_file::copy_section): Likewise.
2780 (Dwo_file::add_unit_set): Likewise.
2781 (Dwp_output_file::add_output_section): Likewise.
2782 (Dwp_output_file::add_contribution): Likewise.
2783 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2784 for empty slot.
2785 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2786 file format.
2787 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2788 slot.
2789 (Dwp_output_file::initialize): Remove unused function.
2790 (Dwp_output_file::finalize): Add support for v2 package file format.
2791 (Dwp_output_file::write_index): Likewise.
2792 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2793 function prototype.
2794
2500c017
CC
27952013-10-31 Cary Coutant <ccoutant@google.com>
2796
2797 * configure.ac: Fix check for -fmerge-constants.
2798 * configure.ac: Regenerate.
2799
dd0845d7
RM
28002013-10-30 Roland McGrath <mcgrathr@google.com>
2801
2802 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2803 Correct 9-byte nop sequence to match what the assembler generates.
2804
b4f7960d
AM
28052013-10-30 Alan Modra <amodra@gmail.com>
2806
2807 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2808 ppc64_local_entry_offset, ppc64_local_entry_offset,
2809 do_read_symbols): New functions.
2810 (Powerpc_relobj::e_flags_, st_other_): New vars.
2811 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2812 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2813 (Powerpc_relobj::e_flags_): New var.
2814 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2815 and adjust for ELFv2.
2816 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2817 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2818 (Powerpc_dynobj::do_find_special_sections): Likewise.
2819 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2820 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2821 to ELFv2 local entry.
2822 (Target_powerpc::do_relax): No thread safe barriers needed for
2823 ELFv2.
2824 (Output_data_plt_powerpc::initial_plt_entry_size_,
2825 plt_entry_size): Delete. Replace all uses with
2826 first_plt_entry_offset() and plt_entry_size().
2827 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2828 reserved_size parm. Update callers.
2829 (Output_data_plt_powerpc::entry_count): Update.
2830 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2831 and use Target_powerpc::first_plt_entry_offset().
2832 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2833 rename to plt_entry_size.
2834 (Output_data_plt_powerpc::add_ifunc_entry,
2835 add_local_ifunc_entry): Adjust reloc for ELFv2.
2836 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2837 (glink_eh_frame_fde_64v2): New.
2838 (Stub_table::plt_call_size): Support ELFv2 sizing.
2839 (Output_data_glink::add_eh_frame): Use the new FDE.
2840 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2841 (Stub_table::do_write): Write ELFv2 stubs and glink.
2842 (Target_powerpc::Relocate::relocate): Replaces nop after call
2843 with ld 2,24(1) and adjust local offset destination for ELFv2.
2844
f9c6b907
AM
28452013-10-30 Alan Modra <amodra@gmail.com>
2846
2847 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2848 (Target_powerpc::Scan::global, local): Likewise.
2849 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2850 on all ppc64 @h and @ha relocs.
2851
e84fe78f
AM
28522013-10-14 Alan Modra <amodra@gmail.com>
2853
2854 * output.h (Output_data_got::add_constant): Tidy.
2855 (Output_data_got::add_constant_pair): New function.
2856 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2857 methods used so as to first call reserve_ent().
2858
679e4abf
RM
28592013-10-11 Roland McGrath <mcgrathr@google.com>
2860
44dcb735
RM
2861 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2862 add_got_entry and add_got_entry_pair.
2863
13323c49
RM
2864 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2865 (HAVE_PUBNAMES): Likewise.
2866 * configure: Regenerate.
2867
1496b446
RM
2868 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2869 * testsuite/Makefile.in: Regenerate.
2870
cc84c10b
RM
2871 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2872 Remove const from declaration.
2873 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2874 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2875 * output.h (Output_file_header): Remove const from member target_
2876 and corresponding constructor argument.
2877 * output.cc (Output_file_header::Output_file_header): Update prototype.
2878 (Output_file_header::do_sized_write): Use this->target_ in place
2879 of parameters()->target().
2880
52f66a2c
RM
2881 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2882
2b64b551
RM
2883 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2884 * configure: Regenerate.
2885 * Makefile.in: Regenerate.
2886 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2887 * testsuite/merge_string_literals_2.c: Likewise.
2888 * testsuite/Makefile.am
2889 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2890 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2891 literal -fmerge-constants.
2892 * testsuite/Makefile.in: Regenerate.
2893
43819297
RM
2894 * i386.cc (Target_i386): Remove unused member dynbss_.
2895 * arm.cc (Target_arm): Likewise.
2896 * powerpc.cc (Target_powerpc): Likewise.
2897 * sparc.cc (Target_sparc): Likewise.
2898 * tilegx.cc (Target_tilegx): Likewise.
2899 * x86_64.cc (Target_x86_64): Likewise.
2900 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2901 type_signature_, type_offset_.
2902 * plugin.h (Plugin_hook): Remove unused member layout_.
2903 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2904 mapfile_.
2905 (Read_member): Remove unused members input_objects_, symtab_,
2906 mapfile_, layout_.
2907 (Check_library): Remove unused member symtab_.
2908 * archive.h (Lib_group): Remove unused member lib_.
2909 * archive.cc (Lib_group::Lib_group): Update initializer.
2910 * incremental.h (Incremental_binary): Remove unused member target_.
2911 (Incremental_script_entry): Removed unused member script_.
2912 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2913 * icf.h (Icf): Remove unused member num_tracked_relocs.
2914
39d9ead7
RM
2915 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2916 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2917 its only use.
2918 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2919
679e4abf
RM
2920 * archive.h: Use struct rather than class for forward declaration
2921 of Read_symbols_data.
2922
54de2ea6
CC
29232013-10-07 Cary Coutant <ccoutant@google.com>
2924
2925 PR gold/16010
2926 * testsuite/Makefile.am (icf_test): Fix dependencies.
2927 (icf_safe_test): Likewise.
2928 (icf_safe_so_test): Likewise.
2929 (large_symbol_alignment): Add empty _LDADD rule.
2930 * testsuite/Makefile.in: Regenerate.
2931
b14016f0
L
29322013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2933
2934 PR gold/15927
2935 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2936 relocation for R_X86_64_32 on x32.
2937
eb426534
RM
29382013-08-27 Roland McGrath <mcgrathr@google.com>
2939
2940 * output.cc (Output_segment::set_section_addresses): Take new
2941 Target* argument. If target->isolate_execinstr() and the segment
2942 is executable and starts at a target->abi_pagesize() boundary,
2943 pad its end out to a target->abi_pagesize() boundary with code fill.
2944 * output.h (Output_segment::set_section_addresses): Update decl.
2945 * layout.h (Layout::check_output_data_for_reset_values): Take new
2946 argument RELAX_OUTPUTS.
2947 (Layout): New member relax_output_list_.
2948 (Layout::add_relax_output): New method.
2949 * layout.cc (Layout::Layout): Update constructor.
2950 (Layout::reset_relax_output): New method.
2951 (Layout::clean_up_after_relaxation): Call it.
2952 (Layout::prepare_for_relaxation): Update caller.
2953 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2954 Call reset_relax_output before re-processing segments for
2955 isolate_execinstr case.
2956 (Layout::write_data): Handle relax_output_list_.
2957 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2958 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2959
9aff4b7a
NC
29602013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2961
2962 PR binutils/15834
2963 * object.h: Fix typos.
2964
93f8221c
RM
29652013-08-16 Roland McGrath <mcgrathr@google.com>
2966
2967 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2968 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2969
e44c3715
CC
29702013-08-07 Cary Coutant <ccoutant@google.com>
2971
2972 Revert support for v2 DWP files:
2973
2974 2013-03-01 Cary Coutant <ccoutant@google.com>
2975
2976 Add dwp support for v2 DWARF package file format.
2977 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2978 tu_length parameter. Adjust all callers.
2979 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2980 * dwp.cc: Include dwarf.h.
2981 (Section_bounds): New struct type.
2982 (Unit_set): New struct type.
2983 (Dwo_file::Dwo_file): Initialize new data member.
2984 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2985 Combine and rename to...
2986 (Dwo_file::read_unit_index): ...this.
2987 (Dwo_file::sized_read_compunit_index)
2988 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2989 (Dwo_file::sized_read_unit_index): ...this.
2990 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2991 parameters; add section_id parameter.
2992 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2993 (Dwo_file::add_unit_set): ...this.
2994 (Dwo_file::shndx_map_): Remove.
2995 (Dwo_file::sect_offsets_): New data member.
2996 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2997 (Dwp_output_file::add_section): Rename to...
2998 (Dwp_output_file::add_contribution): ...this.
2999 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3000 (Dwp_output_file::add_tu_set): Likewise.
3001 (Dwp_output_file::Contribution): New type.
3002 (Dwp_output_file::Section::contributions): New data member.
3003 (Dwp_output_file::Cu_or_tu_set): Remove.
3004 (Dwp_output_file::Section::Section): New ctor.
3005 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3006 (Dwp_output_file::Dwp_index::Section_table): New type.
3007 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3008 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3009 parameter.
3010 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3011 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3012 (Dwp_output_file::Dwp_index::section_table): New member function.
3013 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3014 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3015 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3016 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3017 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3018 (Dwp_output_file::Dwp_index::section_table_): New data member.
3019 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3020 (Dwp_output_file::add_output_section): New member function.
3021 (Dwp_output_file::write_new_section): New member function.
3022 (Dwp_output_file::write_contributions): New member function.
3023 (Dwp_output_file::section_id_map_): New data member.
3024 (class Dwo_id_info_reader): Remove.
3025 (class Unit_reader): New class.
3026 (get_dwarf_section_name): New function.
3027 (Dwo_file::read_executable): Adjust initializations of class data.
3028 (Dwo_file::read): Add support for v2 package file format.
3029 (Dwo_file::read_unit_index): Likewise.
3030 (Dwo_file::sized_read_unit_index): Likewise.
3031 (Dwo_file::copy_section): Likewise.
3032 (Dwo_file::add_unit_set): Likewise.
3033 (Dwp_output_file::add_output_section): Likewise.
3034 (Dwp_output_file::add_contribution): Likewise.
3035 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3036 for empty slot.
3037 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3038 file format.
3039 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3040 slot.
3041 (Dwp_output_file::initialize): Remove unused function.
3042 (Dwp_output_file::finalize): Add support for v2 package file format.
3043 (Dwp_output_file::write_index): Likewise.
3044 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3045 function prototype.
3046
c6905c28
CC
30472013-07-31 Cary Coutant <ccoutant@google.com>
3048
3049 * object.cc (Sized_relobj::do_output_section_address): New function.
3050 (Sized_relobj): Instantiate explicitly.
3051 * object.h (Object::output_section_address): New function.
3052 (Object::do_output_section_address): New function.
3053 (Sized_relobj::do_output_section_address): New function.
3054 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3055
30562013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3057 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3058
3059 * parameters.cc (Parameters::entry): Return target-specific entry
3060 symbol name.
3061 * target.h (Target::entry_symbol_name): New function.
3062 (Target_info::entry_symbol_name): New data member.
3063
3064 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3065 * i386.cc (Target_i386::i386_info): Likewise.
3066 (Target_i386_nacl::i386_nacl_info): Likewise.
3067 * sparc.cc (Target_sparc::sparc_info): Likewise.
3068 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3069 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3070 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3071 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3072
234d4ab8
SA
30732013-07-22 Sterling Augustine <saugustine@google.com>
3074
3075 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3076 Convert parameter shndx to local variable. Add parameters symtab
3077 and symtab_size. Scan over section names. Find relocation
3078 section corresponding to current section. Create and initialize
3079 reloc_mapper_ and reloc_type_.
3080 (Dwarf_pubnames_table::read_header): Add assertion. Change
3081 unit_length to off_t. Initialize member unit_length_. Fill in field
3082 cu_offset_.
3083 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3084 Initialize new fields unit_length_ and cu_offset_.
3085 (Dwarf_pubnames_table::read_section): Update prototype.
3086 (Dwarf_pubnames_table::cu_offset): New member function.
3087 (Dwarf_pubnames_table::subsection_size): Likewise.
3088 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3089 New fields.
3090 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3091 member functions public.
3092 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3093 Update comment. Rework logic. Move repeated parts to...
3094 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3095 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3096 pubtypes_table_, and stmt_list_offset.
3097 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3098 Gdb_index::find_pubtype_offset,
3099 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3100 (Gdb_index::pubnames_read): Update prototype and rework logic.
3101 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3102 Forward declare.
3103 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3104 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3105 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3106 Gdb_index::map_pubtable_to_dies):
3107 Declare functions.
3108 (Gdb_index::pubnames_read): Update declaration.
3109 (Gdb_index::Pubname_offset_map): New type.
3110 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3111 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3112 Gdb_index::stmt_list_offset): Declare.
3113 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3114 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3115 Gdb_index::pubtypes_offset_): Remove.
3116
a3ed37d8
RM
31172013-07-19 Roland McGrath <mcgrathr@google.com>
3118
3119 * options.h (General_options): Add -Trodata-segment option.
3120 * parameters.cc (Parameters::check_rodata_segment): New function.
3121 (Parameters::set_target_once): Call it.
3122 * parameters.h (Parameters): Declare it (private member function).
3123 * layout.cc (load_seg_unusable_for_headers): New function, broken
3124 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3125 then validate rodata segment rather than text segment.
3126 (relaxation_loop_body): Call that.
3127 (is_text_segment): New function. Don't admit a non-executable
3128 segment if TARGET->isolate_execinstr().
3129 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3130
eb5b4ded
CC
31312013-07-15 Shawn Landden <shawnlandden@gmail.com>
3132
3133 PR gold/15070
3134 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3135 * nacl.h (Sniff_file::View::View): Request aligned view.
3136
4d5effb9
CC
31372013-07-11 Cary Coutant <ccoutant@google.com>
3138
3139 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3140 correct BRLT entry size.
3141
ba8ca3e7
AM
31422013-07-03 Alan Modra <amodra@gmail.com>
3143
3144 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3145 comment.
3146
267257d2
CC
31472013-07-01 Cary Coutant <ccoutant@google.com>
3148
3149 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3150 reloc_type_.
3151 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3152 (Dwarf_ranges_table::lookup_reloc): New function.
3153 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3154 reloc_type_.
3155 (Dwarf_ranges_table::lookup_reloc): New function.
3156 (Dwarf_ranges_table::reloc_type_): New data member.
3157
06f30c9d
CC
31582013-06-27 Jing Yu <jingyu@google.com>
3159
3160 PR gold/15662
3161 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3162 function.
3163 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3164 (Target_powerpc::do_relax): Call the above.
3165
a2d7bf59
AM
31662013-06-27 Cary Coutant <ccoutant@google.com>
3167
3168 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3169 on garbage collected .opd section.
3170
31712013-06-27 Alan Modra <amodra@gmail.com>
3172
3173 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3174 is non-zero.
3175 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3176 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3177
32364e50
CC
31782013-06-14 Cary Coutant <ccoutant@google.com>
3179
3180 * resolve.cc (Symbol::override_base): Don't override st_type
3181 from plugin placeholder symbols.
3182 (Symbol_table::resolve): Likewise.
3183 (Symbol_table::should_override): Don't complain about TLS mismatch
3184 if the TO symbol is a plugin placeholder.
3185 * testsuite/Makefile.am (plugin_test_tls): New test.
3186 * testsuite/Makefile.in: Regenerate.
3187 * testsuite/plugin_test_tls.sh: New test script.
3188 * testsuite/two_file_test_2_tls.cc: New test source.
3189 * testsuite/two_file_test_tls.cc: New test source.
3190
7fb47cc9
CC
31912013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3192
3193 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3194 the maximum segment alignment is larger than the page size.
3195 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3196 correctly aligns the symbols with large alignemnt.
3197 * testsuite/Makefile.in: Regenerate.
3198 * testsuite/large_symbol_alignment.cc: New file.
3199
6934001a
CC
32002013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3201 Sriraman Tallam <tmsriram@google.com>
3202
3203 * options.h (sort_section): New option.
3204 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3205 Rename from Input_section_sort_section_name_special_ordering_compare.
3206 (Input_section_sort_section_name_compare): New struct.
3207 * output.cc (Output_section::Input_section_sort_section_name_compare::
3208 operator()): New function.
3209 (Output_section::sort_attached_input_sections): Use new sort function
3210 for .text if --sort-section=name is specified.
3211 * layout.cc (Layout::make_output_section):
3212 Add sorting by name when --sort-section=name is specified.
3213 * testsuite/Makefile.am (text_section_grouping): Test option
3214 --sort-section=name.
3215 * testsuite/Makefile.in: Regenerate.
3216 * testsuite/section_sorting_name.cc: New file.
3217 * testsuite/section_sorting_name.sh: New file.
3218
93acabad
CC
32192013-05-21 Cary Coutant <ccoutant@google.com>
3220
3221 * symtab.h (Symbol::is_cxx_vtable): New function.
3222 * target-reloc.h (relocate_section): Check for vtable symbol.
3223 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3224 * testsuite/Makefile.in: Regenerate.
3225 * testsuite/missing_key_func.cc: New test source.
3226 * testsuite/missing_key_func.sh: New test script.
3227
60e8b3fc
CC
32282013-05-21 Cary Coutant <ccoutant@google.com>
3229
2b64b551
RM
3230 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3231 type of enclosing symbol.
3232 (Relocate_info::location): Check symbol type when describing symbol.
3233 * object.h (Symbol_location_info): Remove unused line_number;
3234 add enclosing_symbol_type.
3235 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3236
9df9de2c
CC
32372013-05-13 Cary Coutant <ccoutant@google.com>
3238
2b64b551
RM
3239 * configure.ac: Export DEFAULT_TARGET.
3240 * configure: Regenerate.
3241 * Makefile.in: Regenerate.
3242 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3243 * testsuite/Makefile.in: Regenerate.
3244 * testsuite/debug_msg.sh: Delete duplicate tests.
3245 Don't check undef_int error message match for powerpc where the
3246 source file and line number aren't available.
9df9de2c 3247
bbc5ae17
RM
32482013-05-10 Roland McGrath <mcgrathr@google.com>
3249
3250 * options.h (General_options): Add --rosegment-gap option.
3251 * options.cc (finalize): --rosegment-gap implies --rosegment.
3252 * layout.cc (set_segment_offsets): Let user option override
3253 target->rosegment_gap().
3254
0c6e6c39
RM
32552013-05-10 Roland McGrath <mcgrathr@google.com>
3256
3257 * options.h (General_options): Remove leading space from help
3258 messages for -nostdlib and --rosegment.
3259
cde7cb01
MR
32602013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3261
3262 PR ld/15365
3263 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3264
f31ae5b8
AM
32652013-05-03 Alan Modra <amodra@gmail.com>
3266
3267 * merge.cc (Output_merge_string::do_add_input_section): Correct
3268 scan for number of strings. Rename vars to avoid shadowing.
3269 Include missing terminator in input_size_.
3270
d3a7cd45
L
32712013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3272
3273 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3274 Restore empty string handling.
3275
6ad3daba
CC
32762013-05-01 Cary Coutant <ccoutant@google.com>
3277
3278 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3279 uninitialized warning.
3280
e31908b6
CC
32812013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3282
3283 * output.cc (Output_section::add_merge_input_section): Allow
3284 to merge sections if the alignment is more than character size.
3285 * merge.h (Output_merge_string::Output_merge_string): Remove
3286 assert.
3287 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3288 only not-null strings. Check the alignment of strings.
3289 * stringpool.h
3290 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3291 alignment as the argument.
3292 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3293 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3294 Align non-zero length strings according to the addralign_.
3295 (Stringpool_template<Stringpool_char>::set_string_offsets):
3296 Updating offsets according to the given alignment.
3297 * testsuite/Makefile.am (text_section_grouping): Test if string
3298 literals are getting merged.
3299 * testsuite/Makefile.in: Regenerate.
3300 * testsuite/merge_string_literals_1.c: New file.
3301 * testsuite/merge_string_literals_2.c: Ditto.
3302 * testsuite/merge_string_literals.sh: Ditto.
3303
0e804863
ILT
33042013-04-26 Ian Lance Taylor <iant@google.com>
3305
3306 * target-reloc.h (relocate_section): If the reloc offset is out of
3307 range, pass VIEW as NULL to relocate.relocate.
3308 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3309 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3310 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3311 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3312 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3313 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3314
e7c5ea40
CC
33152013-04-26 Geoff Pike <gpike@chromium.org>
3316
3317 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3318 * layout.cc (Hash_task): New class.
3319 (Layout::queue_build_id_tasks): New function.
3320 (Layout::write_build_id): Handle single-thread portion of build ID
3321 computation. (In some cases, all of it is single-threaded.) Replace
3322 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3323 functionality in fewer lines of code.
3324 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3325 * options.h (General_options): make "--build-id" default to tree
3326 rather than sha1. Add two new options related to --build-id=tree:
3327 --build-id-chunk-size-for-treehash and
3328 --build-id-min-file-size-for-treehash.
3329 * Makefile.am: add testing of --build-id=tree and related new options
3330 (these tests will be invoked by "make check").
3331 * Makefile.in: Regenerate.
3332
49926cd0
AM
33332013-04-25 Alan Modra <amodra@gmail.com>
3334
3335 * configure.tgt: Add powerpcle and powerpc64le.
3336
a4034750
AM
33372013-04-22 Alan Modra <amodra@gmail.com>
3338
3339 PR gold/15355
3340 * layout.cc (Layout::segment_precedes): Allow more than one
3341 segment with the same type and flags.
3342
e79c84aa
CC
33432013-04-15 Cary Coutant <ccoutant@google.com>
3344
3345 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3346 allocate space in file for BSS sections.
3347
2199fbe7
CC
33482013-04-15 Cary Coutant <ccoutant@google.com>
3349
3350 * script-sections.cc (Orphan_output_section): Reset address
3351 to zero after each orphaned section for relocatable links.
3352
502e8a84
CC
33532013-04-15 Cary Coutant <ccoutant@google.com>
3354
a4034750
AM
3355 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3356 section starting address for relocatable link.
3357 * testsuite/Makefile.am (script_test_11): New test.
3358 * testsuite/Makefile.in: Regenerate.
3359 * testsuite/script_test_11.c: New source file.
3360 * testsuite/script_test_11.t: New linker script.
502e8a84 3361
0cfdc767
AM
33622013-04-13 Alan Modra <amodra@gmail.com>
3363
3364 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3365 owner when sections are not adjacent and exceed group size.
3366 (Target_powerpc::group_sections): Handle corner case.
3367 (Target_powerpc::Branch_info::make_stub): Handle case where
3368 stub table doesn't exist due to branches in non-exec sections.
3369 (Target_powerpc::Relocate::relocate): Likewise.
3370
6830ee24
AM
33712013-04-11 Alan Modra <amodra@gmail.com>
3372
3373 PR gold/15354
3374 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3375 .branch_lt to match bfd ld. Adjust comments throughout file.
3376
54a3d865
ILT
33772013-04-04 Ian Lance Taylor <iant@google.com>
3378
3379 GCC PR c++/56840
3380 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3381 sections before checking whether they are included in the link.
3382
9993ba11
ST
33832013-03-29 Sriraman Tallam <tmsriram@google.com>
3384
3385 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3386 object before calling the plugin claim_file handler. Pass the elf
3387 object of the archive to the plugin. Delete the elf object if the
3388 plugin claims the file.
3389
ebacd51e
AM
33902013-03-21 Alan Modra <amodra@gmail.com>
3391
3392 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3393 segment when omagic.
3394
117be58f
AM
33952013-03-21 Alan Modra <amodra@gmail.com>
3396
3397 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3398 comparison warning.
3399 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3400 uninitialized" warning.
3401
32e2b61d
AM
34022013-03-20 Alan Modra <amodra@gmail.com>
3403
3404 * symtab.h (Symbol::clear_version): New function.
3405 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3406 is_needed by weak references. Clear version for symbols defined
3407 in as-needed objects that are not needed.
3408
b3ccdeb5
AM
34092013-03-15 Alan Modra <amodra@gmail.com>
3410
3411 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3412 static and public. Add report_err param. Return false for data refs.
3413 (Target_powerpc::rela_dyn_section): New overloaded function.
3414 (Target_powerpc::plt_, iplt_): Elucidate.
3415 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3416 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3417 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3418 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3419 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3420 push_branch and make_plt_entry for ifunc syms when
3421 reloc_needs_plt_for_ifunc.
3422 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3423 for ifunc unless reloc_needs_plt_for_ifunc.
3424
ad3d8a2f
AM
34252013-03-15 Alan Modra <amodra@gmail.com>
3426
3427 * gc.h (gc_process_relocs): Don't look through function descriptors.
3428 * icf.cc (get_section_contents): Do so here instead.
3429
4d9aa155
AM
34302013-03-13 Alan Modra <amodra@gmail.com>
3431
3432 * powerpc.cc (is_branch_reloc): Forward declare.
3433 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3434 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3435 false for 64-bit, true for 32-bit non-branch relocs.
3436 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3437 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3438 nm output.
3439 (icf_safe_test): Generate linker map file as well as nm output.
3440 (icf_safe_so_test): Likewise.
3441 * testsuite/Makefile.in: Regenerate.
3442 * testsuite/icf_test.sh: Parse linker map file to determine
3443 section folding.
3444 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3445 * testsuite/icf_safe_so_test.sh: Likewise.
3446 (X86_32_or_ARM_specific_safe_fold): Merge into..
3447 (arch_specific_safe_fold): ..this.
3448 (X86_64_specific_safe_fold): Delete unused function.
3449
57420c20
AM
34502013-03-12 Alan Modra <amodra@gmail.com>
3451
3452 * gc.h (gc_process_relocs): Look through function descriptors
3453 to determine shndx, symvalue and addend used by ICF. Tidy
3454 variable duplication.
3455
dc3714f3
AM
34562013-03-11 Alan Modra <amodra@gmail.com>
3457
3458 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3459 * layout.cc (Layout_task_runner::run): ..to here.
3460 * symtab.h (struct Symbol_location): Extract from..
3461 (class Symbol_table): ..here.
3462 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3463 * target.h (class Target): Add function_location and
3464 do_function_location functions.
3465 (class Sized_target): Add do_function_location.
3466 * object.h (class Sized_relobj_file): Move find_shdr..
3467 (class Object): ..to here.
3468 * object.cc: Likewise. Update to suit. Instantiate.
3469 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3470 * powerpc.cc (class Powerpc_dynobj): New.
3471 (Target_powerpc::do_function_location): New function.
3472 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3473 (Powerpc_dynobj::do_read_symbols): New function.
3474 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3475
956b03bb
ILT
34762013-03-08 Ian Lance Taylor <iant@google.com>
3477
3478 * options.cc (General_options::string_to_object_format): Accept
3479 "default".
3480
4bead2d5
AM
34812013-03-08 Alan Modra <amodra@gmail.com>
3482
3483 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3484 pointer to Post_fde.
3485 (struct Post_fde): Move definition to here..
3486 * ehframe.cc (struct Post_fde): ..from here.
3487 (Cie::write): Don't alloc Post_fde.
3488 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3489
02e60bf7
AM
34902013-03-07 Alan Modra <amodra@gmail.com>
3491
3492 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3493 relocation referencing .LC0.
3494 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3495
8343f03a
AM
34962013-03-07 Alan Modra <amodra@gmail.com>
3497
3498 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3499 always_inline. Add assembly for powerpc to avoid GOT.
3500
3366d57c
AM
35012013-03-07 Alan Modra <amodra@gmail.com>
3502
3503 * testsuite/script_test_10.sh: Don't test .bss section
3504 header number.
3505
6c77229c
AM
35062013-03-06 Alan Modra <amodra@gmail.com>
3507
3508 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3509 (Target_powerpc::symval_for_branch): Add symtab param. Update
3510 all callers. Handle folded sections.
3511 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3512 to Powerpc_relobj.
3513 (Global_symbol_visitor_opd::operator()): Likewise.
3514
a39e4af6
AM
35152013-03-04 Alan Modra <amodra@gmail.com>
3516
3517 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3518 * testsuite/Makefile.in: Regenerate.
3519
d5834edb
CC
35202013-03-01 Cary Coutant <ccoutant@google.com>
3521
3522 Add dwp support for v2 DWARF package file format.
3523 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3524 tu_length parameter. Adjust all callers.
3525 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3526 * dwp.cc: Include dwarf.h.
3527 (Section_bounds): New struct type.
3528 (Unit_set): New struct type.
3529 (Dwo_file::Dwo_file): Initialize new data member.
3530 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3531 Combine and rename to...
3532 (Dwo_file::read_unit_index): ...this.
3533 (Dwo_file::sized_read_compunit_index)
3534 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3535 (Dwo_file::sized_read_unit_index): ...this.
3536 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3537 parameters; add section_id parameter.
3538 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3539 (Dwo_file::add_unit_set): ...this.
3540 (Dwo_file::shndx_map_): Remove.
3541 (Dwo_file::sect_offsets_): New data member.
3542 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3543 (Dwp_output_file::add_section): Rename to...
3544 (Dwp_output_file::add_contribution): ...this.
3545 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3546 (Dwp_output_file::add_tu_set): Likewise.
3547 (Dwp_output_file::Contribution): New type.
3548 (Dwp_output_file::Section::contributions): New data member.
3549 (Dwp_output_file::Cu_or_tu_set): Remove.
3550 (Dwp_output_file::Section::Section): New ctor.
3551 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3552 (Dwp_output_file::Dwp_index::Section_table): New type.
3553 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3554 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3555 parameter.
3556 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3557 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3558 (Dwp_output_file::Dwp_index::section_table): New member function.
3559 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3560 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3561 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3562 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3563 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3564 (Dwp_output_file::Dwp_index::section_table_): New data member.
3565 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3566 (Dwp_output_file::add_output_section): New member function.
3567 (Dwp_output_file::write_new_section): New member function.
3568 (Dwp_output_file::write_contributions): New member function.
3569 (Dwp_output_file::section_id_map_): New data member.
3570 (class Dwo_id_info_reader): Remove.
3571 (class Unit_reader): New class.
3572 (get_dwarf_section_name): New function.
3573 (Dwo_file::read_executable): Adjust initializations of class data.
3574 (Dwo_file::read): Add support for v2 package file format.
3575 (Dwo_file::read_unit_index): Likewise.
3576 (Dwo_file::sized_read_unit_index): Likewise.
3577 (Dwo_file::copy_section): Likewise.
3578 (Dwo_file::add_unit_set): Likewise.
3579 (Dwp_output_file::add_output_section): Likewise.
3580 (Dwp_output_file::add_contribution): Likewise.
3581 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3582 for empty slot.
3583 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3584 file format.
3585 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3586 slot.
3587 (Dwp_output_file::initialize): Remove unused function.
3588 (Dwp_output_file::finalize): Add support for v2 package file format.
3589 (Dwp_output_file::write_index): Likewise.
3590 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3591 function prototype.
3592
a68a081d
CC
35932013-03-01 Cary Coutant <ccoutant@google.com>
3594
3595 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3596 function into class definition in header file.
3597 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3598 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3599 New function.
3600 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3601
9d5781f8
AM
36022013-02-28 Alan Modra <amodra@gmail.com>
3603
3604 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3605 * target.cc (Target::do_plt_fde_location): New function.
3606 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3607 accessor function, and constructor param.
3608 (struct Post_fde, Post_fdes): Declare.
3609 (Cie::write): Add post_fdes param.
3610 * ehframe.cc (Fde::write): Use plt_fde_location.
3611 (struct Post_fde): Define.
3612 (Cie::write): Stash FDEs added post merge mapping.
3613 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3614 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3615 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3616 other FDEs.
3617 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3618 (Target_powerpc::has_glink): New function.
3619 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3620 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3621 glink_eh_frame_fde_32, default_fde): New data.
3622 (Stub_table::eh_frame_added_): New var.
3623 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3624 Make const.
3625 (Stub_table::add_eh_frame): New function.
3626 (Output_data_glink::add_eh_frame): New function.
3627 (Target_powerpc::make_glink_section): Call add_eh_frame.
3628
214383dd
ILT
36292013-02-15 Ian Lance Taylor <iant@google.com>
3630
3631 * options.h (DEFINE_uint64_alias): Define.
3632 (class General_options): Add -Ttext-segment as an alias for
3633 -Ttext.
3634
91c2b899
AM
36352013-02-15 Alan Modra <amodra@gmail.com>
3636
3637 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3638 (Stub_table::do_write): ..here, two places.
3639 (Stub_table::plt_call_size): Use it here too.
3640
20e2a8aa
ILT
36412013-02-11 Ian Lance Taylor <iant@google.com>
3642
3643 * descriptors.cc (Descriptors::close_all): New function.
3644 * descriptors.h (class Descriptors): Declare close_all.
3645 (close_all_descriptors): New inline function.
3646 * plugin.cc: Include "descriptors.h".
3647 (Plugin_manager::cleanup): Call close_all_descriptors.
3648
8952bc69
AM
36492013-02-06 Alan Modra <amodra@gmail.com>
3650
3651 * README: Update coding style link.
3652
29bd8b6b
CC
36532013-01-28 Cary Coutant <ccoutant@google.com>
3654
a4034750
AM
3655 * dwp.cc (File_list): New typedef.
3656 (Dwo_name_info_reader): New class.
3657 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3658 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3659 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3660 (Dwo_file::read_executable): New function.
3661 (Dwo_file::read): Move common setup code to ...
3662 (Dwo_file::make_object): ... here.
3663 (dwp_options): Add --exec/-e.
3664 (usage): Likewise.
3665 (main): Likewise.
29bd8b6b 3666
c6ac678d
ST
36672013-01-24 Sriraman Tallam <tmsriram@google.com>
3668
3669 * layout.cc (Layout::layout): Check for option text_reorder.
3670 (Layout::make_output_section): Ditto.
3671 * options.h (text_reorder): New option.
3672 * output.cc (Input_section_sort_compare): Remove special ordering
3673 of section names.
3674 (Output_section::
3675 Input_section_sort_section_name_special_ordering_compare::
3676 operator()): New function.
3677 (Output_section::sort_attached_input_sections): Use new sort function
3678 for .text.
3679 * output.h (Input_section_sort_section_name_special_ordering_compare):
3680 New struct.
3681 * testsuite/Makefile.am (text_section_grouping): Test option
3682 --no-text-reorder
3683 * testsuite/Makefile.in: Regenerate.
3684 * testsuite/text_section_grouping.sh: Check order of functions without
3685 default text reordering.
3686
50701cc1
MF
36872013-01-18 Mike Frysinger <vapier@gentoo.org>
3688
3689 * options.h (General_options): Change default to true for new_dtags.
3690
b1b00fcc
MF
36912013-01-18 Mike Frysinger <vapier@gentoo.org>
3692
3693 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3694 when enable_new_dtags is false. Only add DT_RUNPATH when
3695 enable_new_dtags is true.
3696
ec5b8187
AM
36972013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3698
3699 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3700 used in declaration and definition consistent.
3701 (Target_powerpc::symval_for_branch): Ditto.
3702
a880d4c4
ST
37032013-01-16 Sriraman Tallam <tmsriram@google.com>
3704
3705 * testsuite/plugin_final_layout.cc: Fix comment.
3706
7c381248
ST
37072013-01-16 Sriraman Tallam <tmsriram@google.com>
3708
3709 * layout.cc (Layout::layout): Do not do default sorting for
3710 text sections when section ordering is specified.
3711 (make_output_section): Ditto.
3712 * testsuite/plugin_final_layout.cc: Name the function sections
3713 to catch reordering issues.
3714
e2458743
AM
37152013-01-15 Alan Modra <amodra@gmail.com>
3716
3717 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3718 plt-thread-safe.
3719
431ed302
AM
37202013-01-15 Alan Modra <amodra@gmail.com>
3721
3722 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3723 * testsuite/Makefile.in: Regenerate.
3724
0ec6429b
AM
37252013-01-14 Alan Modra <amodra@gmail.com>
3726
3727 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3728 * testsuite/Makefile.in: Regenerate.
3729
0bf402d5
ILT
37302013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3731
36af3926 3732 PR bfd/14430
0bf402d5
ILT
3733 Fix mingw gold build with plugins enabled
3734 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3735 * configure.ac: Export DLOPEN_LIBS and add headers check.
3736 * plugin.cc: Handle non-dlfcn case.
3737 * Makefile.in: Regenerate.
3738 * config.in: Regenerate.
3739 * configure: Regenerate.
3740 * testsuite/Makefile.in: Regenerate.
3741
9e9143bc
ST
37422013-01-09 Sriraman Tallam <tmsriram@google.com>
3743
3744 * output.h (sort_attached_input_sections): Change to be public.
3745 * script-sections.cc
3746 (Output_section_definition::set_section_addresses): Sort
3747 attached input sections according to section order before linker
3748 script assigns section addresses.
3749 (Orphan_output_section::set_section_addresses): Sort
3750 attached input sections according to section order before linker
3751 script assigns section addresses.
3752 * Makefile.am (final_layout.sh): Use a simple linker script to
3753 check if section ordering still works.
3754 * Makefile.in: Regenerate.
3755
679af368
ILT
37562013-01-09 Ben Cheng <bccheng@google.com>
3757
3758 * arm.cc (Target_arm::attributes_accept_div): New function.
3759 (Target_arm::attributes_forbid_div): New function.
3760 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3761 attribute using the same new functions as what bfd/elf32_arm.c
3762 does.
3763
3136a00e
CC
37642013-01-07 Cary Coutant <ccoutant@google.com>
3765
3766 PR gold/14993
3767 * output.cc (Output_section::add_input_section): For incremental
3768 updates, don't track input sections that are allocated from patch
3769 space.
3770
f2a6224b
L
37712013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3772 Ian Lance Taylor <iant@google.com>
3773
3774 PR gold/14897
3775 * configure.ac (--enable-ld): Removed.
3776 (install_as_default): Set to yes only for --enable-gold=default
3777 or --disable-ld.
3778 * configure: Regenerated.
3779
4f46f626
L
37802013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3781
3782 * options.h (General_options): Add -fuse-ld= for GCC linker
3783 option compatibility.
3784
26e4ef59
CC
37852013-01-04 Cary Coutant <ccoutant@google.com>
3786
3787 * configure.ac: Fix typo restoring CXXFLAGS.
3788 * configure: Regenerate.
3789
3d587466
CC
37902013-01-04 Cary Coutant <ccoutant@google.com>
3791
4f46f626
L
3792 * testsuite/Makefile.am (CXXLINK_S): New macro.
3793 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3794 * testsuite/Makefile.in: Regenerate.
3d587466 3795
44db6695
L
37962013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3797
3798 * version.cc (print_version): Update copyright year to 2013.
3799
edcac0c1
ILT
38002012-12-20 Ian Lance Taylor <iant@google.com>
3801
3802 * layout.cc (Layout::special_ordering_of_input_section): New
3803 function.
3804 (Layout::layout): If input section requires special ordering, must
3805 sort input sections.
3806 (Layout::make_output_section): May sort .text input sections.
3807 (Layout::is_section_name_prefix_grouped): Remove.
3808 * layout.h (class Layout): Declare
3809 special_ordering_of_input_section. Don't declare
3810 is_section_name_prefix_grouped.
3811 * output.cc (Output_section::add_input_section): Revert last
3812 change.
3813 (Output_section::Input_section_sort::match_file_name): Don't crash
3814 if called on output section data.
3815 (Output_section::Input_section_sort_compare): Sort based on
3816 special ordering.
3817 (Output_section::Input_section_sort_section_order_index_compare):
3818 Revert last patch.
3819 (Output_section::sort_attached_input_sections): Likewise.
3820
28f2a4ac
ST
38212012-12-18 Sriraman Tallam <tmsriram@google.com>
3822
edcac0c1 3823 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3824 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3825 * output.cc (Output_section::add_input_section): Check if section
3826 name contains special prefix. Keep input sections to sort such
3827 sections.
3828 (Output_section::Input_section_sort_section_order_index_compare
3829 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3830 (Output_section::sort_attached_input_sections): Add condition to
3831 Input_section_entry constructor call.
28f2a4ac
ST
3832 * testsuite/Makefile.am (text_section_grouping): New test.
3833 * testsuite/Makefile.in: Regenerate.
3834 * testsuite/text_section_grouping.cc: New file.
3835 * testsuite/text_section_grouping.sh: New file.
3836
5bf135a7
NC
38372012-12-17 Nick Clifton <nickc@redhat.com>
3838
3839 * Makefile.am: Add copyright notice.
3840 * NEWS: Likewise.
3841 * README: Likewise.
3842 * configure.ac: Likewise.
3843 * ftruncate.c: Likewise.
3844 * Makefile.in: Regenerate.
3845
59965708
CC
38462012-12-14 Cary Coutant <ccoutant@google.com>
3847
a4034750
AM
3848 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3849 --no-as-needed flag.
3850 (exception_separate_shared_12_test): Likewise.
3851 (incremental_copy_test): Likewise.
3852 * testsuite/Makefile.in: Regenerate.
59965708 3853
2a77e2ab
CC
38542012-12-14 Cary Coutant <ccoutant@google.com>
3855
3856 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3857 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3858
e3deeb9c
AM
38592012-12-12 Alan Modra <amodra@gmail.com>
3860
3861 * powerpc.cc (class Track_tls): New.
3862 (class Relocate, class Scan): Inherit Track_tls.
3863 (Target_powerpc::Scan::local, global): Track tls optimization
3864 and avoid creating plt entry for __tls_get_addr if all uses
3865 are optimized away.
3866 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3867
d8f5a274
AM
38682012-12-12 Alan Modra <amodra@gmail.com>
3869
3870 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3871 Replace no_toc_optimize with toc_optimize.
3872 * output.h (Output_section::input_sections): Provide non-const variant.
3873 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3874 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3875 accessors.
3876 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3877 (class Sort_toc_sections): New.
3878 (Target_powerpc::do_finalize_sections): Sort toc sections.
3879 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3880
4c8a1de1
RM
38812012-12-10 Roland McGrath <mcgrathr@google.com>
3882
3883 * testsuite/binary_unittest.cc (read_all): New function.
3884 (Sized_binary_test): Use it instead of ::read.
3885 * fileread.cc (do_read): Don't assume pread always reads the whole
3886 amount in a single call.
3887
edc27beb
AM
38882012-12-10 Alan Modra <amodra@gmail.com>
3889
3890 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3891 Set EM_PPC64 or EM_PPC here.
3892 (Target_selector_powerpc::do_recognize): Delete.
3893
906b9150
AM
38942012-12-10 Alan Modra <amodra@gmail.com>
3895
3896 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3897 stub_table_.
3898 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3899
418c15ae
RM
39002012-12-07 Roland McGrath <mcgrathr@google.com>
3901
3902 * testsuite/binary_unittest.cc (Sized_binary_test):
3903 Use open_descriptor rather than ::open.
3904
decdd3bc
AM
39052012-12-07 Alan Modra <amodra@gmail.com>
3906
3907 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3908 typedef and invalid_address constant.
3909 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3910 instantiate constants.
3911
db399005
ILT
39122012-12-06 Roland McGrath <mcgrathr@google.com>
3913
3914 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3915 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3916 * aclocal.m4: Regenerate.
3917 * configure: Regenerate.
3918 * Makefile.in: Regenerate.
3919 * testsuite/Makefile.in: Regenerate.
3920
aba6bc71
AM
39212012-12-07 Alan Modra <amodra@gmail.com>
3922
3923 * options.h (General_options): Add no_toc_optimize.
3924 * powerpc.cc (ok_lo_toc_insn): New function.
3925 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3926
9e69ed50
AM
39272012-12-06 Alan Modra <amodra@gmail.com>
3928
3929 * options.h (General_options): Add plt_align, plt_static_chain,
3930 plt_thread_safe. Update stub_group_size help text.
3931 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3932 for new plt_thread_safe_ var.
3933 (use_plt_offset): Correct comments.
3934 (Target_powerpc::do_relax): Look for thread creation symbols to
3935 determine default plt_thread_safe value. Clear plt call stubs
3936 as well as branch stubs each iteration.
3937 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3938 insn constants.
3939 (l, hi, ha, write_insn): Move earlier.
3940 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3941 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3942 plt stubs too.
3943 (Stub_table::update_size): Adjust.
3944 (Stub_table::prev_size, set_prev_size): Delete.
3945 (Stub_table::stub_align): Let --plt-align affect result.
3946 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3947 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3948 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3949 (Stub_table::do_write): Support more stub variants.
3950
f43ba157
AM
39512012-12-04 Alan Modra <amodra@gmail.com>
3952
3953 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3954 (Target_powerpc::do_define_standard_symbols): New function.
3955
34171bc5
AM
39562012-12-03 Alan Modra <amodra@gmail.com>
3957
3958 * output.h: Formatting, whitespace.
3959
dc9589e9 39602012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3961
3962 * layout.h (Layout::get_executable_sections): Declare.
3963 * layout.cc (Layout::get_executable_sections): New function.
3964 * arm.cc (Target_arm::group_sections): Use it.
3965 (Arm_output_section::group_sections): Delete now redundant test.
3966 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3967 param to handle relative relocs.
3968 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3969 (Output_data_reloc::add_absolute): Adjust.
3970 (Output_data_reloc::add_relative): New function.
3971 (Output_data::reset_data_size): New function.
3972 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3973 (Output_section::set_addralign): New function.
3974 (Output_section::checkpoint_set_addralign): New function.
3975 (Output_section::clear_section_offsets_need_adjustment): New function.
3976 (Output_section::input_sections): Make public.
3977 * powerpc.cc (class Output_data_brlt_powerpc): New.
3978 (class Stub_table, class Stub_control): New.
3979 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3980 stub_table_, set_stub_table, stub_table): New vectors and accessor
3981 functions.
3982 (Target_powerpc::do_may_relax, do_relax, push_branch,
3983 new_stub_table, stub_tables, brlt_section, group_sections,
3984 add_branch_lookup_table, find_branch_lookup_table,
3985 write_branch_lookup_table, make_brlt_section): New functions.
3986 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3987 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3988 branch_info_): New vars.
3989 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3990 make call stubs here.
3991 (Output_data_glink): Remove all call stub handling from this class.
3992 (Target_powerpc::Scan::local, global): Save interesting branch
3993 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3994 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3995 functions on final link.
3996 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3997 Handle long branch destinations too.
3998 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3999 do_plt_address_for_local): Adjust lookup of plt call stubs.
4000
627b30b7
AM
40012012-11-30 Alan Modra <amodra@gmail.com>
4002
4003 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4004 relocs against protected symbols when building 32-bit shared libs.
4005
40b469d7
AM
40062012-11-30 Alan Modra <amodra@gmail.com>
4007
4008 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4009 param. Call got_section() to make .got. Update all callers
4010 and their callers and so on.
4011
bb66a627
AM
40122012-11-30 Alan Modra <amodra@gmail.com>
4013
4014 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4015 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4016 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4017 value if it already exists.
4018
d2cf1c6c
L
40192012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4020
4021 PR gold/14858
4022 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4023
edccdf7c
RM
40242012-11-14 Roland McGrath <mcgrathr@google.com>
4025
4026 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4027 than bfc instruction for data sandboxing.
4028
6febeb74
AM
40292012-11-08 Alan Modra <amodra@gmail.com>
4030
4031 * po/POTFILES.in: Regenerate.
4032
0a6f1bf2
AM
40332012-11-05 Alan Modra <amodra@gmail.com>
4034
4035 * configure.ac: Apply 2012-09-10 change to config.in here.
4036 * configure: Regenerate.
4037
26a4e9cb
AM
40382012-11-05 Alan Modra <amodra@gmail.com>
4039
4040 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4041 (struct Opd_ent): Use "Address" rather than "Offset".
4042 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4043 (Target_powerpc::got_section): Make public.
4044 (Target_powerpc::scan_relocs): Move code setting symbols..
4045 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4046 Create _SDA_BASE_ only when referenced.
4047
cc928013
RM
40482012-11-02 Roland McGrath <mcgrathr@google.com>
4049
4050 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4051 from last change.
4052
50ed5eb1
RM
40532012-11-01 Roland McGrath <mcgrathr@google.com>
4054
62fe925a
RM
4055 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4056 for offset_in_output_section parameter.
4057 (Sized_target::relocate_special_relocatable): Likewise.
4058 * arm.cc (Target_arm::relocate_relocs): Likewise.
4059 (Target_arm::relocate_special_relocatable): Likewise.
4060 * i386.cc (Target_i386::relocate_relocs): Likewise.
4061 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4062 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4063 * target-reloc.h (relocate_relocs): Likewise.
4064 * testsuite/testfile.cc (Target_test): Likewise.
4065 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4066 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4067
4068 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4069 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4070
4071 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4072 parameter, which is unused in the [!F_SETFD] case.
4073
50ed5eb1
RM
4074 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4075 SYMNDX to off_t before comparing it to this->data_size().
4076 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4077 * incremental.cc (Output_section_incremental_inputs::do_write):
4078 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4079
2cadc0bf
RM
4080 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4081
3bfcb652
NC
40822012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4083
4084 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4085 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4086 in EABI_VER5.
4087
c1a8d56e
CC
40882012-10-29 Cary Coutant <ccoutant@google.com>
4089
4090 * dwp.cc (usage): Add file and exit status parameters;
4091 add --help and --version options.
4092 (print_version): New function.
4093 (main): Add --help and --version options.
4094
b2490a7b
L
40952012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4096
4097 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4098 final_layout_sequence.txt.
4099 * testsuite/Makefile.in: Regenerated.
4100
aa543512
L
41012012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4102
4103 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4104 COMPILE generated by automake.
4105 (LINK1): Likewise.
4106 (CXXCOMPILE1): Likewise.
4107 (CXXLINK1): Likewise.
4108 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4109 (LINK): Likewise.
4110 (CXXCOMPILE): Likewise.
4111 (CXXLINK): Likewise.
4112 * testsuite/Makefile.in: Regenerated.
4113
d361fafb
L
41142012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4115
4116 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4117 on bad fwrite return.
4118
598c7410
L
41192012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4120
4121 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4122 on val.
4123
35c813e2
CC
41242012-10-23 Cary Coutant <ccoutant@google.com>
4125
4126 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4127 * testsuite/Makefile.in: Regenerate.
4128 * testsuite/dwp_test.h: New source file.
4129 * testsuite/dwp_test_1.cc: New source file.
4130 * testsuite/dwp_test_1.s: New source file.
4131 * testsuite/dwp_test_1.sh: New source file.
4132 * testsuite/dwp_test_1b.cc: New source file.
4133 * testsuite/dwp_test_1b.s: New source file.
4134 * testsuite/dwp_test_2.cc: New source file.
4135 * testsuite/dwp_test_2.s: New source file.
4136 * testsuite/dwp_test_2.sh: New source file.
4137 * testsuite/dwp_test_main.cc: New source file.
4138 * testsuite/dwp_test_main.s: New source file.
4139
77429909
CC
41402012-10-23 Cary Coutant <ccoutant@google.com>
4141
4142 * dwp.h: New header file.
4143 * dwp.cc: New source file.
4144 * gold.h: Move shared declarations to system.h.
4145 * system.h: New header file.
4146 * Makefile.am: Add dwp.
4147 * Makefile.in: Regenerate.
4148
ed5d6712
CC
41492012-10-23 Cary Coutant <ccoutant@google.com>
4150
4151 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4152 Dwarf_info_reader::read_from_pointer.
4153 (Dwarf_pubnames_table::read_header): Likewise.
4154 (Dwarf_pubnames_table::next_name): Likewise.
4155 (Dwarf_die::read_attributes): Likewise.
4156 (Dwarf_die::skip_attributes): Likewise.
4157 (Dwarf_info_reader::read_from_pointer): New function template.
4158 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4159 (Dwarf_pubnames_table): Likewise.
4160 (Dwarf_info_reader::read_from_pointer): New function template.
4161 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4162 Dwarf_pubnames_table ctor.
4163
8787852d
CC
41642012-10-23 Cary Coutant <ccoutant@google.com>
4165
4166 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4167 abbrev_shndx.
4168 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4169 abbrev_shndx_.
4170 (Dwarf_info_reader::set_abbrev_shndx): New method.
4171 (Dwarf_info_reader::abbrev_shndx_): New data member.
4172
9fc236f3
CC
41732012-10-23 Cary Coutant <ccoutant@google.com>
4174
4175 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4176 from object, not parameters.
4177 (Dwarf_info_reader::parse): Likewise.
4178 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4179 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4180 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4181 methods.
4182
effe8365
CC
41832012-10-23 Cary Coutant <ccoutant@google.com>
4184
4185 * fileread.cc (Input_file::Input_file): New constructor.
4186 * fileread.h (class Input_file): Add new constructor.
4187
1698990d
AM
41882012-10-18 Alan Modra <amodra@gmail.com>
4189
4190 PR gold/14727
4191 * object.cc (Relobj::is_section_name_included): Also match
4192 .sdata personality section.
4193
168a4726
AM
41942012-10-18 Alan Modra <amodra@gmail.com>
4195
4196 * target-reloc.h (class Default_comdat_behavior): New, package up..
4197 (get_comdat_behaviour): ..this.
4198 (relocate_section): Add Relocate_comdat_behavior template arg,
4199 adjust code to suit.
4200 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4201 (Target_arm::scan_reloc_section): Likewise.
4202 * i386.cc (Target_i386::relocate_section): Likewise.
4203 * sparc.cc (Target_sparc::relocate_section): Likewise.
4204 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4205 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4206 * powerpc.cc (class Relocate_comdat_behavior): New.
4207 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4208 gold::relocate_section with new template arg.
4209
acc276d8
AM
42102012-10-18 Alan Modra <amodra@gmail.com>
4211
4212 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4213 dynamic relocs for GOT_TPREL got entries, without symbol if
4214 resolving locally.
4215 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4216 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4217 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4218
e10f9870
AM
42192012-10-17 Alan Modra <amodra@gmail.com>
4220
4221 PR gold/14726
4222 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4223
ae034989
ST
42242012-10-16 Sriraman Tallam <tmsriram@google.com>
4225
4226 * layout.cc (Layout::include_section): Keep sections marked
4227 SHF_EXCLUDE when doing relocatable links.
4228
f3a0ed29
AM
42292012-10-16 Alan Modra <amodra@gmail.com>
4230
4231 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4232 (Target_powerpc::do_finalize_sections): Call it.
4233 (Output_data_save_res): New class and supporting functions.
4234 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4235 normal symbols defined in object files.
4236
c6de8ed4
AM
42372012-10-12 Alan Modra <amodra@gmail.com>
4238
4239 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4240 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4241 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4242 section if scan_opd_relocs not yet called.
4243 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4244
03e25981
AM
42452012-10-12 Alan Modra <amodra@gmail.com>
4246
4247 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4248 add_local_ifunc_entry): Revert last change.
4249 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4250
c9824451
AM
42512012-10-05 Alan Modra <amodra@gmail.com>
4252
4253 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4254 do_plt_address_for_global): New functions.
4255 (Output_data_got_powerpc::do_write): Don't segfault when linking
4256 statically.
4257 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4258 add_local_ifunc_entry): Return true on adding entry..
4259 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4260 glink->add_entry call. Remove unused symtab param. Adjust calls.
4261 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4262 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4263 set up symbols here.
4264 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4265 syms here. Do so even when no .iplt. Don't segfault when linking
4266 statically.
4267 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4268 new variants without reloc param.
4269 (Glink_sym_ent::Glink_sym_ent): Likewise.
4270 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4271 reloc when refs will resolve to plt call stub.
4272 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4273 R_PPC_PLTREL24 to resolve locally.
4274 (Target_powerpc::Scan::global): Correct ifunc handling.
4275 (Target_powerpc::Relocate::relocate): Correct local sym glink
4276 lookup. Don't destroy "value" when we have a plt call stub,
4277 and when checking plt call validity.
4278 (Target_powerpc::do_dynsym_value): Simplify.
4279
19fec8c1
AM
42802012-10-05 Alan Modra <amodra@gmail.com>
4281
4282 * i386.cc (Output_data_plt_i386::address_for_global,
4283 address_for_local): Add plt offset to returned value. Adjust uses.
4284 * sparc.cc (Output_data_plt_sparc::address_for_global,
4285 address_for_local): Likewise.
4286 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4287 address_for_local): Likewise.
4288 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4289 address_for_local): Likewise.
4290 * target.h (Target::plt_address_for_global, plt_address_for_local):
4291 Update comment.
4292 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4293 (Output_data_got::Got_entry::write): Nor here.
4294 * output.h: Comment fix.
4295
e867b647
WL
42962012-10-02 Jiong Wang <jiwang@tilera.com>
4297
4298 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4299 global_offset_table_ value for larget got.
4300 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4301
e5d5f5ed
AM
43022012-09-29 Alan Modra <amodra@gmail.com>
4303
4304 * powerpc.cc (Target_powerpc::iplt_): New output section.
4305 (Target_powerpc::iplt_section, make_iplt_section,
4306 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4307 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4308 Target_powerpc::plt_entry_count): Count iplt entries too.
4309 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4310 reloc section in constructor. New params.
4311 (Target_powerpc::make_plt_section): Create reloc section here instead.
4312 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4313 functions.
4314 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4315 (Output_data_glink::add_entry, find_entry): New functions to
4316 deal with local syms.
4317 (Glink_sym_ent): Add support for local syms.
4318 (Output_data_glink::do_write): Handle ifunc plt entries.
4319 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4320 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4321 (Target_powerpc::Relocate::relocate): Likewise.
4322 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4323
ec4dbad3
AM
43242012-09-25 Alan Modra <amodra@gmail.com>
4325
4326 * object.h (Sized_relobj_file::adjust_local_symbol,
4327 do_adjust_local_symbol): New functions.
4328 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4329 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4330 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4331 and irregular opd entry spacing.
4332 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4333 (Global_symbol_visitor_opd): New functor.
4334 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4335 on deleted opd entries.
4336
5c0b3823
WL
43372012-09-15 Jiong Wang <jiwang@tilera.com>
4338
4339 * tilegx.cc: New file.
4340 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4341 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4342 * configure.tgt: Add entries for tilegx*.
4343 * configure.ac: Likewise.
4344 * Makefile.in: Rebuild.
4345 * configure: Likewise.
4346 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4347 tilegx.
4348
bfdfa4cd
AM
43492012-09-13 Alan Modra <amodra@gmail.com>
4350
4351 * target-reloc.h (scan_relocs): Call scan.local for relocs
4352 against symbols in discarded sections. Pass is_discarded
4353 param.
4354 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4355 Add is_discarded param.
4356 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4357 is_discarded to flag opd entry as discarded. Don't emit dyn
4358 relocs on such entries.
4359 (Target_powerpc::Scan::global): Similarly detect and handle
4360 such opd entries.
4361 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4362 opd_ent_. Update all uses.
4363 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4364 (Target_powerpc::relocate_section): Zero out discarded opd
4365 entry relocs.
4366
d77a0555
ILT
43672012-09-12 Ian Lance Taylor <iant@google.com>
4368
4369 PR gold/14570
4370 * output.cc: Rename Output_data_got template parameter from size
4371 to got_size for all functions. Compile all variants of
4372 Output_data_got.
4373 (Output_data_got::Got_entry::write): Correct use of size for
4374 symbol value. Use local_is_tls rather than casting to
4375 Sized_relobj_file.
4376 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4377 (class Sized_relobj_file): Add do_local_is_tls.
4378 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4379
815a1205
AM
43802012-09-11 Alan Modra <amodra@gmail.com>
4381
4382 PR gold/14566
4383 * layout.cc (Layout::set_segment_offsets): When using
4384 common-page-size alignment, ensure we are on a new max-page-size
4385 page.
4386 * output.cc (Output_segment::set_section_addresses): Use
4387 abi_pagesize, not common_pagesize for relro boundary.
4388 (Output_segment::set_offset): Likewise.
4389
bd73a62d
AM
43902012-09-11 Alan Modra <amodra@gmail.com>
4391
4392 * output.h (Output_data_got::add_global_tls, add_local_tls,
4393 add_local_tls_pair): New functions.
4394 (Output_data_got::add_local_pair_with_rel): Remove second
4395 reloc param. Expand comment.
4396 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4397 use_plt_or_tls_offset_, similarly for constructor param.
4398 (Output_data_got::Got_entry::write): Add got_index param.
4399 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4400 add_local_tls_pair): New functions.
4401 (Output_data_got::Got_entry::write): Handle tls symbols
4402 with use_plt_or_tls_offset_ set specially.
4403 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4404 (Output_data_got::do_write): Replace iterator with index, pass
4405 index to entry write function.
4406 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4407 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4408 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4409 call.
4410 * i386.cc (Target_i386::Scan::local): Likewise.
4411 * sparc.cc (Target_sparc::Scan::local): Likewise.
4412 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4413 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4414 do_tls_offset_for_global): New functions.
4415 (Target_powerpc::Scan::local): Correct TLS relocations and got
4416 entry values.
4417 (Target_powerpc::Scan::global): Don't emit unnecessary
4418 dynamic relocations on TLS GOT entries.
4419
00716ab1
AM
44202012-09-10 Matthias Klose <doko@ubuntu.com>
4421
4422 * config.in: Disable sanity check for kfreebsd.
4423
c891b3f9
SA
44242012-09-10 Sterling Augustine <saugustine@google.com>
4425
4426 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4427 (Gdb_index::pubtypes_read): New parameter.
4428 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4429 to calls.
4430 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4431 pubtypes_object_.
4432
e81fea4d
AM
44332012-09-09 Alan Modra <amodra@gmail.com>
4434
4435 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4436 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4437 * gc.h (gc_process_relocs): Call target gc_add_reference.
4438 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4439 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4440 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4441 unnecessary cast.
4442 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4443 to cater for when we don't need code offset. Update use.
4444 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4445 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4446 set_opd_valid): New functions.
4447 (Target_powerpc::do_gc_add_reference): New function.
4448 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4449 stashed refs.
4450 (Target_powerpc::do_gc_mark_symbol): New function.
4451
d2d60eef
CC
44522012-09-06 Cary Coutant <ccoutant@google.com>
4453
4454 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4455 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4456 (Dwarf_die::skip_attributes): Likewise.
4457 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4458 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4459 (main): Call it.
4460 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4461
32ed4573
L
44622012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4463
4464 * testsuite/script_test_3.t: Add .got.plt output section
4465 statement.
4466 * testsuite/script_test_4.t: Likewise.
4467
f4baf0d4
AM
44682012-09-05 Alan Modra <amodra@gmail.com>
4469
4470 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4471 update all uses and lose "enum" when using type.
4472
864a1b56
AM
44732012-09-05 Alan Modra <amodra@gmail.com>
4474
4475 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4476 * configure: Regenerate.
4477 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4478 (plugin_final_layout.stdout): Likewise.
4479 (memory_test): Set page sizes to 0x1000.
4480 * testsuite/Makefile.in: Regenerate.
4481 * testsuite/discard_locals_test.sh: Add FIXME comment.
4482 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4483 * testsuite/pr14265.t: Add .got output section statement.
4484 * testsuite/script_test_2.t: Likewise.
4485 * testsuite/script_test_3.t: Likewise.
4486 * testsuite/script_test_4.t: Likewise.
4487 * testsuite/script_test_5.t: Likewise.
4488 * testsuite/script_test_6.t: Likewise.
4489 * testsuite/script_test_7.t: Likewise.
4490 * testsuite/script_test_9.t: Likewise.
4491
3ea0a085
AM
44922012-09-05 Alan Modra <amodra@gmail.com>
4493
4494 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4495 (Powerpc_relocate_functions::Status): New typedef.
4496 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4497 (Target_powerpc::Scan::local): Handle REL64.
4498 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4499 for REL32 and REL64.
4500 (Target_powerpc::symval_for_branch): New function, extracted from..
4501 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4502 checks. Report overflow errors.
4503
7404fe1b
AM
45042012-09-05 Alan Modra <amodra@gmail.com>
4505
4506 * object.h (Sized_relobj_file::emit_relocs): Delete.
4507 (Sized_relobj_file::emit_relocs_reltype): Delete.
4508 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4509 relocate_relocs for --emit-relocs.
4510 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4511 * output.h: Update comment.
4512 (Output_segment::first_section): New function.
4513 (Output_segment::first_section_load_address): Use first_section.
4514 * output.cc (Output_segment::first_section): New function extracted..
4515 (Output_segment::first_section_load_address): ..from here. Delete.
4516 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4517 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4518 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4519 adjust call to target.h function.
4520 * i386.cc (Target_i386): Likewise.
4521 * sparc.cc (Target_sparc): Likewise.
4522 * x86_64.cc (Target_x86_64): Likewise.
4523 * powerpc.cc (Target_powerpc): Likewise.
4524 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4525 first tls section has section symbol for optimised local dynamic
4526 output relocs.
4527 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4528 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4529 optimised tls code.
4530 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4531 Rename to relocate_relocs. Update error message.
4532
957564c9
AS
45332012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4534
4535 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4536 --just-symbols.
4537
dd93cd0a
AM
45382012-08-31 Alan Modra <amodra@gmail.com>
4539
4540 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4541 (Powerpc_relobj::toc_base_offset): New stub function.
4542 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4543 got_mod_index_offset to tlsld_got_offset. Update all refs.
4544 (Target_powerpc::Relocate::enum skip_tls): New.
4545 (Target_powerpc::call_tls_get_addr_): New var.
4546 (Target_powerpc::is_branch_reloc): Move to file scope.
4547 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4548 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4549 New functions.
4550 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4551 (powerpc_info): Correct common_pagesize for ppc64.
4552 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4553 (Powerpc_relocate_functions): Add overflow check enums and functions.
4554 Add non-shift version of rela, rela_ua. Delete all rel public
4555 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4556 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4557 addr16_ha3, addr14 functions.
4558 (Output_data_got_powerpc::add_constant_pair): New function.
4559 (Output_data_got_powerpc::got_base_offset): Likewise.
4560 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4561 (instruction constants): Sort, add some more.
4562 (Output_data_glink::do_write): Add and use Address typedef. Use
4563 object->toc_base_offset() stub for 64-bit.
4564 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4565 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4566 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4567 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4568 Always treat .opd relocs as against locally defined symbol.
4569 Correct condition for RELATIVE relocs.
4570 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4571 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4572 for 32-bit syms with a plt entry. Correct ppc64 toc base
4573 calculations. Handle TLS relocs, and more. Add overflow
4574 checking and adjust for Powerpc_relocate_functions changes.
4575 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4576 Reinstate --emit-relocs code with FIXME.
4577
a1373b60
AM
45782012-08-30 Alan Modra <amodra@gmail.com>
4579
4580 * layout.cc (Layout::set_segment_offsets): Set p_align to
4581 abi_pagesize, not common_pagesize.
4582 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4583 to determine whether file header can go in segment.
4584
703d02da
AM
45852012-08-30 Alan Modra <amodra@gmail.com>
4586
4587 * output.h (Output_reloc::Output_reloc <output section>): Add
4588 is_relative param. Adjust calls.
4589 (Output_reloc::add_output_section_relative): New functions.
4590 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4591 is_relative.
4592 (Output_reloc::symbol_value): Handle SECTION_CODE.
4593
16164a6b
ST
45942012-08-24 Sriraman Tallam <tmsriram@google.com>
4595
4596 * gold.cc (queue_middle_tasks): Call layout again when unique
4597 segments for sections is desired.
4598 * layout.cc (Layout::Layout): Initialize new members.
4599 (Layout::get_output_section_flags): New function.
4600 (Layout::choose_output_section): Call get_output_section_flags.
4601 (Layout::layout): Make output section for mapping to a unique segment.
4602 (Layout::insert_section_segment_map): New function.
4603 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4604 output sections marked so.
16164a6b
ST
4605 (Layout::segment_precedes): Check for unique segments when sorting.
4606 * layout.h (Layout::Unique_segment_info): New struct.
4607 (Layout::Section_segment_map): New typedef.
4608 (Layout::insert_section_segment_map): New function.
4609 (Layout::get_output_section_flags): New function.
4610 (Layout::is_unique_segment_for_sections_specified): New function.
4611 (Layout::set_unique_segment_for_sections_specified): New function.
4612 (Layout::unique_segment_for_sections_specified_): New member.
4613 (Layout::section_segment_map_): New member.
4614 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4615 Rename is_gc_pass_one to is_pass_one.
4616 Rename is_gc_pass_two to is_pass_two.
4617 Rename is_gc_or_icf to is_two_pass.
4618 Check for which pass based on whether symbols data is present.
4619 Make it two pass when unique segments for sections is desired.
4620 * output.cc (Output_section::Output_section): Initialize new
4621 members.
4622 * output.h (Output_section::is_unique_segment): New function.
4623 (Output_section::set_is_unique_segment): New function.
4624 (Output_section::is_unique_segment_): New member.
4625 (Output_section::extra_segment_flags): New function.
4626 (Output_section::set_extra_segment_flags): New function.
4627 (Output_section::extra_segment_flags_): New member.
4628 (Output_section::segment_alignment): New function.
4629 (Output_section::set_segment_alignment): New function.
4630 (Output_section::segment_alignment_): New member.
4631 (Output_segment::Output_segment): Initialize is_unique_segment_.
4632 (Output_segment::is_unique_segment): New function.
4633 (Output_segment::set_is_unique_segment): New function.
4634 (Output_segment::is_unique_segment_): New member.
4635 * plugin.cc (allow_unique_segment_for_sections): New function.
4636 (unique_segment_for_sections): New function.
4637 (Plugin::load): Add new functions to transfer vector.
4638 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4639 * Makefile.in: Regenerate.
4640 * testsuite/plugin_final_layout.sh: Check if unique segment
4641 functionality works.
4642 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4643 are available.
4644 (allow_unique_segment_for_sections): New global.
4645 (unique_segment_for_sections): New global.
4646 (claim_file_hook): Call allow_unique_segment_for_sections.
4647 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4648
1e2bee4f
CC
46492012-08-22 Cary Coutant <ccoutant@google.com>
4650
4651 * layout.cc (Layout::include_section): Don't assert on GROUP
4652 sections with --emit-relocs.
4653
1d5dfe78
CC
46542012-08-21 Cary Coutant <ccoutant@google.com>
4655
4656 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4657 if --export-dynamic-symbol names an undef symbol.
4658
c9269dff
AM
46592012-08-18 Alan Modra <amodra@gmail.com>
4660
4661 * powerpc.cc: Formatting and white space.
4662 (Powerpc_relobj): Rename got2_section_ to special_.
4663 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4664 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4665 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4666 (Target_powerpc): Add Address typedef and invalid_address. Use
4667 throughout.
4668 (Target_powerpc::is_branch_reloc): New function.
4669 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4670 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4671 for dst_mask, value and addend.
4672 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4673 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4674 (Output_data_glink::do_write): Correct toc base. Don't try to use
4675 uint16_t for 24-bit offset. Use get_output_section_offset and
4676 check return.
4677 (Target_powerpc::Scan::local): Handle more relocs.
4678 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4679 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4680 Plug in toc restoring insn after plt calls. Translate branches
4681 to function descriptor symbols to corresponding entry point.
4682 (Target_powerpc::relocate_for_relocatable): Check return from
4683 get_output_section_offset.
4684 * symtab.h: Comment typo.
4685
b1759dce
ILT
46862012-08-14 Ian Lance Taylor <iant@google.com>
4687
4688 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4689 unsupported_relocal_local to call unsupported_reloc_global.
4690
b9b2ae8b
NC
46912012-08-14 Nick Clifton <nickc@redhat.com>
4692
4693 PR ld/14265
4694 * script-sections.cc (Sections_element::output_section_name): Add
4695 keep return parameter.
4696 (Output_section_element::match_name): Add keep return parameter.
4697 Return the value of the keep_ member.
4698 * script-sections.h (class Output_section): Update
4699 output_section_name prototype.
4700 * layout.cc (Layout::keep_input_section): New public member
4701 function.
4702 (Layout::choose_output_section): Pass keep parameter to
4703 output_section_name.
4704 * layout.h (class Layout): Add keep_input_section.
4705 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4706 sections.
4707 * testsuite/Makefile.am: Add a test.
4708 * testsuite/Makefile.in: Regenerate.
4709 * testsuite/pr14265.c: Source file for the test.
4710 * testsuite/pr14265.t: Linker script for the test.
4711 * testsuite/pr14265.sh: Shell script for the test.
4712
921b5322
AM
47132012-08-14 Alan Modra <amodra@gmail.com>
4714
4715 * target.h (Target::output_section_name): New function.
4716 (Target::do_output_section_name): New function.
4717 * layout.cc (Layout::choose_output_section): Call the above.
4718 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4719
6ce78956
AM
47202012-08-14 Alan Modra <amodra@gmail.com>
4721
4722 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4723 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4724 for replace_constant call.
4725 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4726 (Output_data_glink::do_print_to_mapfile): New function.
4727 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4728 (Target_powerpc::Relocate::relocate): Likewise.
4729
d1a8cabd
AM
47302012-08-14 Alan Modra <amodra@gmail.com>
4731
4732 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4733 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4734 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4735 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4736 all references to shndx_. Handle special case for R_PPC_PLTREL24
4737 here.
4738 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4739 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4740 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4741 here.
4742 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4743 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4744
d83ce4e3
AM
47452012-08-12 Alan Modra <amodra@gmail.com>
4746
4747 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4748 (glink insn constants): Use uint32_t.
4749 (Output_data_glink::add_entry): Use insert, not [] operator.
4750
cf43a2fe
AM
47512012-08-11 Alan Modra <amodra@gmail.com>
4752
4753 * object.h (Sized_relobj_file::find_shdr): New function.
4754 (Sized_relobj_file::find_special_sections): New function.
4755 * object.cc (Sized_relobj_file::find_shdr): New function.
4756 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4757 (Sized_relobj_file::find_special_sections): New function, split out..
4758 (Sized_relobj_file::do_read_symbols): ..from here.
4759 * output.h (Output_data_got::replace_constant): New function.
4760 (Output_data_got::num_entries): New function.
4761 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4762 (Output_data_got::got_offset): Protected rather than private.
4763 (Output_data_got::replace_got_entry): New function.
4764 * output.cc (Output_data_got::replace_got_entry): New function.
4765 * powerpc.cc (class Powerpc_relobj): New.
4766 (class Powerpc_relocate_functions): Delete all psymval variants or
4767 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4768 Implement _ha functions using corresponding _hi function.
4769 (Powerpc_relobj::find_special_sections): New function.
4770 (Target_powerpc::do_make_elf_object): New function.
4771 (class Output_data_got_powerpc): New.
4772 (class Output_data_glink): New.
4773 (class Powerpc_scan_relocatable_reloc): New.
4774 Many more changes througout file.
4775
3c892704
NC
47762012-08-09 Nick Clifton <nickc@redhat.com>
4777
4778 * po/vi.po: Updated Vietnamese translation.
4779
82435b3b
ILT
47802012-08-07 Ian Lance Taylor <iant@google.com>
4781
4782 * layout.cc (Layout::add_target_dynamic_tags): If
4783 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4784 plt_rel.
4785
a6dc81d2
NC
47862012-07-30 Nick Clifton <nickc@redhat.com>
4787
4788 * po/gold.pot: Updated template.
4789 * po/es.po: Updated Spanish translation.
4790
f1415016
CC
47912012-07-18 Cary Coutant <ccoutant@google.com>
4792
4793 PR gold/14344
4794 * configure.ac: Add check for -gpubnames support.
4795 * configure: Regenerate.
4796 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4797 support; force -gno-pubnames.
4798 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4799 support.
4800 (gdb_index_test_4): New test.
4801 * testsuite/Makefile.in: Regenerate.
4802 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4803 * testsuite/gdb_index_test_2.sh: Likewise.
4804 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4805 * testsuite/gdb_index_test_4.sh: New script.
4806 * testsuite/gdb_index_test_comm.sh: New script with common code;
4807 don't look for space after colon.
4808
b7fd7c37
ST
48092012-07-16 Sriraman Tallam <tmsriram@google.com>
4810
4811 * gold.cc (queue_middle_tasks): Update function order only after
4812 deferred objects due to plugins are processed.
4813
1f3212db
ILT
48142012-07-11 Ian Lance Taylor <iant@google.com>
4815
4816 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4817 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4818 (Target_arm::scan_reloc_for_stub): Likewise.
4819 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4820 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4821 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4822 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4823 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4824
81c82a68
ILT
48252012-07-10 Dodji Seketeli <dodji@redhat.com>
4826 Ian Lance Taylor <iant@google.com>
4827
4828 PR gold/14309
4829 * configure.ac: Test whether std::tr1::hash<off_t> works.
4830 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4831 needed.
4832 * output.h (class Output_fill): Add virtual destructor.
4833 * configure, config.in: Rebuild.
4834
eabc84f4
RM
48352012-06-22 Roland McGrath <mcgrathr@google.com>
4836
4837 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4838
370e30b6
RÁE
48392012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4840
4841 * plugin.cc (Plugin::load): Handle position independent executables.
4842
fb1b895d
CC
48432012-06-06 Cary Coutant <ccoutant@google.com>
4844
4845 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4846 add .debug_macro.
4847 (lines_only_debug_sections): Likewise.
4848 (gdb_fast_lookup_sections): New static array.
4849 (is_gdb_debug_section): Rename formal parameter.
4850 (is_lines_only_debug_section): Likewise.
4851 (is_gdb_fast_lookup_section): New function.
4852 (Layout::include_section): Check for ".zdebug_" prefix; pass
4853 section name suffix to is_gdb_debug_section, et al.; check for
4854 fast-lookup sections when building .gdb_index.
4855 * options.h (--strip-debug-gdb): Update GDB version number.
4856
7c0640fa
CC
48572012-06-06 Cary Coutant <ccoutant@google.com>
4858
4859 * configure.ac: Add check for fallocate.
4860 * configure: Regenerate.
4861 * config.in: Regenerate.
4862
4863 * options.h (class General_options): Add --mmap-output-file and
4864 --posix-fallocate options.
4865 * output.cc: (posix_fallocate): Remove; replace with...
4866 (gold_fallocate): New function.
4867 (Output_file::map_no_anonymous): Call gold_fallocate.
4868 (Output_file::map): Check --mmap-output-file option.
4869
2a49eb69
DK
48702012-06-05 Jing Yu <jingyu@google.com>
4871
4872 * gold.h (textdomain): Add do {} to empty while(0).
4873 (bindtextdomain): Likewise.
4874
fad072ac
CC
48752012-06-04 Cary Coutant <ccoutant@google.com>
4876
4877 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4878 has_dynsym_index.
4879
8cc69fb6
ST
48802012-05-25 Sriraman Tallam <tmsriram@google.com>
4881
4882 * symtab.cc (Symbol_table::define_special_symbol):
4883 Initialize *poldsym to prevent uninitialized variable errors.
4884
1be75daa
CC
48852012-05-23 Cary Coutant <ccoutant@google.com>
4886
4887 * layout.cc (Layout::section_name_mapping): Add rules to handle
4888 exact match on .data.rel.ro.local or .data.rel.ro.
4889 (Layout::output_section_name): Check for exact matches.
4890
9b689de0
CC
48912012-05-23 Cary Coutant <ccoutant@google.com>
4892
4893 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4894 more carefully.
4895
b24fdbf5
CC
48962012-05-22 Cary Coutant <ccoutant@google.com>
4897
4898 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4899 object before exporting symbol.
4900
e550e1a2
L
49012012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4902
4903 * testsuite/tls_test.cc: Include "config.h" first.
4904 * testsuite/tls_test_c.c: Likewise.
4905
df7b86aa
NC
49062012-05-17 Daniel Richard G. <skunk@iskunk.org>
4907 Nick Clifton <nickc@redhat.com>
4908
4909 PR 14072
4910 * configure.in: Add check that sysdep.h has been included before
4911 any system header files.
4912 * configure: Regenerate.
4913 * config.in: Regenerate.
4914
1007b503
CC
49152012-05-14 Cary Coutant <ccoutant@google.com>
4916
4917 * layout.cc (Layout::make_output_section): Mark .tdata section
4918 as RELRO.
4919 * testsuite/relro_test.cc: Add a TLS variable.
4920
fd885f3a
L
49212012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4922
4923 PR gold/14091
4924 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4925 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4926 R_X86_64_64.
4927
80f5885c
CC
49282012-05-08 Cary Coutant <ccoutant@google.com>
4929
4930 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4931 (lines_only_debug_sections): Likewise.
4932
2e702c99
RM
49332012-05-02 Roland McGrath <mcgrathr@google.com>
4934
4935 * nacl.cc: New file.
4936 * nacl.h: New file.
4937 * Makefile.am (CCFILES, HFILES): Add them.
4938 * Makefile.in: Regenerate.
4939 * i386.cc (Output_data_plt_i386_nacl): New class.
4940 (Output_data_plt_i386_nacl_exec): New class.
4941 (Output_data_plt_i386_nacl_dyn): New class.
4942 (Target_i386_nacl): New class.
4943 (Target_selector_i386_nacl): New class.
4944 (target_selector_i386): Use it instead of Target_selector_i386.
4945 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4946 (Target_x86_64_nacl): New class.
4947 (Target_selector_x86_64_nacl): New class.
4948 (target_selector_x86_64, target_selector_x32): Use it instead of
4949 Target_selector_x86_64.
4950 * arm.cc (Output_data_plt_arm_nacl): New class.
4951 (Target_arm_nacl): New class.
4952 (Target_selector_arm_nacl): New class.
4953 (target_selector_arm, target_selector_armbe): Use it instead of
4954 Target_selector_arm.
4955
4956 * target-select.cc (select_target): Take new Input_file* and off_t
4957 arguments, pass them on to recognize method of selector.
4958 * object.cc (make_elf_sized_object): Update caller.
4959 * parameters.cc (parameters_force_valid_target): Likewise.
4960 * incremental.cc (make_sized_incremental_binary): Likewise.
4961 * target-select.h: Update decl.
4962 (Target_selector::recognize): Take new Input_file* argument,
4963 pass it on to do_recognize.
4964 (Target_selector::do_recognize): Take new Input_file* argument.
4965 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4966 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4967 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4968 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4969
4970 * target.h (Target::Target_info): New members isolate_execinstr
4971 and rosegment_gap.
4972 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4973 * arm.cc (Target_arm::arm_info): Update initializer.
4974 * i386.cc (Target_i386::i386_info): Likewise.
4975 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4976 * sparc.cc (Target_sparc::sparc_info): Likewise.
4977 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4978 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4979 * layout.cc (Layout::attach_allocated_section_to_segment):
4980 Take new const Target* argument. If target->isolate_execinstr(), act
4981 like --rosegment.
4982 (Layout::find_first_load_seg): Take new const Target* argument;
4983 if target->isolate_execinstr(), reject PF_X segments.
4984 (Layout::relaxation_loop_body): Update caller.
4985 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4986 reset file offset to zero when we hit LOAD_SEG, and then do a second
4987 loop over the segments before LOAD_SEG to reassign offsets after
4988 addresses have been determined. Handle target->rosegment_gap().
4989 (Layout::attach_section_to_segment): Take new const Target* argument;
4990 pass it to attach_allocated_section_to_segment.
4991 (Layout::make_output_section): Update caller.
4992 (Layout::attach_sections_to_segments): Take new const Target* argument;
4993 pass it to attach_section_to_segment.
4994 * gold.cc (queue_middle_tasks): Update caller.
4995 * layout.h (Layout): Update method decls with new arguments.
4996
4997 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4998 Target_info pointer to use.
4999 (Target_arm::do_make_data_plt): New virtual method.
5000 (Target_arm::make_data_plt): New method that calls it.
5001 (Target_arm::make_plt_entry): Use it.
5002 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5003 for the section alignment.
5004 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5005 method.
5006 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5007 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5008 method.
5009 (Output_data_plt_arm::get_plt_entry_size): Call it.
5010 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5011 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5012 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5013 method.
5014 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5015 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5016 method instead of sizeof(plt_entry).
5017 (Output_data_plt_arm::add_entry): Likewise.
5018 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5019 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5020 than static method.
5021 (Target_arm::plt_entry_size): Likewise.
5022 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5023 Move to ...
5024 (Output_data_plt_arm_standard): ... here, new class.
5025 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5026 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5027 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5028
5029 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5030 Take additional argument for the PLT entry size.
5031 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5032 Use get_plt_entry_size method rather than plt_entry_size variable.
5033 (Output_data_plt_x86_64::reserve_slot): Likewise.
5034 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5035 (Output_data_plt_x86_64::add_entry): Likewise.
5036 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5037 (Output_data_plt_x86_64::address_for_global): Likewise.
5038 (Output_data_plt_x86_64::address_for_local): Likewise.
5039 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5040 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5041 Make method non-static.
5042 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5043 method.
5044 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5045 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5046 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5047 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5048 virtual method.
5049 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5050 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5051 virtual method.
5052 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5053 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5054 virtual method.
5055 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5056 (Output_data_plt_x86_64::plt_entry_size)
5057 (Output_data_plt_x86_64::first_plt_entry)
5058 (Output_data_plt_x86_64::plt_entry)
5059 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5060 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5061 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5062 (Output_data_plt_x86_64_standard): ... here, new class.
5063 (Target_x86_64::Target_x86_64): Take optional argument for the
5064 Target_info pointer to use.
5065 (Target_x86_64::do_make_data_plt): New virtual method.
5066 (Target_x86_64::make_data_plt): New method to call it.
5067 (Target_x86_64::init_got_plt_for_update): Use that.
5068 Call this->plt_->add_eh_frame method here.
5069 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5070 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5071 rather than static method.
5072 (Target_x86_64::plt_entry_size): Likewise.
5073 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5074 rather than plt_entry_size variable. Move guts of PLT filling to...
5075 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5076 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5077 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5078
5079 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5080 additional argument for the section alignment.
5081 Don't do add_eh_frame_for_plt here.
5082 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5083 non-static. Use get_plt_entry_size method rather than plt_entry_size
5084 variable.
5085 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5086 method.
5087 (Output_data_plt_i386::get_plt_entry_size): Call it.
5088 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5089 (Output_data_plt_i386::add_eh_frame): New method to call it.
5090 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5091 method.
5092 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5093 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5094 method.
5095 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5096 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5097 method instead of plt_entry_size.
5098 (Output_data_plt_i386::plt_entry_size)
5099 (Output_data_plt_i386::plt_eh_frame_fde_size)
5100 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5101 (Output_data_plt_i386_standard): ... here, new class.
5102 (Output_data_plt_i386_exec): New class.
5103 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5104 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5105 (Output_data_plt_i386::exec_plt_entry): Move to ...
5106 (Output_data_plt_i386_exec::plt_entry): ... here.
5107 (Output_data_plt_i386_dyn): New class.
5108 (Output_data_plt_i386::first_plt_entry): Move to ...
5109 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5110 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5111 (Output_data_plt_i386_dyn::plt_entry): ... here.
5112 (Target_i386::Target_i386): Take optional argument for the Target_info
5113 pointer to use.
5114 (Target_i386::do_make_data_plt): New virtual method.
5115 (Target_i386::make_data_plt): New method to call it.
5116 (Target_i386::make_plt_section): Use that.
5117 Call this->plt_->add_eh_frame method here.
5118 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5119 rather than plt_entry_size variable.
5120 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5121 (Output_data_plt_i386::address_for_local): Likewise.
5122 (Output_data_plt_i386::do_write): Likewise.
5123 Move guts of PLT filling to...
5124 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5125 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5126 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5127 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5128
b9b9f2ee
CC
51292012-05-01 Cary Coutant <ccoutant@google.com>
5130
5131 * dwarf_reader.cc (Dwarf_die::read_attributes)
5132 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5133 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5134 * reduced_debug_output.cc
5135 (Output_reduced_debug_info_section::get_die_end): Remove
5136 DW_FORM_GNU_ref_index. Add default case.
5137
57923f48
MW
51382012-04-26 Mark Wielaard <mjw@redhat.com>
5139
5140 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5141 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5142 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5143 DW_AT_high_pc as offset from DW_AT_low_pc.
5144
5145 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5146 * testsuite/Makefile.in: Regenerate.
5147 * testsuite/gdb_index_test_3.c: New test source file.
5148 * testsuite/gdb_index_test_3.sh: New test source file.
5149
2c54b4f4
ILT
51502012-04-25 Ian Lance Taylor <iant@google.com>
5151
5152 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5153 pointer.
5154 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5155 as a class, not a struct.
5156 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5157 (Target_arm::apply_cortex_a8_workaround): Likewise.
5158 * gc.h: Declare Reloc_types as a struct, not a class.
5159 * object.h: Declare Symbols_data as a struct.
5160 * reloc.h: Declare Read_relocs_data as a struct.
5161 * target.h: Declare Relocate_info as a struct.
5162
a5a5f7a3
DM
51632012-04-24 David S. Miller <davem@davemloft.net>
5164
5165 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5166 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5167 and R_SPARC_WPLT30.
5168
f038d496
CC
51692012-04-24 Cary Coutant <ccoutant@google.com>
5170
5171 * incremental-dump.cc (find_input_containing_global): Replace
5172 magic number with symbolic constant.
5173 (dump_incremental_inputs): Update version number.
5174 * incremental.cc (Output_section_incremental_inputs): Update version
5175 number; import symbolic constants from Incremental_inputs_reader.
5176 (Incremental_inputs::create_data_sections): Align relocations
5177 section correctly for 64-bit targets.
5178 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5179 constants; add padding.
5180 (Output_section_incremental_inputs::write_header): Add assert for
5181 header_size.
5182 (Output_section_incremental_inputs::write_input_files): Add assert
5183 for input_entry_size.
5184 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5185 add assert for object_info_size, input_section_entry_size,
5186 global_sym_entry_size.
5187 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5188 for data structure sizes; use them.
5189 (Incremental_input_entry_reader): Import symbolic constants from
5190 Incremental_inputs_reader; use them.
5191
a4d85145
DM
51922012-04-23 David S. Miller <davem@davemloft.net>
5193
5194 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5195 and elf_flags_set_.
5196 (Target_sparc::Target_sparc): Initialize new fields.
5197 (Target_sparc::do_make_elf_object): New function.
5198 (Target_sparc::do_adjust_elf_header): New function.
5199
1d509098
CC
52002012-04-23 Cary Coutant <ccoutant@google.com>
5201
5202 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5203 CU range table of gdb index.
5204
7ebeff7f
DM
52052012-04-20 David S. Miller <davem@davemloft.net>
5206
5207 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5208 instead of false.
5209
13cf9988
DM
52102012-04-16 David S. Miller <davem@davemloft.net>
5211
2a1079e8
DM
5212 * sparc.cc (Target_sparc::got_address): New function.
5213 (Sparc_relocate_functions::gdop_hix22): New function.
5214 (Sparc_relocate_functions::gdop_lox10): New function.
5215 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5216 relocs.
5217 (Target_sparc::Scan::local): Likewise if the global symbol is not
5218 preemptible and is not IFUNC.
5219 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5220 transformations for local and non-preemptible non-IFUNC global
5221 symbols.
5222
0bc964fc
DM
5223 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5224 writing out 64-bit part of ranges.
5225
661d7a80
DM
5226 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5227 -fpic and -fpie respectively.
5228 * Makefile.in: Regenerate.
5229
8c2bf391
DM
5230 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5231 (Target_sparc::Target_sparc): Initialize new field.
5232 (Target_sparc::do_plt_section_for_global): New function.
5233 (Target_sparc::do_plt_section_for_local): New function.
5234 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5235 (Target_sparc::make_plt_section): New function, broken out of
5236 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5237 (Target_sparc::make_plt_entry): Call make_plt_section.
5238 (Target_sparc::make_local_ifunc_plt_entry): New function.
5239 (Target_sparc::rela_ifunc_section): New function.
5240 (Target_sparc::plt_section): Remove const.
5241 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5242 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5243 and ifunc_count_ fields.
5244 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5245 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5246 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5247 (Output_data_plt_sparc::rela_ifunc): New function.
5248 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5249 (Output_data_plt_sparc::has_ifunc_section): New function.
5250 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5251 (Output_data_plt_sparc::address_for_global): New function.
5252 (Output_data_plt_sparc::address_for_local): New function.
5253 (Output_data_plt_sparc::plt_index_to_offset): New function.
5254 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5255 and entry_count.
5256 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5257 entry_count.
5258 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5259 R_SPARC_JMP_IREL to switch.
5260 (Target_sparc::Scan::check_non_pic): Likewise.
5261 (Target_sparc::Scan::local): Handle IFUNC symbols.
5262 (Target_sparc::Scan::local): Likewise.
5263 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5264 and plt_address_for_local.
5265 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5266 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5267
13cf9988
DM
5268 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5269 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5270 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5271 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5272 global relocs too.
5273 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5274 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5275 calls.
5276 * sparc.cc (Target_sparc::Scan::global): Likewise.
5277 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5278
31821be0
CC
52792012-04-16 Cary Coutant <ccoutant@google.com>
5280
5281 * archive.cc (Library_base::should_include_member): Check for
5282 --export-dynamic-symbol.
5283 * options.h (class General_options): Add --export-dynamic-symbol.
5284 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5285 --export-dynamic-symbol.
5286 (Symbol_table::gc_mark_undef_symbols): Likewise.
5287 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5288
2615994e
DM
52892012-04-12 David S. Miller <davem@davemloft.net>
5290
5291 * sparc.cc (Reloc::wdisp10): New relocation method.
5292 (Reloc::h34): Likewise.
5293 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5294 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5295 R_SPARC_WDISP10.
5296 (Target_sparc::Scan::local): Likewise.
5297 (Target_sparc::Scan::global): Likewise.
5298 (Target_sparc::Relocate::relocate): Likewise.
5299
6782735d
CC
53002012-04-09 Cary Coutant <ccoutant@google.com>
5301
5302 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5303 low_pc == 0.
5304
8c7a0b00
ILT
53052012-04-06 Ian Lance Taylor <iant@google.com>
5306
5307 * timer.cc: #include <unistd.h>.
5308
58797674
RM
53092012-04-06 Roland McGrath <mcgrathr@google.com>
5310
5311 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5312 * config.in: Regenerate.
5313 * configure: Regenerate.
5314
44350750
NC
53152012-04-05 Nick Clifton <nickc@redhat.com>
5316
5317 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5318 (AM_LC_MESSAGES): Add.
5319 * aclocal.m4: Regenerate.
5320 * config.in: Regenerate.
5321 * configure: Regenerate.
5322
c1027032
CC
53232012-03-21 Cary Coutant <ccoutant@google.com>
5324
5325 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5326 * Makefile.in: Regenerate.
5327 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5328 (Sized_elf_reloc_mapper::symbol_section): New function.
5329 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5330 (make_elf_reloc_mapper): New function.
5331 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5332 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5333 (Dwarf_abbrev_table::do_get_abbrev): New function.
5334 (Dwarf_ranges_table::read_ranges_table): New function.
5335 (Dwarf_ranges_table::read_range_list): New function.
5336 (Dwarf_pubnames_table::read_section): New function.
5337 (Dwarf_pubnames_table::read_header): New function.
5338 (Dwarf_pubnames_table::next_name): New function.
5339 (Dwarf_die::Dwarf_die): New function.
5340 (Dwarf_die::read_attributes): New function.
5341 (Dwarf_die::skip_attributes): New function.
5342 (Dwarf_die::set_name): New function.
5343 (Dwarf_die::set_linkage_name): New function.
5344 (Dwarf_die::attribute): New function.
5345 (Dwarf_die::string_attribute): New function.
5346 (Dwarf_die::int_attribute): New function.
5347 (Dwarf_die::uint_attribute): New function.
5348 (Dwarf_die::ref_attribute): New function.
5349 (Dwarf_die::child_offset): New function.
5350 (Dwarf_die::sibling_offset): New function.
5351 (Dwarf_info_reader::check_buffer): New function.
5352 (Dwarf_info_reader::parse): New function.
5353 (Dwarf_info_reader::do_parse): New function.
5354 (Dwarf_info_reader::do_read_string_table): New function.
5355 (Dwarf_info_reader::lookup_reloc): New function.
5356 (Dwarf_info_reader::get_string): New function.
5357 (Dwarf_info_reader::visit_compilation_unit): New function.
5358 (Dwarf_info_reader::visit_type_unit): New function.
5359 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5360 Sized_elf_reloc_mapper.
5361 (Sized_dwarf_line_info::symbol_section): Remove function.
5362 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5363 (Sized_dwarf_line_info::read_line_mappings): Remove object
5364 parameter, adjust callers.
5365 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5366 * dwarf_reader.h: Include <sys/types.h>.
5367 (class Track_relocs): Remove forward declaration.
5368 (class Elf_reloc_mapper): New class.
5369 (class Sized_elf_reloc_mapper): New class.
5370 (class Dwarf_abbrev_table): New class.
5371 (class Dwarf_range_list): New class.
5372 (class Dwarf_ranges_table): New class.
5373 (class Dwarf_pubnames_table): New class.
5374 (class Dwarf_die): New class.
5375 (class Dwarf_info_reader): New class.
5376 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5377 (Sized_dwarf_line_info::symbol_section): Remove member function.
5378 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5379 base class.
5380 * gdb-index.cc: New source file.
5381 * gdb-index.h: New source file.
5382 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5383 and .debug_types sections, call Layout::add_to_gdb_index.
5384 (Sized_relobj_incr::do_section_name): Implement.
5385 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5386 return type; Implement.
5387 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5388 return type.
5389 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5390 parameter list and return type.
5391 (Sized_incr_dynobj::do_section_contents): Likewise.
5392 * layout.cc: Include gdb-index.h.
5393 (Layout::Layout): Initialize gdb_index_data_.
5394 (Layout::init_fixed_output_section): Check for .gdb_index section.
5395 (Layout::add_to_gdb_index): New function. Instantiate.
5396 * layout.h: Add forward declaration for class Gdb_index.
5397 (Layout::add_to_gdb_index): New member function.
5398 (Layout::gdb_index_data_): New data member.
5399 * main.cc: Include gdb-index.h.
5400 (main): Print statistics for gdb index.
5401 * object.cc (Object::section_contents): Move code into
5402 do_section_contents.
5403 (need_decompressed_section): Check for sections needed when building
5404 gdb index.
5405 (build_compressed_section_map): Likewise.
5406 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5407 gdb index.
5408 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5409 sections; call Layout::add_to_gdb_index.
5410 (Sized_relobj_file::do_decompressed_section_contents): Call
5411 do_section_contents directly.
5412 * object.h (Object::do_section_contents): Adjust parameter list and
5413 return type.
5414 (Object::do_decompressed_section_contents): Call do_section_contents
5415 directly.
5416 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5417 return type.
5418 * options.h (class General_options): Add --gdb-index option.
5419 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5420 list and return type.
5421 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5422 * reloc.h (Track_relocs::checkpoint): New function.
5423 (Track_relocs::reset): New function.
5424
5425 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5426 New test cases.
5427 * testsuite/Makefile.in: Regenerate.
5428 * testsuite/gdb_index_test.cc: New test source file.
5429 * testsuite/gdb_index_test_1.sh: New test source file.
5430 * testsuite/gdb_index_test_2.sh: New test source file.
5431
647f1574
DK
54322012-03-19 Doug Kwan <dougkwan@google.com>
5433
5434 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5435 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5436 __exidx_start and __exidx_end. Make symbol table parameter
5437 anonymous as it is not used.
5438 * gold.cc (queue_middle_tasks): Call target hook to define any
5439 target-specific symbols.
5440 * target.h (Target::define_standard_symbols): New method.
5441 (Target::do_define_standard_symbols): Same.
5442 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5443 * testsuite/Makefile.in: Regenerate.
5444 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5445 and __exidx_end.
5446 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5447 relocations are generated for __exidx_start and __exidx_end.
5448
7c6109da
DK
54492012-03-16 Doug Kwan <dougkwan@google.com>
5450
5451 * testsuite/Makefile.am: Disable test initpri3b.
5452 * testsuite/Makefile.in: Regenerate.
5453
7b8957f8
DK
54542012-03-15 Doug Kwan <dougkwan@google.com>
5455
5456 * arm.cc (Target_arm::got_section): Make .got section read-only
5457 if -z now is given.
5458
14dc9ef7
ILT
54592012-03-15 Ian Lance Taylor <iant@google.com>
5460
5461 PR gold/13850
5462 * layout.cc (Layout::make_output_section): Correctly mark
5463 SHT_INIT_ARRAY, et. al., as relro.
5464
fa40b62a
DK
54652012-03-14 Doug Kwan <dougkwan@google.com>
5466
5467 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5468 dynamic relocations for protected symbols in shared objects.
5469
fd325007
ILT
54702012-03-13 Ian Lance Taylor <iant@google.com>
5471
5472 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5473 keep the larger alignment.
5474
e8dd54e1
CC
54752012-03-12 Cary Coutant <ccoutant@google.com>
5476
5477 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5478 handling of DW_LNE_define_file.
5479
feb5f3b0
CC
54802012-03-12 Cary Coutant <ccoutant@google.com>
5481
5482 * reduced_debug_output.cc
5483 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5484 codes to switch.
5485
a1fb4256
CC
54862012-02-29 Cary Coutant <ccoutant@google.com>
5487
5488 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5489
5dd8762a
CC
54902012-02-29 Cary Coutant <ccoutant@google.com>
5491
5492 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5493 Call Object::decompressed_section_contents.
5494 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5495 New dtor.
5496 (Sized_dwarf_line_info::buffer_start_): New data member.
5497 * merge.cc (Output_merge_data::do_add_input_section): Call
5498 Object::decompressed_section_contents.
5499 (Output_merge_string::do_add_input_section): Likewise.
5500 * object.cc (need_decompressed_section): New function.
5501 (build_compressed_section_map): Decompress sections needed later.
5502 (Sized_relobj_file::do_decompressed_section_contents): New function.
5503 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5504 * object.h (Object::decompressed_section_contents): New function.
5505 (Object::discard_decompressed_sections): New function.
5506 (Object::do_decompressed_section_contents): New function.
5507 (Object::do_discard_decompressed_sections): New function.
5508 (Compressed_section_info): New type.
5509 (Compressed_section_map): Include decompressed section contents.
5510 (Sized_relobj_file::do_decompressed_section_contents): New function.
5511 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5512
7b5de7ee
CC
55132012-02-16 Cary Coutant <ccoutant@google.com>
5514
5515 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5516 * testsuite/Makefile.in: Regenerate.
5517
f9fa4a63
CC
55182012-02-14 Cary Coutant <ccoutant@google.com>
5519
5520 * options.cc (General_options::finalize): Disallow -pie and -static.
5521
2c175ebc
DK
55222012-02-03 Doug Kwan <dougkwan@google.com>
5523
5524 * arm.cc (Arm_relocate_functions::abs8,
5525 Arm_relocate_functions::abs16): Use
5526 Bits::has_signed_unsigned_overflow32.
5527 (Arm_relocate_functions::thm_abs8): Correct range of
5528 overflow check.
5529 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5530 in assertions.
5531
90cff06f
DK
55322012-02-02 Doug Kwan <dougkwan@google.com>
5533
5534 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5535 position independent outputs, not just shared objects.
5536
63887f3d
L
55372012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5538
5539 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5540 * configure: Regenerated.
5541
bef2b434
ILT
55422012-01-27 Ian Lance Taylor <iant@google.com>
5543
5544 * reloc.h (Bits): New class with static functions, copied from
5545 namespace utils in arm.cc.
5546 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5547 instead.
5548
c335b55d
L
55492012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5550
5551 * incremental.cc (write_info_blocks): Correct relocation offset.
5552
41194d9f
L
55532012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5554
5555 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5556 (Relocate::tls_gd_to_le): Likewise.
5557
1bae613c
L
55582012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5559
5560 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5561
24482ca0
L
55622012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5563
5564 * configure.ac: Check if -mcmodel=medium works.
5565 * configure: Regenerated.
5566
c2c7840a
CC
55672012-01-24 Cary Coutant <ccoutant@google.com>
5568
5569 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5570 definition and ...
5571 (read_unsigned_LEB_128_x): ... this new function.
5572 (read_signed_LEB_128): Replaced with inline definition and ...
5573 (read_signed_LEB_128_x): ... this new function.
5574 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5575 (read_unsigned_LEB_128): Add inline definition.
5576 (read_signed_LEB_128_x): New function.
5577 (read_signed_LEB_128): Add inline definition.
5578 * testsuite/Makefile.am (leb128_unittest): New unit test.
5579 * testsuite/Makefile.in: Regenerate.
5580 * testsuite/leb128_unittest.cc: New unit test.
5581
833de760 55822012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5583
5584 PR gold/13617
5585 * i386.cc (Target_i386::do_code_fill): When using a jmp
5586 instruction, pad with nop instructions.
5587 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5588
618d6666
L
55892012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5590
5591 * x86_64.cc (gc_process_relocs): Add typename on types used in
5592 template.
5593 (scan_relocs): Likewise.
5594 (relocate_section): Likewise.
5595 (apply_relocation): Likewise.
5596
3660ff06
L
55972012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5598
5599 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5600 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5601 under x32.
5602
fc51264f
L
56032012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5604
5605 * x86_64.cc: Initial support for x32.
5606
dd74ae06
CC
56072012-01-03 Cary Coutant <ccoutant@google.com>
5608
5609 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5610 Use abstract base class for GOT.
5611 * gold/output.h (class Output_data_got_base): New abstract base class.
5612 (class Output_data_got): Derive from new base class, adjust ctors.
5613 (Output_data_got::reserve_slot): Make virtual; rename to
5614 do_reserve_slot; Adjust callers.
5615 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5616 pointer to abstract base class.
5617 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5618
83896202
ILT
56192011-12-18 Ian Lance Taylor <iant@google.com>
5620
5621 * object.h (Relobj::local_symbol_value): New function.
5622 (Relobj::local_plt_offset): New function.
5623 (Relobj::local_has_got_offset): New function.
5624 (Relobj::local_got_offset): New function.
5625 (Relobj::set_local_got_offset): New function.
5626 (Relobj::do_local_symbol_value): New pure virtual function.
5627 (Relobj::do_local_plt_offset): Likewise.
5628 (Relobj::do_local_has_got_offset): Likewise.
5629 (Relobj::do_local_got_offset): Likewise.
5630 (Relobj::do_set_local_got_offset): Likewise.
5631 (Sized_relobj::do_local_has_got_offset): Rename from
5632 local_has_got_offset.
5633 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5634 (Sized_relobj::do_set_local_got_offset): Rename from
5635 set_local_got_offset.
5636 (Sized_relobj_file::do_local_plt_offset): Rename from
5637 local_plt_offset.
5638 (Sized_relobj_file::do_local_symbol_value): New function.
5639 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5640 local_plt_offset.
5641 * output.cc (Output_data_got::Got_entry::write): Change object to
5642 Relobj. Use local_symbol_value.
5643 (Output_data_got::add_global_with_rel): Change rel_dyn to
5644 Output_data_reloc_generic*. Use add_global_generic.
5645 (Output_data_got::add_global_with_rela): Remove. Change all
5646 callers to use add_global_with_rel.
5647 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5648 Output_data_reloc_generic*. Use add_global_generic.
5649 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5650 callers to use add_global_pair_with_rel.
5651 (Output_data_got::add_local): Change object to Relobj*.
5652 (Output_data_got::add_local_plt): Likewise.
5653 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5654 change rel_dyn to Output_data_reloc_generic*. Use
5655 add_local_generic.
5656 (Output_data_got::add_local_with_rela): Remove. Change all
5657 callers to use all_local_with_rel.
5658 (Output_data_got::add_local_pair_with_rel): Change object to
5659 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5660 add_output_section_generic.
5661 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5662 callers to use add_local_pair_with_rel.
5663 (Output_data_got::reserve_local): Change object to Relobj*.
5664 * output.h: (class Output_data_reloc_generic): Add pure virtual
5665 declarations for add_global_generic, add_local_generic,
5666 add_output_section_generic.
5667 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5668 functions for Output_data_reloc_generic. Update declarations for
5669 changes listed in output.cc.
5670 (class Output_data_got): Change template parameter to got_size.
5671 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5672 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5673 function.
5674 (Sized_relobj_incr::do_local_plt_offset): New function.
5675 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5676 add_global_generic.
5677
76677ad0
CC
56782011-12-17 Cary Coutant <ccoutant@google.com>
5679
5680 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5681 * resolve.cc (Symbol_table::resolve): Likewise.
5682 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5683 arrays.
5684 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5685
8b8dd8d5
ILT
56862011-12-16 Ian Lance Taylor <iant@google.com>
5687
5688 * output.h (Output_data_reloc_generic::add): Only call
5689 add_dynamic_reloc if this is a dynamic reloc section.
5690
d55525b9
L
56912011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5692
5693 PR gold/13505
5694 * target-reloc.h (apply_relocation): Replace <64, false> with
5695 <size, big_endian>.
5696
ff81c7c1
NC
56972011-11-25 Nick Clifton <nickc@redhat.com>
5698
5699 * po/it.po: New Italian translation.
5700
628f39be
SA
57012011-11-17 Sterling Augustine <saugustine@google.com>
5702
5703 * script.cc (script_include_directive): Implement.
5704 (read_script_file): New local variables name and search_path. Update
5705 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5706 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5707 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5708
98ef3ea4
SA
57092011-11-11 Sterling Augustine <saugustine@google.com>
5710
5711 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5712 (file_or_sections_cmd): Likewise.
5713
f4a8b6d7
DK
57142011-11-11 Doug Kwan <dougkwan@google.com>
5715
5716 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5717 if --just-symbols is given.
5718
29ab395d
DK
57192011-11-10 Doug Kwan <dougkwan@google.com>
5720
5721 PR gold/13362
5722 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5723 when processing data relocs.
5724 * reloc.h (Relocate_functions::rel_unaligned): New method.
5725 (Relocate_functions::pcrel_unaligned): Ditto.
5726 (Relocate_functions::rel32_unaligned): Ditto.
5727 (Relocate_functions::pcrel32_unaligned): Ditto.
5728
2c339f71
DK
57292011-11-09 Doug Kwan <dougkwan@google.com>
5730
5731 PR gold/13362
5732 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5733 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5734 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5735 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5736 (Relocate_functions::rel_unaligned): New.
5737 (Relocate_functions::rel32_unaligned): New.
5738 * target-reloc.h (relocate_for_relocatable): Add code to handle
5739 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5740 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5741 arm_unaligned_reloc_r): New targets.
5742 * testsuite/Makefile.in: Regenerate.
5743 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5744 linking.
5745
3f3cddf1
ILT
57462011-11-02 Ian Lance Taylor <iant@google.com>
5747
5748 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5749 NATIVE_LINKER.
5750 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5751 * options.cc (General_options::finalize): Use library search path
5752 from configure script if specified. If not native and no sysroot,
5753 only search TOOLLIBDIR.
5754 * options.h (Search_directory::Search_directory): Change name to
5755 const std::string&.
5756 (General_options::add_to_library_path_with_sysroot): Change arg to
5757 const std::string&.
5758 * configure, Makefile.in, config.in: Rebuild.
5759
a8e2273b
ILT
57602011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5761
5762 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5763 we are working around the ARM1176 Erratum.
5764 * options.h (General_options::fix_arm1176): Add option.
5765 * testsuite/Makefile.am: Add testcases, and keep current ones
5766 working.
5767 * testsuite/Makefile.in: Regenerate.
5768 * testsuite/arm_fix_1176.s: New file.
5769 * testsuite/arm_fix_1176.sh: Likewise.
5770
cd6eab1c
ILT
57712011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5772
5773 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5774 may_use_blx_.
5775 (Target_arm::may_use_blx): Remove method.
5776 (Target_arm::set_may_use_blx): Likewise.
5777 (Target_arm::may_use_v4t_interworking): New method.
5778 (Target_arm::may_use_v5t_interworking): Likewise.
5779 (Target_arm::may_use_blx_): Remove member variable.
5780 (Arm_relocate_functions::arm_branch_common): Check for v5T
5781 interworking.
5782 (Arm_relocate_functions::thumb_branch_common): Likewise.
5783 (Reloc_stub::stub_type_for_reloc): Likewise.
5784 (Target_arm::do_finalize_sections): Correct interworking checks.
5785 * testsuite/Makefile.am: Add new tests.
5786 * testsuite/Makefile.in: Regenerate.
5787 * testsuite/arm_farcall_arm_arm.s: New test.
5788 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5789 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5790 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5791 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5792 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5793 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5794 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5795
286adcf4
CC
57962011-10-31 Cary Coutant <ccoutant@google.com>
5797
5798 PR gold/13023
5799 * expression.cc (Expression::eval_with_dot): Add
5800 is_section_dot_assignment parameter.
5801 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5802 absolute and assigning to dot within a section.
5803 * script-sections.cc
5804 (Output_section_element_assignment::set_section_addresses): Pass
5805 dot_section to set_if_absolute.
5806 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5807 as is_section_dot_assignment flag to eval_with_dot.
5808 (Output_section_element_dot_assignment::set_section_addresses):
5809 Likewise.
5810 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5811 parameter. Also set value if relative to dot_section; set the
5812 symbol's output_section.
5813 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5814 parameter. Adjust all callers.
5815 (Expression::eval_maybe_dot): Likewise.
5816 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5817 Adjust all callers.
5818 * testsuite/script_test_2.t: Test assignment of an absolute value
5819 to dot within an output section element.
5820
9634ed06
CC
58212011-10-31 Cary Coutant <ccoutant@google.com>
5822
5823 * options.h (class General_options): Add --[no-]gnu-unique options.
5824 * symtab.cc (Symbol_table::sized_write_globals): Convert
5825 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5826
de4101c7
CC
58272011-10-31 Cary Coutant <ccoutant@google.com>
5828
5829 PR gold/13359
5830 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5831 unnecessary assertion.
5832 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5833
7257cc92
ST
58342011-10-31 Sriraman Tallam <tmsriram@google.com>
5835
5836 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5837 gc_mark_symbol.
5838 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5839 gc_mark_symbol.
5840 Change to just keep the section associated with symbol.
5841 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5842 they are externally visible and --export-dynamic is turned on.
5843 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5844
bfc34b3f
ILT
58452011-10-19 Ian Lance Taylor <iant@google.com>
5846
5847 PR gold/13163
5848 * script-sections.cc
5849 (Output_section_element_dot_assignment::needs_output_section): New
5850 function.
5851
ea0d8c47
ILT
58522011-10-19 Ian Lance Taylor <iant@google.com>
5853
5854 PR gold/13204
5855 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5856 --section-start option was seen.
5857 * options.h (General_options::any_section_start): New function.
5858
abd242a9
DM
58592011-10-18 David S. Miller <davem@davemloft.net>
5860
5861 PR binutils/13301
5862 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5863 member to track relocation locations that have moved during TLS
5864 reloc optimizations.
5865 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5866 (Target_sparc::Relocate::relocate): Adjust view down by 4
5867 bytes if it matches reloc_adjust_addr_.
5868 (Target_sparc::Relocate::relocate_tls): Always move the
5869 __tls_get_addr call delay slot instruction forward 4 bytes when
5870 performing relaxation.
5871
bab9090f
CC
58722011-10-18 Cary Coutant <ccoutant@google.com>
5873
5874 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5875 (Output_file::map_no_anonymous): Check for non-zero
5876 return code from posix_fallocate.
5877
f7c5b166
CC
58782011-10-17 Cary Coutant <ccoutant@google.com>
5879
5880 PR gold/13245
5881 * plugin.cc (is_visible_from_outside): Check for symbols
5882 referenced from dynamic objects.
5883 * resolve.cc (Symbol_table::resolve): Don't count references
5884 from dynamic objects as references from real ELF files.
5885 * testsuite/plugin_test_2.sh: Adjust expected result.
5886
b490c0bb
CC
58872011-10-17 Cary Coutant <ccoutant@google.com>
5888
5889 * gold.cc: Include timer.h.
5890 (queue_middle_tasks): Stamp time.
5891 (queue_final_tasks): Likewise.
5892 * main.cc (main): Store timer in parameters. Print timers
5893 for each pass.
5894 * parameters.cc (Parameters::Parameters): Initialize timer_.
5895 (Parameters::set_timer): New function.
5896 (set_parameters_timer): New function.
5897 * parameters.h (Parameters::set_timer): New function.
5898 (Parameters::timer): New function.
5899 (Parameters::timer_): New data member.
5900 (set_parameters_timer): New function.
5901 * timer.cc (Timer::stamp): New function.
5902 (Timer::get_pass_time): New function.
5903 * timer.h (Timer::stamp): New function.
5904 (Timer::get_pass_time): New function.
5905 (Timer::pass_times_): New data member.
5906
f475cf7b
CC
59072011-10-17 Cary Coutant <ccoutant@google.com>
5908
5909 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5910 task for members of lib groups.
5911
cdd7e244
CC
59122011-10-17 Cary Coutant <ccoutant@google.com>
5913
5914 PR gold/13288
4f95c8b4 5915 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5916 (File_read::make_view): Move bounds check (replace with assert)...
5917 (File_read::find_or_make_view): ... to here.
5918
dfb45471
CC
59192011-10-12 Cary Coutant <ccoutant@google.com>
5920
4f95c8b4 5921 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5922 ::read returns less than requested size.
5923
53bbcc1b
CC
59242011-10-10 Cary Coutant <ccoutant@google.com>
5925
4f95c8b4 5926 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5927 Initialize defined_count_.
5928 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5929 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5930 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5931 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5932 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5933 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5934 member.
5935 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5936 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5937 Return zeroes instead of internal error.
5938
397b129b
CC
59392011-10-10 Cary Coutant <ccoutant@google.com>
5940
5941 PR gold/13249
4f95c8b4 5942 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5943 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5944 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5945 (Output_reloc::type_): Adjust size of bit field.
5946 (Output_reloc::use_plt_offset_): New bit field.
5947 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5948 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5949 flag. Adjust all callers.
4f95c8b4 5950 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5951 creating RELATIVE relocations.
5952
d5698657
NC
59532011-10-10 Nick Clifton <nickc@redhat.com>
5954
5955 * po/es.po: Updated Spanish translation.
5956 * po/fi.po: Updated Finnish translation.
5957
6a59a5c2
DN
59582011-10-03 Diego Novillo <dnovillo@google.com>
5959
5960 * options.cc (parse_uint): Fix dereference of RETVAL.
5961
f0558624
ST
59622011-09-29 Sriraman Tallam <tmsriram@google.com>
5963
5964 * layout.h (section_order_map_): New member.
5965 (get_section_order_map): New member function.
5966 * output.cc (Output_section::add_input_section): Check for patterns
5967 only when --section-ordering-file is specified.
5968 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5969 output_sections have been formed.
5970 * layout.cc (Layout_Layout): Initialize section_order_map_.
5971 * plugin.cc (update_section_order): Store order in order_map. Do not
5972 update the order.
5973 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5974 * testsuite/Makefile.in: Regenerate.
5975 * testsuite/plugin_section_order.c: New file.
5976 * testsuite/plugin_final_layout.cc: New file.
5977 * testsuite/plugin_final_layout.sh: New file.
5978
a7dac153
CC
59792011-09-29 Cary Coutant <ccoutant@google.com>
5980
4f95c8b4 5981 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5982 Check for NULL.
4f95c8b4 5983 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5984 symbols during incremental update.
5985 (Symbol_table::add_from_dynobj): Likewise.
5986
eebd87a5
ILT
59872011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5988 Ian Lance Taylor <iant@google.com>
5989
5990 * symtab.cc (Symbol_table::define_special_symbol): Always
5991 canonicalize version string.
5992
403a3331
CC
59932011-09-26 Cary Coutant <ccoutant@google.com>
5994
4f95c8b4
CC
5995 * gold.cc (queue_initial_tasks): Move option checks ...
5996 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5997 some options; make others fatal.
5998
235061c2
CC
59992011-09-26 Cary Coutant <ccoutant@google.com>
6000
6001 gcc PR lto/47247
6002 * plugin.cc (get_symbols_v2): New function.
6003 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6004 (is_referenced_from_outside): New function.
6005 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6006 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6007 (get_symbols): Pass version parameter.
6008 (get_symbols_v2): New function.
6009 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6010 parameter.
6011 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6012 (onload): Add LDPT_GET_SYMBOLS_V2.
6013 (all_symbols_read_hook): Use get_symbols_v2; check for
6014 LDPR_PREVAILING_DEF_IRONLY_EXP.
6015 * testsuite/plugin_test_3.sh: Update expected results.
6016
dc87f620
ILT
60172011-09-23 Simon Baldwin <simonb@google.com>
6018
6019 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6020 configuration options.
6021 * configure: Regenerate.
6022 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6023 * Makefile.in: Regenerate.
6024 * testsuite/Makefile.in: Regenerate.
6025
a8279f82
ST
60262011-09-19 Sriraman Tallam <tmsriram@google.com>
6027
6028 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6029
0c9350c8
CC
60302011-09-19 Cary Coutant <ccoutant@google.com>
6031
6032 * incremental.cc (can_incremental_update): Fix typo in comment.
6033 * incremental.h (can_incremental_update): Likewise.
6034
aa06ae28
CC
60352011-09-18 Cary Coutant <ccoutant@google.com>
6036
6037 * incremental.cc (can_incremental_update): New function.
6038 * incremental.h (can_incremental_update): New function.
6039 * layout.cc (Layout::init_fixed_output_section): Call it.
6040 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6041 * object.cc (Sized_relobj_file::do_layout): Call
6042 can_incremental_update.
6043
ebb300b2
CC
60442011-09-13 Cary Coutant <ccoutant@google.com>
6045
6046 * configure.ac: Check for glibc support for gnu_indirect_function
6047 support with static linking, setting automake conditional
6048 IFUNC_STATIC.
6049 * Makefile.in: Regenerate.
6050 * configure: Regenerate.
6051
6052 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6053 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6054 for IFUNC_STATIC.
6055 * testsuite/Makefile.in: Regenerate.
6056
1206d0d5
CC
60572011-09-13 Cary Coutant <ccoutant@google.com>
6058
6059 * incremental.cc (Sized_relobj_incr::do_layout): Call
6060 report_comdat_group for kept comdat sections.
6061 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6062 * testsuite/Makefile.in: Regenerate.
6063 * testsuite/incr_comdat_test_1.cc: New source file.
6064 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6065 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6066 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6067
40b29874
ILT
60682011-09-13 Ian Lance Taylor <iant@google.com>
6069
6070 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6071 variable external_symbols_offset.
6072
1b045aac
ILT
60732011-09-12 Ian Lance Taylor <iant@google.com>
6074
6075 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6076 triggered if object has no symbols.
6077
24c6c55a
DM
60782011-09-09 David S. Miller <davem@davemloft.net>
6079
6080 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6081 (Output_fill_debug_line::do_write): Likewise.
6082
66570254
CC
60832011-08-29 Cary Coutant <ccoutant@google.com>
6084
6085 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6086 casts to match formatting specs.
6087 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6088
8ea8cd50
CC
60892011-08-26 Cary Coutant <ccoutant@google.com>
6090
6091 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6092 remaining hole size when allocating.
6093 (Layout::make_output_section): Set fill methods for debug sections.
6094 * layout.h (Free_list::Free_list_node): Move from private to
6095 public.
6096 (Free_list::set_min_hole_size): New function.
6097 (Free_list::begin, Free_list::end): New functions.
6098 (Free_list::min_hole_): New data member.
6099 * output.cc: Include dwarf.h.
6100 (Output_fill_debug_info::do_minimum_hole_size): New function.
6101 (Output_fill_debug_info::do_write): New function.
6102 (Output_fill_debug_line::do_minimum_hole_size): New function.
6103 (Output_fill_debug_line::do_write): New function.
6104 (Output_section::Output_section): Initialize new data member.
6105 (Output_section::set_final_data_size): Ensure patch space is larger
6106 than minimum hole size.
6107 (Output_section::do_write): Fill holes in debug sections.
6108 * output.h (Output_fill): New class.
6109 (Output_fill_debug_info): New class.
6110 (Output_fill_debug_line): New class.
6111 (Output_section::set_free_space_fill): New function.
6112 (Output_section::free_space_fill_): New data member.
6113 * testsuite/Makefile.am (incremental_test_3): Add
6114 --incremental-patch option.
6115 (incremental_test_4): Likewise.
6116 (incremental_test_5): Likewise.
6117 (incremental_test_6): Likewise.
6118 (incremental_copy_test): Likewise.
6119 (incremental_common_test_1): Likewise.
6120 * testsuite/Makefile.in: Regenerate.
6121
7cf80422
NC
61222011-08-26 Nick Clifton <nickc@redhat.com>
6123
6124 * po/es.po: Updated Spanish translation.
6125
c3f7b0e5
CC
61262011-08-01 Cary Coutant <ccoutant@google.com>
6127
6128 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6129 * gold/testsuite/Makefile.in: Regenerate.
6130 * gold/testsuite/justsyms_exec.c: New source file.
6131 * gold/testsuite/justsyms_lib.c: New source file.
6132
9590bf25
CC
61332011-08-01 Cary Coutant <ccoutant@google.com>
6134
6135 * layout.cc (Layout::set_segment_offsets): Don't realign text
6136 segment if -Ttext was specified.
6137 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6138 file type.
6139 * object.h (Sized_relobj_file::e_type): New function.
6140 (Sized_relobj_file::e_type_): New data member.
6141 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6142 base address for ET_EXEC files.
6143 * target.cc (Target::do_make_elf_object_implementation): Allow
6144 ET_EXEC files with --just-symbols option.
6145
dcd8d12e
CC
61462011-07-28 Cary Coutant <ccoutant@google.com>
6147
6148 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6149 Add thread_number parameter.
6150 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6151 * workqueue-threads.cc
6152 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6153 current thread if its thread number is greater than desired thread
6154 count.
6155 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6156 Add thread_number parameter.
6157 (Workqueue::should_cancel_thread): Likewise.
6158 (Workqueue::find_runnable_or_wait): Pass thread_number to
6159 should_cancel_thread.
6160 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6161 parameter.
6162
804eb480
ST
61632011-07-22 Sriraman Tallam <tmsriram@google.com>
6164
6165 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6166 only after checking if it cannot be forced local.
6167 * symtab.h (is_externally_visible): Check if the symbol is not forced
6168 local.
6169
f1ddb600
ILT
61702011-07-15 Ian Lance Taylor <iant@google.com>
6171
6172 * options.h (class General_options): Add --print-output-format.
6173 Move -EL next to -EB, for better --help output.
6174 * target-select.cc: Include <cstdio>, "options.h", and
6175 "parameters.h".
6176 (Target_selector::do_target_bfd_name): New function.
6177 (print_output_format): New function.
6178 * target-select.h (class Target_selector): Update declarations.
6179 (Target_selector::target_bfd_name): New function.
6180 (print_output_format): Declare.
6181 * main.cc: Include "target-select.h".
6182 (main): Handle --print-output-format.
6183 * gold.cc: Include "target-select.h".
6184 (queue_initial_tasks): Handle --print-output-format when there are
6185 no input files.
6186 * parameters.cc (parameters_force_valid_target): Give a better
6187 error message if -EB/-EL does not match target.
6188 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6189 function.
6190
7d172687
ILT
61912011-07-15 Ian Lance Taylor <iant@google.com>
6192
6193 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6194 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6195 (Output_data_plt_i386::do_write): Write address of .dynamic
6196 section to first entry in .got.plt section.
6197 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6198 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6199 Initialize layout_.
6200 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6201 section to first entry in .got.plt section.
6202 * layout.h (Layout::dynamic_section): New function.
6203
e9552f7e
ST
62042011-07-13 Sriraman Tallam <tmsriram@google.com>
6205
6206 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6207 to claim_file call.
6208 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6209 input_section_position_, and input_section_glob_.
6210 (read_layout_from_file): Call function section_ordering_specified.
6211 * layout.h (is_section_ordering_specified): New function.
6212 (section_ordering_specified): New function.
6213 (section_ordering_specified_): New boolean member.
6214 * main.cc(main): Call load_plugins after layout object is defined.
6215 * output.cc (Output_section::add_input_section): Use
6216 function section_ordering_specified to check if section ordering is
6217 needed.
6218 * output.cc (Output_section::add_relaxed_input_section): Use
6219 function section_ordering_specified to check if section ordering is
6220 needed.
6221 (Output_section::update_section_layout): New function.
6222 (Output_section::sort_attached_input_sections): Check if input section
6223 must be reordered.
6224 * output.h (Output_section::update_section_layout): New function.
6225 * plugin.cc (get_section_count): New function.
6226 (get_section_type): New function.
6227 (get_section_name): New function.
6228 (get_section_contents): New function.
6229 (update_section_order): New function.
58797674 6230 (allow_section_ordering): New function.
e9552f7e
ST
6231 (Plugin::load): Add the new interfaces to the transfer vector.
6232 (Plugin_manager::load_plugins): New parameter.
6233 (Plugin_manager::all_symbols_read): New parameter.
6234 (Plugin_manager::claim_file): New parameter. Save the elf object for
6235 unclaimed objects.
6236 (Plugin_manager::get_elf_object): New function.
6237 (Plugin_manager::get_view): Change to directly use the bool to check
6238 if get_view is called from claim_file_hook.
6239 * plugin.h (input_objects): New function
6240 (Plugin__manager::load_plugins): New parameter.
6241 (Plugin_manager::claim_file): New parameter.
6242 (Plugin_manager::get_elf_object): New function.
6243 (Plugin_manager::in_claim_file_handler): New function.
6244 (Plugin_manager::in_claim_file_handler_): New member.
6245 (layout): New function.
6246 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6247 handler with an extra parameter. Make the elf object before calling
6248 claim_file handler.
6249 * testsuite/plugin_test.c (get_section_count): New function pointer.
6250 (get_section_type): New function pointer.
6251 (get_section_name): New function pointer.
6252 (get_section_contents): New function pointer.
6253 (update_section_order): New function pointer.
6254 (allow_section_ordering): New function pointer.
6255 (onload): Check if the new interfaces exist.
6256
9446efde
ILT
62572011-07-13 Ian Lance Taylor <iant@google.com>
6258
6259 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6260 relro section.
6261 * x86_64.cc (Target_x86_64::got_section): Likewise.
6262 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6263 (relro_now_test_SOURCES): New variable.
6264 (relro_now_test_DEPENDENCIES): New variable.
6265 (relro_now_test_LDFLAGS): New variable.
6266 (relro_now_test_LDADD): New variable.
6267 (relro_now_test.so): New target.
6268 * testsuite/Makefile.in: Rebuild.
6269
07aa62f2
ILT
62702011-07-12 Ian Lance Taylor <iant@google.com>
6271
6272 PR gold/12980
6273 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6274 GLOB_DAT relocation rather than a RELATIVE relocation for a
6275 protected symbol when creating a shared library.
6276 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6277 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6278 * testsuite/protected_main_1.cc (main): Test that protected
6279 function has same address.
6280
e2153196
ILT
62812011-07-11 Ian Lance Taylor <iant@google.com>
6282
6283 PR gold/12979
6284 * options.h (class General_options): Add -Bgroup.
6285 * options.cc (General_options::finalize): If -Bgroup is set,
6286 default to --unresolved-symbols=report-all.
6287 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6288 * target-reloc.h (issue_undefined_symbol_error): Handle
6289 --unresolved-symbols=report-all.
6290
6daf5215
ILT
62912011-07-08 Ian Lance Taylor <iant@google.com>
6292
6293 PR gold/11985
6294 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6295 if linker script discards key sections.
6296 (Layout::create_dynamic_symtab): Likewise.
6297 (Layout::assign_local_dynsym_offsets): Likewise.
6298 (Layout::sized_create_version_sections): Likewise.
6299 (Layout::create_interp): Likewise.
6300 (Layout::finish_dynamic_section): Likewise.
6301 (Layout::set_dynamic_symbol_size): Likewise.
6302
beabb2c6
ILT
63032011-07-08 Ian Lance Taylor <iant@google.com>
6304
6305 PR gold/12386
6306 * options.h (class General_options): Add --unresolved-symbols.
6307 * target-reloc.h (issue_undefined_symbol_error): Check
6308 --unresolved-symbols. Add comments.
6309
9c16daf1
ILT
63102011-07-08 Ian Lance Taylor <iant@google.com>
6311
6312 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6313 expression more complex.
6314
191f1a2d
ILT
63152011-07-08 Ian Lance Taylor <iant@google.com>
6316
6317 PR gold/11317
6318 * target-reloc.h (issue_undefined_symbol_error): New inline
6319 function, broken out of relocate_section.
6320 (relocate_section): Call issue_undefined_symbol_error.
6321 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6322 there is no TLS segment if we are about to issue an undefined
6323 symbol error.
6324 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6325
62855347
ILT
63262011-07-08 Ian Lance Taylor <iant@google.com>
6327
6328 PR gold/12279
6329 * resolve.cc (Symbol_table::should_override): Add fromtype
6330 parameter. Change all callers. Give error when linking together
6331 TLS and non-TLS symbol.
6332 (Symbol_table::should_override_with_special): Add fromtype
6333 parameter. Change all callers.
6334 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6335 there is no TLS segment if we have reported some errors.
6336 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6337
67181c72
ILT
63382011-07-08 Ian Lance Taylor <iant@google.com>
6339
6340 PR gold/12372
6341 * target.h (Target::plt_address_for_global): New function.
6342 (Target::plt_address_for_local): New function.
6343 (Target::plt_section_for_global): Remove.
6344 (Target::plt_section_for_local): Remove.
6345 (Target::do_plt_address_for_global): New virtual function.
6346 (Target::do_plt_address_for_local): New virtual function.
6347 (Target::do_plt_section_for_global): Remove.
6348 (Target::do_plt_section_for_local): Remove.
6349 (Target::register_global_plt_entry): Add Symbol_table and Layout
6350 parameters.
6351 * output.cc (Output_data_got::Got_entry::write): Use
6352 plt_address_for_global and plt_address_for_local.
6353 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6354 address of output section.
6355 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6356 got_irelative_, and irelative_count_ fields. Update
6357 declarations.
6358 (Output_data_plt_i386::has_irelative_section): New function.
6359 (Output_data_plt_i386::entry_count): Add irelative_count_.
6360 (Output_data_plt_i386::set_final_data_size): Likewise.
6361 (class Target_i386): Add got_irelative_ and rel_irelative_
6362 fields. Update declarations.
6363 (Target_i386::Target_i386): Initialize new fields.
6364 (Target_i386::do_plt_address_for_global): New function replacing
6365 do_plt_section_for_global.
6366 (Target_i386::do_plt_address_for_local): New function replacing
6367 do_plt_section_for_local.
6368 (Target_i386::got_section): Create got_irelative_.
6369 (Target_i386::rel_irelative_section): New function.
6370 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6371 fields. Don't define __rel_iplt_{start,end}.
6372 (Output_data_plt_i386::add_entry): Add symtab and layout
6373 parameters. Change all callers. Use different PLT and GOT for
6374 IFUNC symbols.
6375 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6376 layout parameters. Change all callers. Use different PLT and
6377 GOT.
6378 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6379 (Output_data_plt_i386::rel_irelative): New function.
6380 (Output_data_plt_i386::address_for_global): New function.
6381 (Output_data_plt_i386::address_for_local): New function.
6382 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6383 IRELATIVE GOT when changing IFUNC GOT entries.
6384 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6385 reloc.
6386 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6387 if we didn't create an IRELATIVE GOT.
6388 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6389 plt_address_for_local.
6390 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6391 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6392 got_irelative_, and irelative_count_ fields. Update
6393 declarations.
6394 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6395 Initialize new fields. Remove symtab parameter. Change all
6396 callers.
6397 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6398 irelative_count_.
6399 (Output_data_plt_x86_64::has_irelative_section): New function.
6400 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6401 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6402 fields. Update declarations.
6403 (Target_x86_64::Target_x86_64): Initialize new fields.
6404 (Target_x86_64::do_plt_address_for_global): New function replacing
6405 do_plt_section_for_global.
6406 (Target_x86_64::do_plt_address_for_local): New function replacing
6407 do_plt_section_for_local.
6408 (Target_x86_64::got_section): Create got_irelative_.
6409 (Target_x86_64::rela_irelative_section): New function.
6410 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6411 all callers. Don't create __rel_iplt_{start,end}.
6412 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6413 parameters. Change all callers. Use different PLT and GOT for
6414 IFUNC symbols.
6415 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6416 layout parameters. Change all callers. Use different PLT and
6417 GOT.
6418 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6419 parameters. Change all callers. Use different PLT and GOT for
6420 IFUNC symbols.
6421 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6422 (Output_data_plt_x86_64::rela_irelative): New function.
6423 (Output_data_plt_x86_64::address_for_global): New function.
6424 (Output_data_plt_x86_64::address_for_local): New function.
6425 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6426 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6427 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6428 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6429 parameters.
6430 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6431 reloc.
6432 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6433 symbols if we didn't create an IRELATIVE GOT.
6434 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6435 plt_address_for_local.
6436 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6437 * testsuite/ifuncvar1.c: New test file.
6438 * testsuite/ifuncvar2.c: New test file.
6439 * testsuite/ifuncvar3.c: New test file.
6440 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6441 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6442 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6443 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6444 * testsuite/Makefile.in: Rebuild.
6445
33c15b45
CC
64462011-07-07 Cary Coutant <ccoutant@google.com>
6447
6448 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6449 (two_file_test_1_ndebug.o): Likewise.
6450 (two_file_test_1b_ndebug.o): Likewise.
6451 (two_file_test_2_ndebug.o): Likewise.
6452 (two_file_test_main_ndebug.o): Likewise.
6453 (incremental_test_2): Link with no-debug versions.
6454
f48b5fb7
CC
64552011-07-06 Cary Coutant <ccoutant@google.com>
6456
6457 * gold/incremental.cc
6458 (Output_section_incremental_inputs::write_info_blocks): Check for
6459 hidden and internal symbols.
6460
221597a5
CC
64612011-07-06 Cary Coutant <ccoutant@google.com>
6462
6463 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6464 Check disposition for startup file.
6465 (Incremental_inputs::report_command_line): Ignore
6466 --incremental-startup-unchanged option.
6467 * options.cc (General_options::parse_incremental_startup_unchanged):
6468 New function.
6469 (General_options::General_options): Initialize new data member.
6470 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6471 (General_options): Add --incremental-startup-unchanged option.
6472 (General_options::incremental_startup_disposition): New function.
6473 (General_options::incremental_startup_disposition_): New data member.
6474
e24719f6
CC
64752011-07-06 Cary Coutant <ccoutant@google.com>
6476
6477 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6478 input file index to Script_info ctor.
6479 (Sized_incremental_binary::do_file_has_changed): Find the
6480 command-line argument for files named in scripts.
6481 * incremental.h (Script_info::Script_info): New ctor
6482 with input file index.
6483 (Script_info::input_file_index): New function.
6484 (Script_info::input_file_index_): New data member.
6485 (Incremental_binary::get_library): Add const.
6486 (Incremental_binary::get_script_info): Add const.
6487 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6488 * testsuite/Makefile.am (incremental_test_5): New test case.
6489 (incremental_test_6): New test case.
6490 * testsuite/Makefile.in: Regenerate.
6491
8f7c81e8
CC
64922011-07-06 Cary Coutant <ccoutant@google.com>
6493
6494 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6495 debug output when command lines differ.
6496
9fbd3822
CC
64972011-07-06 Cary Coutant <ccoutant@google.com>
6498
6499 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6500 --incremental-patch option.
6501 * layout.cc (Free_list::allocate): Extend allocation beyond original
6502 end if enabled.
6503 (Layout::make_output_section): Mark sections that should get
6504 patch space.
6505 * options.cc (parse_percent): New function.
6506 * options.h (parse_percent): New function.
6507 (DEFINE_percent): New macro.
6508 (General_options): Add --incremental-patch option.
6509 * output.cc (Output_section::Output_section): Initialize new data
6510 members.
6511 (Output_section::add_input_section): Print section name when out
6512 of patch space.
6513 (Output_section::add_output_section_data): Likewise.
6514 (Output_section::set_final_data_size): Add patch space when
6515 doing --incremental-full.
6516 (Output_section::do_reset_address_and_file_offset): Remove patch
6517 space.
6518 (Output_segment::set_section_list_addresses): Print debug output
6519 only if --incremental-update.
6520 * output.h (Output_section::set_is_patch_space_allowed): New function.
6521 (Output_section::is_patch_space_allowed_): New data member.
6522 (Output_section::patch_space_): New data member.
6523 * parameters.cc (Parameters::incremental_full): New function.
6524 * parameters.h (Parameters::incremental_full): New function
6525 * testsuite/Makefile.am (incremental_test_2): Add test for
6526 --incremental-patch option.
6527 * testsuite/Makefile.in: Regenerate.
6528 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6529 (t18): Remove function body.
6530
f6cccc2c
DK
65312011-07-05 Doug Kwan <dougkwan@google.com>
6532
6533 PR gold/12771
6534 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6535 Arm_Address type for relocation result.
6536 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6537 overflow check.
6538 (Arm_relocate_functions::abs32): Use unaligned access.
6539 (Arm_relocate_functions::rel32): Ditto.
6540 (Arm_relocate_functions::prel31): Ditto.
6541 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6542 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6543 static data relocations.
6544 * testsuite/Makefile.in: Regnerate.
6545 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6546
28a13fec
ILT
65472011-07-05 Ian Lance Taylor <iant@google.com>
6548
6549 PR gold/12392
6550 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6551 symbols if necessary.
6552 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6553
24d47b34
ILT
65542011-07-05 Ian Lance Taylor <iant@google.com>
6555
6556 PR gold/12952
6557 * resolve.cc (Symbol::override_base_with_special): Simply override
6558 version with special symbol version, ignoring previous version.
6559
41f9cbbe
ILT
65602011-07-05 Ian Lance Taylor <iant@google.com>
6561
6562 * object.cc (Sized_relobj_file::include_section_group): Add
6563 information to comment about signature location.
6564
886288f1
ILT
65652011-07-02 Ian Lance Taylor <iant@google.com>
6566
6567 PR gold/12957
6568 * options.h (class General_options): Add -f and -F.
6569 * options.cc (General_options::finalize): Fatal error if -f/-F
6570 are used without -shared.
6571 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6572
ae3a6d4f
ILT
65732011-07-02 Ian Lance Taylor <iant@google.com>
6574
6575 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6576
21131061
ILT
65772011-07-01 Ian Lance Taylor <iant@google.com>
6578
6579 PR gold/12525
6580 PR gold/12952
6581 * resolve.cc (Symbol::override_base_with_special): Don't override
6582 the version if the overriding symbol has a different name.
6583 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6584 all callers. If we give an error about an undefined version,
6585 define the base version if necessary.
6586 * dynobj.h (class Versions): Update declaration.
6587 * testsuite/weak_alias_test_5.cc: New file.
6588 * testsuite/weak_alias_test.script: New file.
6589 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6590 and versioned_alias have the right value, and call t2.
6591 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6592 weak_alias_test_5.so.
6593 (weak_alias_test_LDADD): Likewise.
6594 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6595 * testsuite/Makefile.in: Rebuild.
6596
611062c0
ILT
65972011-07-01 Ian Lance Taylor <iant@google.com>
6598
6599 PR gold/12525
6600 * options.h (class General_options): Support -z notext.
6601 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6602 -Wl,-z,notext.
6603 (two_file_shared_nonpic.so): Likewise.
6604 (two_file_shared_mixed.so): Likewise.
6605 (two_file_shared_mixed_1.so): Likewise.
6606 (weak_undef_lib_nonpic.so): Likewise.
6607 (alt/weak_undef_lib_nonpic.so): Likewise.
6608 (tls_test_shared_nonpic.so): Likewise.
6609 * testsuite/Makefile.in: Rebuild.
6610
328c7c2f
ILT
66112011-07-01 Ian Lance Taylor <iant@google.com>
6612
6613 PR gold/12525
6614 * configure.ac: Test whether static linking works, setting
6615 the automake conditional HAVE_STATIC.
6616 * testsuite/Makefile.am: Disable tests using -static if
6617 HAVE_STATIC is not true.
6618 * configure, testsuite/Makefile.in: Rebuild.
6619
02d7cd44
ILT
66202011-07-01 Ian Lance Taylor <iant@google.com>
6621
6622 PR gold/12525
6623 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6624 Assert if we see DW_EH_PE_indirect.
6625 * target.h (Target::ehframe_datarel_base): New function.
6626 (Target::do_ehframe_datarel_base): New target function.
6627 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6628 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6629 function.
6630
07a60597
ILT
66312011-07-01 Ian Lance Taylor <iant@google.com>
6632
6633 PR gold/12571
6634 * options.h (class General_options): Add
6635 --ld-generated-unwind-info.
6636 * ehframe.cc (Fde::write): Add address parameter. Change all
6637 callers. If associated with PLT, fill in address and size.
6638 (Cie::set_output_offset): Only add merge mapping if there is an
6639 object.
6640 (Cie::write): Add address parameter. Change all callers.
6641 (Eh_frame::add_ehframe_for_plt): New function.
6642 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6643 input_offset_ fields into union u_, with new plt field.
6644 (Fde::Fde): Adjust for new union field.
6645 (Fde::Fde) [Output_data version]: New constructor.
6646 (Fde::add_mapping): Only add merge mapping if there is an object.
6647 (class Cie): Update declarations.
6648 (class Eh_frame): Declare add_ehframe_for_plt.
6649 * layout.cc (Layout::layout_eh_frame): Break out code into
6650 make_eh_frame_section, and call it.
6651 (Layout::make_eh_frame_section): New function.
6652 (Layout::add_eh_frame_for_plt): New function.
6653 * layout.h (class Layout): Update declarations.
6654 * merge.cc (Merge_map::add_mapping): Add assertion.
6655 * i386.cc: Include "dwarf.h".
6656 (class Output_data_plt_i386): Make first_plt_entry,
6657 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6658 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6659 and plt_eh_frame_fde.
6660 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6661 boundary. Call add_eh_frame_for_plt if appropriate.
6662 * x86_64.cc: Include "dwarf.h".
6663 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6664 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6665 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6666 and plt_eh_frame_fde.
6667 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6668 appropriate.
6669
14788a3f
ILT
66702011-06-29 Ian Lance Taylor <iant@google.com>
6671
6672 PR gold/12629
6673 * object.cc (Sized_relobj_file::layout_section): Change shdr
6674 parameter to be const.
6675 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6676 out of do_layout.
6677 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6678 appropriate. Call layout_eh_frame_section.
6679 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6680 sections.
6681 * object.h (class Sized_relobj_file): Update declarations.
6682
6c21fce1
ILT
66832011-06-29 Ian Lance Taylor <iant@google.com>
6684
37e41b03 6685 PR gold/12652
6c21fce1
ILT
6686 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6687 modifier.
6688 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6689
4d5e4e62
ILT
66902011-06-29 Ian Lance Taylor <iant@google.com>
6691
6692 PR gold/12675
6693 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6694 SHT_X86_64_UNWIND.
6695 * layout.cc (Layout::layout_eh_frame): Likewise.
6696
886f533a
ILT
66972011-06-29 Ian Lance Taylor <iant@google.com>
6698
6699 PR gold/12695
6700 * layout.cc (Layout::symtab_section_shndx): New function.
6701 * layout.h (class Layout): Declare symtab_section_shndx.
6702 * output.cc (Output_section::write_header): Call it.
6703
f3ae1b28
ILT
67042011-06-29 Ian Lance Taylor <iant@google.com>
6705
6706 PR gold/12818
6707 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6708 symbols which are not used in a relocation.
6709
aecf301f
ILT
67102011-06-28 Ian Lance Taylor <iant@google.com>
6711
6712 PR gold/12898
6713 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6714 script create indistinguishable segments.
6715 (Layout::set_segment_offsets): Use stable_sort when sorting
6716 segments. Pass this to Compare_segments constructor.
6717 * layout.h (class Layout): Make segment_precedes non-static.
6718 (class Compare_segments): Change from struct to class. Add
6719 layout_ field. Add constructor.
6720 * script-sections.cc
6721 (Script_sections::attach_sections_using_phdrs_clause): Rename
6722 local orphan to is_orphan. Don't report failure to put empty
6723 section in segment. On attachment failure, report name of
6724 section, and attach to first PT_LOAD segment.
6725
03ef7571
ILT
67262011-06-28 Ian Lance Taylor <iant@google.com>
6727
6728 PR gold/12934
6729 * target-select.cc (Target_selector::Target_selector): Add
6730 emulation parameter. Change all callers.
6731 (select_target_by_bfd_name): Rename from select_target_by_name.
6732 Change all callers.
6733 (select_target_by_emulation): New function.
6734 (supported_emulation_names): New function.
6735 * target-select.h (class Target_selector): Add emulation_ field.
6736 Update declarations.
6737 (Target_selector::recognize_by_bfd_name): Rename from
6738 recognize_by_name. Change all callers.
6739 (Target_selector::supported_bfd_names): Rename from
6740 supported_names. Change all callers.
6741 (Target_selector::recognize_by_emulation): New function.
6742 (Target_selector::supported_emulations): New function.
6743 (Target_selector::emulation): New function.
6744 (Target_selector::do_recognize_by_bfd_name): Rename from
6745 do_recognize_by_name. Change all callers.
6746 (Target_selector::do_supported_bfd_names): Rename from
6747 do_supported_names. Change all callers.
6748 (Target_selector::do_recognize_by_emulation): New function.
6749 (Target_selector::do_supported_emulations): New function.
6750 (select_target_by_bfd_name): Change name in declaration.
6751 (select_target_by_emulation): Declare.
6752 (supported_emulation_names): Declare.
6753 * parameters.cc (parameters_force_valid_target): Try to find
6754 target based on emulation from -m option.
6755 * options.h (class General_options): Change doc string for -m.
6756 * options.cc (help): Print emulations.
6757 (General_options::parse_V): Likewise.
6758 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6759 Add emulation parameter. Change all callers.
6760
200b2bb9
ILT
67612011-06-28 Ian Lance Taylor <iant@google.com>
6762
6763 * target.h (class Target): Add osabi_ field.
6764 (Target::osabi): New function.
6765 (Target::set_osabi): New function.
6766 (Target::Target): Initialize osabi_.
6767 (Target::do_adjust_elf_header): Make pure virtual.
6768 (Sized_target::do_adjust_elf_header): Declare.
6769 * target.cc (Sized_target::do_adjust_elf_header): New function.
6770 (class Sized_target): Instantiate all versions.
6771 * freebsd.h (class Target_freebsd): Remove.
6772 (Target_selector_freebsd::do_recognize): Call set_osabi on
6773 Target.
6774 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6775 (Target_selector_freebsd::set_osabi): Remove.
6776 * i386.cc (class Target_i386): Inherit from Sized_target rather
6777 than Target_freebsd.
6778 * x86_64.cc (class Target_x86_64): Likewise.
6779
b3ce541e
ILT
67802011-06-28 Ian Lance Taylor <iant@google.com>
6781
6782 * target.h (Target::can_check_for_function_pointers): Rewrite.
6783 Make non-virtual.
6784 (Target::can_icf_inline_merge_sections): Likewise.
6785 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6786 (Target::Target_info): Add can_icf_inline_merge_sections field.
6787 (Target::do_can_check_for_function_pointers): New virtual
6788 function.
6789 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6790 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6791 from can_check_for_function_pointers, move in file.
6792 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6793 section_may_have_icf_unsafe_poineters, move in file.
6794 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6795 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6796 Rename from can_check_for_function_pointers, move in file.
6797 (Target_i386::can_icf_inline_merge_sections): Remove.
6798 (Target_i386::i386_info): Initialize
6799 can_icf_inline_merge_sections.
6800 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6801 Initialize can_icf_inline_merge_sections.
6802 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6803 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6804 Rename from can_check_for_function_pointers, move in file.
6805 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6806 (Target_x86_64::x86_64_info): Initialize
6807 can_icf_inline_merge_sections.
6808 * testsuite/testfile.cc (Target_test::test_target_info):
6809 Likewise.
6810 * icf.cc (get_section_contents): Correct formatting.
6811
6d1c4efb
ILT
68122011-06-27 Ian Lance Taylor <iant@google.com>
6813
6814 * symtab.cc (Symbol::versioned_name): New function.
6815 (Symbol_table::add_to_final_symtab): Use versioned_name when
6816 appropriate.
6817 (Symbol_table::sized_write_symbol): Likewise.
6818 * symtab.h (class Symbol): Declare versioned_name.
6819 * stringpool.h (class Stringpool_template): Add variant of add
6820 which takes a std::basic_string.
6821 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6822 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6823 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6824 (ver_test_12.o): New target.
6825 * testsuite/Makefile.in: Rebuild.
6826
57eb9b50
DK
68272011-06-27 Doug Kwan <dougkwan@google.com>
6828
6829 * arm.cc (Arm_relocate_functions::thm_jump8,
6830 Arm_relocate_functions::thm_jump11): Use a wider signed
6831 type to compute offset.
6832 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6833 arm_thm_jump8.
6834 * testsuite/Makefile.in: Regenerate.
6835 * testsuite/arm_branch_in_range.sh: Check test results of
6836 arm_thm_jump11 and arm_thm_jump8.
6837 * testsuite/arm_thm_jump11.s: New test source file.
6838 * testsuite/arm_thm_jump11.t: New linker script.
6839 * testsuite/arm_thm_jump8.s: New test source file.
6840 * testsuite/arm_thm_jump8.t: New linker script.
6841
487b39df
ILT
68422011-06-24 Ian Lance Taylor <iant@google.com>
6843
6844 * layout.cc: Include "object.h".
6845 (ctors_sections_in_init_array): New static variable.
6846 (Layout::is_ctors_in_init_array): New function.
6847 (Layout::layout): Add entry to ctors_sections_in_init_array if
6848 appropriate.
6849 * layout.h (class Layout): Declare is_ctors_in_init_array.
6850 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6851 is_ctors_reverse_view is set.
6852 (Sized_relobj_file::write_sections): Add layout parameter. Change
6853 all callers. Set is_ctors_reverse_view field of View_size.
6854 (Sized_relobj_file::reverse_words): New function.
6855 * object.h (Sized_relobj_file::View_size): Add
6856 is_ctors_reverse_view field.
6857 (class Sized_relobj_file): Update declarations.
6858 * testsuite/initpri3.c: New test.
6859 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6860 initpri3b.
6861 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6862 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6863 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6864 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6865 * testsuite/Makefile.in: Rebuild.
6866
472076e4
CC
68672011-06-24 Cary Coutant <ccoutant@google.com>
6868
6869 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6870 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6871 (debug_msg_cdebug.err): New targets.
6872 * testsuite/Makefile.in: Regenerate.
6873 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6874 Fix checks for link with shared library.
6875
a60af0db
DK
68762011-06-24 Doug Kwan <dougkwan@google.com>
6877
6878 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6879 skip empty text sections.
6880 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6881
5393d741
ILT
68822011-06-22 Ian Lance Taylor <iant@google.com>
6883
6884 PR gold/12910
6885 * options.h (class General_options): Add --ctors-in-init-array.
6886 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6887 friends as SHT_PROGBITS for merging sections.
6888 (Layout::layout): Remove special handling of .init_array and
6889 friends. Don't sort if doing relocatable link. Sort for .ctors
6890 and .dtors if ctors_in_init_array.
6891 (Layout::make_output_section): Force correct section types for
6892 .init_array and friends. Don't sort if doing relocatable link,
6893 Don't sort .ctors and .dtors if ctors_in_init_array.
6894 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6895 (Layout::output_section_name): Add relobj parameter. Change all
6896 callers. Handle .ctors. and .dtors. in code rather than table.
6897 Handle .ctors and .dtors if ctors_in_init_array.
6898 (Layout::match_file_name): New function, moved from output.cc.
6899 * layout.h (class Layout): Update declarations.
6900 * output.cc: Include "layout.h".
6901 (Input_section_sort_entry::get_priority): New function.
6902 (Input_section_sort_entry::match_file_name): Just call
6903 Layout::match_file_name.
6904 (Output_section::Input_section_sort_init_fini_compare::operator()):
6905 Handle .ctors and .dtors. Sort by explicit priority rather than
6906 by name.
6907 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6908 * testsuite/initpri2.c: New test.
6909 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6910 (check_PROGRAMS): Add initpri2.
6911 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6912 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6913 * configure, testsuite/Makefile.in: Rebuild.
6914
e1f74f98
ILT
69152011-06-19 Ian Lance Taylor <iant@google.com>
6916
6917 PR gold/12880
6918 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6919 .interp section to a PT_INTERP segment even if we have seen a
6920 --dynamic-linker option. Don't do it if we have seen a PHDRS
6921 clause in a linker script.
6922 (Layout::finalize): Don't create a .interp section if we've
6923 already create a PT_INTERP segment.
6924 (Layout::create_interp): Always call choose_output_section (revert
6925 patch of 2011-06-17). Don't create PT_INTERP segment.
6926 * script-sections.cc
6927 (Script_sections::create_note_and_tls_segments): Add a .interp
6928 section to a PT_INTERP segment even if we have seen a
6929 --dynamic-linker option.
6930
766f91bb
ILT
69312011-06-18 Ian Lance Taylor <iant@google.com>
6932
6933 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6934 merely because a non-PT_LOAD segment has a dynamic reloc.
6935
0d212c3a
ILT
69362011-06-18 Ian Lance Taylor <iant@google.com>
6937
6938 * layout.cc (Layout::finish_dynamic_section): Don't create
6939 DT_FLAGS entry if not needed.
6940
911a5072
ILT
69412011-06-18 Ian Lance Taylor <iant@google.com>
6942
6943 PR gold/12745
6944 * layout.cc (Layout::layout_eh_frame): Correct handling of
6945 writable .eh_frame section.
6946
534b4e5f
ILT
69472011-06-17 Ian Lance Taylor <iant@google.com>
6948
6949 PR gold/12893
6950 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6951 symbol is redefined with the exact same object and value.
6952
10b4f102
ILT
69532011-06-17 Ian Lance Taylor <iant@google.com>
6954
6955 PR gold/12880
6956 * layout.h (class Layout): Add interp_segment_ field.
6957 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6958 (Layout::attach_allocated_section_to_segment): If making shared
6959 library, put .interp section in PT_INTERP segment.
6960 (Layout::finalize): Also call create_interp if -dynamic-linker
6961 option was used.
6962 (Layout::create_interp): Assert that there is no PT_INTERP
6963 segment. If not using a SECTIONS clause, use make_output_section.
6964 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6965 * script-sections.cc
6966 (Script_sections::create_note_and_tls_segments): If making shared
6967 library, put .interp section in PT_INTERP segment.
6968
a29b0dad
ILT
69692011-06-17 Ian Lance Taylor <iant@google.com>
6970
e588ea8d
ILT
6971 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6972 when making a shared library.
6973
69742011-06-17 Ian Lance Taylor <iant@google.com>
6975
6976 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6977 parameter. Change all callers. Don't issue warning about PC32
6978 against locally defined symbol.
a29b0dad 6979
9d3b0698
ILT
69802011-06-16 Ian Lance Taylor <iant@google.com>
6981
6982 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6983 occurs in same object.
6984
85b0f90c
AM
69852011-06-14 Alan Modra <amodra@gmail.com>
6986
6987 * po/POTFILES.in: Regenerate.
6988
a94907d9
ILT
69892011-06-09 Ian Lance Taylor <iant@google.com>
6990
6991 * script-sections.cc
6992 (Orphan_output_section::set_section_addresses): For a relocatable
6993 link set address to 0.
6994
4fb3a1c3
CC
69952011-06-09 Cary Coutant <ccoutant@google.com>
6996
6997 PR gold/12804
6998 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6999 used with --compress-debug-sections.
7000 * gold/object.cc (Sized_relobj_file::do_layout): Report
7001 uncompressed size of compressed input sections.
7002
61220854
CC
70032011-06-08 Cary Coutant <ccoutant@google.com>
7004
7005 PR gold/12804
7006 * testsuite/two_file_test_2_v1.cc: Change initialization of
7007 v2 to keep it in .data.
7008
e6455dfb
CC
70092011-06-07 Cary Coutant <ccoutant@google.com>
7010
7011 * common.cc (Symbol_table::do_allocate_commons_list): Call
7012 gold_fallback.
7013 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7014 (Errors::fallback): New function.
7015 (gold_fallback): New function.
7016 * errors.h (Errors::fallback): New function.
7017 * gold.cc (gold_exit): Change status parameter to enum; adjust
7018 all callers.
7019 (queue_initial_tasks): Call gold_fallback.
7020 * gold.h: Include cstdlib.
7021 (Exit_status): New enum type.
7022 (gold_exit): Change status parameter to enum.
7023 (gold_fallback): New function.
7024 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7025 (Layout::create_symtab_sections): Likewise.
7026 (Layout::create_shdrs): Likewise.
7027 * main.cc (main): Adjust call to gold_exit.
7028 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7029 (Output_data_got::add_got_entry_pair): Likewise.
7030 (Output_section::add_input_section): Likewise.
7031 (Output_section::add_output_section_data): Likewise.
7032 (Output_segment::set_section_list_addresses): Likewise.
7033 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7034
fb0e076f
CC
70352011-06-07 Cary Coutant <ccoutant@google.com>
7036
7037 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7038 for incremental links.
7039 * output.cc (Output_segment::set_section_list_addresses): Remove
7040 FIXME and test for TLS or BSS.
7041
a5ee4d5d
CC
70422011-06-07 Cary Coutant <ccoutant@google.com>
7043
7044 * testsuite/Makefile.am: Add incremental_copy_test,
7045 incremental_common_test_1.
7046 * testsuite/Makefile.in: Regenerate.
7047 * testsuite/common_test_1_v1.c: New source file.
7048 * testsuite/common_test_1_v2.c: New source file.
7049 * testsuite/copy_test_v1.cc: New source file.
7050
5146f448
CC
70512011-06-07 Cary Coutant <ccoutant@google.com>
7052
7053 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7054 update, allocate common from bss section's free list.
7055 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7056 linker-defined symbols.
7057 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7058 Skip GOT and PLT entries that are no longer referenced.
7059 (Output_section_incremental_inputs::write_info_blocks): Mark
7060 linker-defined symbols.
7061 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7062 * output.cc (Output_section::allocate): New function.
7063 * output.h (Output_section::allocate): New function.
7064 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7065 linker-defined symbols.
7066 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7067 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7068 (Symbol::init_base_output_data): Likewise.
7069 (Symbol::init_base_output_segment): Likewise.
7070 (Symbol::init_base_constant): Likewise.
7071 (Sized_symbol::init_output_data): Likewise.
7072 (Sized_symbol::init_output_segment): Likewise.
7073 (Sized_symbol::init_constant): Likewise.
7074 (Symbol_table::do_define_in_output_data): Likewise.
7075 (Symbol_table::do_define_in_output_segment): Likewise.
7076 (Symbol_table::do_define_as_constant): Likewise.
7077 * symtab.h (Symbol::is_predefined): New function.
7078 (Symbol::init_base_output_data): Add is_predefined parameter.
7079 (Symbol::init_base_output_segment): Likewise.
7080 (Symbol::init_base_constant): Likewise.
7081 (Symbol::is_predefined_): New data member.
7082 (Sized_symbol::init_output_data): Add is_predefined parameter.
7083 (Sized_symbol::init_output_segment): Likewise.
7084 (Sized_symbol::init_constant): Likewise.
7085 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7086
26d3c67d
CC
70872011-06-07 Cary Coutant <ccoutant@google.com>
7088
7089 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7090 instead of emit_copy_reloc.
7091 (Copy_relocs::emit_copy_reloc): Refactor.
7092 (Copy_relocs::make_copy_reloc): New function.
7093 (Copy_relocs::add_copy_reloc): Remove.
7094 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7095 section.
7096 (Copy_relocs::make_copy_reloc): New function.
7097 (Copy_relocs::add_copy_reloc): Remove.
7098 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7099 unchanged input files.
7100 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7101 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7102 Reserve BSS space for COPY relocations.
7103 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7104 (Output_section_incremental_inputs::write_info_blocks): Record
7105 whether a symbol is copied from a shared object.
7106 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7107 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7108 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7109 (Incremental_input_entry_reader::get_output_symbol_index): Add
7110 is_copy parameter.
7111 (Incremental_binary::emit_copy_relocs): New function.
7112 (Incremental_binary::do_emit_copy_relocs): New function.
7113 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7114 new data member.
7115 (Sized_incremental_binary::add_copy_reloc): New function.
7116 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7117 (Sized_incremental_binary::Copy_reloc): New struct.
7118 (Sized_incremental_binary::Copy_relocs): New typedef.
7119 (Sized_incremental_binary::copy_relocs_): New data member.
7120 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7121 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7122 * target.h (Sized_target::emit_copy_reloc): New function.
7123 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7124
7cdb37d9
CC
71252011-06-02 Cary Coutant <ccoutant@google.com>
7126
7127 PR gold/12163
7128 * gold/archive.cc (Archive::Archive): Initialize new data member.
7129 (Archive::include_all_members): Return if archive has already been
7130 included.
7131 * gold/archive.h (Archive::include_all_members_): New data member.
7132
cc643b88
NC
71332011-06-02 Nick Clifton <nickc@redhat.com>
7134
7135 * dynobj.h: Fix spelling mistake in comment.
7136 * output.cc: Likewise.
7137
f62a3ca7 71382011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7139 Asier Llano
f62a3ca7
DK
7140
7141 PR gold/12826
cc643b88 7142 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7143 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7144 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7145 redundant arm_exidx_test.so.
7146 * testsuite/Makefile.in: Regenerate.
7147 (check_SCRIPTS): Add pr12826.sh
7148 (check_DATA): Add pr12826.stdout
7149 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7150 * testsuite/pr12826.sh: New file.
7151 * testsuite/pr12826_1.s: Ditto.
7152 * testsuite/pr12826_1.s: Ditto.
7153
8dbe1edc
ILT
71542011-05-30 Ian Lance Taylor <iant@google.com>
7155
7156 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7157 sections.
7158
c49875be
ILT
71592011-05-29 Ian Lance Taylor <iant@google.com>
7160
7161 PR gold/12804
7162 * testsuite/Makefile.am: Use different file name for two_file_test
7163 temporary file for each incremental test.
7164 * testsuite/Makefile.in: Rebuild.
7165
69d53f7a
ILT
71662011-05-29 Ian Lance Taylor <iant@google.com>
7167
7168 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7169 binary input file is empty.
7170
41d0ab5f
ILT
71712011-05-27 Ian Lance Taylor <iant@google.com>
7172
7173 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7174 (ver_test_9.so): Likewise.
7175 * testsuite/Makefile.in: Rebuild.
7176
89d8a36b
CC
71772011-05-26 Cary Coutant <ccoutant@google.com>
7178
7179 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7180 * incremental.cc (Incremental_inputs::report_input_section): Fix
7181 comment, indentation.
7182 (Incremental_inputs::report_comdat_group): New function.
7183 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7184 of data for incremental input file entry.
7185 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7186 group count, COMDAT group signatures.
7187 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7188 an unchanged input file.
7189 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7190 Initialize new data member.
7191 (Incremental_object_entry::add_comdat_group): New function.
7192 (Incremental_object_entry::get_comdat_group_count): New function.
7193 (Incremental_object_entry::get_comdat_signature_key): New function.
7194 (Incremental_object_entry::groups_): New data member.
7195 (Incremental_inputs::report_comdat_group): New function.
7196 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7197 data for incremental input file entry.
7198 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7199 (Incremental_input_entry_reader::get_input_section): Adjust size of
7200 data for incremental input file entry.
7201 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7202 (Incremental_input_entry_reader::get_comdat_group_signature): New
7203 function.
7204 * object.cc (Sized_relobj::include_section_group): Report kept
7205 COMDAT groups for incremental links.
7206
1706a06f
ILT
72072011-05-24 David Meyer <pdox@google.com>
7208
7209 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7210 with name parameter. Add found_name parameter.
7211 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7212 * dirsearch.h (class Dirsearch): Update declaration.
7213
a10ae760
ILT
72142011-05-24 Ian Lance Taylor <iant@google.com>
7215
7216 * archive.cc (Library_base::should_include_member): Pull in object
7217 from archive if it defines the entry symbol.
7218 * parameters.cc (Parameters::entry): New function.
7219 * parameters.h (class Parameters): Declare entry.
7220 * output.h (class Output_file_header): Remove entry_ field.
7221 * output.cc (Output_file_header::Output_file_header): Remove entry
7222 parameter. Change all callers.
7223 (Output_file_header::entry): Use parameters->entry.
7224 * gold.cc (queue_middle_tasks): Likewise.
7225 * plugin.cc (Plugin_hook::run): Likewise.
7226
aa92d6ed
CC
72272011-05-24 Cary Coutant <ccoutant@google.com>
7228
7229 * gold.cc (queue_initial_tasks): Pass incremental base filename
7230 to Output_file::open_base_file; don't print error message.
7231 * incremental-dump.cc (main): Adjust call to
7232 Output_file::open_for_modification.
7233 * incremental-dump.cc (main): Likewise.
7234 * incremental.cc (Incremental_inputs::report_command_line):
7235 Ignore --incremental-base option when comparing command lines.
7236 Ignore parameter when given as separate argument.
7237 * options.h (class General_options): Add --incremental-base.
7238 * output.cc (Output_file::Output_file):
7239 (Output_file::open_base_file): Add base_name and writable parameters;
7240 read base file into new file; print error message here.
7241 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7242 callers.
7243 * output.h (Output_file::open_for_modification): Rename to...
7244 (Output_file::open_base_file): ...this; add base_name and
7245 writable parameters; adjust all callers.
7246 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7247 callers.
7248 * testsuite/Makefile.am (incremental_test_4): Test
7249 --incremental-base.
7250 * testsuite/Makefile.in: Regenerate.
7251
2eedd706
CC
72522011-05-24 Cary Coutant <ccoutant@google.com>
7253
7254 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7255 incremental_test_4.
7256 * testsuite/Makefile.in: Regenerate.
7257 * testsuite/two_file_test_1_v1.cc: New test source file.
7258 * testsuite/two_file_test_1b_v1.cc: New test source file.
7259 * testsuite/two_file_test_2_v1.cc: New test source file.
7260
0f1c85a6
CC
72612011-05-24 Cary Coutant <ccoutant@google.com>
7262
7263 * dynobj.h (Dynobj::do_dynobj): New function.
7264 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7265 flag and soname for shared objects.
7266 * incremental.cc (Incremental_inputs::report_object): Make
7267 either Incremental_object_entry or Incremental_dynobj_entry; add
7268 soname to string table.
7269 (Incremental_inputs::report_input_section): Add assertion.
7270 (Output_section_incremental_inputs::set_final_data_size): Adjust
7271 type of input file entry for shared libraries; adjust size of
7272 shared library info entry.
7273 (Output_section_incremental_inputs::write_input_files): Write
7274 as_needed flag for shared libraries.
7275 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7276 of input file entry for shared libraries; write soname.
7277 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7278 soname from incremental info.
7279 * incremental.h (enum Incremental_input_flags): Add
7280 INCREMENTAL_INPUT_AS_NEEDED.
7281 (Incremental_input_entry::Incremental_input_entry): Initialize new
7282 data member.
7283 (Incremental_input_entry::set_as_needed): New function.
7284 (Incremental_input_entry::as_needed): New function.
7285 (Incremental_input_entry::do_dynobj_entry): New function.
7286 (Incremental_input_entry::as_needed_): New data member.
7287 (Incremental_object_entry::Incremental_object_entry): Don't check
7288 for shared library.
7289 (Incremental_object_entry::do_type): Likewise.
7290 (class Incremental_dynobj_entry): New class.
7291 (Incremental_input_entry_reader::as_needed): New function.
7292 (Incremental_input_entry_reader::get_soname): New function.
7293 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7294 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7295 size of shared library info entry.
58797674 7296 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7297 incremental link when adding DT_NEEDED entries.
7298 * object.h (Object::Object): Initialize new data member.
7299 (Object::dynobj): New function.
7300 (Object::set_as_needed): New function.
7301 (Object::as_needed): New function.
7302 (Object::do_dynobj): New function.
7303 (Object::as_needed_): New data member.
7304
6fa2a40b
CC
73052011-05-24 Cary Coutant <ccoutant@google.com>
7306
7307 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7308 info; adjust display of GOT entries.
7309 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7310 vector of input objects; remove file_status_.
7311 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7312 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7313 got_plt reader; call target hooks to reserve GOT entries.
7314 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7315 of input file info header and GOT info entry.
7316 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7317 relocation info.
7318 (Got_plt_view_info::got_descriptor): Remove.
7319 (Got_plt_view_info::sym_index): New data member.
7320 (Got_plt_view_info::input_index): New data member.
7321 (Local_got_offset_visitor::visit): Write input file index.
7322 (Global_got_offset_visitor::visit): Write 0 for input file index.
7323 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7324 with sym_index and input_index.
7325 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7326 incremental info GOT entry; replace got_descriptor with input_index.
7327 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7328 map from input file index to object.
7329 (Sized_relobj_incr::do_layout): Replace direct data member reference
7330 with accessor function.
7331 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7332 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7333 Adjust size of input file info header.
7334 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7335 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7336 (Incremental_input_entry_reader::get_input_section): Adjust size of
7337 input file info header.
7338 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7339 of incremental info GOT entry.
7340 (Incremental_got_plt_reader::get_got_desc): Remove.
7341 (Incremental_got_plt_reader::get_got_symndx): New function.
7342 (Incremental_got_plt_reader::get_got_input_index): New function.
7343 (Sized_incremental_binary::Sized_incremental_binary): Remove
7344 file_status_; add input_objects_.
7345 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7346 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7347 (Sized_incremental_binary::file_is_unchanged): Remove.
7348 (Sized_incremental_binary::set_input_object): New function.
7349 (Sized_incremental_binary::input_object): New function.
7350 (Sized_incremental_binary::file_status_): Remove.
7351 (Sized_incremental_binary::input_objects_): New data member.
7352 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7353 references.
7354 (Sized_relobj_incr::invalid_address): Move to base class.
7355 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7356 class.
7357 (Sized_relobj_incr::do_output_section_offset): Likewise.
7358 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7359 (Sized_relobj_incr::section_offsets_): Likewise.
7360 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7361 function.
7362 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7363 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7364 with accessor function.
7365 (Sized_relobj_file::do_layout): Likewise.
7366 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7367 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7368 (Sized_relobj_file::compute_final_local_value): Replace refs to
7369 section_offsets_ with accessor function.
7370 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7371 * object.h (Relobj::Relobj): Initialize new data members.
7372 (Relobj::add_dyn_reloc): New function.
7373 (Relobj::first_dyn_reloc): New function.
7374 (Relobj::dyn_reloc_count): New function.
7375 (Relobj::first_dyn_reloc_): New data member.
7376 (Relobj::dyn_reloc_count_): New data member.
7377 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7378 references.
7379 (Sized_relobj::Address): New typedef.
7380 (Sized_relobj::invalid_address): Move here from child class.
7381 (Sized_relobj::Sized_relobj): Initialize new data members.
7382 (Sized_relobj::sized_relobj): New function.
7383 (Sized_relobj::is_output_section_offset_invalid): Move here from
7384 child class.
7385 (Sized_relobj::get_output_section_offset): Likewise.
7386 (Sized_relobj::local_has_got_offset): Likewise.
7387 (Sized_relobj::local_got_offset): Likewise.
7388 (Sized_relobj::set_local_got_offset): Likewise.
7389 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7390 (Sized_relobj::clear_got_offsets): New function.
7391 (Sized_relobj::section_offsets): Move here from child class.
7392 (Sized_relobj::do_output_section_offset): Likewise.
7393 (Sized_relobj::do_set_section_offset): Likewise.
7394 (Sized_relobj::Local_got_offsets): Likewise.
7395 (Sized_relobj::local_got_offsets_): Likewise.
7396 (Sized_relobj::section_offsets_): Likewise.
7397 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7398 references.
7399 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7400 class.
7401 (Sized_relobj_file::sized_relobj): New function
7402 (Sized_relobj_file::local_has_got_offset): Move to base class.
7403 (Sized_relobj_file::local_got_offset): Likewise.
7404 (Sized_relobj_file::set_local_got_offset): Likewise.
7405 (Sized_relobj_file::get_output_section_offset): Likewise.
7406 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7407 (Sized_relobj_file::do_output_section_offset): Likewise.
7408 (Sized_relobj_file::do_set_section_offset): Likewise.
7409 (Sized_relobj_file::Local_got_offsets): Likewise.
7410 (Sized_relobj_file::local_got_offsets_): Likewise.
7411 (Sized_relobj_file::section_offsets_): Likewise.
7412 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7413 (all constructors).
7414 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7415 (Output_reloc::get_symbol_index): Likewise.
7416 (Output_reloc::local_section_offset): Likewise.
7417 (Output_reloc::get_address): Likewise.
7418 (Output_reloc::symbol_value): Likewise.
7419 (Output_data_got::reserve_slot): Move to class definition.
7420 (Output_data_got::reserve_local): New function.
7421 (Output_data_got::reserve_slot_for_global): Remove.
7422 (Output_data_got::reserve_global): New function.
7423 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7424 (all constructors, two instantiations).
7425 (Output_reloc::get_relobj): New function (two instantiations).
7426 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7427 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7428 (Output_data_reloc::add_global): Adjust type of relobj.
7429 (Output_data_reloc::add_global_relative): Likewise.
7430 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7431 (Output_data_reloc::add_local): Likewise.
7432 (Output_data_reloc::add_local_relative): Likewise.
7433 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7434 (Output_data_reloc::add_local_section): Likewise.
7435 (Output_data_reloc::add_output_section): Likewise.
7436 (Output_data_reloc::add_absolute): Likewise.
7437 (Output_data_reloc::add_target_specific): Likewise.
7438 (Output_data_got::reserve_slot): Move definition here.
7439 (Output_data_got::reserve_local): New function.
7440 (Output_data_got::reserve_global): New function.
7441 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7442 section_offsets_ with accessor function.
7443 (Sized_relobj_file::write_sections): Likewise.
7444 (Sized_relobj_file::do_relocate_sections): Likewise.
7445 * target.h (Sized_target::reserve_local_got_entry): New function.
7446 (Sized_target::reserve_global_got_entry): New function.
7447 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7448 (Target_x86_64::reserve_global_got_entry): New function.
7449 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7450
4829d394
CC
74512011-05-23 Cary Coutant <ccoutant@google.com>
7452
7453 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7454 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7455 bit when checking got_type.
7456 * incremental.cc (Sized_incremental_binary::setup_readers):
7457 Store symbol table and string table locations; initialize bit vector
7458 of file status flags.
7459 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7460 unchanged files.
7461 (Sized_incremental_binary::do_process_got_plt): New function.
7462 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7463 (Output_section_incremental_inputs::set_final_data_size): Record
7464 file index for each input file.
7465 (Output_section_incremental_inputs::write_got_plt): Store file index
7466 instead of input entry offset for each GOT entry.
7467 * incremental.h
7468 (Incremental_input_entry::Incremental_input_entry): Initialize new
7469 data member.
7470 (Incremental_input_entry::set_offset): Store file index.
7471 (Incremental_input_entry::get_file_index): New function.
7472 (Incremental_input_entry::file_index_): New data member.
7473 (Incremental_binary::process_got_plt): New function.
7474 (Incremental_binary::do_process_got_plt): New function.
7475 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7476 data members.
7477 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7478 (Sized_incremental_binary::set_file_is_unchanged): New function.
7479 (Sized_incremental_binary::file_is_unchanged): New function.
7480 (Sized_incremental_binary::do_process_got_plt): New function.
7481 (Sized_incremental_binary::file_status_): New data member.
7482 (Sized_incremental_binary::main_symtab_loc_): New data member.
7483 (Sized_incremental_binary::main_strtab_loc_): New data member.
7484 * output.cc (Output_data_got::Got_entry::write): Add case
7485 RESERVED_CODE.
7486 (Output_data_got::add_global): Call add_got_entry.
7487 (Output_data_got::add_global_plt): Likewise.
7488 (Output_data_got::add_global_with_rel): Likewise.
7489 (Output_data_got::add_global_with_rela): Likewise.
7490 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7491 (Output_data_got::add_global_pair_with_rela): Likewise.
7492 (Output_data_got::add_local): Call add_got_entry.
7493 (Output_data_got::add_local_plt): Likewise.
7494 (Output_data_got::add_local_with_rel): Likewise.
7495 (Output_data_got::add_local_with_rela): Likewise.
7496 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7497 (Output_data_got::add_local_pair_with_rela): Likewise.
7498 (Output_data_got::reserve_slot): New function.
7499 (Output_data_got::reserve_slot_for_global): New function.
7500 (Output_data_got::add_got_entry): New function.
7501 (Output_data_got::add_got_entry_pair): New function.
7502 (Output_section::add_output_section_data): Edit FIXME.
7503 * output.h
7504 (Output_section_data_build::Output_section_data_build): New
7505 constructor with size parameter.
7506 (Output_data_space::Output_data_space): Likewise.
7507 (Output_data_got::Output_data_got): Initialize new data member; new
7508 constructor with size parameter.
7509 (Output_data_got::add_constant): Call add_got_entry.
7510 (Output_data_got::reserve_slot): New function.
7511 (Output_data_got::reserve_slot_for_global): New function.
7512 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7513 (Output_data_got::add_got_entry): New function.
7514 (Output_data_got::add_got_entry_pair): New function.
7515 (Output_data_got::free_list_): New data member.
7516 * target.h (Sized_target::init_got_plt_for_update): New function.
7517 (Sized_target::register_global_plt_entry): New function.
7518 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7519 Initialize new data member; call init; add constructor with PLT count.
7520 (Output_data_plt_x86_64::init): New function.
7521 (Output_data_plt_x86_64::add_relocation): New function.
7522 (Output_data_plt_x86_64::reserve_slot): New function.
7523 (Output_data_plt_x86_64::free_list_): New data member.
7524 (Target_x86_64::init_got_plt_for_update): New function.
7525 (Target_x86_64::register_global_plt_entry): New function.
7526 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7527 incremental updates.
7528 (Output_data_plt_x86_64::add_relocation): New function.
7529 * testsuite/object_unittest.cc (Object_test): Set default options.
7530
ec69d6da
ILT
75312011-05-16 Ian Lance Taylor <iant@google.com>
7532
7533 * options.h (class General_options): Make -i a synonym for -r.
7534
732e31de
ILT
75352011-05-16 Ian Lance Taylor <iant@google.com>
7536
7537 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7538
403676b5
CC
75392011-05-10 Cary Coutant <ccoutant@google.com>
7540
7541 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7542 strip_all (-s).
7543
5b7b7d6e
ILT
75442011-05-06 Ian Lance Taylor <iant@google.com>
7545
7546 * layout.cc (Layout::layout): If the output section flags change,
7547 update the ordering.
7548
f0f9babf
CC
75492011-04-25 Cary Coutant <ccoutant@google.com>
7550
7551 * incremental-dump.cc (dump_incremental_inputs): Print local
7552 symbol info for each input file.
7553 * incremental.cc
7554 (Output_section_incremental_inputs::set_final_data_size): Add local
7555 symbol info to input file entries in incremental info.
7556 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7557 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7558 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7559 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7560 implementation.
7561 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7562 (Sized_incr_relobj::do_relocate): Write the local symbols.
7563 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7564 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7565 Adjust size of input file header.
7566 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7567 (Incremental_inputs_reader::get_local_symbol_count): New function.
7568 (Incremental_inputs_reader::get_input_section): Adjust size of input
7569 file header.
7570 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7571 (Sized_incr_relobj::This): New typedef.
7572 (Sized_incr_relobj::sym_size): New const data member.
7573 (Sized_incr_relobj::Local_symbol): New struct.
7574 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7575 (Sized_incr_relobj::do_local_symbol_offset): New function.
7576 (Sized_incr_relobj::local_symbol_count_): New data member.
7577 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7578 (Sized_incr_relobj::local_symbol_index_): New data member.
7579 (Sized_incr_relobj::local_symbol_offset_): New data member.
7580 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7581 (Sized_incr_relobj::local_symbols_): New data member.
7582 * object.h (Relobj::output_local_symbol_count): New function.
7583 (Relobj::local_symbol_offset): New function.
7584 (Relobj::do_output_local_symbol_count): New function.
7585 (Relobj::do_local_symbol_offset): New function.
7586 (Sized_relobj::do_output_local_symbol_count): New function.
7587 (Sized_relobj::do_local_symbol_offset): New function.
7588
d0a9ace3
ILT
75892011-04-22 Vladimir Simonov <sv@sw.ru>
7590
7591 * descriptors.cc (set_close_on_exec): New function.
7592 (Descriptors::open): Use set_close_on_exec.
7593 * output.cc (S_ISLNK): Define if not defined.
7594
94a3fc8b
CC
75952011-04-22 Cary Coutant <ccoutant@google.com>
7596
7597 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7598 global symbol map.
7599 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7600 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7601 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7602 relocations.
7603 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7604 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7605 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7606 * incremental.h
7607 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7608 function.
7609 (Incremental_binary::apply_incremental_relocs): New function.
7610 (Incremental_binary::do_apply_incremental_relocs): New function.
7611 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7612 data member.
7613 (Sized_incremental_binary::add_global_symbol): New function.
7614 (Sized_incremental_binary::global_symbol): New function.
7615 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7616 (Sized_incremental_binary::symbol_map_): New data member.
7617 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7618 * target.h (Sized_target::apply_relocation): New function.
7619 * target-reloc.h (apply_relocation): New function.
7620 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7621
c87e4302
DK
76222011-04-22 Doug Kwan <dougkwan@google.com>
7623
7624 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7625 flag of a SHT_ARM_EXIDX section.
2e702c99 7626 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7627 * testsuite/Makefile.in: Regenerate.
7628 * testsuite/arm_exidx_test.s: New file.
7629 * testsuite/arm_exidx_test.sh: Same.
7630
e7782cf6
CC
76312011-04-20 Cary Coutant <ccoutant@google.com>
7632
7633 PR gold/12689
7634 * archive.h (Incremental_archive_entry::Archive_member):
7635 Initialize arg_serial_ (second constructor).
7636
308ecdc7
ILT
76372011-04-17 Ian Lance Taylor <iant@google.com>
7638
7639 * object.cc (Relocate_info::location): Simplify location string.
7640 * errors.cc (Errors::error_at_location): Don't print program
7641 name.
7642 (Errors::warning_at_location): Likewise.
7643 (Errors::undefined_symbol): Likewise.
7644 * testsuite/debug_msg.sh: Update accordingly.
7645
bec5b579
CC
76462011-04-14 Cary Coutant <ccoutant@google.com>
7647
7648 * gold/layout.cc (Layout::symtab_section_offset): New function.
7649 * gold/layout.h (Layout::symtab_section_offset): New function.
7650 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7651
88597d34
ILT
76522011-04-12 Ian Lance Taylor <iant@google.com>
7653
7654 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7655 with MREMAP_MAYMOVE.
7656 * output.h (class Output_file): Add map_is_allocated_ field.
7657 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7658 not available, provide stubs. If mremap is not available, #define
7659 it to gold_mremap.
7660 (MREMAP_MAYMOVE): Define if not defined.
7661 (Output_file::Output_file): Initialize map_is_allocated_.
7662 (Output_file::resize): Check map_is_allocated_.
7663 (Output_file::map_anonymous): If mmap fails, use malloc.
7664 (Output_file::unmap): Don't do anything for an anonymous map.
7665 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7666 is not available, provide stubs.
7667 (File_read::View::~View): Use free rather than delete[].
7668 (File_read::make_view): Use malloc rather than new[]. If mmap
7669 fails, use malloc.
7670 (File_read::find_or_make_view): Use malloc rather than new[].
7671 * gold.h: Remove HAVE_REMAP code.
7672 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7673 exists. Rename mremap to gold_mremap. If mmap is not available
7674 don't do anything.
7675 * configure, config.in: Rebuild.
7676
11e361bc
ILT
76772011-04-11 Ian Lance Taylor <iant@google.com>
7678
7679 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7680 initialize local variable v.
7681
cdc29364
CC
76822011-04-11 Cary Coutant <ccoutant@google.com>
7683
7684 * archive.cc (Archive::include_member): Adjust call to
7685 report_object.
7686 (Add_archive_symbols::run): Track argument serial numbers.
7687 (Lib_group::include_member): Likewise.
7688 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7689 * archive.h (Incremental_archive_entry::Archive_member):
7690 Initialize arg_serial_.
7691 (Archive_member::arg_serial_): New data member.
7692 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7693 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7694 incremental link.
7695 (Sized_dynobj::do_for_all_local_got_entries): New function.
7696 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7697 function.
7698 * fileread.cc (get_mtime): New function.
7699 * fileread.h (get_mtime): New function.
7700 * gold.cc (queue_initial_tasks): Check for incremental update.
7701 (process_incremental_input): New function.
7702 (queue_middle_tasks): Don't force valid target for incremental
7703 update.
7704 * incremental-dump.cc (find_input_containing_global): Adjust
7705 size of symbol info entry.
7706 (dump_incremental_inputs): Dump argument serial number and
7707 in_system_directory flag; bias shndx by 1; print symbol names
7708 when dumping per-file symbol lists; use new symbol info readers.
7709 * incremental.cc
7710 (Output_section_incremental_inputs:update_data_size): New function.
7711 (Sized_incremental_binary::setup_readers): Setup input readers
7712 for each input file; build maps for files added from libraries
7713 and scripts.
7714 (Sized_incremental_binary::check_input_args): New function.
7715 (Sized_incremental_binary::do_check_inputs): Build map of argument
7716 serial numbers to input arguments.
7717 (Sized_incremental_binary::do_file_has_changed): Rename
7718 do_file_is_unchanged to this; compare file modification times.
7719 (Sized_incremental_binary::do_init_layout): New function.
7720 (Sized_incremental_binary::do_reserve_layout): New function.
7721 (Sized_incremental_binary::do_get_input_reader): Remove.
7722 (Sized_incremental_binary::get_symtab_view): New function.
7723 (Incremental_checker::can_incrementally_link_output_file): Remove.
7724 (Incremental_inputs::report_command_line): Exclude --debug options.
7725 (Incremental_inputs::report_archive_begin): Add parameter; track
7726 argument serial numbers; don't put input file entry for archive
7727 before archive members.
7728 (Incremental_inputs::report_archive_end): Put input file entry
7729 for archive after archive members.
7730 (Incremental_inputs::report_object): Add parameter; track argument
7731 serial numbers and in_system_directory flag.
7732 (Incremental_inputs::report_script): Add parameter; track argument
7733 serial numbers.
7734 (Output_section_incremental_inputs::set_final_data_size): Adjust
7735 size of symbol info entry; check for forwarding symbols.
7736 (Output_section_incremental_inputs::write_input_files): Write
7737 in_system_directory flag and argument serial number.
7738 (Output_section_incremental_inputs::write_info_blocks): Map section
7739 indices between incremental info and original input file; store
7740 input section index for each symbol.
7741 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7742 change operator() to visit().
7743 (class Global_got_offset_visitor): Likewise.
7744 (class Global_symbol_visitor_got_plt):
7745 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7746 classes.
7747 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7748 (Sized_incr_relobj::do_read_symbols): New function.
7749 (Sized_incr_relobj::do_layout): New function.
7750 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7751 (Sized_incr_relobj::do_add_symbols): New function.
7752 (Sized_incr_relobj::do_should_include_member): New function.
7753 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7754 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7755 (Sized_incr_relobj::do_section_size): New function.
7756 (Sized_incr_relobj::do_section_name): New function.
7757 (Sized_incr_relobj::do_section_contents): New function.
7758 (Sized_incr_relobj::do_section_flags): New function.
7759 (Sized_incr_relobj::do_section_entsize): New function.
7760 (Sized_incr_relobj::do_section_address): New function.
7761 (Sized_incr_relobj::do_section_type): New function.
7762 (Sized_incr_relobj::do_section_link): New function.
7763 (Sized_incr_relobj::do_section_info): New function.
7764 (Sized_incr_relobj::do_section_addralign): New function.
7765 (Sized_incr_relobj::do_initialize_xindex): New function.
7766 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7767 (Sized_incr_relobj::do_read_relocs): New function.
7768 (Sized_incr_relobj::do_gc_process_relocs): New function.
7769 (Sized_incr_relobj::do_scan_relocs): New function.
7770 (Sized_incr_relobj::do_count_local_symbols): New function.
7771 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7772 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7773 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7774 (Sized_incr_relobj::do_relocate): New function.
7775 (Sized_incr_relobj::do_set_section_offset): New function.
7776 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7777 (Sized_incr_dynobj::do_read_symbols): New function.
7778 (Sized_incr_dynobj::do_layout): New function.
7779 (Sized_incr_dynobj::do_add_symbols): New function.
7780 (Sized_incr_dynobj::do_should_include_member): New function.
7781 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7782 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7783 (Sized_incr_dynobj::do_section_size): New function.
7784 (Sized_incr_dynobj::do_section_name): New function.
7785 (Sized_incr_dynobj::do_section_contents): New function.
7786 (Sized_incr_dynobj::do_section_flags): New function.
7787 (Sized_incr_dynobj::do_section_entsize): New function.
7788 (Sized_incr_dynobj::do_section_address): New function.
7789 (Sized_incr_dynobj::do_section_type): New function.
7790 (Sized_incr_dynobj::do_section_link): New function.
7791 (Sized_incr_dynobj::do_section_info): New function.
7792 (Sized_incr_dynobj::do_section_addralign): New function.
7793 (Sized_incr_dynobj::do_initialize_xindex): New function.
7794 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7795 (make_sized_incremental_object): New function.
7796 (Incremental_library::copy_unused_symbols): New function.
7797 (Incremental_library::do_for_all_unused_symbols): New function.
7798 * incremental.h (enum Incremental_input_flags): New type.
7799 (class Incremental_checker): Remove.
7800 (Incremental_input_entry::Incremental_input_entry): Add argument
7801 serial number.
7802 (Incremental_input_entry::arg_serial): New function.
7803 (Incremental_input_entry::set_is_in_system_directory): New function.
7804 (Incremental_input_entry::is_in_system_directory): New function.
7805 (Incremental_input_entry::arg_serial_): New data member.
7806 (Incremental_input_entry::is_in_system_directory_): New data member.
7807 (class Script_info): Move here from script.h.
7808 (Script_info::Script_info): Add filename parameter.
7809 (Script_info::filename): New function.
7810 (Script_info::filename_): New data member.
7811 (Incremental_script_entry::Incremental_script_entry): Add argument
7812 serial number.
7813 (Incremental_object_entry::Incremental_object_entry): Likewise.
7814 (Incremental_object_entry::add_input_section): Build list of input
7815 sections with map to original shndx.
7816 (Incremental_object_entry::get_input_section_index): New function.
7817 (Incremental_object_entry::shndx_): New data member.
7818 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7819 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7820 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7821 serial number.
7822 (Incremental_inputs::report_archive_begin): Likewise.
7823 (Incremental_inputs::report_object): Likewise.
7824 (Incremental_inputs::report_script): Likewise.
7825 (class Incremental_global_symbol_reader): New class.
7826 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7827 and store flags and input file type.
7828 (Incremental_input_entry_reader::arg_serial): New function.
7829 (Incremental_input_entry_reader::type): Extract type from flags.
7830 (Incremental_input_entry_reader::is_in_system_directory): New function.
7831 (Incremental_input_entry_reader::get_input_section_count): Call
7832 accessor function for type.
7833 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7834 function for type; adjust size of global symbol entry.
7835 (Incremental_input_entry_reader::get_global_symbol_count): Call
7836 accessor function for type.
7837 (Incremental_input_entry_reader::get_object_count): Likewise.
7838 (Incremental_input_entry_reader::get_object_offset): Likewise.
7839 (Incremental_input_entry_reader::get_member_count): Likewise.
7840 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7841 (Incremental_input_entry_reader::get_member_offset): Likewise.
7842 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7843 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7844 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7845 (Incremental_input_entry_reader::get_global_symbol_reader): New
7846 function.
7847 (Incremental_input_entry_reader::get_output_symbol_index): New
7848 function.
7849 (Incremental_input_entry_reader::type_): Remove.
7850 (Incremental_input_entry_reader::flags_): New data member.
7851 (Incremental_inputs_reader::input_file_offset): New function.
7852 (Incremental_inputs_reader::input_file_index): New function.
7853 (Incremental_inputs_reader::input_file): Call input_file_offset.
7854 (Incremental_inputs_reader::input_file_at_offset): New function.
7855 (Incremental_relocs_reader::get_r_type): Reformat.
7856 (Incremental_relocs_reader::get_r_shndx): Reformat.
7857 (Incremental_relocs_reader::get_r_offset): Reformat.
7858 (Incremental_relocs_reader::data): New function.
7859 (Incremental_binary::Incremental_binary): Initialize new data members.
7860 (Incremental_binary::check_inputs): Add cmdline parameter.
7861 (Incremental_binary::file_is_unchanged): Remove.
7862 (Input_reader::arg_serial): New function.
7863 (Input_reader::get_unused_symbol_count): New function.
7864 (Input_reader::get_unused_symbol): New function.
7865 (Input_reader::do_arg_serial): New function.
7866 (Input_reader::do_get_unused_symbol_count): New function.
7867 (Input_reader::do_get_unused_symbol): New function.
7868 (Incremental_binary::input_file_count): New function.
7869 (Incremental_binary::get_input_reader): Change signature to use
7870 index instead of filename.
7871 (Incremental_binary::file_has_changed): New function.
7872 (Incremental_binary::get_input_argument): New function.
7873 (Incremental_binary::get_library): New function.
7874 (Incremental_binary::get_script_info): New function.
7875 (Incremental_binary::init_layout): New function.
7876 (Incremental_binary::reserve_layout): New function.
7877 (Incremental_binary::output_file): New function.
7878 (Incremental_binary::do_check_inputs): New function.
7879 (Incremental_binary::do_file_is_unchanged): Remove.
7880 (Incremental_binary::do_file_has_changed): New function.
7881 (Incremental_binary::do_init_layout): New function.
7882 (Incremental_binary::do_reserve_layout): New function.
7883 (Incremental_binary::do_input_file_count): New function.
7884 (Incremental_binary::do_get_input_reader): Change signature.
7885 (Incremental_binary::input_args_map_): New data member.
7886 (Incremental_binary::library_map_): New data member.
7887 (Incremental_binary::script_map_): New data member.
7888 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7889 new data members.
7890 (Sized_incremental_binary::output_section): New function.
7891 (Sized_incremental_binary::inputs_reader): Add const.
7892 (Sized_incremental_binary::symtab_reader): Add const.
7893 (Sized_incremental_binary::relocs_reader): Add const.
7894 (Sized_incremental_binary::got_plt_reader): Add const.
7895 (Sized_incremental_binary::get_symtab_view): New function.
7896 (Sized_incremental_binary::Inputs_reader): New typedef.
7897 (Sized_incremental_binary::Input_entry_reader): New typedef.
7898 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7899 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7900 (Sized_incremental_binary::do_file_has_changed): New function.
7901 (Sized_incremental_binary::do_init_layout): New function.
7902 (Sized_incremental_binary::do_reserve_layout): New function.
7903 (Sized_input_reader::Inputs_reader): Remove.
7904 (Sized_input_reader::Input_entry_reader): Remove.
7905 (Sized_input_reader::do_arg_serial): New function.
7906 (Sized_input_reader::do_get_unused_symbol_count): New function.
7907 (Sized_input_reader::do_get_unused_symbol): New function.
7908 (Sized_incremental_binary::do_input_file_count): New function.
7909 (Sized_incremental_binary::do_get_input_reader): Change signature;
7910 use index instead of filename.
7911 (Sized_incremental_binary::section_map_): New data member.
7912 (Sized_incremental_binary::input_entry_readers_): New data member.
7913 (class Sized_incr_relobj): New class.
7914 (class Sized_incr_dynobj): New class.
7915 (make_sized_incremental_object): New function.
7916 (class Incremental_library): New class.
7917 * layout.cc (Free_list::num_lists): New static data member.
7918 (Free_list::num_nodes): New static data member.
7919 (Free_list::num_removes): New static data member.
7920 (Free_list::num_remove_visits): New static data member.
7921 (Free_list::num_allocates): New static data member.
7922 (Free_list::num_allocate_visits): New static data member.
7923 (Free_list::init): New function.
7924 (Free_list::remove): New function.
7925 (Free_list::allocate): New function.
7926 (Free_list::dump): New function.
7927 (Free_list::print_stats): New function.
7928 (Layout_task_runner::run): Resize output file for incremental updates.
7929 (Layout::Layout): Initialize new data members.
7930 (Layout::set_incremental_base): New function.
7931 (Layout::init_fixed_output_section): New function.
7932 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7933 incremental updates.
7934 (Layout::create_gold_note): Do not create gold note section for
7935 incremental updates.
7936 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7937 for incremental updates.
7938 (Layout::set_section_offsets): For incremental updates, allocate space
7939 from free list.
7940 (Layout::create_symtab_sections): Layout with offsets relative to
7941 start of section; for incremental updates, allocate space from free
7942 list.
7943 (Layout::create_shdrs): For incremental updates, allocate space from
7944 free list.
7945 (Layout::finish_dynamic_section): For incremental updates, do not
7946 check --as-needed (fixed in subsequent patch).
7947 * layout.h (class Free_list): New class.
7948 (Layout::set_incremental_base): New function.
7949 (Layout::incremental_base): New function.
7950 (Layout::init_fixed_output_section): New function.
7951 (Layout::allocate): New function.
7952 (Layout::incremental_base_): New data member.
7953 (Layout::free_list_): New data member.
7954 * main.cc (main): Print Free_list statistics.
7955 * object.cc (Relobj::finalize_incremental_relocs): Add
7956 clear_counts parameter; clear counts only when clear_counts is set.
7957 (Sized_relobj::Sized_relobj): Initialize new base class.
7958 (Sized_relobj::do_layout): Don't report special sections.
7959 (Sized_relobj::do_for_all_local_got_entries): New function.
7960 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7961 symtab_off to all symbol table offsets.
7962 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7963 * object.h (class Got_offset_list): Move to top of file.
7964 (Object::Object): Allow case where input_file == NULL.
7965 (Object::~Object): Likewise.
7966 (Object::input_file): Assert that input_file != NULL.
7967 (Object::lock): Allow case where input_file == NULL.
7968 (Object::unlock): Likewise.
7969 (Object::is_locked): Likewise.
7970 (Object::token): Likewise.
7971 (Object::release): Likewise.
7972 (Object::is_incremental): New function.
7973 (Object::get_mtime): New function.
7974 (Object::for_all_local_got_entries): New function.
7975 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7976 (Object::set_is_in_system_directory): New function.
7977 (Object::is_in_system_directory): New function.
7978 (Object::do_is_incremental): New function.
7979 (Object::do_get_mtime): New function.
7980 (Object::do_for_all_local_got_entries): New function.
7981 (Object::is_in_system_directory_): New data member.
7982 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7983 (class Sized_relobj_base): New class.
7984 (class Sized_relobj): Derive from Sized_relobj_base.
7985 (class Sized_relobj::Symbols): Redeclare from base class.
7986 (class Sized_relobj::local_got_offset_list): Remove.
7987 (class Sized_relobj::Output_sections): Redeclare from base class.
7988 (class Sized_relobj::do_for_all_local_got_entries): New function.
7989 (class Sized_relobj::write_local_symbols): Add offset parameter.
7990 (class Sized_relobj::local_symbol_offset_): Update comment.
7991 (class Sized_relobj::local_dynsym_offset_): Update comment.
7992 * options.cc (Input_arguments::add_file): Remove const.
7993 * options.h (Input_file_argument::Input_file_argument):
7994 Initialize arg_serial_ (all constructors).
7995 (Input_file_argument::set_arg_serial): New function.
7996 (Input_file_argument::arg_serial): New function.
7997 (Input_file_argument::arg_serial_): New data member.
7998 (Input_arguments::Input_arguments): Initialize file_count_.
7999 (Input_arguments::add_file): Remove const.
8000 (Input_arguments::number_of_input_files): New function.
8001 (Input_arguments::file_count_): New data member.
8002 (Command_line::number_of_input_files): Call
8003 Input_arguments::number_of_input_files.
8004 * output.cc (Output_segment_headers::Output_segment_headers):
8005 Set current size.
8006 (Output_section::Input_section::current_data_size): New function.
8007 (Output_section::Output_section): Initialize new data members.
8008 (Output_section::add_input_section): Don't do merge sections for
8009 an incremental link; allocate space from free list for an
8010 incremental update.
8011 (Output_section::add_output_section_data): Allocate space from
8012 free list for an incremental update.
8013 (Output_section::update_data_size): New function.
8014 (Output_section::set_fixed_layout): New function.
8015 (Output_section::reserve): New function.
8016 (Output_segment::set_section_addresses): Remove const.
8017 (Output_segment::set_section_list_addresses): Remove const; allocate
8018 space from free list for an incremental update.
8019 (Output_segment::set_offset): Adjust size of RELRO segment for an
8020 incremental update.
8021 * output.h (Output_data::current_data_size): Move here from
8022 child classes.
8023 (Output_data::pre_finalize_data_size): New function.
8024 (Output_data::update_data_size): New function.
8025 (Output_section_headers::update_data_size): new function.
8026 (Output_section_data_build::current_data_size): Move to Output_data.
8027 (Output_data_strtab::update_data_size): New function.
8028 (Output_section::current_data_size): Move to Output_data.
8029 (Output_section::set_fixed_layout): New function.
8030 (Output_section::has_fixed_layout): New function.
8031 (Output_section::reserve): New function.
8032 (Output_section::update_data_size): New function.
8033 (Output_section::has_fixed_layout_): New data member.
8034 (Output_section::free_list_): New data member.
8035 (Output_segment::set_section_addresses): Remove const.
8036 (Output_segment::set_section_list_addresses): Remove const.
8037 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8038 New function.
8039 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8040 New function.
8041 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8042 parameter when calling Add_symbols constructor; store argument
8043 serial number for members of a lib group.
8044 (Add_symbols::locks): Allow case where token == NULL.
8045 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8046 (Read_member::~Read_member): New function.
8047 (Read_member::is_runnable): New function.
8048 (Read_member::locks): New function.
8049 (Read_member::run): New function.
8050 (Check_script::~Check_script): New function.
8051 (Check_script::is_runnable): New function.
8052 (Check_script::locks): New function.
8053 (Check_script::run): New function.
8054 (Check_library::~Check_library): New function.
8055 (Check_library::is_runnable): New function.
8056 (Check_library::locks): New function.
8057 (Check_library::run): New function.
8058 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8059 (Add_symbols::library_): New data member.
8060 (class Read_member): New class.
8061 (class Check_script): New class.
8062 (class Check_library): New class.
8063 * reloc.cc (Read_relocs::is_runnable): Allow case where
8064 token == NULL.
8065 (Read_relocs::locks): Likewise.
8066 (Scan_relocs::locks): Likewise.
8067 (Relocate_task::locks): Likewise.
8068 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8069 to clear counters.
8070 (Sized_relobj::incremental_relocs_scan): Fix comment.
8071 (Sized_relobj::do_relocate): Pass output file offset to
8072 write_local_symbols.
8073 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8074 from class declaration.
8075 * script.cc (read_input_script): Allocate Script_info; pass
8076 argument serial number to report_script.
8077 * script.h (class Script_info): Move to incremental.h.
8078 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8079 * symtab.h (Symbol_table::add_from_incrobj): New function.
8080 (Symbol_table::set_file_offset): New function.
8081
b961d0d7
CC
80822011-04-05 Cary Coutant <ccoutant@google.com>
8083
8084 * incremental-dump.cc (dump_incremental_inputs): Change signature
8085 to take a Sized_incremental_binary; change caller. Use readers
8086 in Sized_incremental_binary.
8087 * incremental.cc
8088 (Sized_incremental_binary::find_incremental_inputs_sections):
8089 Rename do_find_incremental_inputs_sections to this.
8090 (Sized_incremental_binary::setup_readers): New function.
8091 (Sized_incremental_binary::do_check_inputs): Check
8092 has_incremental_info_ flag; move setup code to setup_readers;
8093 use input readers.
8094 (Sized_incremental_binary::do_file_is_unchanged): New function.
8095 (Sized_incremental_binary::do_get_input_reader): New function.
8096 * incremental.h (class Incremental_binary): Move to end of file.
8097 (Incremental_binary::file_is_unchanged): New function.
8098 (Incremental_binary::do_file_is_unchanged): New function.
8099 (Incremental_binary::Input_reader): New class.
8100 (Incremental_binary::get_input_reader): New function.
8101 (class Sized_incremental_binary): Move to end of file.
8102 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8103 input section reader classes.
8104 (Sized_incremental_binary::has_incremental_info): New function.
8105 (Sized_incremental_binary::inputs_reader): New function.
8106 (Sized_incremental_binary::symtab_reader): New function.
8107 (Sized_incremental_binary::relocs_reader): New function.
8108 (Sized_incremental_binary::got_plt_reader): New function.
8109 (Sized_incremental_binary::do_file_is_unchanged): New function.
8110 (Sized_incremental_binary::Sized_input_reader): New class.
8111 (Sized_incremental_binary::get_input_reader): New function.
8112 (Sized_incremental_binary::find_incremental_inputs_sections):
8113 Rename do_find_incremental_inputs_sections to this.
8114 (Sized_incremental_binary::setup_readers): New function.
8115 (Sized_incremental_binary::has_incremental_info_): New data member.
8116 (Sized_incremental_binary::inputs_reader_): New data member.
8117 (Sized_incremental_binary::symtab_reader_): New data member.
8118 (Sized_incremental_binary::relocs_reader_): New data member.
8119 (Sized_incremental_binary::got_plt_reader_): New data member.
8120 (Sized_incremental_binary::current_input_file_): New data member.
8121
a869183f
PP
81222011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8123
8124 PR gold/12640
8125 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8126 violation.
8127
81282011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8129
8130 * archive.cc (Archive::include_member): Adjust call to report_object.
8131 (Add_archive_symbols::run): Add script_info to call to
8132 report_archive_begin.
8133 (Lib_group::include_member): Adjust call to report_object.
8134 (Add_lib_group_symbols::run): Adjust call to report_object.
8135 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8136 blocks. Add object count for script input files.
8137 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8138 script_info parameter; change all callers.
8139 (Incremental_inputs::report_object): Add script_info parameter;
8140 change all callers.
8141 (Incremental_inputs::report_script): Store backpointer to
8142 incremental info entry.
8143 (Output_section_incremental_inputs::set_final_data_size): Record
8144 additional information for scripts.
8145 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8146 * incremental.h (Incremental_script_entry::add_object): New function.
8147 (Incremental_script_entry::get_object_count): New function.
8148 (Incremental_script_entry::get_object): New function.
8149 (Incremental_script_entry::objects_): New data member; adjust
8150 constructor.
8151 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8152 (Incremental_inputs::report_object): Add script_info parameter.
8153 (Incremental_inputs_reader::get_object_count): New function.
8154 (Incremental_inputs_reader::get_object_offset): New function.
8155 * options.cc (Input_arguments::add_file): Return reference to
8156 new input argument.
8157 * options.h (Input_argument::set_script_info): New function.
8158 (Input_argument::script_info): New function.
8159 (Input_argument::script_info_): New data member; adjust all
8160 constructors.
8161 (Input_file_group::add_file): Return reference to new input argument.
8162 (Input_file_lib::add_file): Likewise.
8163 (Input_arguments::add_file): Likewise.
8164 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8165 * script.cc (Parser_closure::Parser_closure): Add script_info
8166 parameter; adjust all callers.
8167 (Parser_closure::script_info): New function.
8168 (Parser_closure::script_info_): New data member.
8169 (read_input_script): Report scripts earlier to incremental info.
8170 (script_add_file): Set script_info in Input_argument.
8171 (script_add_library): Likewise.
8172 * script.h (Script_options::Script_info): Rewrite class.
8173
a869183f 81742011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8175
8176 * archive.cc (Library_base::should_include_member): Move
8177 method here from class Archive.
8178 (Archive::Archive): Initialize base class.
8179 (Archive::should_include_member): Move to base class.
8180 (Archive::do_for_all_unused_symbols): New function.
8181 (Add_archive_symbols::run): Remove redundant access to
8182 incremental_inputs.
8183 (Lib_group::Lib_group): Initialize base class.
8184 (Lib_group::do_filename): New function.
8185 (Lib_group::include_member): Pass pointer to Lib_group to
8186 report_object.
8187 (Lib_group::do_for_all_unused_symbols): New function.
8188 (Add_lib_group_symbols::run): Report archive information for
8189 incremental links.
8190 * archive.h (class Library_base): New base class.
8191 (class Archive): Derive from Library_base.
8192 (Archive::filename): Move to base class.
8193 (Archive::set_incremental_info): Likewise.
8194 (Archive::incremental_info): Likewise.
8195 (Archive::Should_include): Likewise.
8196 (Archive::should_include_member): Likewise.
8197 (Archive::Armap_entry): Remove.
8198 (Archive::Unused_symbol_iterator): Remove.
8199 (Archive::unused_symbols_begin): Remove.
8200 (Archive::unused_symbols_end): Remove.
8201 (Archive::do_filename): New function.
8202 (Archive::do_get_mtime): New function.
8203 (Archive::do_for_all_unused_symbols): New function.
8204 (Archive::task_): Move to base class.
8205 (Archive::incremental_info_): Likewise.
8206 (class Lib_group): Derive from Library_base.
8207 (Lib_group::do_filename): New function.
8208 (Lib_group::do_get_mtime): New function.
8209 (Lib_group::do_for_all_unused_symbols): New function.
8210 (Lib_group::task_): Move to base class.
8211 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8212 function.
8213 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8214 function.
8215 * incremental.cc (Incremental_inputs::report_archive_begin):
8216 Use Library_base; call library's get_mtime; add incremental inputs
8217 entry before members.
8218 (class Unused_symbol_visitor): New class.
8219 (Incremental_inputs::report_archive_end): Use Library_base; use
8220 visitor class to record unused symbols; don't add incremental inputs
8221 entry after members.
8222 (Incremental_inputs::report_object): Use Library_base.
8223 * incremental.h
8224 (Incremental_archive_entry::Incremental_archive_entry): Remove
8225 unused Archive parameter.
8226 (Incremental_inputs::report_archive_begin): Use Library_base.
8227 (Incremental_inputs::report_archive_end): Likewise.
8228 (Incremental_inputs::report_object): Likewise.
8229 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8230 function.
8231 * object.h (Object::for_all_global_symbols): New function.
8232 (Object::do_for_all_global_symbols): New function.
8233 (Sized_relobj::do_for_all_global_symbols): New function.
8234 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8235 function.
8236 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8237 function.
8238
61ab3e40
ILT
82392011-03-27 Ian Lance Taylor <iant@google.com>
8240
8241 * archive.cc (Archive::interpret_header): Return -1 if something
8242 goes wrong. Change callers accordingly.
8243
30e1f9e6
CC
82442011-03-25 Cary Coutant <ccoutant@google.com>
8245
8246 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8247 * testsuite/Makefile.in: Regenerate.
8248
9370ce59 82492011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8250
8251 * plugin.cc (get_view): New.
8252 (Plugin::load): Pass get_view to the plugin.
8253 (Plugin_manager::get_view): New.
8254
9312bb0a
ILT
82552011-03-21 Ian Lance Taylor <iant@google.com>
8256
8257 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8258 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8259
7e12ba9e
ST
82602011-03-21 Sriraman Tallam <tmsriram@google.com>
8261
8262 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8263 Change == to -eq.
8264 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8265 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8266 Change == to -eq.
8267 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8268 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8269
fd7a005d
ILT
82702011-03-14 Ian Lance Taylor <iant@google.com>
8271
8272 * script-sections.cc (Sort_output_sections::script_compare):
8273 Rename from is_before, change return type.
8274 (Sort_output_sections::operator()): Adjust accordingly.
8275
ed16fd1b
ILT
82762011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8277
8278 PR gold/12572
8279 * testsuite/odr_violation2.cc: Add comment to make all error line
8280 numbers double digits.
8281 * testsuite/debug_msg.sh: Adjust expected errors.
8282
71ff8986
ILT
82832011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8284
8285 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8286 but mark earlier ones as non-canonical
8287 (offset_to_iterator): Update search target and example
8288 (do_addr2line): Return extra lines in a vector*
8289 (format_file_lineno): Extract from do_addr2line
8290 (one_addr2line): Add vector* out-param
8291 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8292 when a lineno entry appeared last for its instruction
8293 (Dwarf_line_info): Add vector* out-param
8294 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8295 * symtab.cc (Odr_violation_compare): Include the lineno in the
8296 comparison again.
8297 (linenos_from_loc): New. Combine the canonical line for an
8298 address with its other lines.
8299 (True_if_intersect): New. Helper functor to make
8300 std::set_intersection a query.
8301 (detect_odr_violations): Compare sets of lines instead of just
8302 one line for each function. This became less deterministic, but
8303 has fewer false positives.
8304 * symtab.h: Declarations.
8305 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8306 mix an optimized and non-optimized object in the same binary
8307 (odr_violation2.so): Same.
8308 * testsuite/Makefile.in: Regenerate from Makefile.am.
8309 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8310 * testsuite/debug_msg.sh: Update line numbers and add
8311 assertions.
8312 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8313 non-optimized context.
8314 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8315 isn't inlined, and use OdrDerived in an optimized context.
8316 * testsuite/odr_header1.h: Defines OdrDerived, where
8317 optimization will change the
8318 first-instruction-in-the-destructor's file and line number.
8319 * testsuite/odr_header2.h: Defines OdrBase.
8320
a19fefdc
ILT
83212011-03-09 Ian Lance Taylor <iant@google.com>
8322
8323 * fileread.cc (File_read::clear_views): Don't delete the whole
8324 file view.
8325
ecb351e9
ILT
83262011-03-08 Ian Lance Taylor <iant@google.com>
8327
8328 PR gold/12525
8329 * fileread.cc: #include <climits>.
8330 (GOLD_IOV_MAX): Define.
8331 (File_read::read_multiple): Limit number of entries by iov_max.
8332 * fileread.h (class File_read): Always set max_readv_entries to
8333 128.
8334
b821d13c
ILT
83352011-03-07 Ian Lance Taylor <iant@google.com>
8336
8337 PR gold/12525
8338 * options.h (class General_options): Add -dy and -dn.
8339
89243142
CC
83402011-03-02 Cary Coutant <ccoutant@google.com>
8341
8342 * testsuite/script_test_9.t: Add TLS segment.
8343
d0773f31
ILT
83442011-03-02 Simon Baldwin <simonb@google.com>
8345
8346 * configure.ac: Add check for gnu_indirect_function support in
8347 the toolchain building binutils.
8348 * configure: Rebuild.
8349
9370ce59 83502011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8351
8352 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8353 plugin only symbols.
8354 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8355 in plugin files as not needed in the symbol table.
8356
4cf7a849
ST
83572011-02-11 Sriraman Tallam <tmsriram@google.com>
8358
8359 * output.cc (Output_section::add_input_section): Delay fill
8360 generation for section ordering.
8361
b578bd7d
ILT
83622011-02-09 Ian Lance Taylor <iant@google.com>
8363
8364 PR gold/12316
8365 * object.h (class Sized_relobj): Remove clear_local_symbols.
8366 * reloc.cc (Sized_relobj::do_relocate): Don't call
8367 clear_local_symbols.
8368
9370ce59 83692011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8370
8371 * plugin.cc (is_visible_from_outside): Return true for symbols
8372 in the -u option.
8373
55382fb7
ILT
83742011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8375
8376 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8377 filename.
8378
4e271fff
ST
83792011-02-02 Sriraman Tallam <tmsriram@google.com>
8380
8381 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8382 to std::string.
4e271fff 8383 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8384 section_name to be std::string.
4e271fff
ST
8385 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8386
d433c3ac
ILT
83872011-01-25 Ian Lance Taylor <iant@google.com>
8388
8389 * script.cc (script_add_extern): Rewrite to use
8390 add_symbol_reference.
8391
880473a6
DK
83922011-01-25 Doug Kwan <dougkwan@google.com>
8393
d433c3ac 8394 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8395
f30f86fa
ILT
83962011-01-24 Ian Lance Taylor <iant@google.com>
8397
8398 * options.h (class General_options): Accept
8399 --no-detect-odr-violations.
8400
8e51a0b9
ILT
84012011-01-24 Ian Lance Taylor <iant@google.com>
8402
8403 * version.cc (version_string): Bump to 1.11.
8404
0f3b89d8
ILT
84052011-01-24 Ian Lance Taylor <iant@google.com>
8406
8407 * plugin.cc (class Plugin_rescan): Define new class.
8408 (Plugin_manager::claim_file): Set any_claimed_.
8409 (Plugin_manager::save_archive): New function.
8410 (Plugin_manager::save_input_group): New function.
8411 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8412 necessary.
8413 (Plugin_manager::new_undefined_symbol): New function.
8414 (Plugin_manager::rescan): New function.
8415 (Plugin_manager::rescannable_defines): New function.
8416 (Plugin_manager::add_input_file): Set any_added_.
8417 * plugin.h (class Plugin_manager): define new fields rescannable_,
8418 undefined_symbols_, any_claimed_, and any_added_. Declare
8419 Plugin_rescan as friend. Declare new functions.
8420 (Plugin_manager::Rescannable): Define type.
8421 (Plugin_manager::Rescannable_list): Define type.
8422 (Plugin_manager::Undefined_symbol_list): Define type.
8423 (Plugin_manager::Plugin_manager): Initialize new fields.
8424 * archive.cc (Archive::defines_symbol): New function.
8425 (Add_archive_symbols::run): Pass archive to plugins if any.
8426 * archive.h (class Archive): Declare defines_symbol.
8427 * readsyms.cc (Input_group::~Input_group): New function.
8428 (Finish_group::run): Pass input_group to plugins if any.
8429 * readsyms.h (class Input_group): Declare destructor.
8430 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8431 any.
8432
3bb951e5
ILT
84332011-01-10 Ian Lance Taylor <iant@google.com>
8434
8435 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8436 section as relro.
8437 (Layout::set_segment_offsets): Reset increase_relro before calling
8438 set_section_addresses a second time.
8439
0aa45fac
CC
84402011-01-04 Cary Coutant <ccoutant@google.com>
8441
8442 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8443 sections before NOBITS sections.
8444
0db46eb4
L
84452011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8446
8447 * version.cc (print_version): Update copyright to 2011.
8448
829c9745
CC
84492010-12-23 Cary Coutant <ccoutant@google.com>
8450
8451 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8452 of OS to this->add. Add OD parameter to second form of the function.
8453
7500420b
ILT
84542010-12-20 Ian Lance Taylor <iant@google.com>
8455
8456 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8457 second of two consecutive entries with same offset.
8458
f8e9a930
RW
84592010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8460
8461 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8462 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8463 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8464 to avoid unneeded links against $(LDADD).
8465 * testsuite/Makefile.in: Regenerate.
8466
2fbb4320
ILT
84672010-12-15 Ian Lance Taylor <iant@google.com>
8468
8469 PR gold/12324
8470 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8471 for R_X86_64_32 and R_X86_64_PC32.
8472 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8473 ver_matching_def_pic.o.
8474 (ver_matching_def_pic.o): New target.
8475
fedb228d
RW
84762010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8477
8478 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8479 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8480 Move definition before File_read::View member definitions.
8481 (File_read::View::~View): Initialize and hold lock before
8482 updating current_mapped_bytes.
8483
9b547ce6
RW
84842010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8485
8486 * dwarf_reader.cc: Remove outdated comment.
8487 * gold-threads.cc: Fix typo in error message.
8488 * archive.cc: Fix typos in comments.
8489 * archive.h: Likewise.
8490 * arm-reloc-property.cc: Likewise.
8491 * arm-reloc-property.h: Likewise.
8492 * arm-reloc.def: Likewise.
8493 * arm.cc: Likewise.
8494 * attributes.h: Likewise.
8495 * cref.cc: Likewise.
8496 * ehframe.cc: Likewise.
8497 * fileread.h: Likewise.
8498 * gold.h: Likewise.
8499 * i386.cc: Likewise.
8500 * icf.cc: Likewise.
8501 * incremental.h: Likewise.
8502 * int_encoding.cc: Likewise.
8503 * layout.h: Likewise.
8504 * main.cc: Likewise.
8505 * merge.h: Likewise.
8506 * object.cc: Likewise.
8507 * object.h: Likewise.
8508 * options.cc: Likewise.
8509 * readsyms.cc: Likewise.
8510 * reduced_debug_output.cc: Likewise.
8511 * reloc.cc: Likewise.
8512 * script-sections.cc: Likewise.
8513 * sparc.cc: Likewise.
8514 * symtab.h: Likewise.
8515 * target-reloc.h: Likewise.
8516 * target.cc: Likewise.
8517 * target.h: Likewise.
8518 * timer.cc: Likewise.
8519 * timer.h: Likewise.
8520 * x86_64.cc: Likewise.
8521
83e17bd5
CC
85222010-12-09 Cary Coutant <ccoutant@google.com>
8523
8524 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8525 stack.
8526 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8527 parameter; change all callers.
8528 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8529 * options.h (warn_execstack): New option.
8530
017257f8
DK
85312010-12-07 Doug Kwan <dougkwan@google.com>
8532
8533 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8534 like function call relocations.
8535
c20cbc06
ILT
85362010-12-07 Ian Lance Taylor <iant@google.com>
8537
8538 * archive.cc (Archive::get_elf_object_for_member): Permit
8539 punconfigured to be NULL.
8540 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8541 (Archive::include_member): Pass NULL to get_elf_object_for_member
8542 if we searched for the archive and this is the first included
8543 object.
8544
4dbfafcc
ILT
85452010-12-01 Ian Lance Taylor <iant@google.com>
8546
8547 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8548 track_relocs_type_ field.
8549 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8550 Set track_relocs_type_.
8551 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8552 contents when using RELA relocs.
8553 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8554 reloc_map_.
8555 * reloc.cc (Track_relocs::next_addend): New function.
8556 * reloc.h (class Track_relocs): Declare next_addend.
8557
e5e19edd
ILT
85582010-12-01 Ian Lance Taylor <iant@google.com>
8559
8560 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8561 virtual destructor.
8562
9a5ce24c
ILT
85632010-12-01 Ian Lance Taylor <iant@google.com>
8564
8565 * README: Update compilers known to work and fail.
8566
c7791212
NC
85672010-11-23 Matthias Klose <doko@ubuntu.com>
8568
8569 * configure.in: For --enable-gold, handle value `default' instead of
8570 `both*'. Always install ld as ld.bfd, install as ld if gold is
8571 not the default.
8572 * configure: Regenerate.
8573
0ad220c9
DK
85742010-11-18 Doug Kwan <dougkwan@google.com>
8575
8576 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8577 and right_alignment to be zero. Store result alignment only if it is
8578 greater than existing alignment.
8579
ab8056e0
CC
85802010-11-16 Cary Coutant <ccoutant@google.com>
8581
8582 PR gold/12220
8583 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8584 Check for ".zdebug_line".
8585
fd064a5b
CC
85862010-11-16 Doug Kwan <dougkwan@google.com>
8587 Cary Coutant <ccoutant@google.com>
8588
8589 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8590 by reference; adjust all callers.
8591 * output.cc (Output_segment::set_section_addresses): Adjust references
8592 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8593 list is empty.
8594 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8595 end at page boundary.
8596
6fc6ea19
CC
85972010-11-16 Cary Coutant <ccoutant@google.com>
8598
8599 PR gold/12220
8600 * layout.cc (Layout::choose_output_section): Transform names of
8601 compressed sections even when using a script with a SECTIONS clause.
8602 (Layout::output_section_name): Remove code to transform
8603 compressed debug section names.
8604 * output.cc (Output_section::add_input_section): Use uncompressed
8605 section size when tracking input sections.
8606
95a2c8d6
RS
86072010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8608
8609 * symtab.h (Symbol::NON_PIC_REF): Remove.
8610 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8611 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8612 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8613 (Symbol::use_plt_offset): Take a flags argument and pass it
8614 directly to needs_dynamic_reloc. Restrict check for undefined
8615 weak symbols to function calls.
8616 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8617 (Target_arm::Scan::global): Use it.
8618 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8619 (Target_arm::Relocate::relocate): Likewise.
8620 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8621 parameter with an r_type parameter. Use get_reference_flags
8622 to get the flags.
8623 (Target_arm::Relocate::relocate): Update accordingly.
8624 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8625 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8626 (Target_i386::Scan::global): Likewise.
8627 (Target_i386::Relocate::relocate): Likewise.
8628 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8629 parameter with an r_type parameter. Use get_reference_flags
8630 to get the flags.
8631 (Target_i386::Relocate::relocate): Update accordingly.
8632 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8633 (Target_powerpc::Scan::global): Use it.
8634 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8635 (Target_powerpc::Relocate::relocate): Likewise.
8636 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8637 (Target_sparc::Scan::global): Use it.
8638 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8639 (Target_sparc::Relocate::relocate): Likewise.
8640 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8641 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8642 (Target_x86_64::Scan::global): Likewise.
8643 (Target_x86_64::Relocate::relocate): Likewise.
8644
f625ae50
DK
86452010-11-08 Doug Kwan <dougkwan@google.com>
8646 Cary Coutant <ccoutant@google.com>
8647
8648 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8649 (Arm_exidx_merge_section::section_contents_): New data member.
8650 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8651 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8652 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8653 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8654 in parameters instead of calling Object::section_contents without
8655 locking.
8656 (Arm_output_section::group_section): New parameter TASK. Pass it
8657 to callees that need locking objects.
8658 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8659 to lock EXIDX input sections. Fix a formatting issue. Call
8660 Arm_exidx_merged_section::build_contents to create merged section
8661 contents.
8662 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8663 to lock object of stub table owner.
8664 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8665 TEXT_SIZE to initialize data member TEXT_SIZE_.
8666 (Arm_exidx_input_section::addralign): Fix typo in comment.
8667 (Arm_exidx_input_section::text_size): New method.
8668 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8669 that require locking objects. Lock objects before scanning for stubs
8670 and updating local symbols.
8671 (Arm_input_section<big_endian>::init): Copy contents of original
8672 input section.
2e702c99 8673 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8674 original input section instead of calling Object::section_contents
8675 without locking.
8676 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8677 size without calling Object::section_size().
8678 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8679 for size. Allocate a buffer for merged EXIDX entries.
8680 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8681 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8682 building code to Arm_exidx_merged_section::build_contetns. Write
8683 out contetns in buffer instead of building it on the fly.
8684 (Arm_relobj::make_exidx_input_section): Also pass text section size
8685 to Arm_exidx_input_section constructor.
8686 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8687 (Arm_dynobj::do_read_symbols): Fix memory leak.
8688 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8689 * target.h: (class Task): Add forward declaration.
8690 (Target::relax): Add new parameter TASK and pass it to
8691 Target::do_relax().
8692 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8693
5f9bcf58
CC
86942010-11-05 Cary Coutant <ccoutant@google.com>
8695
8696 PR gold/10708
8697 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8698 object when reading from the file.
8699 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8700 second layout pass.
8701 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8702 when reading section contents.
8703 (get_section_contents): Likewise.
8704 (icf::find_identical_sections): Likewise.
8705 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8706 object when reading from the file.
8707 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8708 the object when doing deferred section layout.
8709
e597fa08
NC
87102010-11-03 Nick Clifton <nickc@redhat.com>
8711
8712 PR gold/12001
8713 * script.h (class Symbol_assignment: name): New member. Returns
8714 the name of the symbol.
8715 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8716 Returns true if the given symbol name is on the list of
8717 assignments wating to be processed.
8718 * archive.cc (should_incldue_member): If the symbol is undefined,
8719 check to see if it is on the list of symbols pending assignment.
8720
3f9a3278
ILT
87212010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8722
8723 * script-sections.cc (Script_sections::find_memory_region): Check
8724 for a NULL output section pointer.
8725
d06fb4d1
DK
87262010-10-29 Doug Kwan <dougkwan@google.com>
8727
8728 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8729 Output_section::add_relaxed_input_section.
8730 * output.cc (Output_section::add_relaxed_input_section): Add new
8731 arguments LAYOUT and NAME. Set section order index.
8732 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8733 Copy section order index.
8734 * output.h (Output_section::add_relaxed_input_section): Add new
8735 arguments LAYOUT and NAME.
8736
90e24de5
ILT
87372010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8738
8739 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8740 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8741 * testsuite/Makefile.in: Regenerate.
8742
c9484ea5
DK
87432010-10-20 Doug Kwan <dougkwan@google.com>
8744
8745 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8746 without SHF_LINK_ORDER flags.
8747 * layout.cc (Layout::choose_output_section): Do not filter
8748 SHF_LINK_ORDER flag in a relocatable link.
8749
5bc2f5be
CC
87502010-10-17 Cary Coutant <ccoutant@google.com>
8751
8752 * output.h (Output_segment::set_section_addresses): Change function
8753 signature. Update all callers.
8754 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8755 sections.
8756 (Output_segment::set_section_addresses): Align after last TLS
8757 section. Add padding before last relro section instead of after.
8758
0c91cf04
DK
87592010-10-17 Doug Kwan <dougkwan@google.com>
8760
8761 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8762 GOT output section to be writable.
8763
8c21d9d3
CC
87642010-10-14 Cary Coutant <ccoutant@google.com>
8765
8766 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8767 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8768 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8769 mode.
8770 * incremental.cc (report_command_line): Ignore all forms of
8771 --incremental.
8772 * layout.cc (Layout::Layout): Check parameters for incremental link
8773 mode.
8774 * options.cc (General_options::parse_incremental): New function.
8775 (General_options::parse_no_incremental): New function.
8776 (General_options::parse_incremental_full): New function.
8777 (General_options::parse_incremental_update): New function.
8778 (General_options::incremental_mode_): New data member.
8779 (General_options::finalize): Check incremental_mode_.
8780 * options.h (General_options): Update help text for --incremental.
8781 Add --no-incremental, --incremental-full, --incremental-update.
8782 (General_options::Incremental_mode): New enum type.
8783 (General_options::incremental_mode): New function.
8784 (General_options::incremental_mode_): New data member.
8785 * parameters.cc (Parameters::incremental_mode_): New data member.
8786 (Parameters::set_options): Set incremental_mode_.
8787 (Parameters::set_incremental_full): New function.
8788 (Parameters::incremental): New function.
8789 (Parameters::incremental_update): New function.
8790 (set_parameters_incremental_full): New function.
8791 * parameters.h (Parameters::set_incremental_full): New function.
8792 (Parameters::incremental): New function.
8793 (Parameters::incremental_update): New function.
8794 (Parameters::incremental_mode_): New data member.
8795 (set_parameters_incremental_full): New function.
8796 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8797 incremental link mode.
8798 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8799 (Sized_relobj::do_relocate_sections): Likewise.
8800 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8801 option.
8802 * testsuite/Makefile.in: Regenerate.
8803 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8804
bb32aa18 88052010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8806
8807 * script-sections.h (class Script_sections): Make
8808 Sections_elements typedef public.
8809 * script-sections.cc (class Sort_output_sections): Add elements_
8810 field. Add constructor which sets it; change all callers.
8811 (Sort_output_sections::is_before): New function.
8812 (Sort_output_sections::operator()): Call is_before.
8813 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8814 conditional.
8815 * testsuite/script_test_10.sh: New test. Test script section
8816 order.
8817 * testsuite/script_test_10.t: Likewise.
8818 * testsuite/script_test_10.s: Likewise.
8819 * testsuite/Makefile.am: Wrap the cross linker tests and the
8820 common tests into NATIVE_OR_CROSS_LINKER.
8821 (check_SCRIPTS): Add script_test_10.sh.
8822 (check_DATA): Add script_test_10.stdout.
8823 (script_test_10.o, script_test_10): New targets.
8824 (script_test_10.stdout): New target.
8825 * configure, testsuite/Makefile.in: Regenerate.
8826
3cef7179
ILT
88272010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8828
8829 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8830 error for the deprecated relocations.
8831 (Target_arm::Scan::global): Likewise.
8832 (Target_arm::Relocate::relocate): Likewise.
8833
7411e9a8
RS
88342010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8835
8836 * fileread.cc (Input_file::find_file): Initialize *found_name
8837 and *namep when using the fallback search for case 4.
8838
6a9da32a
CC
88392010-10-11 Cary Coutant <ccoutant@google.com>
8840
8841 * options.h (class General_options): Redefine -z lazy as an alias for
8842 the negation of -z now.
8843
ac897c20
ILT
88442010-10-11 Ian Lance Taylor <iant@google.com>
8845
8846 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8847 binding.
8848
ea5cae92
NC
88492010-10-06 Nick Clifton <nickc@redhat.com>
8850
8851 * script-sections.cc(class Memory_region): Remove
8852 current_lma_offset_ field. Rename current_vma_offset_ to
8853 current_offset_. Add last_section_ field.
8854 (Memory_region::get_current_vma_address): Rename to
8855 get_current_address.
8856 (Memory_region::get_current_lma_address): Delete.
8857 (Memory_region::increment_vma_offset): Rename to
8858 increment_offset.
8859 (Memory_region::increment_lma_offset): Delete.
8860 (Memory_region::attributes_compatible): New method. Returns
8861 true if the provided section is compatible with the region.
8862 (Memory_region::get_last_section): New method. Returns the last
8863 section to use the region.
8864 (Memory_region::set_last_section): New method. Stores the last
8865 section to use the region.
8866 (Script_sections::block_in_region): New method. Returns true if
8867 a block of memory is contained within a region.
8868 (Script_sections::find_memory_region): New method. Locates a
8869 memory region to be used to set a VMA or LMA address.
8870 (Output_section_definition::set_section_addresses): Add code to
8871 check for addresses set by memory regions.
8872 (Output_segment::set_section_addresses): Remove memory region
8873 walking code.
8874 (Script_sections::create_segment): Add a warning if a header
8875 segment is created outside of any region.
8876 * script-sections.h (class Script_sections): Add prototypes for
8877 find_memory_region and block_in_region methods.
8878 * testsuite/memory_test.s: Use .long instead of .word.
8879 * testsuite/memory_test.t: Add some more output sections.
8880 * testsuite/memory_test.sh: Update expected output.
8881
a9bfd952
DK
88822010-10-02 Doug Kwan <dougkwan@google.com>
8883
8884 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8885 defintion to symtab.h
8886 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8887 declaration to defintion.
8888
bacff3ab
NC
88892010-10-01 Nick Clifton <nickc@redhat.com>
8890
8891 * expression.cc (eval): Replace dummy argument with NULL.
8892 (eval_maybe_dot): Check for a NULL result section pointer.
8893 (Symbol_expression::value): Likewise.
8894 (Dot_expression::value): Likewise.
8895 (BINARY_EXPRESSION): Likewise.
8896 (Max_expression::value): Likewise.
8897 (Min_expression::value): Likewise.
8898 (Absolute_expression::value): Likewise.
8899 (Addr_expression::value_from_output_section): Likewise.
8900 (Loaddddr_expression::value_from_output_section): Likewise.
8901 (Segment_start_expression::value): Likewise.
8902 * script-sections.cc
8903 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8904 argument with NULL.
8905 (Sections_elememt_dot_assignment::set_section_addresses):
8906 Likewise.
8907 (Output_data_expression::do_write_to_buffer): Likewise.
8908 (Output_section_definition::finalize_symbols): Likewise.
8909 (Output_section_definition::set_section_addresses): Likewise.
8910
f81bc8b5
DK
89112010-09-30 Doug Kwan <dougkwan@google.com>
8912
8913 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8914
c95e9f27
ST
89152010-09-28 Sriraman Tallam <tmsriram@google.com>
8916
8917 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8918 function.
c95e9f27
ST
8919 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8920 virtual function.
8921 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8922 virtual function.
8923 * icf.cc (get_section_contents): Inline merge sections only when
8924 target allows it.
8925
3cac54d2
RW
89262010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8927
8928 * configure: Regenerate.
8929
2904037a
ILT
89302010-09-17 Ian Lance Taylor <iant@google.com>
8931
8932 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8933 * testsuite/Makefile.am (memory_test.o): New target.
8934 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8935 memory_test.t.
8936 * testsuite/Makefile.in: Rebuild.
2904037a 8937
bca7fb63
DK
89382010-09-17 Doug Kwan <dougkwan@google.com>
8939
8940 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8941 defintion if relocation uses GOT entries of the symbol.
8942 * testsuite/icf_safe_test.sh: Fix test.
8943 * testsuite/icf_safe_so_test.sh: Fix test.
8944
4ef28648
CC
89452010-09-16 Cary Coutant <ccoutant@google.com>
8946
8947 * script_sections.cc (class Memory_region): Remove "NULL" from
8948 vector initializations.
8949
793990de
CC
89502010-09-15 Cary Coutant <ccoutant@google.com>
8951
8952 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8953 Resolve forwarding symbols.
8954
81e015e2
DK
89552010-09-15 Doug Kwan <dougkwan@google.com>
8956
8957 * gold/testsuite/script_test_3.t: Add ARM special sections.
8958 * gold/testsuite/script_test_4.t: Same.
8959 * gold/testsuite/script_test_5.t: Same.
8960 * gold/testsuite/script_test_6.t: Same.
8961 * gold/testsuite/script_test_7.t: Same.
8962 * gold/testsuite/script_test_7.t: Same.
8963 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8964
36171d64
CC
89652010-09-14 Cary Coutant <ccoutant@google.com>
8966
8967 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8968 (Target_x86_64::Relocate::relocate_tls): Replace check for
8969 saw_tls_block_reloc_ with test for executable section.
8970
d89051bd
CC
89712010-09-12 Cary Coutant <ccoutant@google.com>
8972
8973 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8974 position-independent executables to shared libraries need dynamic
8975 relocations.
8976 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8977 position-independent executables.
8978 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8979 * testsuite/Makefile.in: Regenerate.
8980
fca41f0f
NC
89812010-09-10 Nick Clifton <nickc@redhat.com>
8982
8983 PR gold/11997
8984 * testsuite/memory_test.t: Discard any sections that are not
8985 needed.
8986
6695e4b3
L
89872010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8988
8989 PR gold/11996
8990 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8991 "This::" to work around a bug in gcc 4.2.
8992
8993 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8994
0f72bf6f
RÁE
89952010-09-09 Rafael Espindola <espindola@google.com>
8996
8997 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8998 sections with different PF_X flags in the same segment.
8999 (Layout::find_first_load_seg): Search all segments to find the first
9000 one.
9001 * options.h (rosegment): New.
9002
90032010-09-08 Rafael Espindola <espindola@google.com>
a6577478 9004
05a79166 9005 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 9006
aa98ff75
DK
90072010-09-08 Doug Kwan <dougkwan@google.com>
9008
9009 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9010 (Arm_relobj::do_relocate_sections): Add new parameter for output
9011 file to match the parent.
9012 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9013 of local symbols instead of input values. Update code to track
9014 changes in gold::relocate_section.
9015 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9016 (Sized_relobj::compute_final_local_value_internal): New methods.
9017 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9018 body into private version of Sized_relobj::compute_final_local_value.
9019 Call the inline method.
9020 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9021 merged symbol value if there is one.
9022 (Symbol_value::has_output_value): New method defintiion.
9023 (Sized_relobj::Compute_final_local_value_status): New enum type.
9024 (Sized_relobj::compute_final_local_value): New methods.
9025 (Sized_relobj::compute_final_local_value_internal): New methods.
9026 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9027 and arm_cortex_a8.sh.
9028 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9029 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9030 New tests.
9031 * Makefile.in: Regenerate.
9032 * testsuite/arm_bl_out_of_range.s: Update test.
9033 * testsuite/thumb_bl_out_of_range.s: Ditto.
9034 * testsuite/thumb_blx_out_of_range.s: Ditto.
9035 * testsuite/arm_branch_out_of_range.sh: New file.
9036 * testsuite/arm_cortex_a8.sh: Ditto.
9037 * testsuite/arm_cortex_a8_b.s: Ditto.
9038 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9039 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9040 * testsuite/arm_cortex_a8_bl.s: Ditto.
9041 * testsuite/arm_cortex_a8_blx.s: Ditto.
9042 * testsuite/arm_cortex_a8_local.s: Ditto.
9043 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9044 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9045
05a79166
L
90462010-09-08 Rafael Espindola <espindola@google.com>
9047
9048 * Makefile.am (memory_test.stdout): Run readelf with -W.
9049 * Makefile.in: Regenerate.
9050 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9051 64 bit output.
9052
33dbc701
RÁE
90532010-09-08 Rafael Espindola <espindola@google.com>
9054
9055 * script-sections.cc (Script_sections::add_memory_region): Convert
9056 field precision to int.
9057 * script.cc (script_set_section_region, script_set_section_region):
9058 Convert field precision to int.
9059
731ca54a
RÁE
90602010-09-08 Rafael Espindola <espindola@google.com>
9061
9062 * arm.cc (do_finalize_sections): Create the __exidx_start and
9063 __exdix_end symbols even when the section is missing.
9064
7f8cd844
NC
90652010-09-08 Nick Clifton <nickc@redhat.com>
9066
9067 * README: Remove claim that MEMORY is not supported.
9068 * expression.cc (script_exp_function_origin)
9069 (script_exp_function_length): Move from here to ...
9070 * script.cc: ... here.
9071 (script_set_section_region, script_add_memory)
9072 (script_parse_memory_attr, script_include_directive): New
9073 functions.
9074 * script-sections.cc
9075 (class Memory_region): New class.
9076 (class Output_section_definition): Add set_memory_region,
9077 set_section_vma, set_section_lma and get_section_name methods.
9078 (class Script_Sections): Add add_memory_region,
9079 find_memory_region, find_memory_region_origin,
9080 find_memory_region_length and set_memory_region methods.
9081 Have set_section_addresses method walk the list of set memory
9082 regions.
9083 Extend the print methos to display memory regions.
9084 * script-sections.h: Add prototypes for new methods.
9085 Add enum for MEMORY region attributes.
9086 * yyscript.y: Add support for parsing MEMORY regions.
9087 * script-c.h: Add prototypes for new functions.
9088 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9089 * testsuite/Makefile.in: Regenerate.
9090 * testsuite/memory_test.sh: New script.
9091 * testsuite/memory_test.s: New assembler source file.
9092 * testsuite/memory_test.t: New linker script.
9093
a4649286
DK
90942010-08-27 Doug Kwan <dougkwan@google.com>
9095
9096 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9097 reference override an existing dynamic weak reference.
9098 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9099 * testsuite/Makefile.in: Regenerate.
9100 * testsuite/dyn_weak_ref.sh: New file.
9101 * testsuite/dyn_weak_ref_1.c: Ditto.
9102 * testsuite/dyn_weak_ref_2.c: Ditto.
9103
b56648ad
ILT
91042010-08-27 Ian Lance Taylor <iant@google.com>
9105
9106 * incremental.h (class Incremental_input_entry): Add virtual
9107 destructor.
9108
809313cb
ILT
91092010-08-27 Ian Lance Taylor <iant@google.com>
9110
9111 * testsuite/start_lib_test_3.c: Mark t3 as used.
9112
11e32464
NC
91132010-08-27 Nick Clifton <nickc@redhat.com>
9114
9115 * options.cc (version_script): Fix small typo in previous
9116 whitespace tidyup.
9117
ca09d69a
NC
91182010-08-25 Nick Clifton <nickc@redhat.com>
9119
9120 * archive.cc: Formatting fixes: Remove whitespace between
9121 typename and following asterisk. Remove whitespace between
9122 function name and opening parenthesis.
9123 * archive.h: Likewise.
9124 * arm.cc: Likewise.
9125 * attributes.cc: Likewise.
9126 * attributes.h: Likewise.
9127 * common.cc: Likewise.
9128 * copy-relocs.cc: Likewise.
9129 * dirsearch.h: Likewise.
9130 * dynobj.cc: Likewise.
9131 * ehframe.cc: Likewise.
9132 * ehframe.h: Likewise.
9133 * expression.cc: Likewise.
9134 * fileread.cc: Likewise.
9135 * fileread.h: Likewise.
9136 * gc.h: Likewise.
9137 * gold-threads.cc: Likewise.
9138 * gold.cc: Likewise.
9139 * i386.cc: Likewise.
9140 * icf.h: Likewise.
9141 * incremental-dump.cc: Likewise.
9142 * incremental.cc: Likewise.
9143 * layout.cc: Likewise.
9144 * layout.h: Likewise.
9145 * main.cc: Likewise.
9146 * merge.cc: Likewise.
9147 * merge.h: Likewise.
9148 * object.cc: Likewise.
9149 * object.h: Likewise.
9150 * options.cc: Likewise.
9151 * options.h: Likewise.
9152 * output.cc: Likewise.
9153 * output.h: Likewise.
9154 * plugin.cc: Likewise.
9155 * plugin.h: Likewise.
9156 * powerpc.cc: Likewise.
9157 * reloc.cc: Likewise.
9158 * script-c.h: Likewise.
9159 * script-sections.cc: Likewise.
9160 * script.cc: Likewise.
9161 * stringpool.cc: Likewise.
9162 * symtab.cc: Likewise.
9163 * symtab.h: Likewise.
9164 * target.cc: Likewise.
9165 * timer.cc: Likewise.
9166 * timer.h: Likewise.
9167 * version.cc: Likewise.
9168 * x86_64.cc: Likewise.
9169
b8fa8750
NC
91702010-08-24 Nick Clifton <nickc@redhat.com>
9171
9172 PR 11899
9173 * layout.cc (segment_precedes): Sort segments by their physical
9174 addresses, if they have been set.
9175
9919d93b
CC
91762010-08-23 Cary Coutant <ccoutant@google.com>
9177
9178 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9179 symbols data.
9180 (Lib_group::include_member): Unlock object after deleting its
9181 symbols data.
9182 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9183 the bug fixed here.
9184
97b4be1c
CC
91852010-08-19 Neil Vachharajani <nvachhar@google.com>
9186 Cary Coutant <ccoutant@google.com>
9187
9188 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9189 constructor, and set_blocker.
9190 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9191 readsyms_blocker_.
9192 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9193 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9194 * testsuite/Makefile.am (start_lib_test): New test case.
9195 * testsuite/Makefile.in: Regenerate.
9196 * testsuite/start_lib_test_main.c: New file.
9197 * testsuite/start_lib_test_1.c: New file.
9198 * testsuite/start_lib_test_2.c: New file.
9199 * testsuite/start_lib_test_3.c: New file.
9200
dd0b1884
ILT
92012010-08-19 Ian Lance Taylor <iant@google.com>
9202
9203 * Makefile.in: Rebuild with automake 1.11.1.
9204 * aclocal.m4: Likewise.
9205 * testsuite/Makefile.in: Likewise.
9206
7223e9ca
ILT
92072010-08-19 Ian Lance Taylor <iant@google.com>
9208
9209 PR 10893
9210 * i386.cc (class Output_data_plt_i386): Update declarations.
9211 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9212 local_ifuncs_ fields.
9213 (Target_i386::do_plt_section_for_global): New function.
9214 (Target_i386::do_plt_section_for_local): New function.
9215 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9216 parameter; change all callers. Initialize global_ifuncs_ and
9217 local_ifuncs_. If doing a static link define __rel_iplt_start and
9218 __rel_iplt_end.
9219 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9220 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9221 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9222 symbols.
9223 (Target_i386::make_plt_section): New function, broken out of
9224 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9225 (Target_i386::make_plt_entry): Call make_plt_section.
9226 (Target_i386::make_local_ifunc_plt_entry): New function.
9227 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9228 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9229 R_386_IRELATIVE to switch.
9230 (Target_i386::Scan::global): Likewise.
9231 (Target_i386::Relocate::relocate): Likewise.
9232 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9233 switch.
9234 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9235 (Target_x86_64::do_plt_section_for_global): New function.
9236 (Target_x86_64::do_plt_section_for_local): New function.
9237 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9238 parameter; change all callers. If doing a static link define
9239 __rela_iplt_start and __rela_iplt_end.
9240 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9241 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9242 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9243 to point to .plt.
9244 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9245 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9246 switch.
9247 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9248 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9249 R_X86_64_IRELATIVE to switch.
9250 (Target_x86_64::Scan::global): Likewise.
9251 (Target_x86_64::Relocate::relocate): Likewise.
9252 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9253 switch.
9254 * target.h (class Target): Add plt_section_for_global and
9255 plt_section_for_local functions. Add do_plt_section_for_global
9256 and do_plt_section_for_local virtual functions.
9257 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9258 clarifying comments.
9259 (Symbol::use_plt_offset): Handle IFUNC symbol.
9260 * object.cc (Sized_relobj::Sized_relobj): Initialize
9261 local_plt_offsets_.
9262 (Sized_relobj::local_has_plt_offset): New function.
9263 (Sized_relobj::local_plt_offset): New function.
9264 (Sized_relobj::set_local_plt_offset): New function.
9265 (Sized_relobj::do_count): Handle IFUNC symbol.
9266 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9267 a bit away from input_shndx_ field. Add set_is_func_symbol and
9268 is_ifunc_symbol functions.
9269 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9270 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9271 local_plt_offsets_ field.
9272 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9273 * output.h (class Output_section_data): Add non-const
9274 output_section function.
9275 (class Output_data_got): Update declarations.
9276 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9277 Add use_plt_offset parameter to global and local constructors.
9278 Change all callers. Change local_sym_index_ field to 31 bits.
9279 Change GSYM_CODE and CONSTANT_CODE accordingly.
9280 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9281 doing a static link don't set sh_link field.
9282 (Output_data_got::Got_entry::write): Use PLT offset if
9283 appropriate.
9284 (Output_data_got::add_global_plt): New function.
9285 (Output_data_got::add_local_plt): New function.
9286 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9287 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9288 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9289 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9290 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9291 IFUNC conditional.
9292 * testsuite/ifunc-sel.h: New file.
9293 * testsuite/ifuncmain1.c: New file.
9294 * testsuite/ifuncmain1vis.c: New file.
9295 * testsuite/ifuncmod1.c: New file.
9296 * testsuite/ifuncdep2.c: New file.
9297 * testsuite/ifuncmain2.c: New file.
9298 * testsuite/ifuncmain3.c: New file.
9299 * testsuite/ifuncmod3.c: New file.
9300 * testsuite/ifuncmain4.c: New file.
9301 * testsuite/ifuncmain5.c: New file.
9302 * testsuite/ifuncmod5.c: New file.
9303 * testsuite/ifuncmain6pie.c: New file.
9304 * testsuite/ifuncmod6.c: New file.
9305 * testsuite/ifuncmain7.c: New file.
9306 * configure, testsuite/Makefile.in: Rebuild.
9307
56f75c03
ILT
93082010-08-18 Ian Lance Taylor <iant@google.com>
9309
9310 * incremental.cc
9311 (Output_section_incremental_inputs::write_input_files): Add cast
9312 to avoid signed/unsigned comparison warning.
9313 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9314
55455f89
CC
93152010-08-12 Cary Coutant <ccoutant@google.com>
9316
9317 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9318
e2054bcb
ILT
93192010-08-13 Ian Lance Taylor <iant@google.com>
9320
9321 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9322
74f67560
DK
93232010-08-12 Cary Coutant <ccoutant@google.com>
9324 Doug Kwan <dougkwan@google.com>
9325
9326 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9327 defintion overrides non-weak undef, remember that the original undef
9328 is not weak.
9329 * symtab.cc (Symbol_table::sized_write_global): For undef without
9330 an original weak binding, set binding to global in output.
9331 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9332 * testsuite/Makefile.in: Regenerate.
9333 * testsuite/strong_ref_weak_def.sh: New file.
9334 * testsuite/strong_ref_weak_def_1.c: Ditto.
9335 * testsuite/strong_ref_weak_def_2.c: Ditto.
9336
d1238d12
CC
93372010-08-12 Cary Coutant <ccoutant@google.com>
9338
9339 * testsuite/incremental_test.sh: Rewrite.
9340 * testsuite/incremental_test_1.c: Rewrite.
9341 * testsuite/incremental_test_2.c: Rewrite.
9342
0e70b911
CC
93432010-08-12 Cary Coutant <ccoutant@google.com>
9344
9345 * arm.cc (Target_arm::got_size): Add const.
9346 (Target_arm::got_entry_count): New function.
9347 (Target_arm::plt_entry_count): New function.
9348 (Target_arm::first_plt_entry_offset): New function.
9349 (Target_arm::plt_entry_size): New function.
9350 (Output_data_plt_arm::entry_count): New function.
9351 (Output_data_plt_arm::first_plt_entry_offset): New function.
9352 (Output_data_plt_arm::get_plt_entry_size): New function.
9353 * i386.cc (Target_i386::got_size): Add const.
9354 (Target_i386::got_entry_count): New function.
9355 (Target_i386::plt_entry_count): New function.
9356 (Target_i386::first_plt_entry_offset): New function.
9357 (Target_i386::plt_entry_size): New function.
9358 (Output_data_plt_i386::entry_count): New function.
9359 (Output_data_plt_i386::first_plt_entry_offset): New function.
9360 (Output_data_plt_i386::get_plt_entry_size): New function.
9361 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9362 find_incremental_inputs_sections. Dump incremental_got_plt section.
9363 * incremental.cc: Include target.h.
9364 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9365 parameter. Adjust all callers. Find incremental_got_plt section.
9366 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9367 section.
9368 (Output_section_incremental_inputs::set_final_data_size): Calculate
9369 size of incremental_got_plt section.
9370 (Output_section_incremental_inputs::do_write): Write the
9371 incremental_got_plt section.
9372 (Got_plt_view_info): New struct.
9373 (Local_got_offset_visitor): New class.
9374 (Global_got_offset_visitor): New class.
9375 (Global_symbol_visitor_got_plt): New class.
9376 (Output_section_incremental_inputs::write_got_plt): New function.
9377 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9378 Add parameter. Adjust all callers.
9379 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9380 (Incremental_inputs::got_plt_section): New function.
9381 (Incremental_inputs::got_plt_section_): New data member.
9382 (Incremental_got_plt_reader): New class.
9383 * layout.cc (Layout::create_incremental_info_sections): Add the
9384 incremental_got_plt section.
9385 * object.h (Got_offset_list::get_list): New function.
9386 (Got offset_list::for_all_got_offsets): New function.
9387 (Sized_relobj::local_got_offset_list): New function.
9388 * powerpc.cc (Target_powerpc::got_size): Add const.
9389 (Target_powerpc::got_entry_count): New function.
9390 (Target_powerpc::plt_entry_count): New function.
9391 (Target_powerpc::first_plt_entry_offset): New function.
9392 (Target_powerpc::plt_entry_size): New function.
9393 (Output_data_plt_powerpc::entry_count): New function.
9394 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9395 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9396 * sparc.cc (Target_sparc::got_size): Add const.
9397 (Target_sparc::got_entry_count): New function.
9398 (Target_sparc::plt_entry_count): New function.
9399 (Target_sparc::first_plt_entry_offset): New function.
9400 (Target_sparc::plt_entry_size): New function.
9401 (Output_data_plt_sparc::entry_count): New function.
9402 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9403 (Output_data_plt_sparc::get_plt_entry_size): New function.
9404 * symtab.h (Symbol::got_offset_list): New function.
9405 (Symbol_table::for_all_symbols): New function.
9406 * target.h (Sized_target::got_entry_count): New function.
9407 (Sized_target::plt_entry_count): New function.
9408 (Sized_target::plt_entry_size): New function.
9409 * x86_64.cc (Target_x86_64::got_size): Add const.
9410 (Target_x86_64::got_entry_count): New function.
9411 (Target_x86_64::plt_entry_count): New function.
9412 (Target_x86_64::first_plt_entry_offset): New function.
9413 (Target_x86_64::plt_entry_size): New function.
9414 (Output_data_plt_x86_64::entry_count): New function.
9415 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9416 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9417
09ec0418
CC
94182010-08-12 Cary Coutant <ccoutant@google.com>
9419
9420 * archive.cc: Include incremental.h.
9421 (Archive::Archive): Initialize incremental_info_.
9422 (Archive::include_member): Record archive members in incremental info.
9423 (Add_archive_symbols::run): Record begin and end of an archive in
9424 incremental info.
9425 (Lib_group::include_member): Record objects in incremental info.
9426 * archive.h (Incremental_archive_entry): Forward declaration.
9427 (Archive::set_incremental_info): New member function.
9428 (Archive::incremental_info): New member function.
9429 (Archive::Unused_symbol_iterator): New class.
9430 (Archive::unused_symbols_begin): New member function.
9431 (Archive::unused_symbols_end): New member function.
9432 (Archive::incremental_info_): New data member.
9433 * incremental-dump.cc (find_input_containing_global): New function.
9434 (dump_incremental_inputs): Dump new incremental info sections.
9435 * incremental.cc: Include symtab.h.
9436 (Output_section_incremental_inputs): New class.
9437 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9438 new incremental info sections.
9439 (Sized_incremental_binary::do_check_inputs): Likewise.
9440 (Incremental_inputs::report_archive): Remove.
9441 (Incremental_inputs::report_archive_begin): New function.
9442 (Incremental_inputs::report_archive_end): New function.
9443 (Incremental_inputs::report_object): New function.
9444 (Incremental_inputs::finalize_inputs): Remove.
9445 (Incremental_inputs::report_input_section): New function.
9446 (Incremental_inputs::report_script): Rewrite.
9447 (Incremental_inputs::finalize): Do nothing but finalize string table.
9448 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9449 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9450 (Incremental_inputs::create_data_sections): New function.
9451 (Incremental_inputs::relocs_entsize): New function.
9452 (Output_section_incremental_inputs::set_final_data_size): New function.
9453 (Output_section_incremental_inputs::do_write): New function.
9454 (Output_section_incremental_inputs::write_header): New function.
9455 (Output_section_incremental_inputs::write_input_files): New function.
9456 (Output_section_incremental_inputs::write_info_blocks): New function.
9457 (Output_section_incremental_inputs::write_symtab): New function.
9458 * incremental.h (Incremental_script_entry): Forward declaration.
9459 (Incremental_object_entry): Forward declaration.
9460 (Incremental_archive_entry): Forward declaration.
9461 (Incremental_inputs): Forward declaration.
9462 (Incremental_inputs_header_data): Remove.
9463 (Incremental_inputs_header): Remove.
9464 (Incremental_inputs_header_write): Remove.
9465 (Incremental_inputs_entry_data): Remove.
9466 (Incremental_inputs_entry): Remove.
9467 (Incremental_inputs_entry_write): Remove.
9468 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9469 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9470 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9471 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9472 Likewise.
9473 (Incremental_input_entry): New class.
9474 (Incremental_script_entry): New class.
9475 (Incremental_object_entry): New class.
9476 (Incremental_archive_entry): New class.
9477 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9478 (Incremental_inputs::report_inputs): Remove.
9479 (Incremental_inputs::report_archive): Remove.
9480 (Incremental_inputs::report_archive_begin): New function.
9481 (Incremental_inputs::report_archive_end): New function.
9482 (Incremental_inputs::report_object): Change prototype.
9483 (Incremental_inputs::report_input_section): New function.
9484 (Incremental_inputs::report_script): Change prototype.
9485 (Incremental_inputs::get_reloc_count): New function.
9486 (Incremental_inputs::set_reloc_count): New function.
9487 (Incremental_inputs::create_data_sections): New function.
9488 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9489 (Incremental_inputs::inputs_section): New function.
9490 (Incremental_inputs::symtab_section): New function.
9491 (Incremental_inputs::relocs_section): New function.
9492 (Incremental_inputs::get_stringpool): Add const.
9493 (Incremental_inputs::command_line): Add const.
9494 (Incremental_inputs::inputs): Remove.
9495 (Incremental_inputs::command_line_key): New function.
9496 (Incremental_inputs::input_file_count): New function.
9497 (Incremental_inputs::input_files): New function.
9498 (Incremental_inputs::relocs_entsize): New function.
9499 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9500 (Incremental_inputs::finalize_inputs): Remove.
9501 (Incremental_inputs::Input_info): Remove.
9502 (Incremental_inputs::lock_): Remove.
9503 (Incremental_inputs::inputs_): Change type.
9504 (Incremental_inputs::inputs_map_): Remove.
9505 (Incremental_inputs::current_object_entry_): New data member.
9506 (Incremental_inputs::inputs_section_): New data member.
9507 (Incremental_inputs::symtab_section_): New data member.
9508 (Incremental_inputs::relocs_section_): New data member.
9509 (Incremental_inputs::reloc_count_): New data member.
9510 (Incremental_inputs_reader): New class.
9511 (Incremental_symtab_reader): New class.
9512 (Incremental_relocs_reader): New class.
9513 * layout.cc (Layout::finalize): Move finalization of incremental info
9514 and creation of incremental info sections to follow finalization of
9515 symbol table. Set offsets for postprocessing sections.
9516 (Layout::create_incremental_info_sections): Call
9517 Incremental_inputs::create_data_sections. Add incremental symtab
9518 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9519 sections to layout after input sections.
9520 * layout.h (struct Timespec): Forward declaration.
9521 (Layout::incremental_inputs): Add const.
9522 (Layout::create_incremental_info_sections): Add parameter.
9523 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9524 * object.cc: Include incremental.h.
9525 (Relobj::finalize_incremental_relocs): New function.
9526 (Sized_relobj::do_layout): Record input sections in incremental info.
9527 * object.h (Object::output_section): New function.
9528 (Object::output_section_offset): Moved from Relobj.
9529 (Object::get_incremental_reloc_base): New function.
9530 (Object::get_incremental_reloc_count): New function.
9531 (Object::do_output_section): New function.
9532 (Object::do_output_section_offset): Moved from Relobj.
9533 (Object::do_get_incremental_reloc_base): New function.
9534 (Object::do_get_incremental_reloc_count): New function.
9535 (Object::Object): Initialize new data members.
9536 (Relobj::output_section): Renamed do_output_section and moved to
9537 protected.
9538 (Relobj::output_section_offset): Moved to Object.
9539 (Relobj::do_get_incremental_reloc_base): New function.
9540 (Relobj::do_get_incremental_reloc_count): New function.
9541 (Relobj::allocate_incremental_reloc_counts): New function.
9542 (Relobj::count_incremental_reloc): New function.
9543 (Relobj::finalize_incremental_relocs): New function.
9544 (Relobj::next_incremental_reloc_index): New function.
9545 (Relobj::reloc_counts_): New data member.
9546 (Relobj::reloc_bases_): New data member.
9547 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9548 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9549 (Sized_relobj::incremental_relocs_scan): New function.
9550 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9551 (Sized_relobj::incremental_relocs_write): New function.
9552 (Sized_relobj::incremental_relocs_write_reltype): New function.
9553 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9554 incremental link.
9555 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9556 archives and object files elsewhere.
9557 (Add_symbols::run): Report object files here.
9558 (Finish_group::run): Report end of archive at end of group.
9559 * reloc.cc: Include layout.h, incremental.h.
9560 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9561 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9562 (Sized_relobj::incremental_relocs_scan): New function.
9563 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9564 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9565 (Sized_relobj::incremental_relocs_write): New function.
9566 (Sized_relobj::incremental_relocs_write_reltype): New function.
9567 * script.cc (read_input_script): Rewrite test for incremental link.
9568 Change call to Incremental_inputs::report_script.
9569 * symtab.h (Symbol_table::first_global_index): New function.
9570 (Symbol_table::output_count): New function.
9571
ce0d1972
DK
95722010-08-12 Doug Kwan <dougkwan@google.com>
9573
9574 * arm.cc (Target_arm::merge_object_attributes): Check command line
9575 options --no-wchar-size-warning and --no-enum-size-warning.
9576 * options.h (General_options): Add ld-compatible options
9577 --no-enum-size-warning and --no-wchar-size-warning.
9578
6e5710ce
ILT
95792010-08-04 Ian Lance Taylor <iant@google.com>
9580
9581 * x86_64.cc (Target_x86_64::Scan::local): Use
9582 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9583 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9584 (Target_x86_64::Scan::global): Likewise.
9585 (Target_x86_64::Relocate::relocate): Likewise.
9586 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9587 Likewise.
9588
fef830db
CC
95892010-08-03 Cary Coutant <ccoutant@google.com>
9590
9591 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9592 to reserve space in merged_strings vector. Keep total input size
9593 for stats.
9594 (Output_merge_string::do_print_merge_stats): Print total input size.
9595 * merge.h (Output_merge_string): Add input_size_ field.
9596 * stringpool.cc (Stringpool_template::string_length): Move
9597 implementations out of Stringpool_template class and place in
9598 stringpool.h.
9599 * stringpool.h (string_length): Move out of Stringpool_template.
9600
1e3811b0
ILT
96012010-08-03 Ian Lance Taylor <iant@google.com>
9602
9603 PR 11712
9604 * layout.cc (relaxation_loop_body): If address of load segment is
9605 set, adjust address to include headers if possible.
9606
7af0c620
ILT
96072010-08-03 Ian Lance Taylor <iant@google.com>
9608
9609 * version.cc (version_string): Bump to 1.10.
9610
22f0da72
ILT
96112010-08-03 Ian Lance Taylor <iant@google.com>
9612
9613 PR 11805
9614 * layout.h (enum Output_section_order): Define.
9615 (class Layout): Update declarations.
9616 * layout.cc (Layout::get_output_section): Add order parameter.
9617 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9618 is_first_non_relro parameters. Change all callers.
9619 (Layout::choose_output_section): Likewise.
9620 (Layout::add_output_section_data): Likewise.
9621 (Layout::make_output_section): Likewise. Set order.
9622 (Layout::default_section_order): New function.
9623 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9624 * output.cc (Output_section::Output_section): Initialize order_.
9625 Don't initialize deleted fields.
9626 (Output_segment::Output_segment): Don't initialize deleted
9627 fields.
9628 (Output_segment::add_output_section_to_load): New function
9629 replacing add_output_section. Change all callers to call this or
9630 add_output_section_to_nonload.
9631 (Output_segment::add_output_section_to_nonload): New function.
9632 (Output_segment::remove_output_section): Rewrite.
9633 (Output_segment::add_initial_output_data): Likewise.
9634 (Output_segment::has_any_data_sections): Likewise.
9635 (Output_segment::is_first_section_relro): Likewise.
9636 (Output_segment::maximum_alignment): Likewise.
9637 (Output_segment::has_dynamic_reloc): New function replacing
9638 dynamic_reloc_count. Change all callers.
9639 (Output_segment::has_dynamic_reloc_list): New function replacing
9640 dynamic_reloc_count_list. Change all callers.
9641 (Output_segment::set_section_addresses): Rewrite.
9642 (Output_segment::set_offset): Rewrite.
9643 (Output_segment::find_first_and_last_list): Remove.
9644 (Output_segment::set_tls_offsets): Rewrite.
9645 (Output_segment::first_section_load_address): Likewise.
9646 (Output_segment::output_section_count): Likewise.
9647 (Output_segment::section_with_lowest_load_address): Likewise.
9648 (Output_segment::write_section_headers): Likewise.
9649 (Output_segment::print_sections_to_map): Likewise.
9650 * output.h (class Output_data): Remove dynamic_reloc_count_
9651 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9652 (Output_data::add_dynamic_reloc): Rewrite.
9653 (Output_data::has_dynamic_reloc): New function.
9654 (Output_data::dynamic_reloc_count): Remove.
9655 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9656 is_last_relro_, is_first_non_relro_, is_interp_,
9657 is_dynamic_linker_section_ fields. Add order and set_order
9658 functions. Remove is_relro_local, set_is_relro_local,
9659 is_last_relro, set_is_last_relro, is_first_non_relro,
9660 set_is_first_non_relro functions, is_interp, set_is_interp,
9661 is_dynamic_linker_section, and set_is_dynamic_linker_section
9662 functions.
9663 (class Output_segment): Change Output_data_list from std::list to
9664 std:;vector. Add output_lists_ field. Remove output_data_ and
9665 output_bss_ fields. Update declarations.
9666
3ff2ccb0
ILT
96672010-08-02 Ian Lance Taylor <iant@google.com>
9668
9669 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9670 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9671 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9672
88a4108b
ILT
96732010-08-02 Ian Lance Taylor <iant@google.com>
9674
9675 PR 11855
9676 * script.cc (Script_options::Script_options): Initialize
9677 symbol_definitions_ and symbol_references_.
9678 (Script_options::add_symbol_assignment): Update
9679 symbol_definitions_ and symbol_references_.
9680 (Script_options::add_symbol_reference): New function.
9681 (script_symbol): New function.
9682 * script.h (class Script_options): Add symbol_definitions_ and
9683 symbol_references_ fields.
9684 (Script_options::referenced_const_iterator): New type.
9685 (Script_options::referenced_begin): New function.
9686 (Script_options::referenced_end): New function.
9687 (Script_options::is_referenced): New function.
9688 (Script_options::any_unreferenced): New function.
9689 * script-c.h (script_symbol): Declare.
9690 * yyscript.y (exp): Call script_symbol.
9691 * symtab.cc: Include "script.h".
9692 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9693 Change all callers. Check symbols referenced by scripts.
9694 (Symbol_table::add_undefined_symbols_from_command_line): Add
9695 layout parameter. Change all callers.
9696 (Symbol_table::do_add_undefined_symbols_from_command_line):
9697 Likewise. Break out loop body. Check symbols referenced by
9698 scripts.
9699 (Symbol_table::add_undefined_symbol_from_command_line): New
9700 function broken out of
9701 do_add_undefined_symbols_from_command_line.
9702 * symtab.h (class Symbol_table): Update declarations.
9703 * archive.cc: Include "layout.h".
9704 (Archive::should_include_member): Add layout parameter. Change
9705 all callers. Check for symbol mentioned in expression.
9706 * archive.h (class Archive): Update declaration.
9707 * object.cc (Sized_relobj::do_should_include_member): Add layout
9708 parameter.
9709 * object.h (Object::should_include_member): Add layout parameter.
9710 Change all callers.
9711 (Object::do_should_include_member): Add layout parameter.
9712 (class Sized_relobj): Update declaration.
9713 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9714 parameter.
9715 * dynobj.h (class Sized_dynobj): Update declaration.
9716 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9717 layout parameter.
9718 * plugin.h (class Sized_pluginobj): Update declaration.
9719
5f1ab67a
ILT
97202010-08-02 Ian Lance Taylor <iant@google.com>
9721
9722 PR 11866
9723 * output.cc (Output_segment::set_offset): Search for the first and
9724 last sections rather than assuming that the list is in order.
9725 (Output_segment::find_first_and_last_list): New function.
9726 * output.h (class Output_segment): Update declarations.
9727 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9728 (relro_strip_test_SOURCES): New variable.
9729 (relro_strip_test_DEPENDENCIES): New variable.
9730 (relro_strip_test_LDFLAGS): New variable.
9731 (relro_strip_test_LDADD): New variable.
9732 (relro_strip_test.so): New target.
9733
a8df5856
ILT
97342010-08-02 Ian Lance Taylor <iant@google.com>
9735
9736 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9737 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9738 (Target_i386::got_tlsdesc_section): New function.
9739 (Target_i386::got_section): Create space for GOT entries for
9740 TLSDESC relocations.
9741 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9742 R_386_TLS_GOTDESC.
9743 (Target_i386::Scan::global): Likewise.
9744 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9745 using TLSDESC GOT.
9746 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9747 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9748 (Target_x86_64::got_tlsdesc_section): New function.
9749 (Target_x86_64::got_section): Create space for GOT entries for
9750 TLSDESC relocations.
9751 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9752 R_386_TLS_GOTDESC.
9753 (Target_x86_64::Scan::global): Likewise.
9754 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9755 using TLSDESC GOT.
9756
0c10a0a6
ILT
97572010-08-02 Ian Lance Taylor <iant@google.com>
9758
9759 * testsuite/final_layout.sh: Use dc to convert from hex to
9760 decimal.
9761
41cbeecc
ST
97622010-07-29 Sriraman Tallam <tmsriram@google.com>
9763
9764 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9765 paramter to the call to gold::gc_process_relocs.
9766 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9767 paramter to the call to gold::gc_process_relocs.
9768 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9769 parameter to the call to gold::gc_process_relocs.
9770 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9771 template parameter to the call to gold::gc_process_relocs.
9772 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9773 paramter to the call to gold::gc_process_relocs.
9774 * gc.h (get_embedded_addend_size): New function.
9775 (gc_process_relocs): Save the size of the reloc for use by ICF.
9776 * icf.cc (get_section_contents): Get the addend from the text section
9777 for SHT_REL relocation sections.
9778 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9779 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9780 * int_encoding.h (read_from_pointer): New overloaded function.
9781 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9782 * testsuite/icf_sht_rel_addend_test.sh: New file.
9783 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9784 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9785
6ea55b82
RW
97862010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9787
9788 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9789 * Makefile.in: Regenerate.
9790 * testsuite/Makefile.in: Regenerate.
9791
9691462b
ILT
97922010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9793
9794 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9795 * gold/testsuite/debug_msg.cc: Likewise.
9796 * gold/testsuite/odr_violation1.cc
9797 * gold/testsuite/odr_violation2.cc
9798
76897331
CC
97992010-07-21 Cary Coutant <ccoutant@google.com>
9800
9801 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9802 string, and length fields.
9803 (Output_merge_string::Merged_strings_list): New type.
9804 (Output_merge_string::Merged_strings_lists): New typedef.
9805 (Output_merge_string): Replace merged_strings_ with
9806 merged_strings_lists_.
9807 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9808 Merged_strings_list per input object and section. Don't store pointer
9809 to the string. Don't store length with each merged string entry.
9810 (Output_merge_string::finalize_merged_data): Loop over list of merged
9811 strings lists. Recompute length of each merged string.
9812
78384e8f
CC
98132010-07-15 Cary Coutant <ccoutant@google.com>
9814
9815 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9816 here.
9817
783659f9
ILT
98182010-07-14 Ian Lance Taylor <iant@google.com>
9819
9820 * descriptors.cc (Descriptors::open): Report correct name in error
9821 message.
9822
131687b4
DK
98232010-07-13 Doug Kwan <dougkwan@google.com>
9824
9825 * arm.cc (Arm_input_section::Arm_input_section): For a
9826 SHT_ARM_EXIDX section, always keeps the input sections.
9827 (Arm_input_section::set_exidx_section_link): New method.
9828 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9829 has_errors_ to false.
9830 (Arm_exidx_input_section::has_errors,
9831 Arm_exidx_input_section::set_has_errors): New methods.
9832 (Arm_exidx_input_section::has_errors_): New data member.
9833 (Arm_relobj::get_exidx_shndx_list): New method.
9834 (Arm_output_section::append_text_sections_to_list): Do not skip
9835 section without SHF_EXECINSTR.
9836 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9837 errors.
2e702c99 9838 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9839 section header. Make error messages more verbose. Check for
9840 a non-executable section linked to an EXIDX section.
9841 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9842 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9843 check that there is no deferred EXIDX section if we exit early.
9844 Instead of not making an EXIDX section in case of an error, make one
9845 and set the has_errors flag of it.
9846 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9847 in a relocatable link.
9848 (Target_arm::do_relax): Look for the EXIDX output section instead of
9849 assuming that it is called .ARM.exidx.
2e702c99 9850 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9851 section list. Do not check for SHF_EXECINSTR section flags but
9852 skip any input section with errors.
9853 * output.cc (Output_section::Output_section): Initialize
9854 always_keeps_input_sections_ to false.
9855 (Output_section::add_input_section): Check for
9856 always_keeps_input_sections_.
9857 * output.h (Output_section::always_keeps_input_sections,
9858 Output_section::set_always_keeps_input_sections): New methods.
9859 (Output_section::always_keeps_input_sections): New data member.
9860
69517287
RÁE
98612010-07-13 Rafael Espindola <espindola@google.com>
9862
9863 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9864 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9865
82742395
ILT
98662010-07-13 Philip Herron <herron.philip@googlemail.com>
9867 Ian Lance Taylor <iant@google.com>
9868
9869 * output.h (Output_section_lookup_maps::add_merge_section):
9870 Correct check of whether value was inserted.
9871 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9872 (Output_section_lookup_maps::add_relaxed_input_section):
9873 Likewise.
9874 * arm.cc (Target_arm::got_section): Remove used local os.
9875 * i386.cc (Target_i386::got_section): Likewise.
9876 * x86_64.cc (Target_x86_64::got_section): Likewise.
9877 * sparc.cc (Target_sparc::got_section): Likewise.
9878 (Target_sparc::relocate): Remove unused local have_got_offset.
9879 * powerpc.cc (Target_powerpc::relocate): Likewise.
9880
f2d707b5
ILT
98812010-07-13 Ian Lance Taylor <iant@google.com>
9882
241531d6
ILT
9883 * compressed_output.cc (zlib_decompress): Fix signature in
9884 !HAVE_ZLIB_H case.
9885
f2d707b5
ILT
9886 * archive.cc (Archive::include_member): Unlock an external member
9887 of a thin archive. Don't bother to delete an object we know is
9888 NULL.
9889
a2e47362
CC
98902010-07-12 Cary Coutant <ccoutant@google.com>
9891
9892 * compressed_output.cc (zlib_decompress): New function.
9893 (get_uncompressed_size): New function.
9894 (decompress_input_section): New function.
9895 * compressed_output.h (get_uncompressed_size): New function.
9896 (decompress_input_section): New function.
9897 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9898 Handle compressed debug sections.
9899 * layout.cc (is_compressed_debug_section): New function.
9900 (Layout::output_section_name): Map compressed section names to
9901 canonical names.
9902 * layout.h (is_compressed_debug_section): New function.
9903 (is_debug_info_section): Recognize compressed debug sections.
9904 * merge.cc: Include compressed_output.h.
9905 (Output_merge_data::do_add_input_section): Handle compressed
9906 debug sections.
9907 (Output_merge_string::do_add_input_section): Handle compressed
9908 debug sections.
9909 * object.cc: Include compressed_output.h.
9910 (Sized_relobj::Sized_relobj): Initialize new data members.
9911 (build_compressed_section_map): New function.
9912 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9913 * object.h (Object::section_is_compressed): New method.
9914 (Object::do_section_is_compressed): New method.
9915 (Sized_relobj::Compressed_section_map): New type.
9916 (Sized_relobj::do_section_is_compressed): New method.
9917 (Sized_relobj::compressed_sections_): New data member.
9918 * output.cc (Output_section::add_input_section): Handle compressed
9919 debug sections.
9920 * reloc.cc: Include compressed_output.h.
9921 (Sized_relobj::write_sections): Handle compressed debug sections.
9922
ce279a62
CC
99232010-07-08 Cary Coutant <ccoutant@google.com>
9924
9925 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9926 weak when resolving to a dynamic def.
9927 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9928 for weak undef/dynamic def cases. Adjust callers.
9929 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9930 undef_binding_weak_.
9931 (Symbol_table::sized_write_globals): Adjust symbol binding.
9932 (Symbol_table::sized_write_symbol): Add binding parameter.
9933 * symtab.h (Symbol::set_undef_binding): New method.
9934 (Symbol::is_undef_binding_weak): New method.
9935 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9936 (Symbol_table::should_override): Add new parameter.
9937 (Symbol_table::sized_write_symbol): Add new parameter.
9938
9939 * testsuite/weak_undef_file1.cc: Add new test case.
9940 * testsuite/weak_undef_file2.cc: Fix header comment.
9941 * testsuite/weak_undef_test.cc: Add new test case.
9942
b2286c10
DK
99432010-06-29 Doug Kwan <dougkwan@google.com>
9944
9945 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9946 Initialize USE_SYMBOL_.
9947 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9948 definition.
9949 (Arm_reloc_property::uses_symbol_): New data member declaration.
9950 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9951 uses symbol value and symbol is undefined but not weakly undefined.
9952
4802450a
RÁE
99532010-06-28 Rafael Espindola <espindola@google.com>
9954
9955 * plugin.cc (Plugin::load): Use dlerror.
9956
e5ca47ba
ILT
99572010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9958
9959 * symtab.cc (detect_odr_violations): When reporting an ODR
9960 violation, report an object where the symbol is defined.
9961
8a75a161
DK
99622010-06-25 Doug Kwan <dougkwan@google.com>
9963
9964 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9965 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9966 definition.
9967 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9968 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9969 target hook to detect function points.
9970 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9971 * icf.h (Icf::check_section_for_function_pointers): Change type of
9972 parameter SECTION_NAME to const reference to std::string. Use
9973 target hook to determine if section may have unsafe pointers.
9974 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9975 method definition.
9976
42218b9f
RÁE
99772010-06-21 Rafael Espindola <espindola@google.com>
9978
9979 * fileread.cc (Input_file::find_fie): New
9980 (Input_file::open): Use Input_file::find_fie.
9981 * fileread.h (Input_file::find_fie): New
9982 * plugin.cc (set_extra_library_path): New.
9983 (Plugin::load): Add set_extra_library_path to the transfer vector.
9984 (Plugin_manager::set_extra_library_path): New.
9985 (Plugin_manager::add_input_file): Use the extra search path if set.
9986 (set_extra_library_path(): New.
9987 * plugin.h (Plugin_manager): Add set_extra_library_path and
9988 extra_search_path_.
9989
a0506cca
CC
99902010-06-19 Cary Coutant <ccoutant@google.com>
9991
9992 * layout.cc (gdb_sections): Add .debug_types.
9993 (lines_only_debug_sections): Likewise.
9994
6508b958
RÁE
99952010-06-18 Rafael Espindola <espindola@google.com>
9996
9997 * plugin.cc (add_input_file,add_input_library)
9998 (Plugin_manager::add_input_file): Make filename arguments const.
9999 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10000 const.
10001
3e235302
DK
100022010-06-16 Doug Kwan <dougkwan@google.com>
10003
10004 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10005 .ARM.attributes section if we have not merged any input
10006 attributes sections.
10007
106e8a6c
DK
100082010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10009
10010 * arm.cc: Allow combining objects with no EABI version
10011 information.
10012
91ff43fe
RÁE
100132010-06-15 Rafael Espindola <espindola@google.com>
10014
10015 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10016
68ed838c
ILT
100172010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10018
10019 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10020 (struct iovec): Correct !HAVE_READV definition.
10021
f3a2388f
CC
100222010-06-10 Cary Coutant <ccoutant@google.com>
10023
10024 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10025 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10026 reloc sections.
10027 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10028
10029 PR 11683
10030 * symtab.h (Symbol::is_placeholder): New member function.
10031 * target-reloc.h (relocate_section): Check for placeholder symbols.
10032
10033 * testsuite/Makefile.am (plugin_test_8): New test.
10034 (plugin_test_9): New test.
10035 * testsuite/Makefile.in: Regenerate.
10036
e1df38aa
NC
100372010-06-09 Nick Clifton <nickc@redhat.com>
10038
10039 * yyscript.y (input_list_element): Allow strings prefixed with
10040 the '-' character. Treat these as libraries.
10041 * script.cc (script_add_library): New function. Adds a library
10042 specified by "-l<name>" found in an input script.
10043 * script-c.h: Add prototype for script_add_library.
10044
25bbe950
DK
100452010-06-07 Doug Kwan <dougkwan@google.com>
10046
10047 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10048 Restrict stub-group size to be within long conditional branch
10049 range when working around cortex-A8 erratum.
10050
0f32ea4c
ILT
100512010-06-07 Damien Diederen <dd@crosstwine.com>
10052
10053 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10054 #ifdef typo.
10055
8fe2a369
ST
100562010-06-03 Sriraman Tallam <tmsriram@google.com>
10057
10058 PR gold/11658
10059 * output.cc
10060 (Output_section::Input_section_sort_entry::compare_section_ordering):
10061 Change to return non-zero correctly.
10062 (Output_section::Input_section_sort_section_order_index_compare
10063 ::operator()): Change to fix ambiguity in comparisons.
10064
6e9ba2ca
ST
100652010-06-01 Sriraman Tallam <tmsriram@google.com>
10066
10067 * gold.h (is_wildcard_string): New function.
10068 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10069 (Layout::layout_eh_frame): Ditto.
10070 (Layout::find_section_order_index): New method.
10071 (Layout::read_layout_from_file): New method.
10072 * layout.h (Layout::find_section_order_index): New method.
10073 (Layout::read_layout_from_file): New method.
10074 (Layout::input_section_position_): New private member.
10075 (Layout::input_section_glob_): New private member.
10076 * main.cc (main): Call read_layout_from_file here.
10077 * options.h (--section-ordering-file): New option.
10078 * output.cc (Output_section::input_section_order_specified_): New
10079 member.
10080 (Output_section::Output_section): Initialize new member.
10081 (Output_section::add_input_section): Add new parameter.
10082 Keep input sections when --section-ordering-file is used.
10083 (Output_section::set_final_data_size): Sort input sections when
10084 section ordering file is specified.
10085 (Output_section::Input_section_sort_entry): Add new parameter.
10086 Check sorting type.
10087 (Output_section::Input_section_sort_entry::compare_section_ordering):
10088 New method.
10089 (Output_section::Input_section_sort_compare::operator()): Change to
10090 consider section_order_index.
10091 (Output_section::Input_section_sort_init_fini_compare::operator()):
10092 Change to consider section_order_index.
10093 (Output_section::Input_section_sort_section_order_index_compare
10094 ::operator()): New method.
10095 (Output_section::sort_attached_input_sections): Change to sort
10096 according to section order when specified.
e1df38aa
NC
10097 (Output_section::add_input_section<32, true>): Add new parameter.
10098 (Output_section::add_input_section<64, true>): Add new parameter.
10099 (Output_section::add_input_section<32, false>): Add new parameter.
10100 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10101 * output.h (Output_section::add_input_section): Add new parameter.
10102 (Output_section::input_section_order_specified): New
10103 method.
10104 (Output_section::set_input_section_order_specified): New method.
10105 (Input_section::Input_section): Initialize section_order_index_.
10106 (Input_section::section_order_index): New method.
10107 (Input_section::set_section_order_index): New method.
10108 (Input_section::section_order_index_): New member.
10109 (Input_section::Input_section_sort_section_order_index_compare): New
10110 struct.
10111 (Output_section::input_section_order_specified_): New member.
10112 * script-sections.cc (is_wildcard_string): Delete and move modified
10113 method to gold.h.
10114 (Output_section_element_input::Output_section_element_input): Modify
10115 call to is_wildcard_string.
10116 (Output_section_element_input::Input_section_pattern
10117 ::Input_section_pattern): Ditto.
10118 (Output_section_element_input::Output_section_element_input): Ditto.
10119 * testsuite/Makefile.am (final_layout): New test case.
10120 * testsuite/Makefile.in: Regenerate.
10121 * testsuite/final_layout.cc: New file.
10122 * testsuite/final_layout.sh: New file.
10123
3537c84b
RÁE
101242010-06-01 Rafael Espindola <espindola@google.com>
10125
10126 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10127
105b6afd
RÁE
101282010-06-01 Rafael Espindola <espindola@google.com>
10129
10130 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10131 visibility of symbols.
10132
29e11421
DK
101332010-05-27 Doug Kwan <dougkwan@google.com>
10134
10135 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10136 from start of output section instead of address for a local symbol
10137 in a merged or relaxed section when doing a relocatable link.
10138
5e0f337e
RÁE
101392010-05-26 Rafael Espindola <espindola@google.com>
10140
703d02da 10141 PR 11604
5e0f337e
RÁE
10142 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10143 adding sections the garbage collector removed.
10144 * gold/testsuite/Makefile.am: Add test.
10145 * gold/testsuite/Makefile.in: Regenerate.
10146 * gold/testsuite/plugin_test_7.sh: New.
10147 * gold/testsuite/plugin_test_7_1.c: New.
10148 * gold/testsuite/plugin_test_7_2.c: New.
10149
f4187277
RÁE
101502010-05-26 Rafael Espindola <espindola@google.com>
10151
10152 * script-sections.cc (Output_section_definition::set_section_addresses):
10153 Check for --section-start.
10154
5c388529
DK
101552010-05-26 Doug Kwan <dougkwan@google.com>
10156
10157 * arm.cc (Arm_scan_relocatable_relocs): New class.
10158 (Target_arm::relocate_special_relocatable): New method.
10159 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10160 (Arm_relocate_functions::thumb_branch_common): Same.
10161 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10162 instead of Default_scan_relocatable_relocs.
10163 * target-reloc.h (relocate_for_relocatable): Let target handle
10164 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10165 * target.h (Sized_target::relocate_special_relocatable): New method.
10166
bca1c3ae
ILT
101672010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10168
10169 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10170
0439c796
DK
101712010-05-23 Doug Kwan <dougkwan@google.com>
10172
10173 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10174 instead of a cast.
10175 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10176 with a direct branch, not a conditional branch, to a stub.
10177 * merge.cc (Output_merge_base::record_input_section): New method
10178 defintion.
10179 (Output_merge_data::do_add_input_section): Record input section if
10180 keeps-input-sections flag is set.
10181 (Output_merge_string::do_add_input_section): Ditto.
10182 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10183 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10184 INPUT_SECTIONS_.
10185 (Output_merge_base::keeps_input_sections,
10186 Output_merge_base::set_keeps_input_sections,
10187 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10188 method definitions.
10189 (Output_merge_base::Input_sections): New type declaration.
10190 (Output_merge_base::input_sections_begin,
10191 Output_merge_base::input_sections_end,
10192 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10193 (Output_merge_base::bool keeps_input_sections_,
10194 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10195 Output_merge_base::input_sections_): New data members.
10196 (Output_merge_data::do_set_keeps_input_sections): New method
10197 defintion.
10198 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10199 * output.cc (Output_section::Input_section::relobj): Move method
10200 defintion from class declaration to here and handle merge sections.
10201 (Output_section::Input_section::shndx): Ditto.
10202 (Output_section::Output_section): Remove initializations of removed
10203 data members and initialize new data member LOOKUP_MAPS_.
10204 (Output_section::add_input_section): Set keeps-input-sections flag
10205 for a newly created merge output section as appropriate. Adjust code
10206 to use Output_section_lookup_maps class.
10207 (Output_section::add_relaxed_input_section): Adjst code for lookup
10208 maps code refactoring.
2e702c99 10209 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10210 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10211 class. If adding input section to a newly created merge output
10212 section fails, remove the new merge section.
10213 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10214 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10215 (Output_section::find_merge_section): Ditto.
0439c796 10216 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10217 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10218 Output_section_lookup_maps class.
10219 (Output_section::get_input_sections): Export merge sections. Adjust
10220 code to use Output_section_lookup_maps class.
10221 (Output_section:::add_script_input_section): Adjust code to use
10222 Output_section_lookup_maps class. Update lookup maps for merge
10223 sections also.
10224 (Output_section::discard_states): Use Output_section_lookup_maps.
10225 (Output_section::restore_states): Same.
10226 * output.h (Merge_section_properties): Move class defintion out of
10227 Output_section.
10228 (Output_section_lookup_maps): New class.
10229 (Output_section::Input_section::is_merge_section): New method
10230 defintion.
10231 (Output_section::Input_section::relobj): Move defintion out of class
10232 defintion. Declare method only.
10233 (Output_section::Input_section::shndx): Ditto.
10234 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10235 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10236 (Output_section::Merge_section_by_properties_map,
10237 Output_section::Output_section_data_by_input_section_map,
10238 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10239 Remove types.
2e702c99 10240 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10241 KEEPS_INPUT_SECTIONS.
10242 (Output_section::build_lookup_maps): New method declaration.
10243 (Output_section::merge_section_map_,
10244 Output_section::merge_section_by_properties_map_,
10245 Output_section::relaxed_input_section_map_,
10246 Output_section::is_relaxed_input_section_map_valid_): Remove data
10247 members.
10248 (Output_section::lookup_maps_): New data member.
10249
76295588
L
102502010-05-21 Doug Kwan <dougkwan@google.com>
10251
10252 PR gold/11619
10253 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10254 avoid a compilation error.
10255
d103a984
RÁE
102562010-05-19 Rafael Espindola <espindola@google.com>
10257
10258 * script-sections.cc (Output_section_definition::allocate_to_segment):
10259 Update the phdrs_list even when the output section is NULL.
10260 * testsuite/Makefile.am: Add test.
10261 * testsuite/Makefile.in: Regenerate.
10262 * testsuite/script_test_9.cc: New.
10263 * testsuite/script_test_9.sh: New.
10264 * testsuite/script_test_9.t: New.
10265
6625d24e
DK
102662010-05-19 Doug Kwan <dougkwan@google.com>
10267
10268 * arm.cc (Arm_input_section::original_size): New method.
10269 (Arm_input_section::do_addralign): Add a cast.
10270 (Arm_input_section::do_output_offset): Remove static cast.
10271 (Arm_input_section::original_addralign,
10272 Arm_input_section::original_size_): Change type to uint32_t.
10273 (Arm_input_section::init): Add safe casts for section alignment
10274 and size.
10275 (Arm_input_section::set_final_data_size): Do not set address and
10276 offset of stub table.
10277 (Arm_output_section::fix_exidx_coverage): Change use of of
10278 Output_section::Simple_input_section to that of
10279 Output_section::Input_section.
10280 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10281 except for the first pass.
10282 * output.cc (Output_section::get_input_sections): Change type of
10283 input_sections to std::list<Input_section>.
10284 (Output_section::add_script_input_section): Rename from
10285 Output_section::add_simple_input_section. Change type of SIS
10286 parameter from Simple_input_section to Input_section.
10287 * output.h (Output_section::Simple_input_section): Remove class.
10288 (Output_section::Input_section): Change class visibility to public.
10289 (Output_section::Input_section::addralign): Use stored alignments
10290 for special input sections if set.
10291 (Output_section::Input_section::set_addralign): New method.
10292 (Output_section::get_input_sections): Change parameter type from
10293 list of Simple_input_section to list of Input_section.
10294 (Output_section::add_script_input_section): Rename from
10295 Output_section::add_simple_input_section. Change first parameter's
10296 type from Simple_input_section to Input_section and remove the
10297 second and third parameters.
10298 * script-sections.cc (Input_section::Input_section_list): Change
10299 type to list of Output_section::Input_section/
10300 (Input_section_info::Input_section_info): Change parameter type of
10301 INPUT_SECTION to Output_section::Input_section.
10302 (Input_section_info::input_section): Change return type.
10303 (Input_section_info::input_section_): Change type to
10304 Output_section::Input_section.
10305 (Output_section_element_input::set_section_addresses): Adjust code
10306 to use Output_section::Input_section instead of
10307 Output_section::Simple_input_section. Adjust code for renaming
10308 of Output_section::add_simple_input_section.
10309 (Orphan_output_section::set_section_addresses): Ditto.
10310
e1e82ea4
RW
103112010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10312
10313 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10314 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10315
91e75c8a
RÁE
103162010-05-18 Rafael Espindola <espindola@google.com>
10317
10318 * options.cc (General_options::finalize): Handle -nostdlib.
10319 * options.h (nostdlib): New option.
10320 * script.cc (script_add_search_dir): Handle -nostdlib.
10321
da59ad79
DK
103222010-05-12 Doug Kwan <dougkwan@google.com>
10323
10324 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10325 attributes section only if there no attributes section after merging.
10326 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10327 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10328 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10329 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10330 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10331 and arm_attr_merge_7.stdout.
10332 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10333 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10334 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10335 arm_attr_merge_7b.o): New rules.
10336 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10337 arm_attr_merge_7
10338 * testsuite/Makefile.in: Regenerate.
10339 * testsuite/arm_attr_merge.sh: New file.
10340 * testsuite/arm_attr_merge_[67][ab].s: Same.
10341
3e01a7fd
NC
103422010-05-05 Nick Clifton <nickc@redhat.com>
10343
10344 * po/es.po: Updated Spanish translation.
10345
7ad2014a
L
103462010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10347
10348 * Makefile.am (install-exec-local): Properly install gold as
10349 default cross linker.
10350 * Makefile.in: Regenerated.
10351
4fda8867
NC
103522010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10353 Nick Clifton <nickc@redhat.com>
10354
10355 * configure.ac (install_as_default): Define and set to false
10356 unless --enable-gold or --enable-gold=both/gold has been
10357 specified.
10358 * configure: Regenerate.
10359
10360 * Makefile.am (install-exec-local): Install the executable as
10361 'ld.gold'. If install_as_default is true then also install it as
10362 'ld'.
10363 * Makefile.in: Regenerated.
10364
bd288ea2
ILT
103652010-04-24 Ian Lance Taylor <iant@google.com>
10366
10367 * layout.cc (Layout::layout_reloc): In relocatable link don't
10368 combine reloc sections for grouped sections.
10369
ef38fd8a
ST
103702010-04-23 Sriraman Tallam <tmsriram@google.com>
10371
10372 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10373 sections that are not ordinary to icf.
10374 * icf.cc (get_section_contents): Handle relocation pointing to section
10375 with no object or shndx information.
10376 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10377 * testsuite/Makefile.in: Regenerate.
10378 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10379 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10380
f6973bdc
ILT
103812010-04-22 Ian Lance Taylor <iant@google.com>
10382
10383 * expression.cc (Expression::Expression_eval_info): Add
10384 result_alignment_pointer field.
10385 (Expression::eval_with_dot): Add result_alignment_pointer
10386 parameter. Change all callers.
10387 (Expression::eval_maybe_dot): Likewise.
10388 (class Binary_expression): Add alignment_pointer parameter to
10389 left_value and right_value. Change all callers.
10390 (BINARY_EXPRESSION): Set result alignment.
10391 (class Trinary_expression): Add alignment_pointer parameter to
10392 arg2_value and arg3_value. Change all callers.
10393 (Trinary_cond::value): Set result alignment.
10394 (Max_expression::value, Min_expression::value): Likewise.
10395 (Align_expression::value): Likewise.
10396 * script-sections.cc (class Sections_element): Add dot_alignment
10397 parameter to set_section_addresses virtual function. Update
10398 instantiations.
10399 (class Output_section_element): Likewise.
10400 (Script_sections::create_segments): Add dot_alignment parameter.
10401 Change all callers.
10402 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10403 (Script_sections::set_phdrs_clause_addresses): Likewise.
10404 * script-sections.h: Update declarations.
10405 * script.h: Update declarations.
10406 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10407 min_p_align.
10408 * testsuite/script_test_3.t: Set large alignment.
10409 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10410 segment has expected alignment.
10411
9c9c98a5
NC
104122010-04-22 Nick Clifton <nickc@redhat.com>
10413
10414 * po/gold.pot: Updated by the Translation project.
10415 * po/vi.po: Updated Vietnamese translation.
10416
2253bfba
L
104172010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10418
10419 * testsuite/Makefile.am (check_PROGRAMS): Add
10420 icf_virtual_function_folding_test.
10421 * testsuite/Makefile.in: Regenerated.
10422
85fdf906
AH
104232010-04-15 Andrew Haley <aph@redhat.com>
10424
10425 * options.h (merge_exidx_entries): New option.
10426 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10427 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10428 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10429 (Target_arm::merge_exidx_entries): New function.
10430 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10431 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10432 to Arm_exidx_fixup constructor.
10433 Add new arg, merge_exidx_entries.
10434 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10435 Arm_output_section::fix_exidx_coverage.
10436
ce97fa81
ST
104372010-04-18 Sriraman Tallam <tmsriram@google.com>
10438
10439 * icf.cc (get_section_contents): Check for preemptible functions.
10440 Ignore addend when appropriate.
10441 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10442 section folded.
10443 (add_from_relobj): Check for section folded.
10444 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10445 * symtab.h (should_add_dynsym_entry): Add new parameter.
10446 * target-reloc.h (scan_relocs): Check for section folded.
10447 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10448 Check reloc types for function pointers in shared objects.
10449 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10450 case.
10451 (icf_preemptible_functions_test): New test case.
10452 (icf_string_merge_test): New test case.
10453 * testsuite.Makefile.in: Regenerate.
10454 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10455 bar_glob. Refactor code.
10456 * testsuite/icf_preemptible_functions_test.cc: New file.
10457 * testsuite/icf_preemptible_functions_test.sh: New file.
10458 * testsuite/icf_string_merge_test.cc: New file.
10459 * testsuite/icf_string_merge_test.sh: New file.
10460 * testsuite/icf_virtual_function_folding_test.cc: New file.
10461 * testsuite/icf_virtual_function_folding_test.sh: New file.
10462
04ceb17c
DK
104632010-04-14 Doug Kwan <dougkwan@google.com>
10464
10465 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10466 for local symbol recounting if we remove a section due to ICF.
10467 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10468 there are no regular objects in input.
10469
153e7da4
DK
104702010-04-13 Doug Kwan <dougkwan@google.com>
10471
10472 * arm.cc (Arm_input_section::set_final_data_size): Compute
10473 accurate final data size instead of using current data size.
10474
4dbd9faf
DK
104752010-04-09 Doug Kwan <dougkwan@google.com>
10476
10477 * layout.cc (Layout::choose_output_section): Handle script section
10478 types.
10479 (Layout::make_output_section_for_script): Add section type parameter.
10480 Handle script section types.
10481 * layout.h (Layout::make_output_section_for_script): Add section
10482 type parameter.
10483 * output.cc (Output_section::Output_section): Initialize data member
10484 is_noload_.
10485 (Output_section::do_reset_address_and_file_offset): Do not set address
10486 to 0 if section is a NOLOAD section.
10487 * output.h (Output_section::is_noload): New method.
10488 (Output_section::set_is_noload): Ditto.
10489 (Output_section::is_noload_): New data member.
10490 * script-c.h (Script_section_type): New enum type.
10491 (struct Parser_output_section_header): Add new file section_type.
10492 * script-sections.cc (Sections_element::output_section_name): Add
10493 parameter for returning script section type.
10494 (Output_section_definition::output_section_name): Ditto.
10495 (Output_section_definition::section_type)P; New method.
10496 (Output_section_definiton::script_section_type_name): Ditto.
10497 (Output_section_definition::script_section_type_): New data member.
10498 (Output_section_definition::Output_section_definition): Initialize
10499 data member Output_section_definition::script_section_type_.
10500 (Output_section_definition::create_sections): Pass script section type
10501 to Layout::make_output_section_for_script.
10502 (Output_section_definition::output_section_name): Return script
10503 section type to caller.
10504 (Output_section_definition::set_section_address): Do not advance
10505 dot value and load address if section type is NOLOAD. Set address
10506 of NOLOAD sections regardless of section flags.
10507 (Output_section_definition::print): Print section type if it is
10508 not SCRIPT_SECTION_TYPE_NONE.
10509 (Output_section_definition::section_type): New method.
10510 (Output_section_definition::script_section_type_name): Ditto.
10511 (Script_sections::output_section_name): Add new parameter
10512 PSECTION_TYPE for returning script section type. Pass it to
10513 section elements. Handle discard sections.
10514 (Sort_output_sections::operator()): Handle NOLOAD sections.
10515 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10516 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10517 returning script section type.
10518 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10519 INFO and NOLOAD.
10520 * yyscript.y (union): Add new field SECTION_TYPE.
10521 (COPY, DSECT, INFO, NOLOAD): New tokens.
10522 (opt_address_and_section_type): Change type to output_section_header.
10523 (section_type): New non-terminal
10524 (section_header): Handle section type.
2253bfba 10525 (opt_address_and_section_type): Return section type value.
4dbd9faf 10526
721ea635
L
105272010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10528
10529 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10530 * testsuite/plugin_common_test_2.c (foo): Likewise.
10531
6bf924b0
DK
105322010-04-08 Doug Kwan <dougkwan@google.com>
10533
10534 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10535 Output_merge_data.
10536 * output.cc (Output_section::add_merge_input_section): Simplify
10537 code and return status of Output_merge_base::add_input_section.
e1df38aa 10538 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10539 returns true.
10540
24af6f92
DK
105412010-04-07 Doug Kwan <dougkwan@google.com>
10542
10543 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10544 if section is marked as containing instructions but has no mapping
10545 symbols.
10546 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10547 correct section index.
10548 (Arm_relobj::find_linked_text_section): Ditto.
10549
00698fc5
CC
105502010-04-07 Cary Coutant <ccoutant@google.com>
10551
10552 * archive.cc (include_member): Destroy Read_symbols_data object before
10553 releasing file.
10554 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10555 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10556 (Read_symbols_data::~Read_symbols_data) New destructor.
10557 (Section_relocs::Section_relocs) New constructor.
10558 (Section_relocs::~Section_relocs) New destructor.
10559 (Read_relocs_data::Read_relocs_data) New constructor.
10560 (Read_relocs_data::~Read_relocs_data) New destructor.
10561 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10562 pointers to NULL after deleting.
10563
7296d933
DK
105642010-04-07 Doug Kwan <dougkwan@google.com>
10565
10566 * arm.cc: Replace "endianity" with "endianness" in comments.
10567 (Arm_exidx_cantunwind): Ditto.
10568 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10569 (Arm_relobj::merge_flags_and_attributes): New method.
10570 (Arm_relobj::merge_flags_and_attributes_): New data member.
10571 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10572 (Arm_relobj::scan_sections_for_stubs): Ditto.
10573 (Arm_relobj::do_read_symbols): Check to see if we really want to
10574 merge processor-specific flags and attributes. Exit early if
10575 an object is empty except for section names and the undefined symbol.
10576 (Target_arm::do_finalize_sections): Move check for ELF format to
10577 Arm_relobj::do_read_symbols. Merge processor specific flags and
10578 attributes from a regular object only when we have determined that
10579 it is aapropriate. Do not create an .ARM.attributes section in
10580 output if there is no regular input object.
10581 (Target_arm::merge_processor_specific_flags): Check
10582 --warn-mismatch before printing any error.
10583 (Target_arm::merge_object_attributes): Ditto.
10584 * gold.cc (queue_middle_tasks): Handle the case in which there is
10585 no regular object in input.
10586 * options.cc (General_options::parse_EB): New method.
10587 (General_options::parse_EL): Same.
10588 (General_options::General_options): Initialize endianness_.
10589 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10590 New options.
10591 (General_options::Endianness): New enum.
10592 (General_options::endianness): New method.
10593 (General_options::endianness_): New data member.
10594 * parameters.cc (Parameters::set_options): Check target endianness.
10595 (Parameters::set_target_once): Ditto.
10596 (Parameters::check_target_endianness): New method.
10597 (parameters_force_valid_target): If either -EL or -EB is specified,
10598 use it to define endianness of default target.
10599 * parameters.h (Parameters::check_target_endianness): New method
10600 declaration.
10601 * target.h (class Target): Change "endianity" to "endianness"
10602 in comments.
10603
efc8d4f2
RW
106042010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10605
10606 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10607 * configure: Regenerate.
10608 * Makefile.in: Regenerate.
10609 * testsuite/Makefile.in: Regenerate.
10610
be234d88
CC
106112010-04-06 Cary Coutant <ccoutant@google.com>
10612
10613 gcc PR lto/42757
10614 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10615 prevailing definitions of common symbols.
10616 * testsuite/plugin_test_6.sh: New test case.
10617 * testsuite/plugin_common_test_1.c: New test case.
10618 * testsuite/plugin_common_test_2.c: New test case.
10619 * testsuite/Makefile.am (plugin_test_6): New test case.
10620 * testsuite/Makefile.in: Regenerate.
10621
bd32c6bd
NC
106222010-04-06 Nick Clifton <nickc@redhat.com>
10623
10624 * po/vi.po: New Vietnamese translation.
10625
323c532f
DK
106262010-03-30 Doug Kwan <dougkwan@google.com>
10627
10628 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10629
4fcd97eb
DK
106302010-03-25 Doug Kwan <dougkwan@google.com>
10631
10632 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10633 to avoid a conversion warning on a 32-bit host.
10634
4ebf39db
ILT
106352010-03-24 Ian Lance Taylor <iant@google.com>
10636
10637 * testsuite/script_test_3.t: Add a TLS segment.
10638 * testsuite/Makefile.am (check_PROGRAMS): Add
10639 tls_phdrs_script_test.
10640 (tls_phdrs_script_test_SOURCES): Define.
10641 (tls_phdrs_script_test_DEPENDENCIES): Define.
10642 (tls_phdrs_script_test_LDFLAGS): Define.
10643 (tls_phdrs_script_test_LDADD): Define.
10644 * testsuite/Makefile.in: Rebuild.
10645
4a599bdd
CC
106462010-03-23 Cary Coutant <ccoutant@google.com>
10647
10648 * fileread.cc (find_or_make_view): Fix comment.
10649
6c93b22c
ILT
106502010-03-23 Ian Lance Taylor <iant@google.com>
10651
10652 * script-sections.cc (class Orphan_section_placement): Define
10653 PLACE_TLS and PLACE_TLS_BSS.
10654 (Orphan_section_placement::Orphan_section_placement): Initialize
10655 new places.
10656 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10657 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10658 (tls_script_test_SOURCES): Define.
10659 (tls_script_test_DEPENDENCIES): Define.
10660 (tls_script_test_LDFLAGS): Define.
10661 (tls_script_test_LDADD): Define.
10662 * testsuite/Makefile.in: Rebuild.
10663
a2c7281b
DK
106642010-03-22 Doug Kwan <dougkwan@google.com>
10665
10666 * arm.cc (Arm_relocate_functions::abs8,
10667 Arm_relocate_functions::abs16): Use correct check for overflow
10668 specified in the ARM ELF specs.
10669 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10670 target of a BLX instruction specially.
10671 (Reloc_stub::stub_type_for_reloc): Ditto.
10672 (Relocate::relocate): Use symbolic names instead of numeric relocation
10673 codes to report error.
10674 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10675 workaround.
10676 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10677 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10678 thumb2_blx_out_of_range.stdout
10679 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10680 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10681 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10682 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10683 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10684 thumb2_blx_in_range, thumb2_blx_in_range.o,
10685 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10686 thumb2_blx_out_of_range.o): New rules.
2e702c99 10687 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10688 thumb2_blx_in_range and thumb2_blx_out_of_range.
10689 * testsuite/Makefile.in: Regenerate.
10690 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10691 * testsuite/thumb_blx_in_range.s: New file.
10692 * testsuite/thumb_blx_out_of_range.s: New file.
10693
b0193076
RÁE
106942010-03-22 Rafael Espindola <espindola@google.com>
10695
10696 * archive.cc (Should_include): Move to archive.h.
10697 (should_include_member): Make it a member of Archive.
10698 (Lib_group): New.
10699 (Add_lib_group_symbols): New.
10700 * archive.h: Include options.h.
10701 (Archive_member): Moved from Archive.
10702 (Should_include): Moved from archive.cc.
10703 (Lib_group): New.
10704 (Add_lib_group_symbols): New.
10705 * dynobj.cc (do_should_include_member): New.
10706 * dynobj.h (do_should_include_member): New.
10707 * gold.cc (queue_initial_tasks): Update call to queue.
10708 * main.cc (main): Print lib group stats.
10709 * object.cc (do_should_include_member): New.
10710 * object.h: Include archive.h.
10711 (Object::should_include_member): New.
10712 (Object::do_should_include_member): New.
10713 (Sized_relobj::do_should_include_member): New.
10714 * options.cc (General_options::parse_start_lib): New.
10715 (General_options::parse_end_lib): New.
10716 (Input_arguments::add_file): Handle lib groups.
10717 (Input_arguments::start_group): Check we are not in a lib.
10718 (Input_arguments::start_lib): New.
10719 (Input_arguments::end_lib): New.
10720 * options.h (General_options): Add start_lib and end_lib.
10721 (Input_argument::lib_): New.
10722 (Input_argument::lib): New.
10723 (Input_argument::is_lib): New.
10724 (Input_file_lib): New.
10725 (Input_arguments::in_lib_): New.
10726 (Input_arguments::in_lib): New.
10727 (Input_arguments::start_lib): New.
10728 (Input_arguments::end_lib_): New.
10729 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10730 in unused members as preempted.
10731 (Sized_pluginobj::do_should_include_member): New.
10732 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10733 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10734 return the blocker.
10735 (Read_symbols::do_whole_lib_group): New.
10736 (Read_symbols::do_lib_group): New.
10737 (Read_symbols::do_read_symbols): Handle lib groups.
10738 (Read_symbols::get_name): Handle lib groups.
10739 * readsyms.h (Read_symbols): Add an archive member pointer.
10740 (Read_symbols::do_whole_lib_group): New.
10741 (Read_symbols::do_lib_group): New.
10742 (Read_symbols::member_): New.
10743 * script.cc (read_input_script): Update call to queue_soon.
10744
d099120c
DK
107452010-03-19 Doug Kwan <dougkwan@google.com>
10746
10747 * arm.cc (Stub_table::Stub_table): Initialize new data members
10748 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10749 (Stub_table::add_reloc_stub): Assign stub offset and update
10750 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10751 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10752 New data members.
2e702c99 10753 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10754 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10755 instead of going over all reloc stubs.
2e702c99 10756 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10757 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10758 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10759 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10760 Stringpool_template::offset_.
10761 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10762 Stringpool_template::offset_ to zero.
10763
1aa37384
DK
107642010-03-15 Doug Kwan <dougkwan@google.com>
10765
10766 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10767 offset_.
10768 (Stringpool_template::new_key_offset): New method.
10769 (Stringpool_template::add_string): Assign offsets when adding new
10770 strings.
10771 (Stringpool_template::set_string_offsets): Do not set string offsets
10772 when not optimizing.
10773 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10774 member size_.
2e702c99
RM
10775 (Chunked_vector::clear): Clear size_.
10776 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10777 (Chunked_vector::size): Return size_.
10778 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10779 (Chunked_vector::size_): New data member.
1aa37384
DK
10780 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10781 (Stringpool_template::new_key_offset): New method declaration.
10782 (Stringpool_template::offset_): New data member.
10783
b672b057
RÁE
107842010-03-15 Rafael Espindola <espindola@google.com>
10785
10786 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10787 Add_symbols' constructor.
10788 * readsyms.h (Add_symbols): Remove the input_group member.
10789
b6848d3c
ILT
107902010-03-10 Ian Lance Taylor <iant@google.com>
10791
10792 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10793 target to ask whether a reference to a symbol requires a stack
10794 split.
10795 * target.h (Target::is_call_to_non_split): New function.
10796 (Target::do_is_call_to_non_split): Declare virtual function.
10797 * target.cc: Include "symtab.h".
10798 (Target::do_is_call_to_non_split): New function.
10799 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10800
a2a5469e
CC
108012010-03-10 Cary Coutant <ccoutant@google.com>
10802
10803 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10804 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10805 (File_read::open[2]): Add whole_file_view_ to list of views.
10806 (File_read::make_view): Remove test of whole_file_view_.
10807 (File_read::find_or_make_view): Create whole_file_view_ if
10808 necessary.
10809 (File_read::clear_views): Replace bool parameter with enum;
10810 adjust all callers. Don't delete views with permanent data;
10811 do delete cached views and views from archives if
10812 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10813 if clearing the corresponding view.
10814 * fileread.h (File_read::Clear_views_mode): New enum.
10815 (File_read::View::is_permanent_view): New method.
10816 (File_read::clear_views): Replace bool parameter
10817 with enum; adjust all callers.
10818 * options.h (General_options): Change keep_files_mapped option;
10819 add map_whole_files.
10820 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10821 releasing the file.
10822 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10823 the file.
10824
8861f32b
DM
108252010-03-10 David S. Miller <davem@davemloft.net>
10826
10827 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10828
d62d0f5f
ST
108292010-03-09 Sriraman Tallam <tmsriram@google.com>
10830
10831 * icf.cc (get_section_contents): Add '@' marker after processing the
10832 merge reloc.
10833
9177756d
DK
108342010-03-08 Doug Kwan <dougkwan@google.com>
10835
10836 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10837 due to a conversion warning.
10838 (Arm_relobj::update_output_local_symbol_count): Check for local
10839 symbol with unset output index.
10840
9e9e071b
ILT
108412010-03-05 Ian Lance Taylor <iant@google.com>
10842
10843 * options.h (class General_options): Add --spare-dynamic-tags.
10844 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10845 --spare-dynamic-tags.
10846
a81ee015
ILT
108472010-03-05 Ian Lance Taylor <iant@google.com>
10848
10849 * incremental.cc: Include "libiberty.h".
10850
44ec90b9
RO
108512010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10852
10853 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10854 function, is_info_ member.
10855 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10856 (Versions::Versions): Update caller.
10857 (Versions::define_base_version): Likewise.
10858 (Versions::add_def): Likewise.
10859
0897ed3b
ST
108602010-03-03 Sriraman Tallam <tmsriram@google.com>
10861
10862 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10863 (Scan::possible_function_pointer_reloc): New function.
10864 (Scan::local_reloc_may_be_function_pointer): Change to call
10865 possible_function_pointer_reloc.
10866 (Scan::global_reloc_may_be_function_pointer): Ditto.
10867 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10868 relocations in ".data.rel.ro._ZTV" section.
10869 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10870 * testsuite/icf_safe_so_test.cc: Ditto.
10871 * testsuite/icf_safe_test.cc: Ditto.
10872 * testsuite/icf_safe_test.sh: Ditto.
10873
d3bbad62
ILT
108742010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10875 Ian Lance Taylor <iant@google.com>
10876
10877 * target-reloc.h (relocate_section): Check the symbol table index
10878 for -1U before setting the local symbol index.
10879 (scan_relocatable_relocs): If copying the relocation, record that
10880 the local symbol is required.
10881 * object.h (Symbol_value::is_output_symtab_index_set): New
10882 function.
10883 (Symbol_value::may_be_discarded_from_output_symtab): New
10884 function.
10885 (Symbol_value::has_output_symtab_entry): New function.
10886 (Symbol_value::needs_output_symtab_entry): Remove.
10887 (Symbol_value::output_symtab_index): Make sure the symbol index is
10888 set.
10889 (Symbol_value::set_output_symtab_index): Make sure the symbol
10890 index is not set. Make sure the new index is valid.
10891 (Symbol_value::set_must_have_output_symtab_entry): New function.
10892 (Symbol_value::has_output_dynsym_entry): New function.
10893 (Symbol_value::set_output_dynsym_index): Make sure the new index
10894 is valid.
10895 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10896 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10897 local symbol if permitted.
10898 (Sized_relobj::do_finalize_local_symbols): Call
10899 is_output_symtab_index_set rather than needs_output_symtab_entry.
10900 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10901 rather than needs_output_symtab_entry. Call
10902 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10903 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10904 is_output_symtab_index_set rather than needs_output_symtab_entry.
10905 * testsuite/discard_locals_relocatable_test.c: New file.
10906 * testsuite/discard_locals_test.sh: Test -r.
10907 * testsuite/Makefile.am (check_DATA): Add
10908 discard_locals_relocatable_test1.syms,
10909 discard_local_relocatable_test2.syms.
10910 (MOSTLYCLEANFILES): Likewise. Also add
10911 discard_locals_relocatable_test1.lout and
10912 discard_locals_relocatable_test2.out.
10913 (discard_locals_relocatable_test1.syms): New target.
10914 (discard_locals_relocatable_test.o): New target.
10915 (discard_locals_relocatable_test1.out): New target.
10916 (discard_locals_relocatable_test2.syms): New target.
10917 (discard_locals_relocatable_test2.out): New target.
10918 (various): Add missing ../ld-new dependencies.
10919 * testsuite/Makefile.in: Rebuild.
10920
7e8ccf26
NC
109212010-03-03 Nick Clifton <nickc@redhat.com>
10922
10923 * po/fi.po: New Finnish translation.
10924
2a0ff005
DK
109252010-03-01 Doug Kwan <dougkwan@google.com>
10926
10927 * layout.cc (Layout::Layout): Force section types of .init_array*,
10928 .preinit_array* and .fini_array* sections.
10929 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10930 Fix check of return value of std::string::find.().
10931 (Output_section::Input_section_sort_compare::operator()): Remove
10932 comment about .init_array.
10933 (Output_section::Input_section_sort_init_fini_compare::operator()):
10934 New method.
10935 (Output_section::sort_attached_input_sections): Handle .init_array
10936 and .fini_array specially.
10937 * output.h (Output_section::Inut_section_sort_compare): Update
10938 comment.
10939 (Output_section::Input_section_sort_init_fini_compare): New struct.
10940
c3e4ae29
DK
109412010-02-26 Doug Kwan <dougkwan@google.com>
10942
10943 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10944 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10945 * testsuite/debug_msg.sh: Avoid matching source line number for
10946 use of global variable undef_int.
10947
2fd9ae7a
DK
109482010-02-26 Doug Kwan <dougkwan@google.com>
10949
10950 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10951 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10952 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10953 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10954 * options.cc (General_options::General_options): Initialize member
10955 fix_v4bx_.
10956 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10957 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10958 and rm_no_fix_v4bx.stdout
10959 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10960 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10961 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10962 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10963 and arm_no_fix_v4bx.
10964 * Makefile.in: Regenerate.
10965 * testsuite/arm_fix_v4bx.s: New file.
10966 * testsuite/arm_fix_v4bx.sh: Ditto.
10967
67ec7d0b
DK
109682010-02-24 Doug Kwan <dougkwan@google.com>
10969
10970 * arm.cc (Target_arm::got_section): Make the .got section the first
10971 non RELRO section in the data segment.
10972 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10973 suffixes of section names.
10974
10165461
DK
109752010-02-24 Doug Kwan <dougkwan@google.com>
10976
10977 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10978 flags and attributes merging if an input file is a binary file.
10979 * fileread.cc (Input_file::open): Record format of original file.
10980 * fileread.h (Input_file::Format): New enum type.
2e702c99 10981 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10982 (Input_file::format): New method definition.
10983 (Input_file::format_):: New data member.
10984
4a54abbb
DK
109852010-02-24 Doug Kwan <dougkwan@google.com>
10986
10987 * arm.cc (Arm_output_data_got): New class.
10988 (ARM_TCB_SIZE): New constant
10989 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10990 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10991 If user uses a script with a SECTIONS clause, issue only a warning
10992 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10993 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10994 garbage collection.
10995 (Target_arm::got_mode_index_entry): Handle static linking.
10996 (Target_arm::Scan::local): Ditto.
10997 (Target_arm::Scan::global): Ditto.
10998 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10999 all incorrectly implemented relocations.
e1df38aa 11000 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
11001 Arm_output_section::fix_exidx_coverage.
11002 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11003 from ".ARM.exidx." and ".ARM.extab.".
11004
ca419a6f
ILT
110052010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11006
11007 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11008 section if it does not already exist.
11009 * attributes.cc (Attributes_section_data::Attributes_section_data):
11010 Don't crash if size is zero.
11011
135b9c78
ILT
110122010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11013 Ian Lance Taylor <iant@google.com>
11014
11015 * gold.cc (queue_middle_tasks): If no input files were opened,
11016 exit.
11017 * workqueue.h (Task_function::Task_function): Assert that there is
11018 a blocker.
11019
bb0bfe4f
DK
110202010-02-22 Doug Kwan <dougkwan@google.com>
11021
11022 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11023 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11024 types to avoid warnings due to different uint64_t implementations
11025 on different hosts.
11026
2a2b6d42
DK
110272010-02-21 Doug Kwan <dougkwan@google.com>
11028
11029 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11030 handling of the maximum backward branch offset.
2e702c99 11031 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11032 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11033 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11034 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11035 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11036 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11037 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11038 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11039 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11040 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11041 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11042 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11043 thumb2_bl_out_of_range.o): New rules.
11044 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11045 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11046 thumb2_bl_out_of_range
11047 * testsuite/Makefile.in: Regenerate.
11048 * testsuite/arm_bl_in_range.s: New file.
11049 * testsuite/arm_bl_out_of_range.s: Ditto.
11050 * testsuite/arm_branch_in_range.sh: Ditto.
11051 * testsuite/arm_branch_range.t: Ditto.
11052 * testsuite/thumb2_branch_range.t: Ditto.
11053 * testsuite/thumb_bl_in_range.s: Ditto.
11054 * testsuite/thumb_bl_out_of_range.s: Ditto.
11055 * testsuite/thumb_branch_range.t: Ditto.
11056
b487ad64
ST
110572010-02-20 Sriraman Tallam <tmsriram@google.com>
11058
11059 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11060 Add reloc offset information.
11061 * icf.cc (get_section_contents): Change iterators to point to the new
11062 vectors. Add reloc offset information to the contents.
11063 * icf.h (Icf::Sections_reachable_info): New typedef.
11064 (Icf::Sections_reachable_list): New typedef.
11065 (Icf::Offset_info): New typedef.
11066 (Icf::Reloc_info): New struct typedef.
11067 (Icf::Reloc_info_list): New typedef.
11068 (Icf::symbol_reloc_list): Delete method.
11069 (Icf::addend_reloc_list): Delete method.
11070 (Icf::section_reloc_list): Delete method.
11071 (Icf::reloc_info_list): New method.
11072 (Icf::reloc_info_list_): New member.
11073
f96accdf
DK
110742010-02-19 Doug Kwan <dougkwan@google.com>
11075
11076 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11077 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11078 * arm.cc (Arm_relocation_functions): New forward declaration.
11079 (Target_arm::Target_arm): Initialize new data members
11080 got_mod_index_offset_ and tls_base_symbol_defined_.
11081 (Target_arm::Relocate::relocate_tls): New method.
11082 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11083 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11084 New methods.
2e702c99 11085 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11086 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11087 (Target_arm::got_mod_index_offset_,
11088 Target_arm::tls_base_symbol_defined_): New data members.
11089 (Target_arm::Scan::local, Target::Scan::global,
11090 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11091 relocations.
11092
c8761b9a
DK
110932010-02-18 Doug Kwan <dougkwan@google.com>
11094
11095 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11096 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11097 text section as a parameter becuase some broken tools may not set
11098 the link in section header.
11099 (Target_arm::has_got_section): New method.
11100 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11101 without any mapping symbol as data only. Remove warning.
11102 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11103 link in its section header, try to discover the link by inspecting the
11104 REL31 relocation at the beginning of the section.
11105 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11106 in error message.
11107 (Target_arm::Scan::global): Treat any reference to the symbol
11108 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11109
21bb3914
ST
111102010-02-12 Sriraman Tallam <tmsriram@google.com>
11111
11112 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11113 (Scan::global_reloc_may_be_function_pointer): New function.
11114 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11115 (Scan::global_reloc_may_be_function_pointer): New function.
11116 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11117 (Scan::global_reloc_may_be_function_pointer): New function.
11118 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11119 (Scan::global_reloc_may_be_function_pointer): New function.
11120 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11121 (Scan::global_reloc_may_be_function_pointer): New function.
11122 (Scan::possible_function_pointer_reloc): New function.
11123 (Target_x86_64::can_check_for_function_pointers): New function.
11124 * gc.h (gc_process_relocs): Scan relocation types to determine if
11125 function pointers were taken for targets that support it.
11126 * icf.cc (Icf::find_identical_sections): Include functions for
11127 folding in safe ICF whose pointer is not taken.
11128 * icf.h (Secn_fptr_taken_set): New typedef.
11129 (fptr_section_id_): New member.
11130 (section_has_function_pointers): New function.
11131 (set_section_has_function_pointers): New function.
11132 (check_section_for_function_pointers): New function.
11133 * options.h: Fix comment for safe ICF option.
11134 * target.h (can_check_for_function_pointers): New function.
11135 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11136 Modify icf_safe_test for X86-64.
11137 * testsuite/Makefile.in: Regenerate.
11138 * testsuite/icf_safe_so_test.cc: New file.
11139 * testsuite/icf_safe_so_test.sh: New file.
11140 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11141 (main): Change to take pointer to function kept_func_3.
11142 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11143 folding is done correctly for X86-64.
11144
0da6fa6c
DM
111452010-02-12 David S. Miller <davem@davemloft.net>
11146
11147 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11148 is_symbolless parameter.
11149 (Output_reloc<SHT_REL>::is_symbolless): New.
11150 (Output_reloc<SHT_REL>::is_symbolless_): New.
11151 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11152 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11153 (Output_reloc<SHT_RELA>::is_symbolless): New.
11154 (Output_data_reloc::add_global): Handle is_symbolless.
11155 (Output_data_reloc::add_global_relative): Likewise.
11156 (Output_data_reloc::add_local): Likewise.
11157 (Output_data_reloc::add_local_relative): Likewise.
11158 (Output_data_reloc::add_symbolless_global_addend): New.
11159 (Output_data_reloc::add_symbolless_local_addend): New.
11160 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11161 is_symbolless.
11162 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11163 instead of ->is_relative_
11164 (Output_reloc::write): Likewise.
11165 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11166 (Output_reloc::write_rel): Simplify.
11167
11168 * sparc.cc (Target_sparc::Scan::local): Use
11169 ->add_symbolless_local_addend as needed.
11170 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11171 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11172 based upon relocation offset.
11173
e4782e83
DK
111742010-02-11 Doug Kwan <dougkwan@google.com>
11175
11176 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11177 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11178 beginning of function.
11179 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11180 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11181 parameter is_32bit in calls to should_apply_static_reloc.
11182 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11183 (check_DATA): Add arm_abs_global.stdout.
11184 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11185 arm_abs_global.stdout): New rules.
11186 (MOSTLLYCLEANFILES): Add arm_abs_global
11187 * Makefile.in: Regenerate.
11188 * testsuite/arm_abs_global.s: New file.
11189 * testsuite/arm_abs_global.sh: Ditto.
11190 * testsuite/arm_abs_lib.s: Ditto.
11191
93ceb764
ILT
111922010-02-11 Ian Lance Taylor <iant@google.com>
11193
11194 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11195 Read_relocs task.
11196 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11197 Allocate_commons_task first.
11198 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11199 task, rather than symtab_lock_.
11200 (Gc_process_relocs::~Gc_process_relocs): New function.
11201 (Gc_process_relocs::is_runnable): Check this_blocker_.
11202 (Gc_process_relocs::locks): Use next_blocker_ rather than
11203 blocker_.
11204 (Scan_relocs::~Scan_relocs): New function.
11205 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11206 symtab_lock_.
11207 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11208 next_blocker_.
11209 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11210 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11211 constructor accordingly.
11212 (class Gc_process_relocs): Likewise.
11213 (class Scan_relocs): Likewise.
11214 * common.h (class Allocate_commons_task): Remove symtab_lock_
11215 field, and corresponding constructor parameter.
11216 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11217 symtab_lock_.
11218 (Allocate_commons_task::locks): Likewise.
11219
114dfbe1
ILT
112202010-02-11 Ian Lance Taylor <iant@google.com>
11221
11222 * gold-threads.h (class Once): Define.
11223 (class Initialize_lock): Rewrite as child of Once.
11224 * gold-threads.cc (class Once_initialize): Define.
11225 (once_pointer_control): New static variable.
11226 (once_pointer, once_arg): New static variables.
11227 (c_run_once): New static function.
11228 (Once::Once, Once::run_once, Once::internal_run): New functions.
11229 (class Initialize_lock_once): Remove.
11230 (initialize_lock_control): Remove.
11231 (initialize_lock_pointer): Remove.
11232 (initialize_lock_once): Remove.
11233 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11234 (Initialize_lock::initialize): Rewrite.
11235 (Initialize_lock::do_run_once): New function.
11236 * archive.cc (Archive::interpret_header): Only clear name if it is
11237 not already empty.
11238 * fileread.cc: Include "gold-threads.h"
11239 (file_counts_lock): New static variable.
11240 (file_counts_initialize_lock): Likewise.
11241 (File_read::release): Only increment counts when using --stats.
11242 Use a lock around the increment.
11243 * parameters.cc (class Set_parameters_target_once): Define.
11244 (set_parameters_target_once): New static variable.
11245 (Parameters::Parameters): Move here from parameters.h.
11246 (Parameters::set_target): Rewrite.
11247 (Parameters::set_target_once): New function.
11248 (Parameters::clear_target): Move here and rewrite.
11249 * parameters.h (class Parameters): Update declarations. Add
11250 set_parameters_target_once_ field.
11251 (Parameters::Parameters): Move to parameters.cc.
11252 (Parameters::clear_target): Likewise.
11253 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11254 task.
11255 (Start_group::~Start_group): New function.
11256 (Start_group::is_runnable): New function.
11257 (Start_group::locks, Start_group::run): New functions.
11258 (Finish_group::run): Change saw_undefined to size_t.
11259 * readsyms.h (class Start_group): Define.
11260 (class Finish_group): Change saw_undefined_ field to size_t.
11261 (Finish_group::Finish_group): Remove saw_undefined and
11262 this_blocker parameters. Change all callers.
11263 (Finish_group::set_saw_undefined): New function.
11264 (Finish_group::set_blocker): New function.
11265 * symtab.h (class Symbol_table): Change saw_undefined to return
11266 size_t. Change saw_undefined_ field to size_t.
11267 * target-select.cc (Set_target_once::do_run_once): New function.
11268 (Target_selector::Target_selector): Initialize set_target_once_
11269 field. Don't initialize lock_ and initialize_lock_ fields.
11270 (Target_selector::instantiate_target): Rewrite.
11271 (Target_selector::set_target): New function.
11272 * target-select.h (class Set_target_once): Define.
11273 (class Target_selector): Update declarations. Make
11274 Set_target_once a friend. Remove lock_ and initialize_lock_
11275 fields. Add set_target_once_ field.
11276
fa17a3f4
ILT
112772010-02-10 Ian Lance Taylor <iant@google.com>
11278
11279 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11280 queueing any tasks.
11281 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11282 (queue_middle_tasks): Add all blockers before queueing any tasks.
11283 (queue_final_tasks): Likewise.
11284 * token.h (Task_token::add_blockers): New function.
11285 * object.h (Input_objects::number_of_relobjs): New function.
11286
c7177d31
ILT
112872010-02-10 Ian Lance Taylor <iant@google.com>
11288
5de0e392
ILT
11289 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11290 shared, not if not position independent.
11291 * x86_64.cc (Relocate::relocate_tls): Likewise.
11292 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11293 (tls_pie_pic_test): New target.
11294 * testsuite/Makefile.in: Rebuild.
11295
c7177d31
ILT
11296 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11297 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11298 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11299 * testsuite/Makefile.in: Rebuild.
11300
684b268a
DM
113012010-02-09 David S. Miller <davem@davemloft.net>
11302
11303 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11304 R_SPARC_RELATIVE using ->add_local_relative().
11305 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11306
612a8d3d
DM
11307 * output.h (Output_data_dynamic::add_section_size): New method
11308 that takes two Output_data objects.
11309 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11310 entry param. Handle it in initializers.
11311 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11312 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11313 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11314 arg.
11315 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11316 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11317 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11318 for dynrel_includes_plt.
11319 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11320 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11321 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11322 before .rela.plt
11323 (Target_sparc::do_finalize_sections): Update to pass true for
11324 dynrel_includes_plt.
11325 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11326 output before .rela.plt
11327 (Target_powerpc::do_finalize_sections): Update to pass true for
11328 dynrel_includes_plt when 32-bit.
11329
cb1be87e
DK
113302010-02-08 Doug Kwan <dougkwan@google.com>
11331
11332 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11333 method.
11334 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11335 Arm_relobj::scan_section_for_cortex_a8_stubs,
11336 Arm_relobj::do_relocation_section): Instead of calling
11337 Output_section::output_address, use faster
11338 Arm_relobj::simple_input_section_output_address.
11339
705b5121
DM
113402010-02-08 David S. Miller <davem@davemloft.net>
11341
11342 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11343 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11344 relocation helper function.
11345
024c4466
DM
11346 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11347 just like R_SPARC_GOT{10,13,22}.
11348 (Target_sparc::Scan::local): Likewise.
11349 (Target_sparc::Relocate:relocate): Likewise.
11350
9109c078
ILT
113512010-02-06 Ian Lance Taylor <iant@google.com>
11352
11353 * configure.ac: Rewrite targetobjs duplicate removal code to use
11354 only shell constructs.
11355 * configure: Rebuild.
11356
cf846138
DK
113572010-02-05 Doug Kwan <dougkwan@google.com>
11358
11359 PR 11247
11360 * arm.cc (Arm_relobj::section_is_scannable): New method.
11361 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11362 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11363
6cfaf60b
DK
113642010-02-04 Doug Kwan <dougkwan@google.com>
11365
11366 PR 11247
11367 * arm-reloc-property.cc (cstdio): Include.
11368 * configure.ac (targetobjs): Remove duplicates.
11369 * configure: Regenerate.
11370 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11371 big and little endian version for a given address size.
11372
5c57f1be
DK
113732010-02-03 Doug Kwan <dougkwan@google.com>
11374
11375 * arm-reloc-property.cc
11376 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11377 definition.
11378 * arm-reloc-property.h
11379 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11380 New method definition.
11381 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11382 declaration.
11383 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11384 overflow to N.
11385 (GOT_PREL): Change implemented to Y.
11386 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11387 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11388 (Arm_relocate_functions::movw_abs_nc): Remove method.
11389 (Arm_relocate_functions::movt_abs): Ditto.
11390 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11391 (Arm_relocate_functions::thm_movt_abs): Ditto.
11392 (Arm_relocate_functions::movw_rel_nc): Ditto.
11393 (Arm_relocate_functions::movw_rel): Ditto.
11394 (Arm_relocate_functions::movt_rel): Ditto.
11395 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11396 (Arm_relocate_functions:thm_movw_rel): Ditto.
11397 (Arm_relocate_functions:thm_movt_rel): Ditto.
11398 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11399 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11400 New method definitions.
11401 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11402 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11403 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11404 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11405 (Target_arm::Relocate::relocate): Check for non-static or
11406 unimplemented relocation code and exit early. Change calls to
11407 Target_arm::reloc_uses_thumb_bit and
11408 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11409 instead. Refactor code to handle similar relocations to increase
11410 code sharing. Remove check for unsupported relocation code in switch
11411 statement.
11412 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11413 relocation property table to find out size. Change error message to
11414 print out the name of a relocation code instead of the numeric value.
11415 (Target_arm::scan_reloc_for_stub): Use relocation property table
11416 instead of calling Target_arm::reloc_uses_thumb_bit().
11417
218c5831
DK
114182010-02-02 Doug Kwan <dougkwan@google.com>
11419
11420 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11421 types of relaxed input section.
11422
0d31c79d
DK
114232010-02-02 Doug Kwan <dougkwan@google.com>
11424
11425 * Makefile.am (HFILES): Add arm-reloc-property.h.
11426 (DEFFILES): New.
2e702c99
RM
11427 (TARGETSOURCES): Add arm-reloc-property.cc
11428 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11429 (libgold_a_SOURCES): $(DEFFILES)
11430 * Makefile.in: Regenerate.
11431 * arm-reloc-property.cc: New file.
11432 * arm-reloc-property.h: New file.
11433 * arm-reloc.def: New file.
11434 * arm.cc: Update comments.
11435 (arm-reloc-property.h): New included header.
11436 (arm_reloc_property_table): New global variable.
11437 (Target_arm::do_select_as_default_target): New method definition.
11438 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11439 arm-reloc-property to targ_extra_obj.
11440 * parameters.cc (set_parameters_target): Call
11441 Target::select_as_default_target().
11442 * target.h (Target::select_as_default_target): New method definition.
11443 (Target::do_select_as_default_target): Same.
11444
546c7457
DK
114452010-02-01 Doug Kwan <dougkwan@google.com>
11446
11447 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11448 first_output_text_section_.
11449 (Arm_exidx_fixup::first_output_text_section): New method definition.
11450 (Arm_exidx_fixup::first_output_text_section_): New data member.
11451 (Arm_exidx_fixup::process_exidx_section): Record the first text
11452 output section seen.
11453 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11454 and entsize in output section header.
11455
11b861d5
DK
114562010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11457
11458 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11459 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11460 (Arm_relocate_functions::thm_alu11): New Method.
11461 (Arm_relocate_functions::thm_pc8): New Method.
11462 (Arm_relocate_functions::thm_pc12): New Method.
11463 (Target_arm::Scan::local): Handle the relocations.
11464 (Target_arm::Scan::global): Likewise.
11465 (Target_arm::Relocate::relocate): Likewise.
11466 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11467
c9a2c125
DK
114682010-01-29 Doug Kwan <dougkwan@google.com>
11469
11470 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11471 of relocation types as ld.
11472
1521477a
DK
114732010-01-29 Doug Kwan <dougkwan@google.com>
11474
11475 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11476 to public.
11477 (Arm_relocate_functions::thumb_branch_common): Ditto.
11478 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11479 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11480 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11481 Arm_relocate_functions::jump24): Remove.
11482 (Target_arm::Relocate::relocate): Adjust code to call
11483 Arm_relocation_functions::arm_branch_common and
11484 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11485 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11486
e7eca48c
DK
114872010-01-29 Doug Kwan <dougkwan@google.com>
11488
11489 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11490 output_local_symbol_count_needs_update_.
11491 (Arm_relobj::output_local_symbol_count_needs_update,
11492 Arm_relobj::set_output_local_symbol_count_needs_update,
11493 Arm_relobj::update_output_local_symbol_count): New methods.
11494 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11495 member.
11496 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11497 of pointed function as in a R_ARM_PREL31 relocation.
11498 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11499 for output local symbol count updating.
11500 (Target_arm::do_relax): Update output local symbol counts in objects
11501 if necessary.
11502 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11503
02961d7e
ILT
115042010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11505
11506 * arm.cc: Added support for the ARM relocations:
11507 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11508 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11509 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11510 movw_prel_nc).
11511 (Arm_relocate_functions::movw_rel): New method.
11512 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11513 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11514 thm_movw_prel_nc).
11515 (Arm_relocate_functions::thm_movw_rel): New method.
11516 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11517 thm_movt_prel).
11518 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11519 relocations.
11520 (Target_arm::Scan::global): Likewise.
11521 (Target_arm::Relocate::relocate): Likewise.
11522 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11523 Likewise.
11524
b10d2873
ILT
115252010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11526
11527 * arm.cc: Added support for ARM group relocations.
11528 (Target_arm::reloc_needs_sym_origin): New method.
11529 (Arm_relocate_functions::calc_grp_kn): New method.
11530 (Arm_relocate_functions::calc_grp_residual): New method.
11531 (Arm_relocate_functions::calc_grp_gn): New method.
11532 (Arm_relocate_functions::arm_grp_alu): New Method.
11533 (Arm_relocate_functions::arm_grp_ldr): New Method.
11534 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11535 (Arm_relocate_functions::arm_grp_ldc): New Method.
11536 (Target_arm::Scan::local): Handle the ARM group relocations.
11537 (Target_arm::Scan::global): Likewise.
11538 (Target_arm::Relocate::relocate): Likewise.
11539 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11540 Likewise.
11541
2b328d4e
DK
115422010-01-26 Doug Kwan <dougkwan@google.com>
11543
11544 * arm.cc (set): Include.
11545 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11546 pointer type.
2e702c99 11547 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11548 (Arm_output_section::append_text_sections_to_list): New method.
11549 (Arm_output_section::fix_exidx_coverage): Ditto.
11550 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11551 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11552 Relobj::set_section_offset() instead of
11553 Sized_relobj::invalidate_section_offset().
2e702c99 11554 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11555 parameter for section headers. Ignore relocation sections for
11556 unallocated sections and EXIDX sections.
11557 (Target_arm::fix_exidx_coverage): New method.
11558 (Target_arm::output_section_address_less_than): New type.
11559 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11560 linked text section instead of the EXIDX section.
11561 (Arm_output_section::create_stub_group): Add an assertion to check
11562 that this is not an EXIDX output section.
11563 (Arm_output_section::append_text_sections_to_list): New method.
11564 (Arm_output_section::fix_exidx_coverage): Ditto.
11565 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11566 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11567 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11568 first pass.
11569 (Target_arm::fix_exidx_coverage): New method.
11570 * object.h (Relobj::set_output_section): New method.
11571 (Sized_relobj::invalidate_section_offset): Remove method.
11572 (Sized_relobj::do_invalidate_section_offset): Remove method.
11573 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11574
c7f3c371
DK
115752010-01-25 Doug Kwan <dougkwan@google.com>
11576
11577 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11578 Fix warning due to signed and unsigned comparison on a 32-bit host.
11579
8923b24c
DK
115802010-01-22 Doug Kwan <dougkwan@google.com>
11581
11582 * arm.cc (Target_arm::do_relax): Record an output section for section
11583 offset adjustment it contains any stub table that has changed.
11584 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11585 offsets in an output section if necessary.
11586 * output.cc (Output_section::Output_section): Initialize
11587 section_offsets_need_adjustments_.
11588 (Output_section::add_input_section_for_script): Renamed to
11589 Output_section::add_simple_input_section.
11590 (Output_section::save_states): Add a comment.
11591 (Output_section::discard_states): New method defintion.
11592 (Output_section::adjust_section_offsets): Same.
11593 * output.h (Output_section::add_input_section_for_script): Renamed to
11594 Output_section::add_simple_input_section.
11595 (Output_section::discard_states): New method declaration.
11596 (Output_section::adjust_section_offsets): Same.
11597 (Output_section::section_offsets_need_adjustment,
11598 Output_section::set_section_offsets_need_adjustment): New method
11599 definitions.
11600 (Output_section::section_offsets_need_adjustment_): New data member.
11601 * script-sections.cc
11602 (Output_section_element_input::set_section_address): Adjust code for
11603 renaming of Output_section::add_input_section_for_script.
11604 (Orphan_output_section::set_section_address): Same.
11605
9b2fd367
DK
116062010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11607
11608 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11609 Fix_v4bx enum values .
11610 * gold/options.h (General_options): New option definitions.
11611 (General_options::fix_v4bx): New method.
11612 (General_options::Fix_v4bx): New enum.
11613 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11614 (General_options::parse_fix_v4bx_interworking): New method.
11615
80d0d023
DK
116162010-01-22 Doug Kwan <dougkwan@google.com>
11617
11618 * arm.cc (Arm_exidx_fixup): New class.
11619
af2cdeae
DK
116202010-01-21 Doug Kwan <dougkwan@google.com>
11621
11622 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11623 classes.
11624 (Arm_exidx_section_offset_map): New type.
11625
993d07c1
DK
116262010-01-21 Doug Kwan <dougkwan@google.com>
11627
11628 * arm.cc (Arm_exidx_input_section): New class.
11629 (Arm_relobj::exidx_input_section_by_link,
11630 Arm_relobj::exidx_input_section_by_shndx,
11631 Arm_relobj::make_exidx_input_section): New methods.
11632 (read_arm_attributes_section): Remove.
11633 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11634 information about them.
11635 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11636 to here.
11637
5ac169d4
DK
116382010-01-20 Doug Kwan <dougkwan@google.com>
11639
11640 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11641 Input_section_specifier to Section_id.
11642 (Target_arm::new_arm_input_section: Adjust code for change of key
11643 type.
11644 (Target_arm::find_arm_input_section): Ditto.
11645 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11646 (Section_id): Remove.
11647 (Garbage_collection::Section_id_hash): Remove.
11648 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11649 (Section_id): Remove.
11650 (Icf::Section_id_hash): Remove.
11651 * object.h (Section_id, Const_section_id, Section_id_hash,
11652 Const_section_id_hash): New type definitions.
11653 * output.cc (Output_section::add_relaxed_input_section): Change to
11654 use Const_section_id instead of Input_section_specifier as key type.
11655 (Output_section::add_merge_input_section): Ditto.
11656 (Output_section::build_relaxation_map): Change to use Section_id
11657 instead of Input_section_specifier as key type.
2e702c99 11658 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11659 Ditto.
11660 (Output_section::convert_input_sections_to_relaxed_sections): Change
11661 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11662 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11663 (Output_section::find_relaxed_input_section): Ditto.
11664 * output.h (Input_section_specifier): Remove class.
11665 (Output_section::Output_section_data_by_input_section_map): Change
11666 key type to Const_section_id.
11667 (Output_section::Output_relaxed_input_section_by_input_section_map):
11668 Ditto.
11669 (Output_section::Relaxation_map): Change key type to Section_id.
11670
a2162063
ILT
116712010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11672
11673 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11674 (class Arm_v4bx_stub): New class.
11675 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11676 (Stub_factory::make_arm_v4bx_stub): New method.
11677 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11678 (Stub_table::empty): Handle v4bx stubs.
11679 (Stub_table::add_arm_v4bx_stub): New method.
11680 (Stub_table::find_arm_v4bx_stub): New method.
11681 (Arm_relocate_functions::v4bx): New method.
11682 (Target_arm::fix_v4bx): New method.
11683 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11684 (Stub_table::relocate_stubs): Likewise.
11685 (Stub_table::do_write): Likewise.
11686 (Stub_table::update_data_size_and_addralign): Likewise.
11687 (Stub_table::finalize_stubs): Likewise.
11688 (Target_arm::Scan::local): Likewise.
11689 (Target_arm::Scan::global): Likewise.
11690 (Target_arm::do_finalize_sections): Likewise.
11691 (Target_arm::Relocate::relocate): Likewise.
11692 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11693 Likewise.
11694 (Target_arm::scan_reloc_for_stub): Likewise.
11695 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11696
5696ab0b
ILT
116972010-01-19 Ian Lance Taylor <iant@google.com>
11698
11699 * output.cc (Output_section_headers::do_sized_write): Write large
11700 segment count to sh_info field.
11701 (Output_file_header::do_sized_write): For large segment count,
11702 write PN_XNUM to e_phnum field.
11703
800d0f56
ILT
117042010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11705
11706 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11707 (Arm_relocate_functions::thm_jump8): New function.
11708 (Arm_relocate_functions::thm_jump11): New function.
11709 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11710 R_ARM_THM_JUMP11.
11711 (Target_arm::Scan::global): Likewise.
11712 (Target_arm::Relocate::relocate): Likewise.
11713 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11714 Likewise.
11715
41263c05
DK
117162010-01-14 Doug Kwan <dougkwan@google.com>
11717
11718 * arm.cc (map, utility): Include headers.
11719 (Target_arm::apply_cortex_a8_workaround): New method.
11720 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11721 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11722 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11723 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11724 the --[no-]fix-cortex-a8 command line options.
11725 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11726 (Target_arm::relocate_stub): Use addend in instruction template.
11727 * options.h (DEFINE_bool): Set the user-set flag.
11728 (General_options): Add --[no-]-fix-cortex options.
11729 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11730 : Update fast look-up map after conversion.
41263c05 11731
459e9b03
ST
117322010-01-14 Sriraman Tallam <tmsriram@google.com>
11733
11734 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11735 in the first pass of do_layout.
11736
b521dfe4
DK
117372010-01-13 Doug Kwan <dougkwan@google.com>
11738
11739 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11740 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11741 apparent compiler problem of not folding static constant integral
11742 data members of elfcpp::Elf_sizes<32>.
11743
44272192
DK
117442010-01-13 Doug Kwan <dougkwan@google.com>
11745
11746 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11747 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11748 Arm_relobj::scan_section_for_cortex_a8_erratum,
11749 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11750 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11751 sections to scan for relocation stubs into a new method
11752 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11753 relocation and Cortex-A8 stub scanning.
11754 (Target_arm::do_relax): Force stubs to be after stubbed sections
11755 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11756 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11757 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11758
44b71ece
ILT
117592010-01-12 Ian Lance Taylor <iant@google.com>
11760
11761 * target-reloc.h (visibility_error): New inline function.
11762 (relocate_section): Call visibility_error.
11763 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11764 (MOSTLYCLEANFILES): Likewise.
11765 (protected_4_pic.o, protected_3.err): New targets.
11766 * testsuite/protected_4.cc: New file.
11767
a120bc7f
DK
117682010-01-12 Doug Kwan <dougkwan@google.com>
11769
11770 * arm.cc (Cortex_a8_reloc): New class.
11771 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11772 and cortex_a8_relocs_info_.
11773 (Target_arm::fix_cortex_a8): New method definition.
11774 (Target_arm::Cortex_a8_relocs_info): New type.
11775 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11776 New data member declarations.
11777 (Target_arm::scan_reloc_for_stub): Record information about
11778 relocations for THUMB branches that might be exempted from the
11779 Cortex-A8 workaround.
11780 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11781 at the beginning of a relaxation pass.
11782
20138696
DK
117832010-01-12 Doug Kwan <dougkwan@google.com>
11784
11785 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11786 (Arm_relobj::Mapping_symbol_position,
11787 Arm_reloj::Mapping_symbol_position_less,
11788 Arm_relobj::Mapping_symbols_info): New types.
11789 (Target_arm::is_mapping_symbol_name): New method definition.
11790 (Arm_relobj::do_count_local_symbols): Save information about mapping
11791 symbols.
11792
089d69dc
DK
117932010-01-11 Doug Kwan <dougkwan@google.com>
11794
11795 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11796 Arm_relocate_functions::thumb32_branch_upper,
11797 Arm_relocate_functions::thumb32_branch_lower,
11798 Arm_relocate_functions::thumb32_cond_branch_offset,
11799 Arm_relocate_functions::thumb32_cond_branch_upper,
11800 Arm_relocate_functions::thumb32_cond_branch_lower,
11801 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11802 branch offset encoding.
11803 (Arm_relocate_functions::thumb_branch_common): Use new branch
11804 offset encoding methods to avoid code duplication.
11805 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11806 (Stub_addend_reader::operator()): Use new branch encoding method
11807 to avoid code duplication.
11808
99e5bff2
DK
118092010-01-11 Doug Kwan <dougkwan@google.com>
11810
11811 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11812 (Target_arm::do_finalize_sections): Define special EXIDX section
11813 symbols only if referenced.
11814 * gc.h (Garbage_collection::add_reference): New method.
11815 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11816 code duplication.
11817
98e090bd
ILT
118182010-01-11 Ian Lance Taylor <iant@google.com>
11819
d0a91bd8
ILT
11820 * script.cc (Version_script_info::build_expression_list_lookup):
11821 Change complaing about duplicate wildcard match from error to
11822 warning.
11823
98e090bd
ILT
11824 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11825 of 2009-12-30.
11826 (Version_script_info::Version_script_info): Initialize globs_,
11827 default_version_, default_is_global_, and exact_. Don't
11828 initialize globals_ or locals_.
11829 (Version_script_info::build_lookup_tables): Build local symbols
11830 first.
11831 (Version_script_info::unquote): New function.
11832 (Version_script_info::add_exact_match): New function.
11833 (Version_script_info::build_expression_list_lookup): Remove lookup
11834 parameter. Add is_global parameter. Change all callers. Handle
11835 wildcard pattern specially. Unquote pattern. Call
11836 add_exact_match.
11837 (Version_script_info::get_name_to_match): New function.
11838 (Version_script_info::get_symbol_version): New function.
11839 (Version_script_info::get_symbol_version_helper): Remove.
11840 (Version_script_info::check_unmatched_names): Call unquote.
11841 * script.h (class Version_script_info): Change get_symbol_version
11842 to be non-inline and add is_global parameter; change all callers.
11843 Rewrite symbol_is_local. Update declarations. Define struct
11844 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11845 Remove globals_ and locals_ members. Add exact_, globs_,
11846 default_version_, is_global_.
11847 (Version_script_info::Glob): Remove pattern, add expression and
11848 is_global. Update constructor. Change all callers.
11849 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11850 default version.
11851 (Versions::symbol_section_contents): If a symbol is undefined, or
11852 defined in a dynamic object, set the version index to
11853 VER_NDX_LOCAL.
11854 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11855 symbol_is_local.
11856 (Symbol_table::add_from_pluginobj): Likewise.
11857 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11858
d56962d3
DK
118592010-01-11 Doug Kwan <dougkwan@google.com>
11860
11861 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11862 (incremental_dump_LDADD): Add linking option for libintl.
11863 * Makefile.in: Regenerate.
11864
94e6ee91
L
118652010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11866
11867 PR gold/11144
11868 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11869 instead of -Ds.
11870 * testsuite/Makefile.in: Regenerated.
11871
e96c574b
DK
118722010-01-10 Doug Kwan <dougkwan@google.com>
11873
11874 * options.h (DEFINE_var): Use parentheses around argument varname__
11875 in macro body to avoid any unintended subsequent substitutions.
11876
7198066b
ILT
118772010-01-10 Ian Lance Taylor <iant@google.com>
11878
ba4d53bf
ILT
11879 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11880 candidates before doing symbol resolution.
11881
7198066b
ILT
11882 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11883 ODR candidates if only one is weak.
11884
a2beed37
ILT
118852010-01-08 Ian Lance Taylor <iant@google.com>
11886
11887 * script.cc (Version_script_info::build_expression_list_lookup):
11888 Don't warn about ambiguous version, just record the ambiguity.
11889 (Version_script_info::get_symbol_version_helper): Give error if
11890 version is ambiguous.
11891
2fb7225c
DK
118922010-01-08 Doug Kwan <dougkwan@google.com>
11893
11894 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11895 prev_data_size_ and prev_addralign_. Remove initializer for
11896 deleted data member has_been_changed_.
11897 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11898 to determine if the table is empty.
11899 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11900 Remove.
11901 (Stub_table::add_reloc_stub): Define method in class definition
11902 instead of just declaring it there.
11903 (Stub_table::add_cortex_a8_stub): New method definition.
11904 (Stub_table::update_data_size_and_addralign): Ditto.
11905 (Stub_table::finalize_stubs): Ditto.
11906 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11907 (Stub_table::do_addralign_): Return address alignment in the
11908 (Stub_table::do_reset_address_and_file_offset): Define method in
11909 class definition instead of declaring it there. Set current data
11910 size to be the data size of the previous pass.
11911 (Stub_table::set_final_data_size): Use current data size as the
11912 final data size.
11913 (Stub_table::relocate_stub): Change parameter type of stub from
11914 Reloc_stub pointer to Stub pointer.
11915 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11916 (Stub_table::Cortex_a8_stub_list): New typedef.
11917 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11918 Stub_table::prev_addralign_): New data member.
11919 (Arm_relobj::Arm_relobj): Initialize data member
11920 section_has_cortex_a8_workaround_.
11921 (Arm_relobj::section_has_cortex_a8_workaround,
11922 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11923 definitions.
11924 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11925 declarations.
11926 (Target_arm::relocate_stub): Change parameter type of stub from
11927 Reloc_stub pointer to Stub pointer.
11928 (Insn_template::size, Insn_template::alignment): Handle
11929 THUMB16_SPECIAL_TYPE.
11930 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11931 Stub_table::update_data_size_and_addralign,
11932 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11933 definitions.
11934 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11935 (Stub_table::do_write): Ditto.
11936 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11937
880cd20d
ILT
119382010-01-08 Ian Lance Taylor <iant@google.com>
11939
11940 PR 11108
11941 * symtab.h (class Symbol): Remove fields is_target_special_ and
11942 has_plt_offset_. Add field is_defined_in_discarded_section_.
11943 (Symbol::is_defined_in_discarded_section): New function.
11944 (Symbol::set_is_defined_in_discarded_section): New function.
11945 (Symbol::has_plt_offset): Rewrite.
11946 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11947 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11948 Don't initialize is_target_special_ or has_plt_offset_.
11949 Initialize is_defined_in_discarded_section_.
11950 (Symbol_table::add_from_relobj): If appropriate, set
11951 is_defined_in_discarded_section.
11952 * resolve.cc (Symbol::override_base_with_special): Don't test
11953 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11954 * target-reloc.h (relocate_section): Do special handling for
11955 symbols defined in discarded sections for global symbols as well
11956 as local symbols.
11957
2703e3eb
ILT
119582010-01-08 Ian Lance Taylor <iant@google.com>
11959
11960 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11961 the SHT_SYMTAB case.
11962
339d40a3
ILT
119632010-01-08 Ian Lance Taylor <iant@google.com>
11964
11965 * object.cc (Sized_relobj::do_layout): Don't get confused if
11966 layout_eh_frame returns NULL.
11967
abecea76
ILT
119682010-01-08 Ian Lance Taylor <iant@google.com>
11969
11970 PR 11084
11971 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11972 dynamic symbol table, use the normal symbol table.
11973 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11974 symbol table.
11975
6b7dd3f3
ILT
119762010-01-08 Ian Lance Taylor <iant@google.com>
11977
11978 PR 11072
11979 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11980 sections.
11981
36c50e63
L
119822010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11983
11984 * version.cc (print_version): Change to "Copyright 2010".
11985
e291e7b9
ILT
119862010-01-08 Ian Lance Taylor <iant@google.com>
11987
11988 PR 10287
11989 PR 11063
11990 * i386.cc (class Target_i386): Change return type of plt_section
11991 to be non-const.
11992 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11993 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11994 tls_desc_rel_ field.
11995 (Output_data_plt_i386::rel_tls_desc): New function.
11996 (Target_i386::rel_tls_desc_section): New function.
11997 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11998 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11999 R_386_TLS_DESC reloc in rel_tls_desc_section.
12000 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12001 Define struct Tlsdesc_info.
12002 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12003 (Target_x86_64::do_reloc_symbol_index): New function.
12004 (Target_x86_64::add_tlsdesc_info): New function.
12005 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12006 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12007 tlsdesc_rel_ field.
12008 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12009 all callers.
12010 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12011 (Target_x86_64::rela_tlsdesc_section): New function.
12012 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12013 handling.
12014 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12015 (Target_x86_64::do_reloc_addend): New function.
12016 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12017 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12018 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12019 (Output_reloc::type): New function.
12020 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12021 (Output_reloc::is_target_specific): New function.
12022 (Output_reloc::target_arg): New function.
12023 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12024 absolute relocs and target specific relocs.
12025 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12026 add_target_specific.
12027 (class Output_data_reloc) [SHT_RELA]: Likewise.
12028 * output.cc (Output_reloc::Output_reloc): Add four new versions
12029 for absolute relocs and target specific relocs.
12030 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12031 (Output_reloc::get_symbol_index): Likewise.
12032 (Output_reloc::local_section_offset): Check that local_sym_index_
12033 is not TARGET_CODE or 0.
12034 (Output_reloc::symbol_value): Likewise.
12035 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12036 reloc.
12037 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12038 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12039 functions.
12040 * layout.cc (add_target_dynamic_tags): Use output section for
12041 DT_PLTRELSZ and DT_JMPREL.
12042
3a44184e
ILT
120432010-01-07 Ian Lance Taylor <iant@google.com>
12044
12045 PR 11061
12046 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12047 function.
12048 (class Output_data_reloc_generic): Define.
12049 (class Output_data_reloc_base): Change base class to
12050 Output_data_reloc_generic. Change add() method to call
12051 bump_relative_reloc_count for a relative reloc. Remove
12052 sort_relocs_ field.
12053 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12054 to sort_relocs().
12055 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12056 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12057 appropriate.
12058 * layout.h (class Layout): Update declaration.
12059
ea715a34
ILT
120602010-01-07 Ian Lance Taylor <iant@google.com>
12061
12062 * output.h (class Output_data): Add const version of
12063 output_section and do_output_section.
12064 (class Output_section_data): Add const version of
12065 do_output_section.
12066 (class Output_section): Likewise.
12067 * layout.cc (Layout::add_target_dynamic_tags): New function.
12068 * layout.h (class Layout): Update declarations.
12069 * arm.cc (Target_arm::do_finalize_sections): Use
12070 add_target_dynamic_tags.
12071 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12072 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12073 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12074 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12075
659948a4
ILT
120762010-01-07 Ian Lance Taylor <iant@google.com>
12077
12078 PR 11042
12079 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12080 object as needed.
12081
9d3b86f6
ILT
120822010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12083 Ian Lance Taylor <iant@google.com>
12084
12085 PR 11019
12086 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12087 Xindex::read_symtab_xindex.
12088
bb0d3eb0
DK
120892010-01-07 Doug Kwan <dougkwan@google.com>
12090
12091 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12092 (Insn_template::thumb16_bcond_insn): New method declaration.
12093 (Insn_template): Fix spelling.
12094 (Stub::thumb16_special): New method declaration.
12095 (Stub::do_write): Define virtual method which was previously pure
12096 virtual.
12097 (Stub::do_thumb16_special): New method declaration.
12098 (Stub::do_fixed_endian_write): New template member.
12099 (Reloc_stub::do_write): Remove.
12100 (Reloc_stub::do_fixed_endian_write): Remove.
12101 (Cortex_a8_stub): New class definition.
12102 (Stub_factory::make_cortex_a8_stub): New method definition.
12103 (Stub_factory::Stub_factory): Add missing static storage class
12104 qualifier for elf32_arm_stub_a8_veneer_blx.
12105
ffeef7df
ILT
121062010-01-07 Ian Lance Taylor <iant@google.com>
12107
dc3f80fe
ILT
12108 PR 10980
12109 * options.h (class General_options): Add --warn-unresolved-symbols
12110 and --error-unresolved-symbols.
12111 * errors.cc (Errors::undefined_symbol): Implement
12112 --warn-unresolved-symbols.
12113
ffeef7df
ILT
12114 * options.h (class General_options): Add -z text and -z textoff.
12115 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12116
f1ec9ded
ST
121172010-01-06 Sriraman Tallam <tmsriram@google.com>
12118
12119 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12120 (Garbage_collection::cident_sections): New function.
12121 (Garbage_collection::add_cident_section): New function.
12122 (Garbage_collection::cident_sections_): New member.
12123 (gc_process_relocs): Add references to sections whose names are C
12124 identifiers.
12125 * gold.h (cident_section_start_prefix): New constant.
12126 (cident_section_stop_prefix): New constant.
12127 (is_cident): New function.
12128 * layout.cc (Layout::define_section_symbols): Replace string constants
12129 with the newly defined constants.
12130 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12131 C identifiers.
12132 * testsuite/Makefile.am: Add gc_orphan_section_test.
12133 * testsuite/Makefile.in: Regenerate.
12134 * testsuite/gc_orphan_section_test.cc: New file.
12135 * testsuite/gc_orphan_section_test.sh: New file.
12136
6eda8c29
ILT
121372010-01-06 Ian Lance Taylor <iant@google.com>
12138
b9674e17
ILT
12139 PR 10980
12140 * options.h (class General_options): Add --warn-shared-textrel.
12141 * layout.cc (Layout::finish_dynamic_section): Implement
12142 --warn-shared-textrel.
12143
6eda8c29
ILT
12144 PR 10980
12145 * options.h (class General_options): Add --warn-multiple-gp.
12146
32dcd44e
ILT
121472010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12148
12149 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12150 $(THREADSLIB) and $(LIBDL).
12151 * Makefile.in: Rebuild.
12152
a192ba05
ILT
121532010-01-06 Ian Lance Taylor <iant@google.com>
12154
12155 PR 10980
12156 * options.cc (General_options::parse_section_start): New function.
12157 (General_options::section_start): New function.
12158 (General_options::General_options): Initialize all members.
12159 * options.h: Include <map>
12160 (class General_options): Add --section-start. Add section_starts_
12161 member.
12162 * layout.cc (Layout::attach_allocated_section_to_segment): If
12163 --section-start was used, set the address of the segment. Remove
12164 local sort_sections.
12165 (Layout::relaxation_loop_body): If the address of the load segment
12166 has been set by --section-start, don't use it.
12167 * output.h (Output_segment::update_flags_for_output_section): New
12168 function.
12169 * output.cc (Output_segment::add_output_section): Call
12170 update_flags_for_output_section.
12171
dde3f402
ILT
121722010-01-05 Ian Lance Taylor <iant@google.com>
12173
62dfdd4d
ILT
12174 PR 10980
12175 * options.h (class General_options): Add --undefined-version.
12176 * script.cc (struct Version_expression): Add was_matched_by_symbol
12177 field.
12178 (Version_script_info::matched_symbol): New function.
12179 (Version_script_info::get_symbol_version_helper): Call
12180 matched_symbol.
12181 (Version_script_info::check_unmatched_names): New function.
12182 * script.h (class Version_script_info): Update declarations.
12183 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12184
9c4ae156
ILT
12185 * options.h (class General_options): Use DEFINE_bool_alias for
12186 allow_multiple_definition.
12187 * resolve.cc (Symbol_table::should_override): Don't test
12188 allow_multiple_definition.
12189
dde3f402
ILT
12190 PR 10980
12191 * options.h (class General_options): Add --cref.
12192 * main.cc (main): Print cref table if --cref. Don't close mapfile
12193 until after printing cref table.
12194 * cref.cc: Include "symtab.h".
12195 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12196 (Cref_table_compare::operator()): New function.
12197 (Cref_inputs::gather_cref): New function.
12198 (filecol): New static const.
12199 (Cref_inputs::print_cref): New function.
12200 (Cref::print_cref): New function.
12201 * cref.h: Include <cstdio>.
12202 (class Cref): Update declarations.
12203 * mapfile.h (Mapfile::file): New function.
12204 * object.h (class Object): Define Symbols. Declare virtual
12205 do_get_global_symbols.
12206 (Object::get_global_symbols): New function.
12207 * object.cc (Input_objects::add_object): Pass object to cref_ if
12208 --cref.
12209 (Input_objects::archive_start): Likewise.
12210 (Input_objects::archive_stop): Likewise.
12211 (Input_objects::print_cref): New function.
12212 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12213 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12214 --cref.
12215 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12216 function.
12217 * plugin.h (class Sized_pluginobj): Update declarations.
12218
8781f709
ILT
122192010-01-05 Ian Lance Taylor <iant@google.com>
12220
12221 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12222 to is_default_version. Rename insdef to insdefault.
12223 (Symbol_table::add_from_relobj): Rename def to is_default_version
12224 and local to is_forced_local.
12225 (Symbol_table::add_from_pluginobj): Likewise.
12226 (Symbol_table::add_from_dynobj): Likewise.
12227 (Symbol_table::define_special_symbol): Rename insdef to
12228 insdefault.
12229
fe35d28d
ILT
122302010-01-04 Ian Lance Taylor <iant@google.com>
12231
30bc8c46
ILT
12232 PR 10980
12233 * options.h (class General_options): Add
12234 --allow-multiple-definition and -z muldefs.
12235 * resolve.cc (Symbol_table::should_override): Don't warn about a
12236 multiple symbol definition if --allow-multiple-definition or -z
12237 muldefs.
12238
7eaea549
ILT
12239 PR 10980
12240 * options.h (class General_options): Add --add-needed and
12241 --copy-dt-needed-entries. Tweak --as-needed help entry.
12242 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12243 error if --copy-dt-needed-entries aka --add-needed is used and
12244 would cause a change in behaviour.
12245
fe35d28d
ILT
12246 PR 10980
12247 * options.h (class General_options): Add -G as a short version of
12248 --shared. Add no-op options -assert, -g, and -i.
12249
55a2bb35
ST
122502010-01-04 Sriraman Tallam <tmsriram@google.com>
12251
12252 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12253 check for .text or .gnu.linkonce.t sections.
12254 * icf.cc (Icf::find_identical_sections): Ditto.
12255 Change the detection for mangled function name within the section
12256 name.
12257 * icf.h (is_section_foldable_candidate): New function.
12258
719328e1
ILT
122592009-12-30 Ian Lance Taylor <iant@google.com>
12260
12261 PR 10980
12262 * options.h (class General_options): Permit two dashes with
12263 --retain-symbols-file.
12264
d7bb5745
ILT
122652009-12-30 Ian Lance Taylor <iant@google.com>
12266
403a15dd
ILT
12267 PR 10979
12268 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12269 don't put the file header and segment headers in the text
12270 segment.
12271
eda294df
ILT
12272 PR 10979
12273 * common.cc (Sort_commons::operator()): Stabilize sort when both
12274 entries are NULL.
12275 (Symbol_table::do_allocate_commons_list): When allocating common
12276 symbols, skip a symbol which is no longer common.
12277 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12278 an object before checking its type.
12279 * testsuite/common_test_2.c: New file.
12280 * testsuite/common_test_3.c: New file.
12281 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12282 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12283 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12284 (common_test_2_pic.o, common_test_2.so): New targets.
12285 (common_test_3_pic.o, common_test_3.so): New targets.
12286 * testsuite/Makefile.in: Rebuild.
12287
d7bb5745
ILT
12288 PR 10979
12289 * script.cc (read_input_script): If we see a new SECTIONS clause,
12290 and we have added an input section, give an error.
12291 * layout.h (class Layout): Add have_added_input_section function.
12292 Add have_added_input_section_ field.
12293 * layout.cc (Layout::Layout): Initialize
12294 have_added_input_section_.
12295 (Layout::layout): Set have_added_input_section_.
12296 (Layout::layout_eh_frame): Likewise.
12297
fc59c572
ILT
122982009-12-30 Ian Lance Taylor <iant@google.com>
12299
12300 PR 10931
12301 * options.h (class General_options): Add --sort-common option.
12302 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12303 * common.cc (Sort_common): Add sort_order parameter to
12304 constructor. Add sort_order_ field.
12305 (Sort_commons::operator): Check sort_order_.
12306 (Symbol_table::allocate_commons): Determine the sort order.
12307 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12308 Change all callers.
12309 (Symbol_table::do_allocate_commons_list): Likewise.
12310
1c74fab0
ILT
123112009-12-30 Ian Lance Taylor <iant@google.com>
12312
12313 PR 10916
12314 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12315 symbols from this object, don't change the visibility of an
12316 undefined symbol.
12317 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12318
6affe781
ILT
123192009-12-30 Ian Lance Taylor <iant@google.com>
12320
12321 PR 10861
12322 * script.h (class Version_script_info): Define Language enum.
12323 Update declarations. Define Glob, Exact, and Lookup types. Add
12324 new fields globals_, locals_, and is_finalized_.
12325 * script.cc: Various formatting fixes.
12326 (class Parser_closure): Change language_stack_ from a vector of
12327 std::string to one of Version_script_info::Language. Adjust all
12328 uses accordingly.
12329 (class Lazy_demangler): Remove.
12330 (struct Version_expression): Change language from std::string to
12331 Version_script_info::Language.
12332 (Version_script_info::Version_script_info): New function.
12333 (Version_script_info::~Version_script_info): Don't call clear.
12334 (Version_script_info::finalize): New function.
12335 (Version_script_info::build_lookup_tables): New function.
12336 (Version_script_info::build_expression_list_lookup): New
12337 function.
12338 (Version_script_info::get_symbol_version_helper): Rewrite to use
12339 lookup tables.
12340 (Version_script_info::print_expression_list): Adjust to use
12341 Version_script_info::Language.
12342 (script_push_lex_into_version_mode): Check that the version script
12343 has not been finalized.
12344 (version_script_push_lang): Change language string to
12345 Version_script_info::Language.
12346 * options.cc (Command_line::version_script): New function.
12347 * options.h (class General_options): Add finalize_dynamic_list
12348 function. Change version_script from declaration to definition.
12349 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12350 * testsuite/version_script.map: Remove duplicate def of foo.
12351 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12352 version_script.map.
12353 * testsuite/Makefile.in: Rebuild.
12354
818bf354
ILT
123552009-12-30 Ian Lance Taylor <iant@google.com>
12356
12357 PR 10843
12358 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12359 if the input symbol index is 0, make the output symbol index 0.
12360
ebcc8304
ILT
123612009-12-30 Ian Lance Taylor <iant@google.com>
12362
12363 PR 10670
12364 * options.h (class General_options): Add -x/--discard-all.
12365 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12366 --discard-all. If the local symbol needs a dynamic entry, check
12367 that before handling --discard-locals.
12368
176fe33f
ILT
123692009-12-30 Ian Lance Taylor <iant@google.com>
12370
bb321bb1
ILT
12371 PR 10450
12372 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12373 flags to PF_R.
12374 (Output_segment::add_output_section): Don't change the flags if
12375 the type is PT_TLS.
12376
176fe33f
ILT
12377 PR 10450
12378 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12379 GNU hash table if they need a dynamic value. Otherwise, don't add
12380 them if they are defined in a dynamic object or are forced local.
12381
e8cd95c7
ILT
123822009-12-29 Ian Lance Taylor <iant@google.com>
12383
1b81fb71
ILT
12384 PR 10450
12385 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12386 .gnu.hash table for a 32-bit target.
12387
8d6d383d
ILT
12388 PR 10450
12389 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12390 regular and a dynamic object only needs a dynamic symbol table
12391 entry if it is externally visible.
12392
e785ec03
ILT
12393 PR 10450
12394 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12395 constructor. Add global_offset_table_ field.
12396 (Target_i386::got_section): Set global_offset_table_.
12397 (Target_i386::do_finalize_sections): Set global_offset_table_
12398 size.
12399 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12400 in constructor. Add global_offset_table_ field.
12401 (Target_x86_64::got_section): Set global_offset_table_.
12402 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12403 size.
12404
1a2dff53
ILT
12405 * layout.cc (Layout::Layout): Initialize increase_relro_.
12406 (Layout::get_output_section): Add is_relro, is_last_relro, and
12407 is_first_non_relro parameters. Change all callers.
12408 (Layout::choose_output_section): Likewise.
12409 (Layout::add_output_section_data): Likewise.
12410 (Layout::make_output_section): Likewise.
12411 (Layout::set_segment_offsets): Clear increase_relro when using a
12412 linker script.
12413 * layout.h (class Layout): Add increase_relro method. Add
12414 increase_relro_ field. Update declarations.
12415 * output.cc (Output_section::Output_section): Initialize
12416 is_last_relro_ and is_first_non_relro_.
12417 (Output_segment::add_output_section): Group relro sections is
12418 do_sort is true. Handle is_last_relro and is_first_non_relro.
12419 (Output_segment::maximum_alignment): Remove relro handling.
12420 (Output_segment::set_section_addresses): Add increase_relro
12421 parameter. Change all callers. Add initial alignment to align
12422 relro sections on separate page. Remove old relro handling.
12423 (Output_segment::set_section_list_addresses): Remove in_relro
12424 parameter. Change all callers.
12425 (Output_segment::set_offset): Add increase parameter. Change all
12426 callers. Remove old relro handling.
12427 * output.h (class Output_section): Add new methods: is_last_relro,
12428 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12429 Add is_last_relro_ and is_first_non_relro_ fields.
12430 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12431 Create separate .got.plt section. Call increase_relro.
12432 * x86_64.cc (Target_x86_64::got_section): Likewise.
12433 * testsuite/relro_script_test.t: Add .got.plt.
12434
f0ba79e2
ILT
12435 PR 10450
12436 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12437 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12438 (Layout::finalize): Call set_dynamic_symbol_size.
12439 (Layout::set_dynamic_symbol_size): New function.
12440 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12441 set_dynamic_symbol_size.
12442
e8cd95c7
ILT
12443 PR 10450
12444 * output.h (class Output_section): Add is_entsize_zero_ field.
12445 * output.cc (Output_section::Output_section): Initialize
12446 is_entsize_zero_.
12447 (Output_section::set_entsize): If two different entsizes are
12448 requested, force it to zero.
12449 (Output_section::add_input_section): Set flags for .debug_str
12450 before updating section flags. Set entsize.
12451 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12452 and SHF_STRING if all input sections have those flags.
12453
3e1b9a8a
RÁE
124542009-12-29 Rafael Espindola <espindola@google.com>
12455
12456 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12457 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12458 reporting.
3e1b9a8a 12459
3dcad376
ST
124602009-12-29 Sriraman Tallam <tmsriram@google.com>
12461
12462 * options.cc (General_options::parse_version): Allow -v to exit
12463 without an error if there is nothing to link.
12464
084e2665
ILT
124652009-12-29 Ian Lance Taylor <iant@google.com>
12466
12467 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12468 using a version of gcc before 4.1.
12469 * configure: Rebuild.
12470
250acde3
CD
124712009-12-28 Chris Demetriou <cgd@google.com>
12472
12473 * attributes.cc (Output_attributes_section_data::do_write): Use
12474 std::vector::front rather than std::vector::data.
12475
99fff23b
ILT
124762009-12-28 Ian Lance Taylor <iant@google.com>
12477
12478 * symtab.h (class Symbol_table): Add enum Defined.
12479 * resolve.cc (Symbol_table::should_override): Add defined
12480 parameter. Change all callers. Test whether object is NULL
12481 before calling a method on it.
12482 (Symbol_table::report_resolve_problem): Add defined parameter.
12483 Change all callers.
12484 (Symbol_table::should_override_with_special): Likewise.
12485 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12486 parameter. Change all callers.
12487 (Symbol_table::do_define_in_output_data): Likewise.
12488 (Symbol_table::define_in_output_segment): Likewise.
12489 (Symbol_table::do_define_in_output_segment): Likewise.
12490 (Symbol_table::define_as_constant): Likewise.
12491 (Symbol_table::do_define_as_constant): Likewise.
12492 * script.h (class Symbol_assignment): Add is_defsym parameter to
12493 constructor; change all callers.
12494 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12495 parameter. Change all callers. Add is_defsym_ field.
12496 (class Parser_closure): Add parsing_defsym parameter to
12497 constructor; change all callers. Add parsing_defsym accessor
12498 function. Add parsing_defsym_ field.
12499
556bd683
ILT
125002009-12-28 Ian Lance Taylor <iant@google.com>
12501
12502 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12503 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12504
1782c879
ILT
125052009-12-23 Ian Lance Taylor <iant@google.com>
12506
12507 * i386.cc (Target_i386::do_calls_non_split): Recognize
12508 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12509 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12510 -fsplit-stack prologue when using %r11.
1782c879 12511
329ca2b1
ST
125122009-12-21 Sriraman Tallam <tmsriram@google.com>
12513
12514 * options.cc (General_options::parse_version): Make -v continue and do
12515 the link like GNU ld does.
12516
d675ff46
RÁE
125172009-12-17 Rafael Avila de Espindola <espindola@google.com>
12518
12519 * Makefile.am (CCFILES): Add timer.cc.
12520 (HFILES): Add timer.h.
12521 * configure.ac: Check for sysconf and times.
12522 * main.cc: include timer.h.
12523 (main): Use Timer instead of get_run_time.
12524 * timer.cc: New.
12525 * timer.h: New.
12526 * workqueue.cc: include timer.h.
12527 (Workqueue::find_and_run_task):
12528 Report user, sys and wall time.
12529 * Makefile.in: Regenerate.
12530 * config.in: Regenerate.
12531 * configure: Regenerate.
12532
d6344fb5
DK
125332009-12-16 Doug Kwan <dougkwan@google.com>
12534
12535 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12536 sections.
12537 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12538 relaxed input sections.
12539 * output.cc (Output_section::find_relaxed_input_section): Change
12540 return type to Output_relaxed_input_section pointer. Adjust code
12541 for new type of relaxed_input_section_map_.
12542 * output.h (Output_section::find_relaxed_input_section): Change
12543 return type to Output_relaxed_input_section pointer.
12544 (Output_section::Output_relaxed_input_section_by_input_section_map):
12545 New type.
12546 (Output_section::relaxed_input_section_map_): Change type to
12547 Output_section::Output_relaxed_input_section_by_input_section_map.
12548 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12549 input section.
12550
0e0d5469
ILT
125512009-12-15 Ian Lance Taylor <iant@google.com>
12552
12553 * layout.cc (Layout::create_shstrtab): Only write out after input
12554 sections if we are compressing debug sections.
12555
0649a889
ILT
125562009-12-15 Ian Lance Taylor <iant@google.com>
12557
12558 * archive.cc (Archive::add_symbols): Only look up a symbol without
12559 a version if there is, in fact, a version.
12560
2ea97941
ILT
125612009-12-14 Ian Lance Taylor <iant@google.com>
12562
12563 Revert -Wshadow changes, all changes from:
12564 2009-12-11 Doug Kwan <dougkwan@google.com>
12565 2009-12-11 Nick Clifton <nickc@redhat.com>
12566 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12567
b0eec2cc
DK
125682009-12-11 Doug Kwan <dougkwan@google.com>
12569
12570 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12571 due to -Wshadow.
12572 * attributes.cc (Object_attribute::size): Ditto.
12573 (Attributes_section_data::size): Ditto.
12574 (Attributes_section_data::Attributes_section_data): Ditto.
12575 (Output_attributes_section_data::do_write): Ditto.
12576 * attributes.h (Object_attribute::set_type): Ditto.
12577 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12578
91d6fa6a
NC
125792009-12-11 Nick Clifton <nickc@redhat.com>
12580
12581 * archive.cc: Fix shadowed variable warnings.
12582 * arm.cc: Likewise.
12583 * compressed_output.cc: Likewise.
12584 * compressed_output.h: Likewise.
12585 * configure: Likewise.
12586 * dwarf_reader.cc: Likewise.
12587 * dynobj.cc: Likewise.
12588 * dynobj.h: Likewise.
12589 * ehframe.cc: Likewise.
12590 * ehframe.h: Likewise.
12591 * errors.cc: Likewise.
12592 * expression.cc: Likewise.
12593 * fileread.cc: Likewise.
12594 * fileread.h: Likewise.
12595 * freebsd.h: Likewise.
12596 * i386.cc: Likewise.
12597 * icf.cc: Likewise.
12598 * incremental.h: Likewise.
12599 * layout.cc: Likewise.
12600 * layout.h: Likewise.
12601 * mapfile.cc: Likewise.
12602 * merge.cc: Likewise.
12603 * merge.h: Likewise.
12604 * object.cc: Likewise.
12605 * object.h: Likewise.
12606 * options.h: Likewise.
12607 * output.cc: Likewise.
12608 * output.h: Likewise.
12609 * parameters.cc: Likewise.
12610 * plugin.cc: Likewise.
12611 * powerpc.cc: Likewise.
12612 * reduced_debug_output.cc: Likewise.
12613 * reduced_debug_output.h: Likewise.
12614 * reloc.cc: Likewise.
12615 * reloc.h: Likewise.
12616 * resolve.cc: Likewise.
12617 * script-sections.cc: Likewise.
12618 * script.cc: Likewise.
12619 * script.h: Likewise.
12620 * sparc.cc: Likewise.
12621 * symtab.cc: Likewise.
12622 * symtab.h: Likewise.
12623 * target-select.cc: Likewise.
12624 * target-select.h: Likewise.
12625 * token.h: Likewise.
12626 * workqueue.cc: Likewise.
12627 * workqueue.h: Likewise.
12628 * x86_64.cc: Likewise.
12629
a0351a69
DK
126302009-12-10 Doug Kwan <dougkwan@google.com>
12631
12632 * arm.cc (attributes.h): New include.
12633 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12634 (Arm_relobj::~Arm_relobj): Delete object pointed by
12635 attributes_section_data_.
12636 (Arm_relobj::attributes_section_data): New method definition.
12637 (Arm_relobj::attributes_section_data_): New data member declaration.
12638 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12639 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12640 attributes_section_data_.
12641 (Arm_dynobj::attributes_section_data): New method definition.
12642 (Arm_dynobj::attributes_section_data_): New data member declaration.
12643 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12644 initialization value of may_use_blx_ to false.
2e702c99 12645 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12646 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12647 object attributes to compute results instead of hard-coding.
12648 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12649 Target_arm::get_secondary_compatible_arch,
12650 Target_arm::set_secondary_compatible_arch
12651 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12652 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12653 New method declarations.
12654 (Target_arm::get_aeabi_object_attribute): New method definition.
12655 (Target_arm::attributes_section_data_): New data member declaration.
12656 (read_arm_attributes_section): New template definition.
12657 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12658 (Arm_dynobj::do_read_symbols): Ditto.
12659 (Target_arm::do_finalize_sections): Merge attributes sections from
12660 input. Check for BLX use after attributes section merging.
12661 Fix __exidx_start and __exidx_end visibility. Create an
12662 .ARM.attributes section if necessary.
12663 (Target_arm::get_secondary_compatible_arch,
12664 Target_arm::set_secondary_compatible_arch,
12665 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12666 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12667 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12668 New method definitions.
12669
b59befec
ILT
126702009-12-09 Ian Lance Taylor <iant@google.com>
12671
12672 * plugin.cc (Plugin::load): Don't cast from void* to a function
12673 pointer.
12674
1276bc89
ILT
126752009-12-09 Ian Lance Taylor <iant@google.com>
12676
12677 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12678 information fields.
12679
2f2de248
L
126802009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12681
12682 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12683 Replace two_file_shared_1.so with two_file_shared_2.so.
12684 * testsuite/Makefile.in: Regenerated.
12685
4f787271
DK
126862009-12-08 Doug Kwan <dougkwan@google.com>
12687
12688 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12689 (HFILES): Add attributes.h and int_encoding.h.
12690 * Makefile.in: Regenerate.
12691 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12692 function definitions to int_encoding.cc
12693 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12694 prototypes to int_encoding.h
12695 * reduced_debug_output.cc (int_encoding.h): New include.
12696 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12697 function definitions to int_encoding.cc
12698 (insert_into_vector, read_from_pointer): Move template definitions to
12699 int_encoding.h
12700 * attributes.cc: New file.
12701 * attributes.h: New file.
12702 * int_encoding.cc: New file.
12703 * int_encoding.h: New file.
12704
20b52f1a
RÁE
127052009-12-07 Rafael Avila de Espindola <espindola@google.com>
12706
12707 PR gold/11055
12708 * incremental-dump.cc (dump_incremental_inputs): New.
12709 (main): Use dump_incremental_inputs.
12710
53d7974c
L
127112009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12712
12713 PR gold/10893
12714 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12715 checking elfcpp::STT_FUNC.
12716 (Target_i386::Relocate::relocate): Likewise.
12717 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12718
12719 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12720 symbols from shared libraries into normal FUNC symbols.
12721
12722 * symtab.h (Symbol): Add is_func and use it.
12723
05a352e6
DK
127242009-12-05 Doug Kwan <dougkwan@google.com>
12725
12726 * arm.cc (Target_arm::arm_info): Initialize new fields
12727 attributes_section and attributes_vendor.
12728 * i386.cc (Target_i386::i386_info): Same.
12729 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12730 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12731 fields attributes_section and attributes_vendor.
53d7974c 12732 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12733 * target.h (Target::attributes_section, Target::attributes_vendor,
12734 Target::is_attributes_section, Target::attribute_arg_type,
12735 Target::attributes_order): New method definitions.
12736 (Target::Target_info::attributes_section,
12737 Target::Target_info::attributes_vendor): New fields.
12738 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12739 virtual method definitions.
12740 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12741 attributes_section and attributes_vendor.
12742 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12743
f4e5969c
DK
127442009-12-05 Doug Kwan <dougkwan@google.com>
12745
12746 * arm.cc: Update comments about interworking and stub generation.
12747 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12748 considered as non-PIC.
12749 (Arm_relocate_functions::base_abs): Fix formatting.
12750 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12751 of function to use GOT entry address instead of offset.
12752 (Target_arm::Scan::global): Issue an error if a symbol would need a
12753 PLT does not get one because it is untyped. Remove code to create
12754 dynamic symbols for relative branches.
12755 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12756 takes unsigned integer instead of boolean.
12757
1abce4a6
L
127582009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12759
12760 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12761 (two_file_test_LDADD): Likewise.
12762 (common_test_1_LDADD): Likewise.
12763 (exception_test_LDADD) Likewise.
12764 (weak_test_LDADD): Likewise.
12765 (many_sections_test_LDADD): Likewise.
12766 (initpri1_LDADD): Likewise.
12767 (script_test_1_LDADD): Likewise.
12768 (script_test_2_LDADD): Likewise.
12769 (justsyms_LDADD): Likewise.
12770 (binary_test_LDADD): Likewise.
12771 (large_LDADD): Likewise.
12772 * testsuite/Makefile.in: Regenerated.
12773
adcf2816 127742009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12775
adcf2816
L
12776 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12777 (Symbol_table::override_with_special): Likewise.
12778 (Symbol_table::add_from_object): Likewise.
12779
28e67f5d
RÁE
127802009-12-04 Rafael Avila de Espindola <espindola@google.com>
12781
12782 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12783 Don't set the data_offset twice.
12784
ae10a101
RÁE
127852009-12-04 Rafael Avila de Espindola <espindola@google.com>
12786
12787 * testsuite/Makefile.in: Regenerate.
12788
f59f41f3
DK
127892009-12-03 Doug Kwan <dougkwan@google.com>
12790
12791 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12792 (Target_arm::do_finalize_sections): Add parameter for symbol table
12793 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12794 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12795 parameter for symbol table pointer.
12796 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12797 an additional parameter for a pointer to symbol table.
12798 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12799 parameter for a symbol table pointer.
12800 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12801 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12802 Ditto.
12803 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12804 parameter for a symbol table pointer.
12805
ca55d848
RÁE
128062009-12-03 Rafael Avila de Espindola <espindola@google.com>
12807
12808 * incremental.cc (Incremental_inputs_header)
12809 (Incremental_inputs_header_write, Incremental_inputs_entry)
12810 (Incremental_inputs_entry_write): Move ...
12811 * incremental.h (Incremental_inputs_header)
12812 (Incremental_inputs_header_write, Incremental_inputs_entry)
12813 (Incremental_inputs_entry_write): here.
12814
3aec4f9c
RÁE
128152009-12-02 Rafael Avila de Espindola <espindola@google.com>
12816
12817 * incremental.cc (make_sized_incremental_binary): Set the target.
12818 Error if it is incompatible.
12819 * output.h (Output_file): Add filename method.
12820
9c0ae74d
RÁE
128212009-12-02 Rafael Avila de Espindola <espindola@google.com>
12822
12823 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12824 from the get_* methods.
12825
a45500ae
RÁE
128262009-12-02 Rafael Avila de Espindola <espindola@google.com>
12827
12828 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12829 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12830 Write 0 for the data_offset of scripts.
12831
325e6408
RÁE
128322009-12-02 Rafael Avila de Espindola <espindola@google.com>
12833
12834 * testsuite/Makefile.am: Add the incremental_test.sh test.
12835 * testsuite/incremental_test.sh: New.
12836 * testsuite/incremental_test_1.c: New.
12837 * testsuite/incremental_test_2.c: New.
12838
954c3e2e
RÁE
128392009-12-01 Rafael Avila de Espindola <espindola@google.com>
12840
703d02da 12841 * incremental-dump.cc (main): Fix typos.
954c3e2e 12842
f8086623
RÁE
128432009-11-27 Rafael Avila de Espindola <espindola@google.com>
12844
12845 PR gold/11025
12846 * incremental-dump.cc (main): Use llu to print 64 bit values.
12847
3b0dd6ac
L
128482009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12849 H.J. Lu <hongjiu.lu@intel.com>
12850
12851 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12852 $(LIBDL).
12853 (incremental_dump_LDADD): Likewise.
12854 * Makefile.in: Regenerated.
12855
a6d1ef57 128562009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12857
a6d1ef57
DK
12858 Revert:
12859
12860 2009-11-25 Doug Kwan <dougkwan@google.com>
12861
12862 * arm.cc (Target_arm::Target_arm): Move method definition
12863 outside of class definition. Add code to handle
12864 --target1-rel, --target1-abs and --target2= options.
12865 (Target_arm::get_reloc_reloc_type): Change method to be
12866 non-static and const.
12867 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12868 New data member declaration.
12869 (Target_arm::Scan::local, Target_arm::Scan::global,
12870 Target_arm::Relocate::relocate,
12871 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12872 Adjust call to Target_arm::get_real_reloc_type.
12873 (Target_arm::get_real_reloc_type): Use command line options
12874 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12875 * options.h (--target1-rel, --target1-abs, --target2): New
12876 ARM-only options.
12877
50aeb7d4
DK
128782009-11-25 Doug Kwan <dougkwan@google.com>
12879
12880 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12881 class definition. Add code to handle --target1-rel, --target1-abs
12882 and --target2= options.
12883 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12884 and const.
12885 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12886 member declaration.
12887 (Target_arm::Scan::local, Target_arm::Scan::global,
12888 Target_arm::Relocate::relocate,
12889 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12890 call to Target_arm::get_real_reloc_type.
12891 (Target_arm::get_real_reloc_type): Use command line options to
12892 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12893 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12894 options.
12895
51938283
DK
128962009-11-25 Doug Kwan <dougkwan@google.com>
12897
12898 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12899 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12900 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12901 formatting.
12902 (Arm_relocate_functions::thm_call): Replace body with a call to
12903 Arm_relocate_functions::thumb_branch_common.
12904 (Arm_relocate_functions::thm_jump24,
12905 Arm_relocate_functions::thm_xpc22): New method definitions.
12906 (Arm_relocate_functions::thumb_branch_common): New method definition.
12907 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12908 operator.
12909 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12910 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12911
e2b8f3c4
RÁE
129122009-11-24 Rafael Avila de Espindola <espindola@google.com>
12913
12914 * Makefile.am: Build incremental-dump
12915 * Makefile.in: Regenerate.
12916 * incremental-dump.cc: New.
12917 * incremental.cc (Incremental_inputs_header_data,
12918 Incremental_inputs_entry_data): Move to incremental.h
12919 * incremental.h: (Incremental_inputs_header_data,
12920 Incremental_inputs_entry_data): Move from incremental.cc
12921
bcba9aec
RÁE
129222009-11-24 Rafael Avila de Espindola <espindola@google.com>
12923
12924 * incremental.cc (Incremental_inputs_header,
12925 Incremental_inputs_header_write, Incremental_inputs_entry,
12926 Incremental_inputs_entry_write): Add a typedef with the data type.
12927
7c3afe08
RÁE
129282009-11-24 Rafael Avila de Espindola <espindola@google.com>
12929
12930 * incremental.cc (Incremental_inputs_header,
12931 Incremental_inputs_header_write, Incremental_inputs_entry,
12932 Incremental_inputs_entry_write): Update comment about which
12933 type has the filed descriptions.
12934
d204b6e9
DK
129352009-11-15 Doug Kwan <dougkwan@google.com>
12936
12937 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12938 (Arm_relocate_functions::arm_branch_common): Change method defintion
12939 in class definition to a method declaration and update list of formal
12940 parameters.
12941 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12942 Arm_relocation_functions::jump24): Adjust call to
12943 Arm_relocate_functions::arm_branch_common. Update list of formal
12944 parameters.
12945 (Arm_relocate_functions::xpc25): New method definition.
12946 (Arm_relocate_functions::arm_branch_common): Move method defintion
12947 out from class definition. Use stubs for mode-switching and extending
12948 branch ranges.
12949 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12950 specially. Change code to enable use of stubs in ARM branches.
12951
43d12afe
DK
129522009-11-10 Doug Kwan <dougkwan@google.com>
12953
12954 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12955 in method declaration.
12956 (Target_arm::relocate_stub): New method declaration.
12957 (Target_arm::default_target): Change to return a pointer instead of
12958 a const reference.
12959 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12960 Target_arm::default_target.
12961 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12962 method definition.
12963 (Target_arm::relocate_section): Adjust view.
12964 (Target_arm::relocate_stub): New method definition.
12965
ac33a407
DK
129662009-11-10 Doug Kwan <dougkwan@google.com>
12967
12968 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12969 a format warning.
12970 * incremental.cc (open_incremental_binary): Initialized local
12971 variables to avoid warnings.
12972 * object.cc (make_elf_object): Ditto.
12973 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12974 a format warning.
e1df38aa 12975
88ee28e9
L
12976009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12977
12978 PR gold/10930
12979 * testsuite/plugin_test.c: Include "config.h".
12980
2daedcd6
DK
129812009-11-09 Doug Kwan <dougkwan@google.com>
12982
12983 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12984 (arm_symbol_value): Remove.
12985 (Arm_relocate_functions::arm_branch_common,
12986 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12987 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12988 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12989 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12990 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12991 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12992 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12993 Arm_relocate_functions::thm_mobw_abs_nc,
12994 Arm_relocate_functions::thm_mov_abs,
12995 Arm_relocate_functions::movw_prel_nc,
12996 Arm_relocate_functions::thm_movt_abs,
12997 Arm_relocate_functions::movt_prel,
12998 Arm_relocate_functions::thm_movw_prel_nc,
12999 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13000 (Target_arm::Relocate::relocate): Only decompose address into two
13001 parts if relocation type uses the thumb-bit and pass the actual
13002 bit instead of a flag indicating that the thumb-bit is used. Adjust
13003 calls to methods in Arm_relocate_functions for this change.
13004
1276bc89 130052009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
13006
13007 PR 10925
13008 * reloc.cc: Instantiate
13009 Sized_relobj::initialize_input_to_output_maps and
13010 Sized_relobj:free_input_to_output_maps.
13011
e53ad1b5
ILT
130122009-11-06 Ian Lance Taylor <iant@google.com>
13013
13014 PR 10876
13015 * defstd.cc (in_segment): Set only_if_ref true for "end".
13016
eb44217c
DK
130172009-11-06 Doug Kwan <dougkwan@google.com>
13018
13019 * arm.cc (class Reloc_stub): Correct a comment.
13020 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13021 (Target_arm::scan_section_for_stubs): New method declaration.
13022 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13023 Change methods from private to protected.
13024 (Target_arm::do_may_relax): New method definition.
13025 (Target_arm::do_relax, Target_arm::group_sections,
13026 Target_arm::scan_reloc_for_stub,
13027 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13028 (Target_arm::arm_input_section_map_): New data member declaration.
13029 (Target_arm::scan_reloc_for_stub,
13030 Target_arm::scan_reloc_section_for_stubs,
13031 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13032 Target_arm::do_relax): New method definitions.
13033
5d329b7d
ILT
130342009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13035
13036 * configure.ac: Check for (struct stat)::st_mtim
13037 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13038 * config.in: Regenerate.
13039 * configure: Regenerate.
13040
96a0d71b
ILT
130412009-11-05 Ian Lance Taylor <iant@google.com>
13042
13043 PR 10910
13044 * output.cc (Output_segment::add_output_section): Add missing
13045 return statement.
13046
594c8e5e
ILT
130472009-11-04 Ian Lance Taylor <iant@google.com>
13048
13049 PR 10880
13050 * object.h (class Object): Add is_needed and set_is_needed
13051 methods. Add is_needed_ field. Make bool fields into bitfields.
13052 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13053 defined in a dynamic object and referenced by a regular object,
13054 set is_needed for the dynamic object.
13055 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13056 if the file is marked with as_needed and it is not needed.
13057
22b127cc
ILT
130582009-11-04 Ian Lance Taylor <iant@google.com>
13059
13060 PR 10887
13061 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13062 tags if data is discarded by linker script.
13063 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13064 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13065 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13066 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13067
f5c870d2
ILT
130682009-11-04 Ian Lance Taylor <iant@google.com>
13069
13070 * layout.cc (Layout::get_output_section): Add is_interp and
13071 is_dynamic_linker_section parameters. Change all callers.
13072 (Layout::choose_output_section): Likewise.
13073 (Layout::make_output_section): Likewise.
13074 (Layout::add_output_section_data): Add is_dynamic_linker_section
13075 parameter. Change all callers.
13076 * layout.h (class Layout): Update declarations.
13077 * output.h (class Output_section): Add is_interp, set_is_interp,
13078 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13079 Add is_interp_, is_dynamic_linker_section_ fields. Change
13080 generate_code_fills_at_write_ to a bitfield.
13081 * output.cc (Output_section::Output_sections): Initialize new
13082 fields.
13083 (Output_segment::add_output_section): Add do_sort parameter.
13084 Change all callers.
13085
1ae4d23b
ILT
130862009-11-03 Ian Lance Taylor <iant@google.com>
13087
13088 PR 10860
13089 * options.h (class General_options): Add --warn-common.
13090 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13091 merging two common symbols.
13092 (Symbol_table::should_override): Handle --warn-common when merging
13093 a common symbol with a defined symbol. Use report_resolve_problem
13094 for multiple definitions.
13095 (Symbol_table::report_resolve_problem): New function.
13096 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13097
55da9579
DK
130982009-11-03 Doug Kwan <dougkwan@google.com>
13099
13100 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13101 stub_factory_.
13102 (Target_arm::stub_factory): New method definition.
13103 (Target_arm::new_arm_input_section,
13104 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13105 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13106 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13107 New type definitions.
13108 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13109 member declarations.
13110 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13111 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13112 New method definitions.
13113
37a9ac43
ILT
131142009-11-03 Ian Lance Taylor <iant@google.com>
13115
13116 * options.h (class General_options): Add --warn_constructors.
13117
b3d6a3d4
ILT
131182009-11-03 Ian Lance Taylor <iant@google.com>
13119
13120 PR 10893
13121 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13122 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13123
934b01dd
ILT
131242009-11-03 Ian Lance Taylor <iant@google.com>
13125
13126 PR 10895
13127 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13128 --msgid-bugs-address.
13129 (install-pdf): New target.
13130 (install-data_yes): Look up one directory to find mkinstalldirs.
13131
03c1939b
L
131322009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13133
13134 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13135 tree.
13136
ebd95253
DK
131372009-10-30 Doug Kwan <dougkwan@google.com>
13138
13139 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13140
e9bbb538
DK
131412009-10-30 Doug Kwan <dougkwan@google.com>
13142
13143 * arm.cc (Stub_addend_reader): New struct template definition
13144 and partial specializations.
13145 (Stub_addend_reader::operator()): New method definition for a
13146 partially specialized template.
13147
d5b40221
DK
131482009-10-30 Doug Kwan <dougkwan@google.com>
13149
13150 * arm.cc (Arm_relobj::processor_specific_flags): New method
13151 definition.
13152 (Arm_relobj::do_read_symbols): New method declaration.
13153 (Arm_relobj::processor_specific_flags_): New data member declaration.
13154 (Arm_dynobj): New class definition.
13155 (Target_arm::do_finalize_sections): Add input_objects parameter.
13156 (Target_arm::do_adjust_elf_header): New method declaration.
13157 (Target_arm::are_eabi_versions_compatible,
13158 (Target_arm::merge_processor_specific_flags): New method declaration.
13159 (Target_arm::do_make_elf_object): New overloaded method definitions
13160 and declaration.
13161 (Arm_relobj::do_read_symbols): New method definition.
13162 (Arm_dynobj::do_read_symbols): Ditto.
13163 (Target_arm::do_finalize_sections): Add input_objects parameters.
13164 Merge processor-specific flags from all input objects.
13165 (Target_arm::are_eabi_versions_compatible,
13166 Target_arm::merge_processor_specific_flags,
13167 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13168 New method definitions.
13169 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13170 Input_objects pointer type parameter.
13171 * layout.cc (Layout::finalize): Pass input objects to target's.
13172 finalize_sections function.
13173 * output.cc (Output_file_header::do_sized_write): Set ELF file
13174 header's processor-specific flags.
13175 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13176 Input_objects pointer type parameter.
13177 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13178 * target.h (Input_objects): New forward class declaration.
13179 (Target::processor_specific_flags,
13180 Target::are_processor_specific_flags_sect): New method definitions.
13181 (Target::finalize_sections): Add input_objects parameter.
13182 (Target::Target): Initialize processor_specific_flags_ and
13183 are_processor_specific_flags_set_.
13184 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13185 parameter.
13186 (Target::set_processor_specific_flags): New method definition.
13187 (Target::processor_specific_flags_,
13188 Target::are_processor_specific_flags_set_): New data member
13189 declarations.
13190 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13191 Input_objects pointer type parameter.
13192
ebabffbd
DK
131932009-10-30 Doug Kwan <dougkwan@google.com>
13194
13195 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13196
ad0f2072
ILT
131972009-10-28 Ian Lance Taylor <iant@google.com>
13198
13199 * object.h (class Relobj): Drop options parameter from
13200 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13201 do_scan_relocs, do_relocate. Change all callers.
13202 (class Sized_relobj): Drop options parameters from
13203 do_gc_process_relocs, do_scan_relocs, do_relocate,
13204 do_relocate_sections, relocate_sections, emit_relocs_scan,
13205 emit_relocs_scan_reltype. Change all callers.
13206 (struct Relocate_info): Remove options field and all references to
13207 it.
13208 * reloc.h (class Read_relocs): Remove options constructor
13209 parameter and options_ field. Change all callers.
13210 (class Gc_process_relocs, class Scan_relocs): Likewise.
13211 (class Relocate_task): Likewise.
13212 * target-reloc.h (scan_relocs): Remove options parameter. Change
13213 all callers.
13214 (scan_relocatable_relocs): Likewise.
13215 * target.h (class Sized_target): Remove options parameter from
13216 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13217 all callers.
13218 * gc.h (gc_process_relocs): Remove options parameter. Change all
13219 callers.
13220 * arm.cc: Update functions to remove options parameters.
13221 * i386.cc: Likewise.
13222 * powerpc.cc: Likewise.
13223 * sparc.cc: Likewise.
13224 * x86_64.cc: Likewise.
13225 * testsuite/testfile.cc: Likewise.
13226
8ffa3667
DK
132272009-10-28 Doug Kwan <dougkwan@google.com>
13228
13229 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13230 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13231 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13232 New method definitions.
13233
40f36857
CC
132342009-10-28 Cary Coutant <ccoutant@google.com>
13235
13236 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13237 (Plugin::cleanup_done_): New member.
13238 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13239 (Plugin_manager::cleanup_done_): Remove.
13240 (Plugin_manager::add_input_file): Edit error message.
13241 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13242 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13243
2c849493
ILT
132442009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13245
13246 * fileread.cc: (File_read::View::~View): Use the new
13247 data_ownership_ filed.
13248 (File_read::~File_read): Dispose the new whole_file_view_.
13249 (File_read::open): Mmap the whole file if needed.
13250 (File_read::open): Use whole_file_view_ instead of contents_.
13251 (File_read::find_view): Use whole_file_view_ if applicable.
13252 (File_read::do_read): Use whole_file_view_ instead of contents_.
13253 (File_read::make_view): Use whole_file_view_ instead of contents_,
13254 update File_read::View::View call.
13255 (File_read::find_or_make_view): Update File_read::View::View
13256 call.
13257 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13258 remove contents_
13259 (File_read::View::Data_ownership): New enum.
13260 (File_read::View::View): Replace bool mapped_ with Data_ownership
13261 argument.
13262 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13263 (File_read::View::data_ownership_): New field.
13264 (File_read::contents_): Remove (replaced by whole_file_view_).
13265 (File_read::whole_file_view_): New field.
13266 * options.h (class General_options): Add --keep-files-mapped.
13267
24998053
CC
132682009-10-27 Cary Coutant <ccoutant@google.com>
13269
13270 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13271 * testsuite/Makefile.am (plugin_test_5): New test case.
13272 * testsuite/Makefile.in: Regenerate.
13273
72adc4fa
DK
132742009-10-25 Doug Kwan <dougkwan@google.com>
13275
13276 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13277 from private to protected to allow access by child class.
13278 (Sized_relobj::do_relocate_sections): New method declaration.
13279 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13280 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13281 Sized_relobj::relocate_sections. Instantiate template explicitly
13282 for different target sizes and endianity.
13283
07f508a2
DK
132842009-10-24 Doug Kwan <dougkwan@google.com>
13285
13286 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13287 (Arm_input_section::as_arm_input_section): New method.
13288 (Arm_output_section): New class definition.
13289 (Arm_output_section::create_stub_group,
13290 Arm_output_section::group_sections): New method definitions.
13291
10ad9fe5
DK
132922009-10-22 Doug Kwan <dougkwan@google.com>
13293
13294 * arm.cc (Arm_input_section): New class definition.
13295 (Arm_input_section::init, Arm_input_section:do_write,
13296 Arm_input_section::set_final_data_size,
13297 Arm_input_section::do_reset_address_and_file_offset): New method
13298 definitions.
13299
56ee5e00
DK
133002009-10-21 Doug Kwan <dougkwan@google.com>
13301
13302 * arm.cc (Stub_table, Arm_input_section): New forward class
13303 declarations.
13304 (Stub_table): New class defintion.
13305 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13306 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13307 New method definition.
13308
b569affa
DK
133092009-10-21 Doug Kwan <dougkwan@google.com>
13310
13311 * arm.cc: Update copyright comments.
13312 (Target_arm): New forward class template declaration.
13313 (Arm_address): New type.
13314 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13315 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13316 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13317 constants.
13318 (Insn_template): Same.
13319 (DEF_STUBS): New macro.
13320 (Stub_type): New enum type.
13321 (Stub_template): New class definition.
13322 (Stub): Same.
13323 (Reloc_stub): Same.
13324 (Stub_factory): Same.
13325 (Target_arm::Target_arm): Initialize may_use_blx_ and
13326 should_force_pic_veneer_.
13327 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13328 Target_arm::should_force_pic_veneer,
13329 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13330 Target_arm::using_thumb_only, Target_arm:;default_target): New
13331 method defintions.
13332 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13333 New data member declarations.
13334 (Insn_template::size, Insn_template::alignment): New method defintions.
13335 (Stub_template::Stub_template): New method definition.
13336 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13337 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13338 (Stub_factory::Stub_factory): New method definition.
13339 * gold.h (string_hash): New template.
13340 * output.h (Input_section_specifier::hash_value): Use
13341 gold::string_hash.
13342 (Input_section_specifier::string_hash): Remove.
13343 * stringpool.cc (Stringpool_template::string_hash): Use
13344 gold::string_hash.
13345
6c172549
DK
133462009-10-20 Doug Kwan <dougkwan@google.com>
13347
13348 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13349 symbols of relaxed input sections.
13350 * output.h (Output_section::find_relaxed_input_section): Make
13351 method public.
13352
c5617f2f
DK
133532009-10-16 Doug Kwan <dougkwan@google.com>
13354
13355 * dynobj.cc (Versions::Versions): Initialize version_script_.
13356 Only insert base version symbol definition for a shared object
13357 if version script defines any version versions.
13358 (Versions::define_base_version): New method definition.
13359 (Versions::add_def): Check that base version is not needed.
13360 (Versions::add_need): Define base version lazily.
13361 * dynobj.h (Versions::define_base_version): New method declaration.
13362 (Versions::needs_base_version_): New data member declaration.
13363 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13364 (check_DATA): Add no_version_test.stdout.
13365 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13366 New make rules.
13367 * testsuite/Makefile.in: Regenerate.
13368 * testsuite/no_version_test.c: New file.
13369 * testsuite/no_version_test.sh: Ditto.
13370
3c12dcdb
DK
133712009-10-16 Doug Kwan <dougkwan@google.com>
13372
13373 * expression.cc (class Segment_start_expression): New class definition.
13374 (Segment_start_expression::value): New method definition.
13375 (script_exp_function_segment_start): Return a new
13376 Segment_start_expression.
13377 * gold/script-c.h (script_saw_segment_start_expression): New function
13378 prototype.
13379 * script-sections.cc (Script_sections::Script_sections): Initialize
13380 SAW_SEGMENT_START_EXPRESSION_ to false.
13381 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13382 and -Tbbs options to specify section addresses if given in
13383 command line and no SEGMENT_START expression is seen in a script.
13384 * script-sections.h (Script_sections::saw_segment_start_expression,
13385 Script_sections::set_saw_segment_start_expression): New method
13386 definition.
13387 (Script_sections::saw_segment_start_expression_): New data member
13388 declaration.
13389 * script.cc (script_saw_segment_start_expression): New function.
13390 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13391 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13392 script_test_7.sh and script_test_8.sh.
13393 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13394 script_test_8.stdout.
13395 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13396 (script_test_6, script_test_6.stdout, script_test_7,
13397 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13398 * Makefile.in: Regenerate.
13399 * testsuite/script_test_6.sh: New file.
13400 * testsuite/script_test_6.t: Same.
13401 * testsuite/script_test_7.sh: Same.
13402 * testsuite/script_test_7.t: Same.
13403 * testsuite/script_test_8.sh: Same.
13404
64b1ae37
DK
134052009-10-16 Doug Kwan <dougkwan@google.com>
13406
13407 * output.cc (Output_segment::set_section_list_address): Cast
13408 expressions to unsigned long long type to avoid format warnings.
13409
661be1e2
ILT
134102009-10-15 Ian Lance Taylor <iant@google.com>
13411
12edd763 13412 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13413 dot assignment to script_sections_.
12edd763
ILT
13414 * script-sections.cc (Script_sections::add_dot_assignment):
13415 Initialize if necessary.
13416
68b6574b
ILT
13417 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13418 program headers with no load segment if there is a linker script.
13419
661be1e2
ILT
13420 * layout.cc (Layout::set_segment_offsets): Align the file offset
13421 to the segment aligment for -N or -n with no load segment.
13422 * output.cc (Output_segment::add_output_section): Don't crash if
13423 the first section is a TLS section.
13424 (Output_segment::set_section_list_addresses): Print an error
13425 message if the address moves backward in a linker script.
13426 * script-sections.cc
13427 (Output_section_element_input::set_section_addresses): Don't
13428 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13429 (Orphan_output_section::set_section_addresses): Likewise.
13430
f15f61a7
DK
134312009-10-15 Doug Kwan <dougkwan@google.com>
13432
13433 * layout.cc (Layout::finish_dynamic_section): Generate tags
13434 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13435 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13436 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13437
82bb573a
ILT
134382009-10-14 Ian Lance Taylor <iant@google.com>
13439
13440 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13441 fields.
13442 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13443 data_shdr fields of relinfo.
13444 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13445 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13446 R_386_TLS_LDO_32, adjust based on section flags.
13447 (Target_i386::Relocate::fix_up_ldo): Remove.
13448
374ad285
ILT
134492009-10-13 Ian Lance Taylor <iant@google.com>
13450
13451 Add support for -pie.
13452 * options.h (class General_options): Add -pie and
13453 --pic-executable.
13454 (General_options::output_is_position_independent): Test -pie.
13455 (General_options::output_is_executable): Return true if not shared
13456 and not relocatable.
13457 (General_options::output_is_pie): Remove.
13458 * options.cc (General_options::finalize): Reject incompatible uses
13459 of -pie.
13460 * gold.cc (queue_middle_tasks): A -pie link is not static.
13461 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13462 * symtab.cc (Symbol::final_value_is_known): Return false if
13463 output_is_position_independent.
13464 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13465 output_is_position_independent.
13466 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13467 output_is_position_independent.
13468 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13469 output_is_position_independent.
13470 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13471 two_file_pie_test.
13472 (basic_pie_test.o, basic_pie_test): New targets.
13473 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13474 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13475 (two_file_pie_test): New target.
13476 * testsuite/Makefile.in: Rebuild.
13477 * README: Remove note saying that -pie is not supported.
13478
c6585162
ILT
134792009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13480
13481 * options.h (class General_options): Add -init and -fini.
13482 * layout.cc (Layout::finish_dynamic_section): Emit
13483 given init and fini functions.
13484
032ce4e9
ST
134852009-10-13 Sriraman Tallam <tmsriram@google.com>
13486
13487 * gc.h (gc_process_relocs): Check if icf is enabled using new
13488 function.
13489 * gold.cc (queue_initial_tasks): Likewise.
13490 (queue_middle_tasks): Likewise.
13491 * object.cc (do_layout): Likewise.
13492 * symtab.cc (is_section_folded): Likewise.
13493 * main.cc (main): Likewise.
13494 * reloc.cc (Read_relocs::run): Likewise.
13495 (Sized_relobj::do_scan_relocs): Likewise.
13496 * icf.cc (is_function_ctor_or_dtor): New function.
13497 (Icf::find_identical_sections): Check if function is ctor or dtor when
13498 safe icf is chosen.
13499 * options.h (General_options::icf): Change option to be an enum.
13500 (Icf_status): New enum.
13501 (icf_enabled): New method.
13502 (icf_safe_folding): New method.
13503 (set_icf_status): New method.
13504 (icf_status_): New variable.
13505 * (options.cc) (General_options::finalize): Set icf_status_.
13506 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13507 icf_test and icf_keep_unique_test to use the --icf enum flag.
13508 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13509 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13510
f345227a
ST
135112009-10-12 Sriraman Tallam <tmsriram@google.com>
13512
13513 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13514 includes to gc.h and icf.h.
13515 * arm.cc: Include gc.h.
13516 * gold.cc: Likewise.
13517 * i386.cc: Likewise.
13518 * powerpc.cc: Likewise.
13519 * sparc.cc: Likewise.
13520 * x86_64.cc: Likewise.
13521 * gc.h: Include icf.h.
13522
1c7814ed
ILT
135232009-10-11 Ian Lance Taylor <iant@google.com>
13524
13525 * plugin.cc: Include "gold.h" before other header files.
13526
ae3b5189
CD
135272009-10-10 Chris Demetriou <cgd@google.com>
13528
13529 * options.h (Input_file_argument::Input_file_type): New enum.
13530 (Input_file_argument::is_lib_): Replace with...
13531 (Input_file_argument::type_): New member.
13532 (Input_file_argument::Input_file_argument): Take Input_file_type
13533 'type' rather than boolean 'is_lib' as second argument.
13534 (Input_file_argument::is_lib): Use type_.
13535 (Input_file_argument::is_searched_file): New function.
13536 (Input_file_argument::may_need_search): Handle is_searched_file.
13537 * options.cc (General_options::parse_library): Support -l:filename.
13538 (General_options::parse_just_symbols): Update for Input_file_argument
13539 changes.
13540 (Command_line::process): Likewise.
13541 * archive.cc (Archive::get_file_and_offset): Likewise.
13542 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13543 * script.cc (read_script_file, script_add_file): Likewise.
13544 * fileread.cc (Input_file::Input_file): Likewise.
13545 (Input_file::will_search_for): Handle is_searched_file.
13546 (Input_file::open): Likewise.
13547 * readsyms.cc (Read_symbols::get_name): Likewise.
13548 * testsuite/Makefile.am (searched_file_test): New test.
13549 * testsuite/Makefile.in: Regenerate.
13550 * testsuite/searched_file_test.cc: New file.
13551 * testsuite/searched_file_test_lib.cc: New file.
13552
f3048a1d
ILT
135532009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13554 Ian Lance Taylor <iant@google.com>
13555
13556 * descriptor.cc: Include <cstdio> and "binary-io.h".
13557 (Descriptors::open): Open the files in binary mode always.
13558 * script.cc (Lex::get_token): Treat \r as whitespace.
13559
d4780e57
ILT
135602009-10-09 Ian Lance Taylor <iant@google.com>
13561
13562 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13563
d9a893b8
ILT
135642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13565 Ian Lance Taylor <iant@google.com>
13566
13567 * configure.ac: Check for readv function also.
13568 * fileread.cc (readv): Define if not HAVE_READV.
13569 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13570 does not exist.
13571 * config.in: Regenerate.
13572 * configure: Regenerate.
13573
c0a62865
DK
135742009-10-09 Doug Kwan <dougkwan@google.com>
13575
13576 * layout.cc (Layout::make_output_section): Call target hook to make
13577 ordinary output section.
13578 (Layout::finalize): Adjust parameter list of call the
13579 Target::may_relax().
13580 * layout.h (class Layout::section_list): New method.
13581 * merge.h (Output_merge_base::entsize): Change visibility to public.
13582 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13583 New methods.
13584 (Output_merge_string::do_is_string): New method.
13585 * object.cc (Sized_relobj::do_setup): renamed from
13586 Sized_relobj::set_up.
13587 * object.h (Sized_relobj::adjust_shndx,
13588 Sized_relobj::initializ_input_to_output_maps,
13589 Sized_relobj::free_input_to_output_maps): Change visibilities to
13590 protected.
13591 (Sized_relobj::setup): Virtualize.
13592 (Sized_relobj::do_setup): New method declaration.
13593 (Sized_relobj::invalidate_section_offset,
13594 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13595 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13596 * options.cc (parse_int): New function.
13597 * options.h (parse_int): New declaration.
13598 (DEFINE_int): New macro.
13599 (stub_group_size): New option.
13600 * output.cc (Output_section::Output_section): Initialize memebers
13601 merge_section_map_, merge_section_by_properties_map_,
13602 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13603 (Output_section::add_input_section): Handled deferred code-fill
13604 generation and remove an old comment.
13605 (Output_section::add_relaxed_input_section): New method definition.
13606 (Output_section::add_merge_input_section): Use merge section by
13607 properties map to speed to search. Update merge section maps
13608 as appropriate.
13609 (Output_section::build_relaxation_map): New method definition.
13610 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13611 Same.
13612 (Output_section::relax_input_section): Renamed to
13613 Output_section::convert_input_sections_to_relaxed_sections and change
13614 interface to take a vector of pointers to relaxed sections.
13615 (Output_section::find_merge_section,
13616 Output_section::find_relaxed_input_section): New method definitions.
13617 (Output_section::is_input_address_mapped,
13618 Output_section::output_offset, Output_section::output_address):
13619 Use output section data maps to speed up searching.
13620 (Output_section::find_starting_output_address): Add comments.
13621 (Output_section::do_write,
13622 Output_section::write_to_postprocessing_buffer): Do code-fill
13623 generation as appropriate.
13624 (Output_section::get_input_sections): Invalidate relaxed input section
13625 map.
13626 (Output_section::restore_states): Adjust type of checkpoint .
13627 Invalidate relaxed input section map.
13628 * output.h (Output_merge_base): New class declaration.
13629 (Input_section_specifier): New class defintion.
13630 (class Output_relaxed_input_section) Change base class to
13631 Output_section_data_build.
13632 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13633 base class initializer.
13634 (Output_section::add_relaxed_input_section): New method declaration.
13635 (Output_section::Input_section): Change visibility to protected.
2e702c99 13636 (Output_section::Input_section::relobj,
c0a62865
DK
13637 Output_section::Input_section::shndx): Handle relaxed input sections.
13638 Output_section::input_sections) Change visibility to protected. Also
13639 define overload to return a non-const pointer.
13640 (Output_section::Merge_section_properties): New class defintion.
13641 (Output_section::Merge_section_by_properties_map,
13642 Output_section::Output_section_data_by_input_section_map,
13643 Output_section::Relaxation_map): New types.
13644 (Output_section::relax_input_section): Rename method to
13645 Output_section::convert_input_sections_to_relaxed_sections and change
13646 interface to take a vector of relaxed section pointers.
13647 (Output_section::find_merge_section,
13648 Output_section::find_relaxed_input_section,
13649 Output_section::build_relaxation_map,
13650 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13651 New method declarations.
13652 (Output_section::merge_section_map_
13653 Output_section::merge_section_by_properties_map_,
13654 Output_section::relaxed_input_section_map_,
13655 Output_section::is_relaxed_input_section_map_valid_,
13656 Output_section::generate_code_fills_at_write_): New data members.
13657 * script-sections.cc
13658 (Output_section_element_input::set_section_addresses): Call
13659 current_data_size and addralign methods of relaxed input sections.
13660 (Orphan_output_section::set_section_addresses): Call current_data_size
13661 and addralign methods of relaxed input sections.
13662 * symtab.cc (Symbol_table::compute_final_value): Extract template
13663 from the body of Symbol_table::sized_finalize_symbol.
13664 (Symbol_table::sized_finalized_symbol): Call
13665 Symbol_table::compute_final_value.
13666 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13667 (Symbol_table::compute_final_value): New templated method declaration.
13668 * target.cc (Target::do_make_output_section): New method defintion.
13669 * target.h (Target::make_output_section): New method declaration.
13670 (Target::relax): Add more parameters for input objects, symbol table
13671 and layout. Adjust call to do_relax.
13672 (Target::do_make_output_section): New method declaration.
13673 (Target::do_relax): Add parameters for input objects, symbol table
13674 and layout.
13675
d446d6c4
ILT
136762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13677
13678 * pread.c: Include stdio.h.
13679
bc06c745
ILT
136802009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13681
13682 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13683 defined.
13684
75aea3d0
ILT
136852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13686
13687 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13688 Change read_shndx type to unsigned int.
13689 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13690 int.
13691 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13692 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13693 Change read_shndx type to unsigned int.
13694 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13695 int.
13696 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13697 * layout.cc (Layout::create_symtab_sections): Cast the result of
13698 local_symcount * symsize to off_t in the gold_assert.
13699
be8fcb75
ILT
137002009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13701
13702 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13703 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13704 R_ARM_BASE_ABS.
13705 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13706 (Arm_relocate_functions::thm_abs5): New function.
13707 (Arm_relocate_functions::abs12): New function.
13708 (Arm_relocate_functions::abs16): New function.
13709 (Arm_relocate_functions::base_abs): New function.
13710 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13711 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13712 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13713 R_ARM_BASE_ABS.
13714 (Scan::global): Likewise.
13715 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13716 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13717 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13718 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13719 R_ARM_BASE_ABS.
13720
c2a122b6
ILT
137212009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13722
13723 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13724 (Arm_relocate_functions::movt_prel): New function.
13725 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13726 (Arm_relocate_functions::thm_movt_prel): New function.
13727 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13728 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13729 (Scan::global, Relocate::relocate): Likewise.
13730 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13731
c4aa1e2d
ILT
137322009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13733
13734 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13735 Incremental_checker.
13736 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13737 unsigned int.
13738 (class Incremental_inputs_header): New class.
13739 (Incremental_inputs_header_writer): Edit comment.
13740 (Incremental_inputs_entry): New class.
13741 (Incremental_inputs_entry_writer): Edit comment.
13742 (Sized_incremental_binary::do_find_incremental_inputs_section):
13743 Add *strtab_shndx parameter, fill it.
13744 (Sized_incremental_binary::do_check_inputs): New method.
13745 (Incremental_checker::can_incrementally_link_output_file): Use
13746 Sized_incremental_binary::check_inputs.
13747 (Incremental_inputs::report_command_line): Save command line in
13748 command_line_.
13749 * incremental.h:
13750 (Incremental_binary::find_incremental_inputs_section): New
13751 method.
13752 (Incremental_binary::do_find_incremental_inputs_section): Add
13753 strtab_shndx parameter.
13754 (Incremental_binary::do_check_inputs): New pure virtual method.
13755 (Sized_incremental_binary::do_check_inputs): Declare.
13756 (Incremental_checker::Incremental_checker): Add incremental_inputs
13757 parameter, use it to initialize incremental_inputs_.
13758 (Incremental_checker::incremental_inputs_): New field.
13759 (Incremental_checker::command_line): New method.
13760 (Incremental_checker::inputs): New method.
13761 (Incremental_checker::command_line_): New field.
13762
c549a694
ILT
137632009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13764
13765 * incremental.cc: Include <cstdarg> and "target-select.h".
13766 (vexplain_no_incremental): New function.
13767 (explain_no_incremental): New function.
13768 (Incremental_binary::error): New method.
13769 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13770 method.
13771 (make_sized_incremental_binary): New function.
13772 (open_incremental_binary): New function.
13773 (can_incrementally_link_file): Add checks if output is ELF and has
13774 inputs section.
13775 * incremental.h: Include "elfcpp_file.h" and "output.h".
13776 (Incremental_binary): New class.
13777 (Sized_incremental_binary): New class.
13778 (open_incremental_binary): Declare.
13779 * object.cc (is_elf_object): Use
13780 elfcpp::Elf_recognizer::is_elf_file.
13781 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13782 * output.h (Output_file::filesize): New method.
13783
fd3c5f0b
ILT
137842009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13785
13786 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13787 New function.
13788 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13789 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13790 function.
13791 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13792 function.
13793 (Arm_relocate_functions::movw_abs_nc): New function.
13794 (Arm_relocate_functions::movt_abs): New function.
13795 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13796 (Arm_relocate_functions::thm_movt_abs): New function.
13797 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13798 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13799 (Scan::global): Likewise.
13800 (Relocate::relocate): Likewise.
13801 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13802
7f5309a5
ILT
138032009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13804
13805 * arm.cc (Arm_relocate_functions::got_prel) New function.
13806 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13807 (Relocate::relocate): Likewise.
13808 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13809
364c7fa5
ILT
138102009-10-06 Ian Lance Taylor <iant@google.com>
13811
13812 * options.h (class General_options): Define
13813 split_stack_adjust_size parameter.
13814 * object.h (class Object): Add uses_split_stack_ and
13815 has_no_split_stack_ fields. Add uses_split_stack and
13816 has_no_split_stack accessor functions. Declare
13817 handle_split_stack_section.
13818 (class Reloc_symbol_changes): Define.
13819 (class Sized_relobj): Define Function_offsets. Declare
13820 split_stack_adjust, split_stack_adjust_reltype, and
13821 find_functions.
13822 * object.cc (Object::handle_split_stack_section): New function.
13823 (Sized_relobj::do_layout): Call handle_split_stack_section.
13824 * dynobj.cc (Sized_dynobj::do_layout): Call
13825 handle_split_stack_section.
13826 * reloc.cc (Sized_relobj::relocate_sections): Call
13827 split_stack_adjust for executable sections in split_stack
13828 objects. Pass reloc_map to relocate_section.
13829 (Sized_relobj::split_stack_adjust): New function.
13830 (Sized_relobj::split_stack_adjust_reltype): New function.
13831 (Sized_relobj::find_functions): New function.
13832 * target-reloc.h: Include "object.h".
13833 (relocate_section): Add reloc_symbol_changes parameter. Change
13834 all callers.
13835 * target.h (class Target): Add calls_non_split method. Declare
13836 do_calls_non_split virtual method. Declare match_view and
13837 set_view_to_nop.
13838 * target.cc: Include "elfcpp.h".
13839 (Target::do_calls_non_split): New function.
13840 (Target::match_view): New function.
13841 (Target::set_view_to_nop): New function.
13842 * gold.cc (queue_middle_tasks): Give an error if mixing
13843 split-stack and non-split-stack objects with -r.
13844 * i386.cc (Target_i386::relocate_section): Add
13845 reloc_symbol_changes parameter.
13846 (Target_i386::do_calls_non_split): New function.
13847 * x86_64.cc (Target_x86_64::relocate_section): Add
13848 reloc_symbol_changes parameter.
13849 (Target_x86_64::do_calls_non_split): New function.
13850 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13851 parameter.
13852 * powerpc.cc (Target_powerpc::relocate_section): Add
13853 reloc_symbol_changes parameter.
13854 * sparc.cc (Target_sparc::relocate_section): Add
13855 reloc_symbol_changes parameter.
13856 * configure.ac: Call AM_CONDITIONAL for the default target.
13857 * configure: Rebuild.
13858 * testsuite/Makefile.am (TEST_AS): New variable.
13859 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13860 (check_DATA): Add split_i386 and split_x86_64 files.
13861 (SPLIT_DEFSYMS): Define.
13862 (split_i386_[1234n].o): New targets.
13863 (split_i386_[124]): New targets.
13864 (split_i386_[1234r].stdout): New targets.
13865 (split_x86_64_[1234n].o): New targets.
13866 (split_x86_64_[124]): New targets.
13867 (split_x86_64_[1234r].stdout): New targets.
13868 (MOSTLYCLEANFILES): Add new executables.
13869 * testsuite/split_i386.sh: New file.
13870 * testsuite/split_x86_64.sh: New file.
13871 * testsuite/split_i386_1.s: New file.
13872 * testsuite/split_i386_2.s: New file.
13873 * testsuite/split_i386_3.s: New file.
13874 * testsuite/split_i386_4.s: New file.
13875 * testsuite/split_i386_n.s: New file.
13876 * testsuite/split_x86_64_1.s: New file.
13877 * testsuite/split_x86_64_2.s: New file.
13878 * testsuite/split_x86_64_3.s: New file.
13879 * testsuite/split_x86_64_4.s: New file.
13880 * testsuite/split_x86_64_n.s: New file.
13881 * testsuite/testfile.cc (Target_test): Update relocation_section
13882 function.
13883 * testsuite/Makefile.in: Rebuild.
13884
e8a9fcda
ILT
138852009-10-06 Ian Lance Taylor <iant@google.com>
13886
13887 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13888 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13889 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13890 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13891 the address on ldo_addrs_.
13892 (Target_i386::Relocate::fix_up_ldo): New function.
13893
e99daf92
ILT
138942009-10-06 Rafael Espindola <espindola@google.com>
13895
13896 * plugin.cc (add_input_library): New.
13897 (Plugin::load): Add add_input_library to tv.
13898 (Plugin_manager::add_input_file): Add the is_lib argument.
13899 (add_input_file): Update call to Plugin_manager::add_input_file.
13900 (add_input_library): New.
13901 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13902
966d4097
DK
139032009-09-30 Doug Kwan <dougkwan@google.com>
13904
13905 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13906 symbol and call Symbol::may_need_copy_reloc to determine if
13907 a copy reloc is needed.
13908 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13909 nocopyreloc is given in command line.
13910 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13911 given in command line.
13912 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13913 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13914 of the removed Target_i386::may_need_copy_reloc.
13915 * options.h (copyreloc): New option with default value false.
13916 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13917 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13918 instead of the removed Target_powerpc::may_need_copy_reloc.
13919 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13920 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13921 instead of the removed Target_sparc::may_need_copy_reloc.
13922 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13923 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13924 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13925 instead of the removed Target_x86_64::may_need_copy_reloc.
13926
029ba973
ILT
139272009-09-30 Ian Lance Taylor <iant@google.com>
13928
13929 * object.h (class Object): Remove target_ field, and target,
13930 sized_target, and set_target methods.
13931 (Object::sized_target): Remove.
13932 (class Sized_relobj): Update declarations. Remove sized_target.
13933 * object.cc (Sized_relobj::setup): Remove target parameter.
13934 Change all callers.
13935 (Input_objects::add_object): Don't do anything with the target.
13936 (make_elf_sized_object): Add punconfigured parameter. Change all
13937 callers. Set or test parameter target.
13938 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13939 Change all callers.
13940 * parameters.cc (Parameters::set_target): Change parameter type to
13941 be non-const.
13942 (Parameters::default_target): Remove.
13943 (set_parameters_target): Change parameter type to be non-const.
13944 (parameters_force_valid_target): New function.
13945 (parameters_clear_target): New function.
13946 * parameters.h (class Parameters): Update declarations. Remove
13947 default_target method. Add sized_target and clear_target
13948 methods. Change target_ to be non-const.
13949 (set_parameters_target): Update declaration.
13950 (parameters_force_valid_target): Declare.
13951 (parameters_clear_target): Declare.
13952 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13953 as NULL if we aren't searching.
13954 (Add_symbols::run): Don't check for compatible target.
13955 * fileread.cc (Input_file::open_binary): Call
13956 parameters_force_valid_target.
13957 * gold.cc (queue_middle_tasks): Likewise.
13958 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13959 set_target on object.
13960 * dynobj.h (class Sized_dynobj): Update declarations.
13961 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13962 make_elf_object returns NULL.
13963 (Archive::include_member): Don't check whether object target is
13964 compatible.
13965 * output.cc (Output_section::add_input_section): Get target from
13966 parameters.
13967 (Output_section::relax_input_section): Likewise.
13968 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13969 parameters.
13970 (Sized_relobj::do_scan_relocs): Likewise.
13971 (Sized_relobj::relocate_sections): Likewise.
13972 * resolve.cc (Symbol_table::resolve): Likewise.
13973 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13974 parameter. Change all callers.
13975 (Symbol_table::add_from_object): Get target from parameters.
13976 (Symbol_table::add_from_relobj): Don't check object target.
13977 (Symbol_table::add_from_dynobj): Likewise.
13978 (Symbol_table::define_special_symbol): Get target from
13979 parameters.
13980 * symtab.h (class Symbol_table): Update declaration.
13981 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13982 parameter. Change all callers. Clear parameter target.
13983 (Binary_test): Test target here.
13984 * testsuite/object_unittest.cc (gold_testsuite): Remove
13985 target_test_pointer parameter. Change all callers.
13986 (Object_test): Test target here.
13987
a6a22b83
ILT
139882009-09-26 Ian Lance Taylor <iant@google.com>
13989
13990 * testsuite/initpri1.c: Don't try to use constructor priorities if
13991 compiling with gcc before 4.3.
13992
6a8f49fe
ILT
139932009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13994
13995 * testsuite/retain_symbols_file_test.sh (check_present): Change
13996 output file name to retain_symbols_file_test.stdout.
13997 (check_absent): Likewise.
13998
8c604651
CS
139992009-09-18 Craig Silverstein <csilvers@google.com>
14000
14001 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14002 * options.cc: Include <cerrno> and <fstream>.
14003 (General_options::finalize): Parse -retain-symbols-file tag.
14004 * options.h: New flag.
14005 (General_options): New method should_retain_symbol, new
14006 variable symbols_to_retain.
14007 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14008 should_retain_symbol map.
14009 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14010 * testsuite/Makefile.in: Regenerate.
14011 * testsuite/retain_symbols_file_test.sh: New file.
14012
ca58b19f
NC
140132009-09-18 Nick Clifton <nickc@redhat.com>
14014
14015 * po/es.po: Updated Spanish translation.
14016
20e6d0d6
DK
140172009-09-17 Doug Kwan <dougkwan@google.com>
14018
14019 * debug.h (DEBUG_RELAXATION): New constant.
14020 (DEBUG_ALL): Add DEBUG_RELAXATION.
14021 (debug_string_to_enum): Add relaxation debug option.
14022 * layout.cc
14023 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14024 Layout::Relaxation_debug_check::read_sections,
14025 Layout::Relaxation_debug_check::read_sections): New method definitions.
14026 (Layout::Layout): Initialize data members
14027 record_output_section_data_from_scrips_,
14028 script_output_section_data_list_ and relaxation_debug_check_.
14029 (Layout::save_segments, Layout::restore_segments,
14030 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14031 Layout::relaxation_loop_body): New method definitions.
14032 (Layout::finalize): Support relaxation. Move section layout code to
14033 Layout::relaxation_loop_body.
14034 (Layout::set_asection_address_from_script): Move code for orphan
14035 section placement out.
14036 (Layout::place_orphan_sections_in_script): New method definition.
14037 * layout.h (Output_segment_headers, Output_file_header):
14038 New forward class declarations.
14039 (Layout::~Layout): Define.
14040 (Layout::new_output_section_data_from_script): New method definition.
14041 (Layout::place_orphan_sections_in_script): New method declaration.
14042 (Layout::Segment_states): New type declaration.
14043 (Layout::save_segments, Layout::restore_segments,
14044 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14045 Layout::relaxation_loop_body): New method declarations.
14046 (Layout::Output_section_data_list): New type declaration.
14047 (Layout::Relaxation_debug_check): New class definition.
14048 (Layout::record_output_section_data_from_script_,
14049 Layout::script_output_section_data_list_, Layout::segment_states_,
14050 Layout::relaxation_debug_check_): New data members.
14051 * output.cc: (Output_section_headers::do_size): New method definition.
14052 (Output_section_headers::Output_section_headers): Move size
14053 computation to Output_section_headers::do_size.
14054 (Output_segment_headers::do_size): New method definition.
e1df38aa 14055 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14056 Output_file_header::do_size and call it.
14057 (Output_file_header::do_size): New method definition.
14058 (Output_data_group::Output_data_group): Adjust call to
14059 Output_section_data.
14060 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14061 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14062 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14063 RELAXED_INPUT_SECTION_CODE.
14064 (Output_section::Output_section): Initialize data member checkpoint_.
14065 (Output_section::~Output_section): Delete checkpoint object pointed
14066 by checkpoint_.
14067 (Output_section::add_input_section): Always add an Input_section if
14068 relaxing.
14069 (Output_section::add_merge_input_section): Add assert.
14070 (Output_section::relax_input_section): New method definition.
14071 (Output_section::set_final_data_size): Set load address to zero for
14072 an unallocated section.
14073 (Output_section::do_address_and_file_offset_have_reset_values):
14074 New method definition.
14075 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14076 Handle relaxed input section.
14077 (Output_section::sort_attached_input_sections): Checkpoint input
14078 section list lazily.
14079 (Output_section::get_input_sections): Change type of input_sections to
14080 list of Simple_input_section pointers. Checkpoint input section list
14081 lazily. Also handle relaxed input sections.
14082 (Output_section::add_input_section_for_script): Take a reference to
14083 a Simple_input_section object instead of Relobj pointer and section
14084 index as parameter. Handle relaxed input sections.
14085 (Output_section::save_states, Output_section::restore_states): New
14086 method definitions.
14087 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14088 (Output_data::is_data_size_fixed): New method definition.
14089 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14090 if it is fixed.
14091 (Output_data::address_and_file_offset_have_reset_values): New method
14092 definition.
14093 (Output_data::do_address_and_file_offset_have_reset_values): New method
14094 definition.
14095 (Output_data::set_data_size): Check that data size is not fixed.
14096 (Output_data::fix_data_size): New method definition.
14097 (Output_data::is_data_size_fixed_): New data member.
14098 (Output_section_headers::set_final_data_size): New method definition.
14099 (Output_section_headers::do_size): New method declaration.
14100 (Output_segment_headers::set_final_data_size): New method definition.
14101 (Output_segment_headers::do_size): New method declaration.
14102 (Output_file_header::set_final_data_size)::New method definition.
14103 (Output_file_header::do_size)::New method declaration.
14104 (Output_section_data::Output_section_data): Add new parameter
14105 is_data_size_fixed and use it to fix data size.
14106 (Output_data_const::Output_data_const): Adjust call to base class
14107 constructor and fix data size.
14108 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14109 base class constructor and fix data size.
14110 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14111 base class constructor and fix data size.
14112 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14113 class constructor and fix data size.
14114 (Output_data_group::set_final_data_size): New method definition.
14115 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14116 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14117 class constructor and fix data size.
14118 (Output_relaxed_input_section): New class definition.
14119 (Output_section::Simple_input_section): New class definition.
14120 (Output_section::get_input_sections): Adjust parameter list.
14121 (Output_section::add_input_section_for_script): Same.
14122 (Output_section::save_states, Output_section::restore_states,
14123 Output_section::do_address_and_file_offset_have_reset_values,
14124 (Output_section::Input_section::Input_section): Handle
14125 RELAXED_INPUT_SECTION_CODE. Add new overload for
14126 Output_relaxed_input_section.
14127 (Output_section::Input_section::is_input_section,
14128 Output_section::Input_section::set_output_section): Handle relaxed
14129 input section.
14130 (Output_section::Input_section::is_relaxed_input_section,
14131 Output_section::Input_section::output_section_data,
14132 Output_section::Input_section::relaxed_input_section): New method
14133 definitions.
14134 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14135 value.
14136 (Output_section::Input_section::u1_): Update comments.
14137 (Output_section::Input_section::u2_): Add new union member poris.
14138 (Output_section::Checkpoint_output_section): New classs definition.
14139 (Output_section::relax_input_section): New method declaration.
14140 (Output_section::checkpoint_): New data member.
14141 (Output_segment): Update comments.
14142 (Output_segment::Output_segment): Un-privatize copy constructor.
14143 (Output_segment::operator=): Un-privatize.
14144 * script-sections.cc (Output_section_element::Input_section_list):
14145 Change element type to Output_section::Simple_input_section.
14146 (Output_section_element_dot_assignment::set_section_addresses):
14147 Register output section data for relaxation clean up.
14148 (Output_data_exression::Output_data_expression): Adjust call to base
14149 constructor to fix data size.
14150 (Output_section_element_data::set_section_addresses): Register
14151 Output_data_expression object for relaxation clean up.
14152 (struct Input_section_info): Replace Relobj pointer and section index
14153 pair with Output_section::Simple_input_section and Convert struct to a
14154 class.
14155 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14156 Input_section_info data member to use accessors.
20e6d0d6
DK
14157 (Output_section_element_input::set_section_addresses): Use layout
14158 parameter. Adjust code to use Output_section::Simple_input_section
14159 and Input_secction_info classes. Register filler for relaxation
14160 clean up.
14161 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14162 and section index pair with Output_section::Simple_input_section
14163 class. Adjust code accordingly.
14164 (Phdrs_element::release_segment): New method definition.
14165 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14166 segment list.
14167 (Script_sections::release_segments): New method definition.
14168 * gold/script-sections.h (Script_sections::release_segments): New
14169 method declaration.
14170 * gold/target.h (Target::may_relax, Target::relax,
14171 Target::do_may_relax, Target::do_relax): New method definitions.
14172
5e445df6
ILT
141732009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14174
14175 * arm.cc (has_signed_unsigned_overflow): New function.
14176 (Arm_relocate_functions::abs8): New function.
14177 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14178 (Target_arm::Scan::global): Likewise.
14179 (Target_arm::relocate::relocate): Likewise.
14180 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14181 Likewise.
14182
8c604651 141832009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14184
14185 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14186 * testsuite/Makefile.in: Regenerate.
14187
1e9cc1c2
NC
141882009-09-11 Nick Clifton <nickc@redhat.com>
14189
14190 * po/gold.pot: Updated by the Translation project.
14191
6a89f575
CC
141922009-09-08 Cary Coutant <ccoutant@google.com>
14193
14194 * output.cc (Output_file::open): Add execute permission to empty file.
14195 * testsuite/Makefile.am (permission_test): New test.
14196 * testsuite/Makefile.in: Regenerate.
14197
fdcac5af
ILT
141982009-09-02 Ian Lance Taylor <iant@google.com>
14199
14200 * output.cc (Output_file::resize): Call map_no_anonymous rather
14201 than map.
14202
44453f85
ILT
142032009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14204
14205 * gold.cc: Include "incremental.h".
14206 (queue_initial_tasks): Call Incremental_checker methods.
14207 * incremental.cc: Include "output.h".
14208 (Incremental_checker::can_incrementally_link_output_file): New
14209 method.
14210 * incremental.h (Incremental_checker): New class.
14211
14212 * output.cc (Output_file::open_for_modification): New method.
14213 (Output_file::map_anonymous): Changed return type to bool. Record
14214 map in base_ field.
14215 (Output_file::map_no_anonymous): New method, broken out of map.
14216 (Output_file::map): Use map_no_anonymous and map_anonymous.
14217 * output.h (class Output_file): Update declarations.
14218
293c1386
CC
142192009-08-24 Cary Coutant <ccoutant@google.com>
14220
14221 * options.h (Command_line::Pre_options): New class.
14222 (Command_line::pre_options): New member.
14223 * options.cc (gold::options::ready_to_register): New variable.
14224 (One_option::register_option): Do nothing if not registering options.
14225 Assert if same short option registered twice.
14226 (General_options::General_options): Turn off option registration when
14227 done constructing.
14228 (Command_line::Pre_options::Pre_options): New constructor.
14229
f773f3d2
CC
142302009-08-24 Cary Coutant <ccoutant@google.com>
14231
06a73cfe
CC
14232 * options.h (General_options::no_keep_memory): Remove incorrect
14233 short option.
f773f3d2 14234
a15af8e2
RW
142352009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14236
14237 * Makefile.am (am__skiplex, am__skipyacc): New.
14238 * Makefile.in: Regenerate.
14239
c462b41b
RW
142402009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14241
14ec8efd
RW
14242 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14243 (INCLUDES): ... this.
14244 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14245 (AM_CPPFLAGS): Renamed from ...
14246 (INCLUDE): ... this.
14247 * Makefile.in, testsuite/Makefile.in: Regenerate.
14248
81ecdfbb
RW
14249 * Makefile.in: Regenerate.
14250 * aclocal.m4: Likewise.
14251 * config.in: Likewise.
14252 * configure: Likewise.
14253 * testsuite/Makefile.in: Likewise.
14254
c462b41b
RW
14255 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14256 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14257 * Makefile.in: Regenerate.
14258 * testsuite/Makefile.in: Regenerate.
14259
2da73f13
CC
142602009-08-19 Cary Coutant <ccoutant@google.com>
14261
14262 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14263 symbols in shared libraries overridden by hidden or internal symbols
14264 in the main program.
14265
2db70501
CD
142662009-08-19 Chris Demetriou <cgd@google.com>
14267
14268 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14269 checking source file names in error messages.
14270
f733487b
DK
142712009-08-18 Doug Kwan <dougkwan@google.com>
14272
14273 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14274 an elcpp::Ehdr as parameter. Adjust call to set_target.
14275 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14276 an elfcpp::Ehdr as parameter.
14277 * object.cc (Object::set_target): Remove the version that looks up
14278 a target and sets it.
14279 (Sized_relobj::setup): Take a Target object instead of
14280 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14281 (make_elf_sized_object): Find target and ask target to
14282 make an ELF object.
14283 * object.h: (Object::set_target): Remove the version that looks up
14284 a target and sets it.
14285 (Sized_relobj::setup): Take a Target object instead of
14286 an elfcpp:Ehdr as parameter.
14287 * target.cc: Include dynobj.h.
14288 (Target::do_make_elf_object_implementation): New.
2e702c99 14289 (Target::do_make_elf_object): New.
f733487b
DK
14290 * target.h (Target::make_elf_object): New template declaration.
14291 (Target::do_make_elf_object): New method declarations.
14292 (Target::do_make_elf_object_implementation): New template declaration.
14293
cc70f101
ILT
142942009-08-14 Ian Lance Taylor <iant@google.com>
14295
14296 * gold.h (FUNCTION_NAME): Define.
14297 (gold_unreachable): Use FUNCTION_NAME.
14298
ef5e0cb1
ST
142992009-08-12 Sriraman Tallam <tmsriram@google.com>
14300
14301 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14302 symbol in the --keep-unique list is not found.
14303
48c187ce
ST
143042009-08-12 Sriraman Tallam <tmsriram@google.com>
14305
14306 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14307 been maked as --keep-unique.
14308 (Icf::unfold_section): New function.
14309 * icf.h (Icf::unfold_section): New function.
14310 * options.h (General_options::keep_unique): New option.
14311 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14312 * testsuite/Makefile.in: Regenerate.
14313 * testsuite/icf_keep_unique_test.sh: New file.
14314 * testsuite/icf_keep_unique_test.cc: New file.
14315
645afe0c
CC
143162009-08-12 Cary Coutant <ccoutant@google.com>
14317
14318 PR 10471
14319 * resolve.cc (Symbol_table::resolve): Check for references from
14320 dynamic objects to hidden and internal symbols.
14321 * testsuite/Makefile.am (hidden_test.sh): New test.
14322 * testsuite/Makefile.in: Regenerate.
14323 * testsuite/hidden_test.sh: New script.
14324 * testsuite/hidden_test_1.c: New test source.
14325 * testsuite/hidden_test_main.c: New test source.
14326
11af873f
DK
143272009-08-11 Doug Kwan <dougkwan@google.com>
14328
14329 * arm.cc: Update comments.
14330 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14331 segment to locate the .ARM.exidx section if present.
14332
b9f7d72d
DK
143332009-08-09 Doug Kwan <dougkwan@google.com>
14334
14335 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14336 patch.
14337
ddd3c53c
ST
143382009-08-07 Sriraman Tallam <tmsriram@google.com>
14339 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14340 compiler warnings.
14341
27721062
ST
143422009-08-06 Sriraman Tallam <tmsriram@google.com>
14343
14344 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14345 valid tls_segment only for non-debug-section relocations.
14346 * testsuite/Makefile.am: Add gc_tls_test.
14347 * testsuite/Makefile.in: Regenerate.
14348 * testsuite/gc_tls_test.cc: New file.
14349 * testsuite/gc_tls_test.sh: New file.
14350
ef15dade 143512009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14352
ef15dade
ST
14353 * icf.cc: New file.
14354 * icf.h: New file.
14355 * Makefile.am (CCFILES): Add icf.cc.
14356 (HFILES): Add icf.h
14357 * Makefile.in: Regenerate.
14358 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14359 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14360 section, symbol and addend information for the relocs.
14361 * gold.cc (queue_middle_tasks): Call identical code folding.
14362 * gold.h: Add defines for multimap.
14363 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14364 to the call of finalize_local_symbols.
14365 * main.cc (main): Create object of class Icf.
14366 * object.cc (Sized_relobj::do_layout): Allow this function to be
14367 called twice during icf.
14368 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14369 to sections marked as identical by icf.
14370 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14371 when available.
14372 (Sized_relobj::do_section_entsize): New function.
14373 * object.h (Object::section_entsize): New function.
14374 (Object::do_section_entsize): New pure virtual function.
14375 (Relobj::finalize_local_symbols): Add new parameter.
14376 (Relobj::do_section_entsize): New function.
14377 * options.h (General_options::icf): New option.
14378 (General_options::icf_iterations): New option.
14379 (General_options::print_icf_sections): New option.
14380 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14381 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14382 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14383 icf.
14384 * symtab.cc (Symbol_table::is_section_folded): New function.
14385 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14386 to sections marked as identical by icf.
14387 * symtab.h (Symbol_table::set_icf): New function.
14388 (Symbol_table::icf): New function.
14389 (Symbol_table::is_section_folded): New function.
14390 (Symbol_table::icf_): New data member.
14391 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14392 * testsuite/Makefile.am: Add commands to build icf_test.
14393 * testsuite/Makefile.in: Regenerate.
14394 * testsuite/icf_test.sh: New file.
14395 * testsuite/icf_test.cc: New file.
14396
c3b65ac4
CD
143972009-07-24 Chris Demetriou <cgd@google.com>
14398
14399 * layout.cc (is_compressible_debug_section): Fix incorrect
14400 comment about compressed section names.
14401
1caf2c51
ILT
144022009-07-20 Ian Lance Taylor <ian@airs.com>
14403
14404 PR 10419
14405 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14406
1ef4d87f
ILT
144072009-07-16 Ian Lance Taylor <iant@google.com>
14408
14409 PR 10400
14410 * layout.h: #include <map>.
14411 (class Kept_section): Change from struct to class. Add accessors
14412 and setters. Add section size to Comdat_group mapping. Change
14413 Comdat_group to std::map. Add is_comdat_ field. Add
14414 linkonce_size field in union.
14415 (class Layout): Update declaration of find_or_add_kept_section.
14416 Don't declare find_kept_object.
14417 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14418 parameter. Add object, shndx, is_comdat, and is_group_name
14419 parameters. Change all callers. Adjust for new Kept_section.
14420 (Layout::find_kept_object): Remove.
14421 * object.cc (Sized_relobj::include_section_group): Update use of
14422 Kept_section. Rename secnum to shndx. Only record
14423 Kept_comdat_section if sections are the same size.
14424 (Sized_relobj::include_linkonce_section): Update use of
14425 Kept_section. Only record Kept_comdat_section if sections are the
14426 same size. Set size of linkonce section.
14427 (Sized_relobj::map_to_kept_section): Update call to
14428 get_kept_comdat_section.
14429 * object.h (class Sized_relobj): Rename fields in
14430 Kept_comdat_section to drop trailing underscores; change object
14431 field to Relobj*. Change Kept_comdat_section_table to store
14432 struct rather than pointer.
14433 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14434 Add kept_object and kept_shndx parameters. Change all callers.
14435 (Sized_relobj::get_kept_comdat_section): Change return type to
14436 bool. Add kept_object and kept_shndx parameters. Change all
14437 callers.
14438 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14439 Layout::find_or_add_kept_section.
14440
37c3b7b0
ILT
144412009-07-09 Ian Lance Taylor <iant@google.com>
14442
14443 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14444 Reserve space in the hash table.
14445
98fa85cb
ILT
144462009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14447
14448 * fileread.cc (File_read::get_mtime): New method.
14449 * fileread.h (Timespec): New structure.
14450 (File_read::get_mtime): New method.
14451 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14452 Renamed from timestamp_nsec.
14453 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14454 Elf_Xword.
e1df38aa 14455 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14456 timestamp_nsec.
e1df38aa 14457 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14458 (Incremental_inputs::report_obejct): Save mtime; style fix.
14459 (Incremental_inputs::report_script): Save mtime; style fix.
14460 (Incremental_inputs::finalize_inputs): Style fix.
14461 (Incremental_inputs::finalize): Style fix.
14462 (Incremental_inputs::create_input_section_data): Store inputs
14463 mtime.
14464 * incremental.h (Incremental_inputs::report_script): Add mtime
14465 argument.
14466 (Incremental_inputs::Input_info::Input_info): Intialize only one
14467 union member.
14468 (Incremental_inputs::Input_info::archive): Move to nameless
14469 union.
14470 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14471 (Incremental_inputs::Input_info::script): Move to nameless union.
14472 (Incremental_inputs::mtime): New field.
14473 * script.cc (read_input_script): Pass file mtime to
14474 Incremental_input.
14475 * script.h (Script_info::inputs): Style fix.
14476
c9d70757
ILT
144772009-07-01 Ian Lance Taylor <ian@airs.com>
14478
14479 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14480 instead of 32.
14481
9c547ec3
ILT
144822009-06-24 Ian Lance Taylor <iant@google.com>
14483
14484 PR 10156
14485 * layout.cc (Layout::choose_output_section): If we find an
14486 existing section, update the flags.
14487 (Layout::create_notes): New function, broken out of
14488 Layout::finalize.
14489 (Layout::finalize): Don't create note sections.
14490 (Layout::create_note): Don't crash if linker script discards
14491 section.
14492 (Layout::create_gold_note): Likewise.
14493 (Layout::create_build_id): Likewise. Don't set
14494 after_input_sections on the section.
14495 (Layout::create_executable_stack_info): Remove target parameter.
14496 Change caller.
14497 * layout.h (class Layout): Declare create_notes. Update
14498 declaration of create_executable_stack_info.
14499 * gold.cc (queue_middle_tasks): Call create_notes.
14500 * output.cc (Output_section::update_flags_for_input_section): Move
14501 here from output.h. If SHF_ALLOC flag is newly set, mark address
14502 invalid.
14503 * output.h (Output_data::mark_address_invalid): New function.
14504 (class Output_section): Only declare, not define,
14505 update_flags_for_input_section. Remove set_flags.
14506
55458500
ILT
145072009-06-24 Ian Lance Taylor <iant@google.com>
14508
14509 * script-sections.cc (Output_section_definition::
14510 set_section_addresses): Rename shadowing local load_address to
14511 laddr.
14512
1307d6cd
ILT
145132009-06-24 Ian Lance Taylor <iant@google.com>
14514
14515 PR 10244
14516 * reloc.cc (relocate_sections): Skip empty relocation sections.
14517
ec3f783e
ILT
145182009-06-23 Ian Lance Taylor <iant@google.com>
14519
14520 PR 10156
14521 * layout.cc (Layout::create_note): Use choose_output_section
14522 rather than make_output_section.
14523
459c9f1c
ILT
145242009-06-23 Ian Lance Taylor <iant@google.com>
14525
14526 PR 10237
14527 * options.cc (General_options::parse_V): Set printed_version_.
14528 (General_options::General_options): Initialize printed_version_.
14529 * options.h (class General_options): Add printed_version_ field.
14530 * gold.cc (queue_initial_tasks): If there are no input files,
14531 don't give a fatal error if we printed the version information.
14532 (queue_middle_tasks): If using -r with a shared object, give a
14533 fatal error rather than an ordinary error.
14534
1518dc8f
ILT
145352009-06-23 Ian Lance Taylor <iant@google.com>
14536
14537 PR 10219
14538 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14539 (Layout::make_output_section): Set have_stabstr_section_ if we see
14540 a .stab*str section.
14541 (Layout::finalize): Call link_stabs_sections.
14542 (Layout::link_stabs_sections): New file.
14543 * layout.h (class Layout): Add have_stabstr_section_ field.
14544 Declare link_stabs_sections.
14545
3d857b98
DK
145462009-06-23 Doug Kwan <dougkwan@google.com>
14547
14548 * Makefile.am (libgold_a_LIBADD): New.
14549 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14550 * Makefile.in: Regenerate.
3d857b98
DK
14551 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14552 * configure: Regenerate.
14553 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14554 * fileread.cc: Include sys/state.h
14555 * gold.h: Declare memmem and strndup if found missing.
14556 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14557
0639a6f6
ILT
145582009-06-23 Ian Lance Taylor <iant@google.com>
14559
14560 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14561 * configure: Rebuild.
14562
8d63875c
ILT
145632009-06-23 Ian Lance Taylor <iant@google.com>
14564
14565 PR 10147
14566 * object.cc (Object::section_contents): Don't try to get a view if
14567 the section has length zero.
14568 (Object::handle_gnu_warning_section): If the section is empty, use
14569 the name of the section as the warning.
14570
f7c8a183
ILT
145712009-06-23 Ian Lance Taylor <iant@google.com>
14572
14573 PR 10133
14574 * stringpool.h (class Stringpool_template): Add optimize_ field.
14575 (Stringpool_template::set_optimize): New function.
14576 * stringpool.cc (Stringpool_template::Stringpool_template):
14577 Initialize optimize_ field.
14578 (Stringpool_template::set_string_offsets): Test local optimize
14579 fild rather than parameter.
14580 * layout.cc (Layout::Layout): Call set_optimize on the section
14581 name stringpool.
14582
e6a307ba
ILT
145832009-06-22 Ian Lance Taylor <iant@google.com>
14584
14585 PR 10030
14586 * yyscript.y: Parse TARGET.
14587 * script.cc (script_set_target): New function.
14588 * script-c.h (script_set_target): Declare.
14589 * options.cc (General_options::string_to_object_format): Rename
14590 from string_to_object_format in anonymous namespace. Change
14591 callers.
14592 * options.h (class General_options): Declare
14593 string_to_object_format.
14594
3ee173de
ILT
145952009-06-22 Ian Lance Taylor <iant@google.com>
14596
14597 * script-sections.cc (Script_sections::create_segments): Don't put
14598 program headers in a PT_LOAD segment if -n or -N.
14599
146002009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14601
14602 PR 10141
14603 * options.h (class General_options): Add -z lazy and -z now. Sort
14604 -z options into alphabetical order.
14605 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14606
cd6739a1 146072009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14608
14609 * layout.cc (Layout::make_output_section): Call
14610 Target::new_output_section.
14611 (Layout::attach_allocated_section_to_segment): Put large section
14612 sections in a separate load segment with the large segment flag
14613 set.
14614 (Layout::segment_precedes): Sort large data segments after other
14615 load segments.
14616 (align_file_offset): New static function.
14617 (Layout::set_segment_offsets): Use align_file_offset.
14618 * output.h (class Output_section): Add is_small_section_ and
14619 is_large_section_ fields.
14620 (Output_section::is_small_section): New function.
14621 (Output_section::set_is_small_section): New function.
14622 (Output_section::is_large_section): New function.
14623 (Output_section::set_is_large_section): New function.
14624 (Output_section::is_large_data_section): New function.
14625 (class Output_segment): Add is_large_data_segment_ field.
14626 (Output_segment::is_large_data_segment): New function.
14627 (Output_segment::set_is_large_data_segment): New function.
14628 * output.cc (Output_section::Output_section): Initialize new
14629 fields.
14630 (Output_segment::Output_segment): Likewise.
14631 (Output_segment::add_output_section): Add assertion that large
14632 data sections always go in large data segments. Force small data
14633 sections to the end of the list of data sections. Force small BSS
14634 sections to the start of the list of BSS sections. For large BSS
14635 sections to the end of the list of BSS sections.
14636 * symtab.h (class Symbol): Declare is_common_shndx.
14637 (Symbol::is_defined): Check Symbol::is_common_shndx.
14638 (Symbol::is_common): Likewise.
14639 (class Symbol_table): Define enum Commons_section_type. Update
14640 declarations. Add small_commons_ and large_commons_ fields.
14641 * symtab.cc (Symbol::is_common_shndx): New function.
14642 (Symbol_table::Symbol_table): Initialize new fields.
14643 (Symbol_table::add_from_object): Put small and large common
14644 symbols in the right list.
14645 (Symbol_table::sized_finalized_symbol): Check
14646 Symbol::is_common_shndx.
14647 (Symbol_table::sized_write_globals): Likewise.
14648 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14649 common symbol lists. Don't call do_allocate_commons_list if the
14650 list is empty.
14651 (Symbol_table::do_allocate_commons_list): Remove is_tls
14652 parameter. Add comons_section_type parameter. Change all
14653 callers. Handle small and large common symbols.
14654 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14655 Symbol::is_common_shndx.
14656 * resolve.cc (symbol_to_bits): Likewise.
14657 * target.h (Target::small_common_shndx): New function.
14658 (Target::small_common_section_flags): New function.
14659 (Target::large_common_shndx): New function.
14660 (Target::large_common_section_flags): New function.
14661 (Target::new_output_section): New function.
14662 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14663 small_common_section_flags, and large_common_section_flags
14664 fields.
14665 (Target::do_new_output_section): New virtual function.
14666 * arm.cc (Target_arm::arm_info): Initialize new fields.
14667 * i386.cc (Target_i386::i386_info): Likewise.
14668 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14669 Likewise.
14670 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14671 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14672 (Target_x86_64::do_new_output_section): New function.
14673 * configure.ac: Define conditional MCMODEL_MEDIUM.
14674 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14675 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14676 (large_LDFLAGS): Define.
14677 * testsuite/large.c: New file.
14678 * testsuite/testfile.cc (Target_test::test_target_info):
14679 Initialize new fields.
14680 * configure, testsuite/Makefile.in: Rebuild.
14681
bb04269c
DK
146822009-06-05 Doug Kwan <dougkwan@google.com>
14683
14684 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14685 * Makefile.in: Regenerate.
bb04269c
DK
14686 * i386.cc (class Target_i386): Define new virtual method to
14687 override do_is_local_label_name in parent.
14688 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14689 local symbols if --discard-locals or -X is given.
14690 * options.h (class General_options): Declare new options
14691 '--discard-locals' and '-X' for discarding locals.
14692 * target.h (class Target): Define new methods is_local_label_name.
14693 Declare new virtual method do_is_local_label_name.
14694 * target.cc: New file.
14695 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14696 (check_SCRIPTS): Add discard_locals_test.sh.
14697 (check_DATA): Add discard_local_tests.syms.
14698 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14699 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14700 * testsuite/Makefile.in: Regenerate.
14701 * testsuite/discard_locals_test.c: New file.
14702 * testsuite/discard_locals_test.sh: Same.
14703
805bb01c
DK
147042009-06-05 Doug Kwan <dougkwan@google.com>
14705
14706 * object.cc (Sized_relobj::Sized_relobj): Initialize
14707 discarded_eh_frame_shndx_ to -1U.
14708 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14709 section.
14710 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14711 a discarded .eh_frame section.
14712 (Sized_relobj::do_finalize_local_symbols): Ditto.
14713 * object.h (class Sized_relobj): Declare new member
14714 discarded_eh_frame_shndx_.
14715 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14716 (local_labels_test.o, local_labels_test): New rules.
14717 * testsuite/Makefile.in: Regenerate.
14718
1dcd334d
DK
147192009-06-04 Doug Kwan <dougkwan@google.com>
14720
14721 * layout.cc (Layout::section_name_mapping): Add mapping for
14722 special ARM sections.
14723
96d49306
DK
147242009-06-03 Doug Kwan <dougkwan@google.com>
14725
14726 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14727 (utils::has_overflow): Same.
14728
dff16297
ILT
147292009-06-03 Ian Lance Taylor <iant@google.com>
14730
14731 * layout.cc (Layout::section_name_mapping): New array, replacing
14732 Layout::linkonce_mapping.
14733 (Layout::section_name_mapping_count): New variable, replacing
14734 Layout::linkonce_mapping_count.
14735 (Layout::linkonce_output_name): Remove.
14736 (Layout::output_section_name): Rewrite.
14737 * layout.h (class Layout): Rename Linkonce_mapping to
14738 Section_name_mapping, linkonce_mapping to section_name_mapping,
14739 linkonce_mapping_count to section_name_mapping_count. Don't
14740 declare linkonce_output_name.
14741
c121c671
DK
147422009-06-03 Doug Kwan <dougkwan@google.com>
14743
14744 * gold/arm.cc (namespace utils): New.
14745 (Target_arm::reloc_is_non_pic): Define new method.
14746 (class Arm_relocate_functions): New.
14747 (Target_arm::Relocate::relocate): Handle relocation types used by
14748 Android.
14749
07800fab
ILT
147502009-06-03 Ian Lance Taylor <iant@google.com>
14751
14752 * arm.cc (Target_arm::scan::global): Use || instead of |.
14753
c121c671
DK
147542009-06-02 Doug Kwan <dougkwan@google.com>
14755
14756 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14757 issued_non_pic_error_.
14758 (class Target_arm::Scan): Declare new method check_non_pic.
14759 Define new method symbol_needs_plt_entry.
14760 Declare new data member issued_non_pic_error_.
14761 (class Target_arm::Relocate): Declare new method
14762 should_apply_static_reloc.
14763 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14764 (Target_arm::Scan::check_non_pic): Define new method.
14765 (Target_arm::Scan::local): Handle a small subset of reloc types used
14766 by Android.
14767 (Target_arm::Scan::local): Same.
14768 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14769
b19b0c6d
ILT
147702009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14771
14772 * incremental.cc (Incremental_inputs::report_command_line): Filter
14773 out --incremental-* options.
14774
94cdfcff
DK
147752009-05-29 Doug Kwan <dougkwan@google.com>
14776
14777 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14778 template class.
14779 (class Target_arm): Update comment.
14780 (Target_arm::Target_arm): Initialize new data members GOT_,
14781 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14782 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14783 and Target_arm::rel_dyn_section.
14784 Declare new_enum Target_arm::Got_type.
14785 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14786 and DYNBSS_.
14787 Update commments for member do_dynsym_value.
14788 (Target_arm::got_size, Target_arm::plt_section,
14789 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14790 new methods inside class defintion.
14791 (Target_arm::got_section): Define new method.
14792 (Target_arm::rel_dyn_section): Same.
14793 (Output_data_plt_arm): New template class.
14794 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14795 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14796 (Output_data_plt_arm::add_entry): Same.
14797 (Output_data_plt_arm::first_plt_entry): Define new
14798 static data member for PLT instruction template.
14799 (Output_data_plt_arm::plt_entry): Same.
14800 (Output_data_plt_arm::do_write): Define new method.
14801 (Target_arm::make_plt_entry): Same.
14802 (Target_arm::do_finalize_sections): Same.
14803 (Target_arm::do_dynsym_value): Same.
14804
4a657b0d
DK
148052009-05-28 Doug Kwan <dougkwan@google.com>
14806
14807 * Makefile.am (TARGETSOURCES): Add arm.cc.
14808 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14809 * Makefile.in: Regenerate.
14810 * arm.cc: New file.
14811 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14812
e7ae8c36
DK
148132009-05-26 Doug Kwan <dougkwan@google.com>
14814
14815 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14816 (General_options::check_excluded_libs): Strip off directories in
14817 archive name before matching like GNU ld does.
14818 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14819 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14820 (exclude_libs_test_LDFLAGS): Add linker option
14821 -Wl,--exclude-libs,libexclude_libs_test_3
14822 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14823 an explicit archive without using -l.
14824 (alt/libexclude_libs_test_3.a): New make rule.
14825 * testsuite/Makefile.in: Regenerate.
14826 * testsuite/exclude_libs_test.c : Declare lib3_default().
14827 (main): Call it.
14828 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14829 * exclude_libs_test_3.c: New file.
14830
f12e7348
NC
148312009-05-26 Nick Clifton <nickc@redhat.com>
14832
14833 * po/id.po: New Indonesian translation.
14834 * po/gold.pot: Updated template file.
14835
4daadc0d
ST
148362009-05-22 Sriraman Tallam <tmsriram@google.com>
14837
e1df38aa 14838 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14839 gc_comdat_test files. Add -Wl,--gc-sections to build
14840 gc_comdat_test.
14841 * testsuite/Makefile.in: Regenerate.
14842 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14843
531813ad
ST
148442009-05-21 Sriraman Tallam <tmsriram@google.com>
14845
14846 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14847 kept comdat section was garbage collected.
14848 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14849 * testsuite/Makefile.in: Regenerate.
14850 * testsuite/gc_comdat_test.sh: New file.
14851 * testsuite/gc_comdat_test_1.cc: New file.
14852 * testsuite/gc_comdat_test_2.cc: New file.
14853
65514900
CC
148542009-05-19 Doug Kwan <dougkwan@google.com>
14855
14856 * archive.cc (Archive::Archive): Move constructor from archive.h
14857 to here. Initialize no_export_.
14858 (Archive::get_elf_object_for_member): Set no_export flag of object.
14859 * archive.h (Archive::Archive): Move constructor body to
14860 archive.cc.
14861 (Archive::no_export): New method.
14862 (Archive::no_export_): New field.
14863 * object.h (Object::Object): Initialize no_export_ to false.
14864 (Object::no_export, Object::set_no_export): New methods.
14865 (Object::no_export_): New field.
14866 * options.cc (General_options::parse_exclude_libs): New method.
14867 (General_options::check_excluded_libs) Same.
14868 * options.h (exclude_libs): New option.
14869 (General_options::check_excluded_libs): New method declaration.
14870 (General_options::excluded_libs_): New field.
14871 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14872 default or protected visibility if an object has no-export flag set.
14873 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14874 (check_SCRIPTS): Add exclude_libs_test.sh.
14875 (check_DATA): Add exclude_libs_test.syms.
14876 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14877 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14878 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14879 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14880 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14881 libexclude_libs_test_2.a): New rules.
14882 * testsuite/Makefile.in: Regenerate.
14883 * testsuite/exclude_libs_test.c: New file.
14884 * testsuite/exclude_libs_test.sh: Ditto.
14885 * testsuite/exclude_libs_test_1.c: Ditto.
14886 * testsuite/exclude_libs_test_2.c: Ditto.
14887
1b77ea50
ILT
148882009-05-15 Ian Lance Taylor <iant@google.com>
14889
14890 * configure.ac: Check for declarations for cases where libiberty.h
14891 checks HAVE_DECL_xxx.
14892 * configure, config.in: Rebuild.
14893
072fe7ce
ILT
148942009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14895
14896 * gold.h (Incremental_argument_list): Remove (invalid) forward
14897 declaration.
14898 * incremental.cc (Incremental_inputs::report_achive): New method.
14899 (Incremental_inputs::report_object): New method.
14900 (Incremental_inputs::report_script): New method.
14901 (Incremental_inputs::finalize_inputs): New method.
14902 (Incremental_inputs::finalize): Call finalize_inputs().
14903 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14904 Create inputs entries.
14905 * incremental.h (Incremental_input_type): New enum.
14906 (Incremental_inputs::Incremental_input): Initialize new fields.
14907 (Incremental_inputs::report_inputs): New method.
14908 (Incremental_inputs::report_achive): New method.
14909 (Incremental_inputs::report_object): New method.
14910 (Incremental_inputs::report_script): New method.
14911 (Incremental_inputs::finalize_inputs): New method.
14912 (Incremental_inputs::Input_info): New struct.
14913 (Incremental_inputs::Input_info_map): New typedef.
14914 (Incremental_inputs::lock_): New field.
14915 (Incremental_inputs::Inputs_): New field.
14916 (Incremental_inputs::Inputs_map): New field.
14917 * main.cc (main): Call Incremental_input::report_inputs.
14918 * options.h (Input_argument_list): Typedef moved from
14919 Input_arguments.
14920 (Input_file_group::Files): Remove, use ::Input_argument_list.
14921 (Input_file_group::Input_argument_list): Remove, use
14922 ::Input_argument_list.
14923 * plugin.cc (Plugin_manager::add_input_file): Add error in
14924 incremental build.
14925 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14926 functions.
14927 * script.cc (read_input_script): Call
14928 Incremental_input::report_script.
14929 * script.h (Script_info): New class.
14930
b0481b0b
ILT
149312009-04-27 Ian Lance Taylor <iant@google.com>
14932
14933 * x86_64.cc (do_adjust_output_section): Set entsize to
14934 plt_entry_size.
14935
b22a5a41 149362009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14937
14938 * output.cc (Output_file::close): After short writes, continue
14939 writing from the correct offset in the buffer being written.
14940
40fde488
CD
149412009-04-23 Chris Demetriou <cgd@google.com>
14942
14943 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14944 * configure: Regenerate.
14945 * config.in: Regenerate.
14946 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14947 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14948
3ce2c28e
ILT
149492009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14950
14951 * incremental.cc (Incremental_inputs_header_data): Renamed from
14952 Incremental_input_header_data.
14953 (Incremental_inputs_header_data::data_size): New field.
14954 (Incremental_inputs_header_data::put_input_file_count): Renamed
14955 from input_file_count.
14956 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14957 from command_line_offset.
14958 (Incremental_inputs_header_data::put_reserved): Renamed from
14959 put_reserved.
14960 (Incremental_inputs_entry_data): Renamed from
14961 Incremental_input_entry_data.
14962 (Incremental_inputs_entry_data::data_size): New field.
14963 (Incremental_inputs::report_command_line): New method.
14964 (Incremental_inputs::finalize): New method.
14965 (Incremental_inputs::create_incremental_inputs_data): New method.
14966 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14967 * incremental.h: New file.
14968 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14969 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14970 incremental builds.
703d02da 14971 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14972 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14973 (Layout::create_incremental_info_sections): New method.
14974 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14975 * main.cc (main): Notify Incremental_input of the command line.
14976
e55bde5e
ILT
149772009-04-01 Ian Lance Taylor <iant@google.com>
14978 Mikolaj Zalewski <mikolajz@google.com>
14979
14980 * gold.h (reserve_unordered_map): Define, three versions, one for
14981 each version of Unordered_map.
14982 * layout.cc (Layout::Layout): Remove options parameter. Add
14983 number_of_input_files parameter. Don't initialize options_.
14984 Initialize number_of_input_files_ and resized_signatures_. Move
14985 sections_are_attached_.
14986 (Layout::layout_group): Reserve space for group_signatures_.
14987 (Layout::find_or_add_kept_section): Change name parameter to be a
14988 reference. Resize signatures_ map when it gets large enough.
14989 (Layout::layout_eh_frame): Use parameters->options() instead of
14990 this->options_.
14991 (Layout::make_output_section): Likewise.
14992 (Layout::attach_allocated_section_to_segment): Likewise.
14993 (Layout::finalize, Layout::create_executable_stack): Likewise.
14994 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14995 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14996 * layout.h (class Layout): Update declarations. Remove options_
14997 field. Add number_of_input_files_ and resized_signatures_
14998 fields. Move sections_are_attached_ field.
14999 * main.cc (main): Pass number of input files to Layout
15000 constructor. Don't pass options.
15001
154b857c
ILT
150022009-03-30 Ian Lance Taylor <iant@google.com>
15003
15004 * ffsll.c (ffsll): Correct implementation.
15005
2f35ab9b
ILT
150062009-03-27 Ian Lance Taylor <iant@google.com>
15007
fd03461a
ILT
15008 * ffsll.c: New file.
15009 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15010 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15011 * ftruncate.c (ftruncate): Declare before definition.
15012 * mremap.c (mremap): Likewise.
15013 * pread.c (pread): Likewise.
15014 * configure, Makefile.in, config.in: Rebuild.
15015
2f35ab9b
ILT
15016 * mremap.c: New file.
15017 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15018 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15019 (mremap): Declare if HAVE_MREMAP is not defined.
15020 * configure, Makefile.in, config.in: Rebuild.
15021
33aea2fd
CC
150222009-03-27 Cary Coutant <ccoutant@google.com>
15023
15024 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15025 position independent.
15026 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15027 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15028
6d479619
CC
150292009-03-24 Cary Coutant <ccoutant@google.com>
15030
15031 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15032 an executable.
15033 (needs_dynamic_reloc): Likewise.
15034
afc06bb8
ILT
150352009-03-24 Ian Lance Taylor <iant@google.com>
15036
15037 * yyscript.y (file_cmd): Recognize EXTERN.
15038 (extern_name_list, extern_name_list_body): New nonterminals.
15039 * script.cc (script_add_extern): Define.
15040 * script-c.h (script_add_extern): Declare.
15041
f6060a4d
ILT
150422009-03-24 Rafael Avila de Espindola <espindola@google.com>
15043
15044 * object.cc (is_elf_object): Define.
15045 * object.h (is_elf_object): Declare.
15046 * archive.cc (Archive::get_elf_object_for_member): Call
15047 is_elf_object.
33aea2fd 15048 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15049
26736d8e
ILT
150502009-03-24 Elliott Hughes <enh@google.com>
15051
15052 * output.cc (Output_file::map_anonymous): Define.
15053 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15054 try an anonymous one. Report the size if the mmap fails.
15055 * output.h (class Output_file): Declare map_anonymous.
15056
22fd9730
ILT
150572009-03-24 Ian Lance Taylor <iant@google.com>
15058
15059 * target-select.cc (instantiate_target): Don't acquire the lock if
15060 the instantiated_target_ field has already been set.
15061
cb010894
ILT
150622009-03-23 Ian Lance Taylor <iant@google.com>
15063
7f055c20
ILT
15064 * gold-threads.h (class Initialize_lock): Define.
15065 * gold-threads.cc (class Initialize_lock_once): Define.
15066 (initialize_lock_control): New static variable.
15067 (initialize_lock_pointer): New static variable.
15068 (initialize_lock_once): New static function.
15069 (Initialize_lock::Initialize_lock): Define.
15070 (Initialize_lock::initialize): Define.
15071 * target-select.h: Include "gold-threads.h".
15072 (class Target_selector): Add lock_ and initialize_lock_ fields.
15073 Don't define instantiate_target, just declare it.
15074 * target-select.cc (Target_selector::Target_selector): Initialize
15075 new fields.
15076 (Target_selector::instantiate_target): Define.
15077 * descriptors.h: Include "gold-threads.h".
15078 (class Descriptors): Add initialize_lock_ field.
15079 * descriptors.cc (Descriptors::Descriptors): Initialize new
15080 field.
15081 (Descriptors::open): Use initialize_lock_ field
15082 * errors.h (class Errors): Add initialize_lock_ field.
15083 * errors.cc (Errors::Errors): Initialize new field.
15084 (Errors::initialize_lock): Use initialize_lock_ field.
15085 * powerpc.cc (class Target_selector_powerpc): Remove
15086 instantiated_target_ field. In do_recognize call
15087 instantiate_target rather than do_instantiate_target. In
15088 do_instantiate_target just allocate a new target.
15089 * sparc.cc (class Target_selector_sparc): Likewise.
15090
36959681
ILT
15091 * freebsd.h: New file.
15092 * i386.cc: Include "freebsd.h".
15093 (Target_i386): Derive from Target_freebsd rather than
15094 Sized_target.
15095 (Target_selector_i386): Derive from Target_selector_freebsd rather
15096 than Target_selector.
15097 * x86_64.cc: Include "freebsd.h".
15098 (Target_x86_64): Derive from Target_freebsd rather than
15099 Sized_target.
15100 (Target_selector_x86_64): Derive from Target_selector_freebsd
15101 rather than Target_selector.
15102 * target.h (class Target): Add adjust_elf_header and
15103 do_adjust_elf_header.
15104 * output.cc (Output_file_header:: do_sized_write): Call target
15105 adjust_elf_header routine.
15106 * configure.tgt: Set targ_osabi.
15107 * configure.ac: Define GOLD_DEFAULT_OSABI.
15108 * parameters.cc (Parameters::default_target): Pass
15109 GOLD_DEFAULT_OSABI to select_target.
15110 * target-select.h (class Target_selector): Make instantiate_target
15111 protected rather than private.
15112 * Makefile.am (HFILES): Add freebsd.h.
15113 * configure, Makefile.in, config.in: Rebuild.
15114
cb010894
ILT
15115 * merge.cc (do_add_input_section): Correct pend value. Change
15116 message about last entry not being null terminated from error to
15117 warning.
15118
0e879927
ILT
151192009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15120
15121 * incremental.cc: New file.
15122 * Makefile.am (CCFILES): Add incremental.cc.
15123 * Makefile.in: Rebuild.
15124
41105937
PP
151252009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15126
15127 * layout.cc (Layout::output_section_name): Preserve names
15128 of '.note.' sections.
e1df38aa 15129
60439920
ILT
151302009-03-19 Ian Lance Taylor <iant@google.com>
15131
15132 * descriptors.cc (Descriptors::open): Check that the options are
15133 valid before using them.
15134
0d371ad3
ILT
151352009-03-18 Ian Lance Taylor <iant@google.com>
15136
15137 * script-sections.h: Include <list>.
15138 (class Script_sections): Change Sections_elements from std::vector
15139 to std::list. Typedef public Elements_iterator. Add
15140 orphan_section_placement_, data_segment_align_start_, and
15141 saw_data_segment_align_ fields. Remove data_segment_align_index_
15142 field.
15143 * script-sections.cc (class Orphan_section_placement): New class.
15144 (class Sections_element): Add virtual functions is_relro and
15145 orphan_section_init. Remove virtual function place_orphan_here.
15146 (class Output_section_definition): Add is_relro and
15147 orphan_section_init. Remove place_orphan_here.
15148 (class Orphan_output_section): Likewise.
15149 (Script_sections::Script_sections): Update for field changes.
15150 (Script_sections::data_segment_align): Set saw_data_segment_align_
15151 and data_segment_align_start_, not data_segment_align_index.
15152 (Script_sections::data_segment_relro_end): Check
15153 saw_data_segment_align_. Use data_segment_align_start_ rather
15154 than data_segment_align_index_.
15155 (Script_sections::place_orphan): Rewrite to use
15156 Orphan_section_placement.
15157
9201d894
ILT
151582009-03-17 Ian Lance Taylor <iant@google.com>
15159
9c5b8369
ILT
15160 * archive.cc (Archive::add_symbols): Check for a version attached
15161 to the symbol name in the archive map.
15162 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15163 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15164 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15165 (ver_test_11.a): New target.
15166 * testsuite/Makefile.in: Rebuild.
15167
9201d894
ILT
15168 * configure.ac: Check for chsize and posix_fallocate. Replace
15169 ftruncate.
15170 * ftruncate.c: New file, from gnulib.
15171 * output.cc (posix_fallocate): Define dummy version if not
15172 HAVE_POSIX_FALLOCATE.
15173 (Output_file::map): Call posix_fallocate rather than lseek and
15174 write.
15175 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15176 * configure, Makefile.in, config.in: Rebuild.
15177
ef4ab7a8 151782009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15179
ef4ab7a8
PP
15180 * layout.h (Layout::create_note): Add section_name parameter.
15181 * layout.cc (Layout::create_note): Likewise.
15182 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15183
8c500701
ILT
151842009-03-17 Ian Lance Taylor <iant@google.com>
15185
e85b18e1
ILT
15186 * descriptors.cc: Include "options.h".
15187 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15188 (Descriptors::open): Always use O_CLOEXEC when opening a new
15189 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15190 then set FD_CLOEXEC.
15191
9efe6174
ILT
15192 * sparc.cc (class Target_sparc): Add has_got_section.
15193 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15194 make sure we have a GOT section.
15195
15196 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15197 (Target_sparc::Scan::local): Likewise.
15198 (Target_sparc::Scan::global): Likewise.
15199 (Target_sparc::Relocate::relocate): Likewise.
15200 (Target_sparc::Relocate::relocate_tls): Likewise.
15201
8c500701
ILT
15202 * symtab.cc (Symbol_table::define_default_version): New function,
15203 broken out of add_from_object.
15204 (Symbol_table::add_from_object): Call define_default_version.
15205 (Symbol_table::define_special_symbol): Add resolve_oldsym
15206 parameter. Change all callers. If the version for a symbol comes
15207 from a version script, resolve it with the symbol with the same
15208 name with no version. Also add the symbol without a version if
15209 appropriate.
15210 (do_define_in_output_data): If resolving with oldsym, don't delete
15211 sym.
15212 (do_define_in_output_segment): Likewise.
15213 (do_define_as_constant): Likewise.
15214 * symtab.h (class Symbol_table): Update declarations.
15215
f1ed28fb
ILT
152162009-03-13 Ian Lance Taylor <iant@google.com>
15217
15f8229b
ILT
15218 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15219 (Read_symbols::requeue): New function.
15220 (Read_symbols::do_read_symbols): If make_elf_object fails because
15221 the target type is not configured, and the file was searched for,
15222 issue a warning and retry with the next directory.
15223 (Add_symbols::run): If the file has an incompatible format, and
15224 it was searched for, requeue the Read_symbols task. On error,
15225 release the object.
15226 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15227 dirindex parameter to constructor. Change all callers. Declare
15228 incompatible_warning and requeue.
15229 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15230 input_argument_ and input_group_ fields. Add them to
15231 constructor. Change all callers.
15232 (class Read_script): Add dirindex_ field. Add it to constructor.
15233 Change all callers.
15234 * archive.cc (Archive::setup): Remove input_objects parameter.
15235 Change all callers.
15236 (Archive::get_file_and_offset): Likewise.
15237 (Archive::read_all_symbols): Likewise.
15238 (Archive::read_symbols): Likewise.
15239 (Archive::get_elf_object_for_member): Remove input_objects
15240 parameter. Add punconfigured parameter. Change all callers.
15241 (Archive::add_symbols): Change return type to bool. Check return
15242 value of include_member.
15243 (Archive::include_all_members): Likewise.
15244 (Archive::include_member): Change return type to bool. Return
15245 false if first included object has incompatible target. Set
15246 included_member_ field.
15247 (Add_archive_symbols::run): If add_symbols returns false, requeue
15248 Read_symbols task.
15249 * archive.h (class Archive): Add included_member_ field.
15250 Initialize it in constructor. Add input_file and searched_for
15251 methods. Update declarations.
15252 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15253 input_argument_ fields. Add them to constructor. Change all
15254 callers.
15255 * script.cc: Include "target-select.h".
15256 (class Parser_closure): Add skip_on_incompatible_target_ and
15257 found_incompatible_target_ fields. Add
15258 skip_on_incompatible_target parameter to constructor. Change all
15259 callers. Add methods skip_on_incompatible_target,
15260 clear_skip_on_incompatible_target, found_incompatible_target, and
15261 set_found_incompatible_target.
15262 (read_input_script): Add dirindex parameter. Change all callers.
15263 If parser finds an incompatible target, requeue Read_symbols
15264 task.
15265 (script_set_symbol): Clear skip_on_incompatible_target in
15266 closure.
15267 (script_add_assertion, script_parse_option): Likewise.
15268 (script_start_sections, script_add_phdr): Likewise.
15269 (script_check_output_format): New function.
15270 * script.h (read_input_script): Update declaration.
15271 * script-c.h (script_check_output_format): Declare.
15272 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15273 (ignore_cmd): Remove OUTPUT_FORMAT.
15274 * fileread.cc (Input_file::Input_file): Add explicit this.
15275 (Input_file::will_search_for): New function.
15276 (Input_file::open): Add pindex parameter. Change all callers.
15277 * fileread.h (class Input_file): Add input_file_argument method.
15278 Declare will_search_for. Update declarations.
15279 * object.cc (make_elf_object): Add punconfigured parameter.
15280 Change all callers.
15281 * object.h (class Object): Make input_file public. Add
15282 searched_for method.
15283 (make_elf_object): Update declaration.
15284 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15285 restart search.
15286 * dirsearch.h (class Dirsearch): Update declaration.
15287 * options.h (class General_options): Add --warn-search-mismatch.
15288 * parameters.cc (Parameters::is_compatible_target): New function.
15289 * parameters.h (class Parameters): Declare is_compatible_target.
15290 * workqueue.cc (Workqueue::add_blocker): New function.
15291 * workqueue.h (class Workqueue): Declare add_blocker.
15292
f1ed28fb
ILT
15293 * fileread.cc (Input_file::open): Remove options parameter.
15294 Change all callers.
15295 (Input_file::open_binary): Likewise.
15296 * script.cc (read_input_script): Likewise.
15297 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15298 options parameter from constructor. Change all callers.
15299 (class Read_script): Likewise.
15300 * fileread.h (class Input_file): Update declarations.
15301 * script.h (read_input_script): Update declaration.
15302
34dd024a
NC
153032009-03-10 Nick Clifton <nickc@redhat.com>
15304
15305 * po/es.po: New Spanish translation.
15306
6d71b17c
CC
153072009-03-06 Cary Coutant <ccoutant@google.com>
15308
15309 * options.cc (parse_short_option): Keep dash_z from registering itself.
15310
031cdbed
ILT
153112009-03-03 Ian Lance Taylor <iant@google.com>
15312
15313 PR 9918
15314 * target-reloc.h (relocate_section): Pass output_section to
15315 relocate.
15316 * i386.cc (Target_i386::should_apply_static_reloc): Add
15317 output_section parameter. Change all callers.
15318 (Target_i386::Relocate::relocate): Add output_section parameter.
15319 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15320 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15321 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15322 * testsuite/two_file_shared.sh: New script.
15323 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15324 (check_DATA): Add two_file_shared.dbg.
15325 (two_file_shared.dbg): New target.
15326 * testsuite/Makefile.in: Rebuild.
15327
15d5fa16
ILT
153282009-03-01 Ian Lance Taylor <iant@google.com>
15329
15330 * configure.ac: Check for byteswap.h.
15331 * configure: Rebuild.
15332 * config.in: Rebuild.
15333
8a4c0b0d
ILT
153342009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15335
15336 * layout.cc (Layout::find_or_add_kept_section): New function.
15337 (Layout::add_comdat): Removed.
15338 * layout.h (struct Kept_section): Move out of class Layout.
15339 Remove trailing underscores from field names. Add group_sections
15340 field. Rename group_ field to is_group. Change all uses.
15341 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15342 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15343 comdat_groups_ field.
15344 (Sized_relobj::include_section_group): Use
15345 find_or_add_kept_section and Kept_section::group_sections.
15346 (Sized_relobj::include_linkonce_section): Likewise.
15347 * object.cc (class Sized_relobj): Don't define Comdat_group or
15348 Comdat_group_table. Remove find_comdat_group and
15349 add_comdat_group. Remove comdat_groups_ field.
15350 * plugin.cc (include_comdat_group): Use
15351 Layout::find_or_add_kept_section.
15352
b4ecf66b
ILT
153532009-02-28 Ian Lance Taylor <iant@google.com>
15354
14359ca0
ILT
15355 * README: --gc-sections and map files are now supported. Document
15356 some build requirements.
15357
b4ecf66b
ILT
15358 PR 6992
15359 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15360 relocatable link set the value of the section symbol to zero.
15361 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15362 relocatable link don't include the section address in the local
15363 symbol value.
15364
0602e05a
ILT
153652009-02-27 Ian Lance Taylor <iant@google.com>
15366
fd9d194f
ILT
15367 PR 6811
15368 * options.h (class Search_directory): Add is_system_directory.
15369 (class General_options): Declare is_in_system_directory.
15370 * options.cc (get_relative_sysroot): Make static.
15371 (get_default_sysroot): Make static.
15372 (General_optoins::is_in_system_directory): New function.
15373 * fileread.cc (Input_file::is_in_system_directory): New function.
15374 * fileread.h (class Input_file): Declare is_in_system_directory.
15375 * object.h (class Object): Add is_in_system_directory.
15376 (class Input_objects): Remove system_library_directory_ field.
15377 * object.cc (Input_objects::add_object): Don't set
15378 system_library_directory_.
15379 (input_objects::found_in_system_library_directory): Remove.
15380 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15381 parameter. Change all callers.
15382 (Symbol_table::sized_write_globals): Likewise.
15383 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15384 Call Object::is_in_system_directory.
15385 * symtab.h (class Symbol_table): Update declarations.
15386
61edd21f
ILT
15387 PR 5990
15388 * descriptors.h (Open_descriptor): Add is_on_stack field.
15389 * descriptors.cc (Descriptors::open): If the descriptor is on the
15390 top of the stack, remove it. Initialize is_on_stack field.
15391 (Descriptors::release): Only add pod to stack if it is not on the
15392 stack already.
15393 (Descriptors::close_some_descriptor): Clear stack_next and
15394 is_on_stack fields.
15395
e29e076a
ILT
15396 PR 7091
15397 * output.cc (Output_section::find_starting_output_address): Rename
15398 from starting_output_address; add PADDR parameter; change return
15399 type.
15400 * output.h (class Output_section): Declare
15401 find_starting_output_address instead of starting_output_address.
15402 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15403 section symbol for which we can't find a merge section.
15404
0602e05a
ILT
15405 PR 9836
15406 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15407 hidden or internal, force the symbol to be local.
15408 * resolve.cc (Symbol::override_visibility): Define.
15409 (Symbol::override_base): Use override_visibility.
15410 (Symbol_table::resolve): Likewise.
15411 (Symbol::override_base_with_special): Likewise.
15412 (Symbol_table::override_with_special): If the visibility is hidden
15413 or internal, force the symbol to be local.
15414 * symtab.h (class Symbol): Add set_visibility and
15415 override_visibility.
15416 * testsuite/ver_test_1.sh: New file.
15417 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15418 (check_DATA): Add ver_test_1.syms.
15419 (ver_test_1.syms): New target.
15420 * testsuite/Makefile.in: Rebuild.
15421
401a9a73
CC
154222009-02-25 Cary Coutant <ccoutant@google.com>
15423
15424 * layout.cc (Layout::choose_output_section): Don't rename sections
15425 when using a linker script that has a SECTIONS clause.
15426 * Makefile.in: Regenerate.
15427
15428 * testsuite/Makefile.am (script_test_5.sh): New test case.
15429 * testsuite/Makefile.in: Regenerate.
15430 * testsuite/script_test_5.cc: New file.
15431 * testsuite/script_test_5.sh: New file.
15432 * testsuite/script_test_5.t: New file.
15433
f488e4b0
CC
154342009-02-13 Rafael Avila de Espindola <espindola@google.com>
15435
15436 * archive.cc (Archive::include_member): Update calls to add_symbols.
15437 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15438 the Layout argument.
15439 * dynobj.h (do_add_symbols): Add the Layout argument.
15440 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15441 Layout argument.
15442 * object.h (Object::add_symbols): Add the Layout argument.
15443 (Object::do_add_symbols): Add the Layout argument.
15444 (Sized_relobj::do_add_symbols): Add the Layout argument.
15445 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15446 Unify the two versions.
15447 (Add_plugin_symbols): Remove.
15448 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15449 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15450 (Add_plugin_symbols): Remove.
15451 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15452 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15453 (Add_symbols::run): Make it work with Pulginobj.
15454
89dd1680
ILT
154552009-02-06 Ian Lance Taylor <iant@google.com>
15456
15457 * object.cc (Sized_relobj::do_layout): Make info message start
15458 with lower case letter.
15459
266d0a74
ILT
154602009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15461
602b464e
ILT
15462 * binary.cc: Fix file comment.
15463
266d0a74
ILT
15464 * options.h (enum Incremental_disposition): Define.
15465 (class General_options): Add new options: --incremental,
15466 --incremental_changed, --incremental_unchanged,
15467 --incremental_unknown. Add incremental_disposition_ and
15468 implicit_incremental_ fields.
15469 (General_options::incremental_disposition): New function.
15470 (class Position_dependent_options): Add incremental_disposition
15471 option.
15472 (Position_dependent_options::copy_from_options): Set incremental
15473 dispositions.
15474 * options.cc (General_options::parse_incremental_changed): New
15475 function.
2e702c99
RM
15476 (General_options::parse_incremental_unchanged): New function.
15477 (General_options::parse_incremental_unknown): New function.
15478 (General_options::General_options): Initialize new fields
266d0a74 15479 incremental_disposition_ and implicit_incremental_.
2e702c99 15480 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15481 without --incremental.
15482
f073bbf7
CD
154832009-02-06 Chris Demetriou <cgd@google.com>
15484
15485 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15486 pointer and to report location as the file name associated with
15487 the symbol.
15488 (gold_undefined_symbol_at_location): New function to replace the
15489 old gold_undefined_symbol functionality.
15490 * target-reloc.h (relocate_section): Update to use
15491 gold_undefined_symbol_at_location.
15492 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15493 Call gold_undefined_symbol function rather than gold_error.
15494 * errors.h (Errors::undefined_symbol): Take location as a
15495 string, rather than calculating it from a relocation.
15496 * errors.cc (Errors::fatal): Print "fatal error:" before the
15497 formatted message.
15498 (Errors::error, Errors::error_at_location): Print "error: "
15499 before the formatted message.
15500 (Errors::undefined_symbol): Take location as a string, rather
15501 than calculating it from a relocation.
15502 (gold_undefined_symbol_at_location): New function akin to
15503 old gold_undefined_symbol, calculates location from relocation.
15504 (gold_undefined_symbol): Change to take only a Symbol pointer
15505 and to report location as the file name associated with the symbol.
15506 * testsuite/debug_msg.sh: Update for changed error messages.
15507 * testsuite/undef_symbol.sh: Likewise.
15508
8e94a90c
ILT
155092009-02-04 Duncan Sands <baldrick@free.fr>
15510
15511 PR 9812
15512 * reduced_debug_output.h
15513 (Output_reduced_debug_abbrev_section::failed): Use format for
15514 gold_warning.
15515 (Output_reduced_debug_info_section::faild): Likewise.
15516
88a0e15b
ILT
155172009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15518
15519 * script.cc (Lazy_demangler): New class.
2e702c99 15520 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15521 symbol only once.
15522
5efc7cd2
CC
155232009-01-29 Cary Coutant <ccoutant@google.com>
15524
15525 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15526 to __tls_get_addr.
15527 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15528
e0ebcf42
ILT
155292009-01-28 Ian Lance Taylor <iant@google.com>
15530
5efc7cd2 15531 * version.cc (version_string): Bump to 1.9.
75fe7426 15532
e0ebcf42
ILT
15533 * gold.h: Include <cstring> and <stdint.h>.
15534 * version.cc: Include <cstdio>.
15535 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15536 warning.
15537 * reduced_debug_output.cc (insert_into_vector): Rename from
15538 Insert_into_vector; change all callers. Use Swap_unaligned to
15539 avoid aliasing issue; remove union since it is unnecessary.
15540
8e2813be 155412009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15542
15543 * Makefile.am (CCFILES): Add gc.cc.
15544 (HFILES): Add gc.h.
15545 * Makefile.in: Regenerate.
15546 * gold.cc (Gc_runner): New class.
15547 (queue_initial_tasks): Call garbage collection related tasks
15548 when corresponding options are invoked.
15549 (queue_middle_gc_tasks): New function.
15550 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15551 processed early before laying out sections during garbage collection.
15552 * gold.h (queue_middle_gc_tasks): New function.
15553 (is_prefix_of): Move from "layout.cc".
15554 * i386.cc (Target_i386::gc_process_relocs): New function.
15555 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15556 * main.cc (main): Create object of class "Garbage_collection".
15557 * object.cc (Relobj::copy_symbols_data): New function.
15558 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15559 (Sized_relobj::do_layout): Allow this function to be called twice
15560 during garbage collection and defer layout of section during the
6d03d481
ST
15561 first call.
15562 * object.h (Relobj::get_symbols_data): New function.
15563 (Relobj::is_section_name_included): New function.
15564 (Relobj::copy_symbols_data): New function.
15565 (Relobj::set_symbols_data): New function.
15566 (Relobj::get_relocs_data): New function.
15567 (Relobj::set_relocs_data): New function.
15568 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15569 (Relobj::gc_process_relocs): New function.
15570 (Relobj::do_gc_process_relocs): New pure virtual function.
15571 (Relobj::sd_): New data member.
15572 (Sized_relobj::is_output_section_offset_invalid): New function.
15573 (Sized_relobj::do_gc_process_relocs): New function.
15574 * options.h (General_options::gc_sections): Modify to not be a no-op.
15575 (General_options::print_gc_sections): New option.
15576 * plugin.cc (Plugin_finish::run): Remove function call to
15577 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15578 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15579 * reloc.cc (Read_relocs::run): Add task to process relocs and
15580 determine unreferenced sections when doing garbage collection.
15581 (Gc_process_relocs): New class.
15582 (Sized_relobj::do_gc_process_relocs): New function.
15583 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15584 sections that are garbage collected.
15585 * reloc.h (Gc_process_relocs): New class.
15586 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15587 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15588 symbols whose corresponding sections are garbage collected.
15589 (Symbol_table::Symbol_table): Add new parameter for the garbage
15590 collection object.
15591 (Symbol_table::gc_mark_undef_symbols): New function.
15592 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15593 (Symbol_table::gc_mark_dyn_syms): New function.
15594 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15595 as garbage.
15596 (Symbol_table::add_from_object): Likewise.
15597 (Symbol_table::add_from_relobj): When building shared objects, do not
15598 treat externally visible symbols as garbage.
15599 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15600 table information for static and relocatable links.
15601 * symtab.h (Symbol_table::set_gc): New function.
15602 (Symbol_table::gc): New function.
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::gc_): New data member.
e1df38aa 15607 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15608 function.
15609 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15610 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15611
3b293544
CF
156122009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15613
15614 * options.h (General_options::gc_sections): Define as a no-op for now.
15615 (General_options::no_keep_memory): Ditto.
15616 (General_options::Bshareable): Define.
15617 * options.cc (General_options::finalize): Honor -Bshareable.
15618
83d22aa8
AS
156192009-01-20 Andreas Schwab <schwab@suse.de>
15620
15621 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15622 read the value in the contents, since we don't use it. Use the
15623 template endianness when writing.
15624 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15625
cd536b21
AS
156262009-01-19 Andreas Schwab <schwab@suse.de>
15627
15628 * configure.tgt (powerpc64-*): Fix targ_obj.
15629
99e9a495
ILT
156302009-01-15 Ian Lance Taylor <iant@google.com>
15631
15632 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15633 local symbols when stripping all symbols.
15634
bbbfea06
CC
156352009-01-14 Cary Coutant <ccoutant@google.com>
15636
99e9a495 15637 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15638
0f7c0701
CC
156392009-01-14 Cary Coutant <ccoutant@google.com>
15640
15641 * archive.cc (Archive::get_elf_object_for_member): Remove call
15642 to File_read::claim_for_plugin.
15643 * descriptors.cc (Descriptors::open): Remove reference to
15644 is_claimed.
15645 (Descriptors::claim_for_plugin): Remove.
15646 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15647 (Descriptors::is_claimed): Remove.
15648 (claim_descriptor_for_plugin): Remove.
15649 * fileread.cc (File_read::claim_for_plugin): Remove.
15650 * fileread.h (File_read::claim_for_plugin): Remove.
15651 (File_read::descriptor): Reopen descriptor if necessary.
15652 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15653 (Plugin_manager::all_symbols_read): Add task parameter. Change
15654 all callers.
15655 (Plugin_manager::get_input_file): New function.
15656 (Plugin_manager::release_input_file): New function.
15657 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15658 corresponding data member.
15659 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15660 and pass to base constructor. Change all callers.
15661 (get_input_file, release_input_file): New functions.
15662 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15663 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15664 (Plugin_manager::all_symbols_read): Add task parameter.
15665 (Plugin_manager::get_input_file): New function.
15666 (Plugin_manager::release_input_file): New function.
15667 (Plugin_manager::task_): New data member.
15668 (Pluginobj::Pluginobj): Add filesize parameter.
15669 (Pluginobj::filename): New function.
15670 (Pluginobj::descriptor): New function.
15671 (Pluginobj::filesize): New function.
15672 (Pluginobj::filesize_): New data member.
15673 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15674 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15675 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15676
15677 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15678 with archive libraries.
15679 * testsuite/Makefile.in: Regenerate.
15680 * testsuite/plugin_test.c (struct sym_info): New type.
15681 (get_input_file, release_input_file): New static variables.
15682 (onload): Capture new transfer vector entries.
15683 (claim_file_hook): Stop reading at end of file according to filesize.
15684 Factor out parsing of readelf output into separate function.
15685 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15686 APIs and get the source file name from the symbol table. Convert
15687 source file name to corresponding object file name. Print info
15688 message when adding new input files.
15689 (parse_readelf_line): New function.
15690 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15691 * testsuite/plugin_test_2.sh: Likewise.
15692 * testsuite/plugin_test_3.sh: Likewise.
15693 * testsuite/plugin_test_4.sh: New test case.
15694
62a6d109
ILT
156952009-01-07 Ian Lance Taylor <iant@google.com>
15696
15697 * version.cc (version_string): Bump to 1.8.
15698
483620e8
CC
156992008-12-23 Cary Coutant <ccoutant@google.com>
15700
15701 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15702 * plugin.cc (Plugin_manager::finish): Rename as
15703 layout_deferred_objects. Move cleanup to separate function.
15704 (Plugin_manager::cleanup): New function.
15705 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15706 separately.
15707 * plugin.h (Plugin_manager::finish): Rename as
15708 layout_deferred_objects.
15709 (Plugin_manager::cleanup): New function.
15710 (Plugin_manager::cleanup_done): New field.
15711
d66a9eb3
CC
157122008-12-23 Cary Coutant <ccoutant@google.com>
15713
15714 * plugin.cc (is_visible_from_outside): New function.
15715 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15716 so we don't return "IR only" status for exported symbols or -r links.
15717
15718 * testsuite/Makefile.am (plugin_test_3): New test case.
15719 * testsuite/Makefile.in: Regenerate.
15720 * testsuite/plugin_test_3.sh: New file.
15721
5995b570
CC
157222008-12-22 Cary Coutant <ccoutant@google.com>
15723
15724 * object.cc (Sized_relobj::layout_section): New function.
15725 (Sized_relobj::do_layout): Defer layout of input sections until after
15726 plugin has provided replacement files.
15727 (Sized_relobj::do_layout_deferred_sections): New function.
15728 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15729 (Relobj::layout_deferred_sections): New function.
15730 (Relobj::do_layout_deferred_sections): New function.
15731 (Sized_relobj::do_layout_deferred_sections): New function.
15732 (Sized_relobj::layout_section): New function.
15733 (Sized_relobj::Deferred_layout): New structure.
15734 (Sized_relobj::deferred_layout_): New field.
15735 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15736 Change all callers. Layout deferred sections.
15737 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15738 references.
15739 (Plugin_hook::run): Move code from do_plugin_hook inline.
15740 (Plugin_hook::do_plugin_hook): Remove.
15741 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15742 (Plugin_manager::finish): Renamed, was cleanup.
15743 (Plugin_manager::should_defer_layout): New function.
15744 (Plugin_manager::add_deferred_layout_object): New function.
15745 (Plugin_manager::Deferred_layout_list): New type.
15746 (Plugin_manager::deferred_layout_objects_): New field.
15747 (Plugin_hook::do_plugin_hook): Remove.
15748
ee769c88
ILT
157492008-12-17 Ian Lance Taylor <iant@google.com>
15750
15751 * options.h (class General_options): Add --no case for
15752 --export-dynamic.
15753
abc8dcba
CC
157542008-12-16 Cary Coutant <ccoutant@google.com>
15755
15756 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15757 vector.
15758 (Plugin_manager::claim_file): Create plugin object even if
15759 plugin did not call the add_symbols callback.
15760 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15761 asking for more symbols than were added.
15762 * testsuite/Makefile.am (plugin_test_1): Add test case with
15763 no global symbols.
15764 (empty.syms): New target.
15765 * testsuite/Makefile.in: Regenerate.
15766 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15767 message. Don't call add_symbols if no globals.
15768 (all_symbols_read_hook): Don't provide replacement for empty
15769 claimed file.
15770
b0074644
ILT
157712008-12-12 Ian Lance Taylor <iant@google.com>
15772
68943102
ILT
15773 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15774 r_type == 0 for a local symbol with r_sym == 0.
15775 (scan_relocatable_relocs): Pass r_sym to
15776 local_non_section_strategy.
15777 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15778 r_sym parameter.
15779
b0074644
ILT
15780 * configure.ac: Update test for TLS descriptors: they are
15781 supported as of glibc 2.9.
15782 * configure: Rebuild.
15783
c2508178
ILT
157842008-12-11 Ian Lance Taylor <iant@google.com>
15785
15786 PR 7091
15787 * target-reloc.h (Default_scan_relocatable_relocs): For each
15788 function, map r_type == 0 to RELOC_DISCARD.
15789
2756a258
CC
157902008-12-10 Cary Coutant <ccoutant@google.com>
15791
15792 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15793 object to override a kept COMDAT group from a plugin object.
15794
bb6f53d3
ILT
157952008-12-09 Ian Lance Taylor <iant@google.com>
15796
fbc558e1
ILT
15797 PR 7088
15798 * yyscript.y (file_cmd): Handle INPUT.
15799
bb6f53d3
ILT
15800 * testsuite/initpri1.c: Change all declarations to be full
15801 prototypes by adding void, to avoid compiler warnings.
15802
4674ecfc
CC
158032008-12-05 Rafael Avila de Espindola <espindola@google.com>
15804
15805 * options.cc (General_options::parse_plugin_opt): New.
15806 (General_options::add_plugin): The argument now is just the filename.
15807 (General_options::add_plugin_option): New.
15808 * options.h (plugin_opt): New.
15809 (add_plugin): Change argument name.
15810 (add_plugin_option): New.
15811 * plugin.cc (Plugin::load): Don't parse the plugin option.
15812 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15813 (Plugin::add_option): New.
15814 (Plugin::args_): Change type.
15815 (Plugin::filename_): New.
15816 (Plugin_manager::add_plugin_option): New.
15817 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15818 * testsuite/Makefile.in: Regenerate.
15819
fd06b4aa
CC
158202008-12-05 Cary Coutant <ccoutant@google.com>
15821
15822 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15823 Handle --strip-lto-sections option.
15824 * options.h (strip_lto_sections): New option.
15825
6c52134c
CC
158262008-12-01 Cary Coutant <ccoutant@google.com>
15827
15828 * plugin.cc (ld_plugin_message): Change format parameter to const.
15829 Fix mismatch between new[] and delete.
15830
a45248e0
CC
158312008-11-14 Cary Coutant <ccoutant@google.com>
15832
15833 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15834 instead of -1U.
15835
c82fbeee
CS
158362008-11-05 Craig Silverstein <csilvers@google.com>
15837
15838 * options.cc (General_options::parse_dynamic_list): New function.
15839 * options.h (General_options): New flags dynamic_list,
15840 dynamic_list_data, dynamic_list_cpp_new, and
15841 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15842 (General_options::in_dynamic_list): New function.
15843 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15844 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15845 (Lex::can_continue_name): Likewise.
15846 (yylex): Likewise.
15847 (read_script_file): New parameter script_options.
15848 (read_dynamic_list): New function.
15849 (Script_options::define_dynamic_list): New function.
15850 (dynamic_list_keyword_parsecodes): New variable.
15851 (dynamic_list_keywords): New variable.
15852 * script.h (Script_options::define_dynamic_list): New function
15853 prototype.
15854 (read_dynamic_list): New function prototype.
15855 * symtab.cc (strprefix): New macro.
15856 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15857 dynamic_list_data, dynamic_list_cpp_new, and
15858 dynamic_list_cpp_typeinfo.
15859 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15860 (dynamic_list_expr): New rule.
15861 (dynamic_list_nodes): Likewise.
15862 (dynamic_list_node): Likewise.
15863 * testsuite/Makefile.am (dynamic_list): New test.
15864 * testsuite/Makefile.in: Regenerated.
15865 * testsuite/dynamic_list.t: New file.
15866 * testsuite/dynamic_list.sh: New file.
15867
e0bb29a5
CS
158682008-11-05 Craig Silverstein <csilvers@google.com>
15869
15870 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15871 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15872 (t11_last): Likewise.
15873 * testsuite/ver_test_6.c (main): Likewise.
15874
4e1e25e0
CC
158752008-10-07 Cary Coutant <ccoutant@google.com>
15876
15877 * options.c (General_options::finalize): Add check for -static and
15878 -shared.
15879 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15880 is not empty.
15881
92f03fcb
CC
158822008-10-02 Cary Coutant <ccoutant@google.com>
15883
15884 * plugin.cc (make_sized_plugin_object): Fix conditional
15885 compilation to work when not all targets are enabled.
15886
fbd8a257
CC
158872008-09-29 Cary Coutant <ccoutant@google.com>
15888
15889 * archive.cc (Archive::get_file_and_offset): Use filename instead
15890 of name to get library path.
15891 (Archive::include_member): Unlock external member of a thin archive.
15892
15893 * testsuite/Makefile.am (TEST_AR): New variable.
15894 (thin_archive_test_1): New test.
15895 (thin_archive_test_2): New test.
81636b3f
CC
15896 * testsuite/Makefile.in: Regenerate.
15897 * testsuite/thin_archive_main.cc: New file.
15898 * testsuite/thin_archive_test_1.cc: New file.
15899 * testsuite/thin_archive_test_2.cc: New file.
15900 * testsuite/thin_archive_test_3.cc: New file.
15901 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15902
eff45813
CC
159032008-09-29 Cary Coutant <ccoutant@google.com>
15904
15905 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15906 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15907 instead of -1U.
15908 (Sized_relobj::do_finalize_local_symbols): Likewise.
15909 (Sized_relobj::map_to_kept_section): Likewise.
15910 * object.h (Sized_relobj::invalid_address): New constant.
15911 (Sized_relobj::do_output_section_offset): Check for invalid_address
15912 and return -1ULL.
15913 * output.cc (Output_reloc::local_section_offset): Use constant
15914 invalid_address instead of -1U.
15915 (Output_reloc::get_address): Likewise.
15916 (Output_section::output_address): Change -1U to -1ULL.
15917 * output.h (Output_reloc::invalid_address): New constant.
15918 * reloc.cc (Sized_relobj::write_sections): Use constant
15919 invalid_address instead of -1U.
15920 (Sized_relobj::relocate_sections): Likewise.
15921 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15922 values for merge sections.
15923 * target-reloc.h (relocate_for_relocatable): Use constant
15924 invalid_address instead of -1U.
15925
89fc3421
CC
159262008-09-19 Cary Coutant <ccoutant@google.com>
15927
15928 Add plugin functionality for link-time optimization (LTO).
15929 * configure.ac (plugins): Add --enable-plugins option.
15930 * configure: Regenerate.
15931 * config.in: Regenerate.
15932 * Makefile.am (LIBDL): New variable.
15933 (CCFILES): Add plugin.cc.
15934 (HFILES): Add plugin.h.
15935 (ldadd_var): Add LIBDL.
15936 * Makefile.in: Regenerate.
15937
15938 * archive.cc: Include "plugin.h".
15939 (Archive::setup): Don't preread archive symbols when using a plugin.
15940 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15941 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15942 files.
15943 (Archive::include_member): Add symbols from plugin objects.
15944 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15945 * descriptors.cc (Descriptors::open): Check for file descriptors
15946 abandoned by plugins.
15947 (Descriptors::claim_for_plugin): New function.
15948 * descriptors.h (Descriptors::claim_for_plugin): New function.
15949 (Open_descriptor::is_claimed): New field.
15950 (claim_descriptor_for_plugin): New function.
15951 * fileread.cc (File_read::claim_for_plugin): New function.
15952 * fileread.h (File_read::claim_for_plugin): New function.
15953 (File_read::descriptor): New function.
15954 * gold.cc: Include "plugin.h".
15955 (queue_initial_tasks): Add task to call plugin hooks for generating
15956 new object files.
15957 * main.cc: Include "plugin.h".
15958 (main): Load plugin libraries.
15959 * object.h (Pluginobj): Declare.
15960 (Object::pluginobj): New function.
15961 (Object::do_pluginobj): New function.
15962 (Object::set_target): New function.
15963 * options.cc: Include "plugin.h".
15964 (General_options::parse_plugin): New function.
15965 (General_options::General_options): Initialize plugins_ field.
15966 (General_options::add_plugin): New function.
15967 * options.h (Plugin_manager): Declare.
15968 (General_options): Add --plugin option.
15969 (General_options::has_plugins): New function.
15970 (General_options::plugins): New function.
15971 (General_options::add_plugin): New function.
15972 (General_options::plugins_): New field.
15973 * plugin.cc: New file.
15974 * plugin.h: New file.
15975 * readsyms.cc: Include "plugin.h".
15976 (Read_symbols::do_read_symbols): Check for archive before checking
15977 for ELF file. Call plugin hooks to claim files.
15978 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15979 from a real object file; force override when processing replacement
15980 files.
15981 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15982 (Symbol::init_base_object): Likewise.
15983 (Symbol::init_base_output_data): Likewise.
15984 (Symbol::init_base_output_segment): Likewise.
15985 (Symbol::init_base_constant): Likewise.
15986 (Symbol::init_base_undefined): Likewise.
15987 (Symbol::output_section): Assert that object is not a plugin.
15988 (Symbol_table::add_from_pluginobj): New function.
15989 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15990 undefined.
15991 (Symbol_table::sized_write_globals): Likewise.
15992 (Symbol_table::add_from_pluginobj): Instantiate template.
15993 * symtab.h (Sized_pluginobj): Declare.
15994 (Symbol::in_real_elf): New function.
15995 (Symbol::set_in_real_elf): New function.
15996 (Symbol::in_real_elf_): New field.
15997 (Symbol_table::add_from_pluginobj): New function.
15998
15999 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16000 (LIBDL): New variable.
16001 (LDADD): Add LIBDL.
16002 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16003 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16004 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16005 (MOSTLYCLEANFILES): Likewise.
16006 * testsuite/Makefile.in: Regenerate.
16007 * testsuite/plugin_test.c: New file.
16008 * testsuite/plugin_test_1.sh: New file.
16009 * testsuite/plugin_test_2.sh: New file.
16010
de31bda5
ILT
160112008-09-16 Ian Lance Taylor <iant@google.com>
16012
9c2d0ef9
ILT
16013 * target-reloc.h (relocate_section): Check whether a symbol is
16014 defined by the ABI before reporting an undefined symbol error.
16015 * target.h (Target::is_defined_by_abi): Make parameter const.
16016 (Target::do_is_defined_by_abi): Likewise.
16017 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16018 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16019 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16020 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16021 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16022 * testsuite/Makefile.in: Rebuild.
16023
de31bda5
ILT
16024 * fileread.cc (make_view): Add casts to avoid warning.
16025
9fa33bee
AO
160262008-09-16 Alexandre Oliva <aoliva@redhat.com>
16027
16028 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16029 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16030
183fd0e3
AO
160312008-09-16 Alexandre Oliva <aoliva@redhat.com>
16032
16033 * options.h (General_options::output_is_executable): New.
16034 (General_options::output_is_pie): New.
16035 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16036 for shared libraries.
16037 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16038
7be8330a
CD
160392008-09-11 Chris Demetriou <cgd@google.com>
16040
16041 * options.h (origin): New -z option.
16042 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16043 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16044 in DT_FLAGS_1.
16045
a9caad02
CC
160462008-09-05 Cary Coutant <ccoutant@google.com>
16047
16048 * fileread.cc (File_read::make_view): Add check for attempt to map
16049 beyond end of file.
16050
ae6dce4d
CC
160512008-09-05 Cary Coutant <ccoutant@google.com>
16052
16053 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16054 explicit instantiations.
16055
d7ab2a47
KVH
160562008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16057
16058 PR gold/6858
16059 * options.cc (General_options::finalize): Allow undefined symbols
16060 in shlibs if linking -shared.
16061
16062 PR gold/6859
16063 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16064 symbols as not needing a dynsym entry.
16065
1e52a9c1
CS
160662008-08-20 Craig Silverstein <csilvers@google.com>
16067
16068 * fileread.cc (File_read::open): Do not lock the file unless it
16069 was successfully opened.
16070
d85c80a3
CC
160712008-08-14 Cary Coutant <ccoutant@google.com>
16072
16073 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16074 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16075 * testsuite/tls_test.cc (struct int128): 128-bit struct
16076 for testing TLS relocs with non-zero addend.
16077 (v12): New TLS variable.
16078 (t12): New test.
16079 (t_last): Add check for v12.
16080 * testsuite/tls_test.h (t12): New function.
16081 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16082
2d924fd9
ILT
160832008-08-13 Ian Lance Taylor <iant@google.com>
16084
16085 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16086 set tls_segment_ or relro_segment_.
16087 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16088 when appropriate.
16089 * output.h (Output_section::clear_is_relro): New function.
16090 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16091 sections specially even when output_data_ is empty.
16092 (Output_segment::maximum_alignment): When first section is relro,
16093 only force alignment for PT_LOAD segments.
16094 * script.cc (script_data_segment_align): New function.
16095 (script_data_segment_relro_end): New function.
16096 * script-c.h (script_data_segment_align): Declare.
16097 (script_data_segment_relro_end): Declare.
16098 * script-sections.h (class Script_sections): Declare
16099 data_segment_align and data_segment_relro_end. Add fields
16100 segment_align_index_ and saw_relro_end_.
16101 * script-sections.cc (class Sections_element): Add set_is_relro
16102 virtual function. Add new bool* parameter to place_orphan_here.
16103 Add get_output_section virtual function.
16104 (class Output_section_definition): Add set_is_relro. Add new
16105 bool* parameter to place_orphan_here. Add get_output_section.
16106 Add is_relro_ field.
16107 (Output_section_definition::Output_section_definition): Initialize
16108 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16109 and is_relro_ fields.
16110 (Output_section_definition::place_orphan_here): Add is_relro
16111 parameter.
16112 (Output_section_definition::set_section_addresses): Set relro for
16113 output section.
16114 (Output_section_definition::alternate_constraint): Likewise.
16115 (class Orphan_output_section): Add new bool* parameter to
16116 place_orphan_here. Add get_output_section.
16117 (Orphan_output_section::place_orphan_here): Add is_relro
16118 parameter.
16119 (Script_sections::Script_sections): Initialize
16120 data_segment_align_index_ and saw_relro_end_.
16121 (Script_sections::data_segment_align): New function.
16122 (Script_sections::data_segment_relro_end): New function.
16123 (Script_sections::place_orphan): Set or clear is_relro.
16124 (Script_sections::set_section_addresses): Force alignment of first
16125 TLS section.
16126 * yyscript.y (exp): Call script_data_segment_align and
16127 script_data_segment_relro_end.
16128 * testsuite/relro_script_test.t: New file.
16129 * testsuite/relro_test.cc (using_script): Declare.
16130 (t1, t2): Test using_script.
16131 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16132 (relro_script_test_SOURCES): Define.
16133 (relro_script_test_DEPENDENCIES): Define.
16134 (relro_script_test_LDFLAGS): Define.
16135 (relro_script_test_LDADD): Define.
16136 (relro_script_test.so): New target.
16137 * testsuite/Makefile.in: Rebuild.
16138
f827c9a9
CC
161392008-08-06 Cary Coutant <ccoutant@google.com>
16140
16141 * archive.cc (Archive::total_archives, Archive::total_members)
16142 (Archive::total_members_loaded): New variables.
16143 (Archive::setup): Add parameter. Add option to preread
16144 archive symbols.
16145 (Archive::read_armap): Add counter.
16146 (Archive::get_file_and_offset): New function.
16147 (Archive::get_elf_object_for_member): New function.
16148 (Archive::read_all_symbols): New function.
16149 (Archive::read_symbols): New function.
16150 (Archive::add_symbols): Add counters.
16151 (Archive::include_all_members): Use armap to find members if it's
16152 already built.
16153 (Archive::include_member): Skip reading symbols if already read.
16154 Factored code into Archive::get_file_and_offset and
16155 Archive::get_elf_object_for_member. Changed call to
16156 Mapfile::report_include_archive_member.
16157 (Archive::print_stats): New function.
16158 * archive.h: Declare Object and Read_symbols_data classes.
16159 (Archive::Archive): Add initializers for new members.
16160 (Archive::setup): Add parameter.
16161 (Archive::print_stats): New function.
16162 (Archive::total_archives, Archive::total_members)
16163 (Archive::total_members_loaded): New variables.
16164 (Archive::get_file_and_offset): New function.
16165 (Archive::get_elf_object_for_member): New function.
16166 (Archive::read_all_symbols): New function.
16167 (Archive::read_symbols): New function.
16168 (Archive::Archive_member): New class.
16169 (Archive::members_): New member.
16170 (Archive::num_members_): New member.
16171 * main.cc: Include archive.h.
16172 (main): Call Archive::print_stats.
16173 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16174 archive parameter; member_name is now the fully-decorated name.
16175 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16176 * options.h: (General_options): Add --preread-archive-symbols option.
16177 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16178 Archive::setup.
16179
de4c45bd
ILT
161802008-08-04 Ian Lance Taylor <iant@google.com>
16181
16182 * symtab.h (Symbol::use_plt_offset): New function.
16183 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16184 * powerpc.cc (Relocate::relocate): Likewise.
16185 * sparc.cc (Relocate::relocate): Likewise.
16186 * x86_64.cc (Relocate::relocate): Likewise.
16187 * testsuite/weak_plt.sh: New test.
16188 * testsuite/weak_plt_main.cc: New test.
16189 * testsuite/weak_plt_shared.cc: New test.
16190 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16191 (check_PROGRAMS): Add weak_plt.
16192 (check_DATA): Add weak_plt_shared.so.
16193 (weak_plt_main_pic.o, weak_plt): New targets.
16194 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16195 * testsuite/Makefile.in: Rebuild.
16196
16197 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16198 gcctestdir/ld.
16199 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16200 * testsuite/Makefile.in: Rebuild.
16201
323ee3f4
AM
162022008-08-04 Alan Modra <amodra@bigpond.net.au>
16203
16204 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16205 * Makefile.in: Regenerate.
16206 * po/POTFILES.in: Regenerate.
16207
7c07ecec
ILT
162082008-07-29 Ian Lance Taylor <iant@google.com>
16209
16210 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16211 symbols before other symbols.
16212 * testsuite/script_test_2.cc (test_addr): Declare.
16213 (test_addr_alias): Declare.
16214 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16215 values.
7c07ecec
ILT
16216 * testsuite/script_test_2.t: Define test_addr_alias and
16217 test_addr.
16218
5778530e
ILT
162192008-07-24 Ian Lance Taylor <iant@google.com>
16220
2a00e4fb
ILT
16221 PR 5990
16222 * descriptors.cc: New file.
16223 * descriptors.h: New file.
16224 * gold-threads.h (class Hold_optional_lock): New class.
16225 * fileread.cc: Include "descriptors.h".
16226 (File_read::~File_read): Release descriptor rather than closing
16227 it.
16228 (File_read::open) [file]: Call open_descriptor rather than open.
16229 Set is_descriptor_opened_.
16230 (File_read::open) [memory]: Assert that descriptor is not open.
16231 (File_read::reopen_descriptor): New function.
16232 (File_read::release): Release descriptor.
16233 (File_read::do_read): Make non-const. Reopen descriptor.
16234 (File_read::read): Make non-const.
16235 (File_read::make_view): Reopen descriptor.
16236 (File_read::do_readv): Likewise.
16237 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16238 Update declarations.
16239 * layout.cc: Include "descriptors.h".
16240 (Layout::create_build_id): Use open_descriptor rather than open.
16241 * output.cc: Include "descriptors.h".
16242 (Output_file::open): Use open_descriptor rather than open.
16243 * archive.cc (Archive::const_iterator): Change Archive to be
16244 non-const.
16245 (Archive::begin, Archive::end): Make non-const.
16246 (Archive::count_members): Likewise.
16247 * archive.h (class Archive): Update declarations.
16248 * object.h (Object::read): Make non-const.
16249 * Makefile.am (CCFILES): Add descriptors.cc.
16250 (HFILES): Add descriptors.h.
16251 * Makefile.in: Rebuild.
16252
801647d1
ILT
16253 PR 6716
16254 * gold.h: Always include <clocale>. Add Solaris workarounds
16255 following code in binutils/sysdep.h.
16256
5edd166e
ILT
16257 PR 6048
16258 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16259 this->eh_frame_hdr_ is NULL before using it.
16260
c89ad728
ILT
16261 * dynobj.cc (Versions::Versions): Update comment.
16262
aa86f06b
ILT
16263 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16264 the base version name.
16265
5778530e
ILT
16266 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16267 array size plus one.
16268 (Stringpool_template::set_string_offsets): Subtract one from key
16269 before using it as an array index.
16270 (Stringpool_template::get_offset_with_length): Likewise.
16271 (Stringpool_template::write_to_buffer): Likewise.
16272 * stringpool.h (Stringpool_template::get_offset_from_key):
16273 Likewise.
16274
057ead22
ILT
162752008-07-23 Ian Lance Taylor <iant@google.com>
16276
7f649c59
ILT
16277 PR 6658
16278 * object.h (Merged_symbol_value::value): Do our best to handle a
16279 negative addend.
16280
057ead22
ILT
16281 PR 6647
16282 * script.cc (Version_script_info::get_versions): Don't add empty
16283 version tag to return value.
16284 (Version_script_info::get_symbol_version_helper): Change return
16285 type to bool. Add pversion parameter. Change all callers.
16286 (script_register_vers_node): Don't require a non-NULL tag.
16287 * script.h (class Version_script_info): Update declarations.
16288 (Version_script_info::get_symbol_version): Change return type to
16289 bool. Add version parameter. Change all callers.
16290 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16291 handling. Handle an empty version from a version script.
16292 (Symbol_table::define_special_symbol): Likewise.
16293 * testsuite/ver_test_10.script: New file.
16294 * testsuite/ver_test_10.sh: New file.
16295 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16296 (check_DATA): Add ver_test_10.syms.
16297 (ver_test_10.syms, ver_test_10.so): New target.
16298 * testsuite/Makefile.in: Rebuild.
16299
58e54ac2
CD
163002008-07-23 Simon Baldwin <simonb@google.com>
16301
16302 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16303 to zero for undefined symbols from dynamic libraries.
16304
95d14cd3
ILT
163052008-07-23 Ian Lance Taylor <iant@google.com>
16306
16307 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16308 Change all callers.
16309 * symtab.h (class Symbol_table): Update declaration.
16310 * testsuite/ver_test_9.cc: New file.
16311 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16312 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16313 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16314 (ver_test_9.so, ver_test_9.o): New targets.
16315 * testsuite/Makefile.in: Rebuild.
16316
92de84a6
ILT
163172008-07-22 Ian Lance Taylor <iant@google.com>
16318
34810851
ILT
16319 * options.h (class General_options): Define --check-sections.
16320 * layout.cc (Layout::set_segment_offsets): Handle
16321 --check-sections.
16322
af6156ef
ILT
16323 * options.h (class General_options): Define -n/--nmagic and
16324 -N/--omagic.
16325 * options.cc (General_options::finalize): For -n/--nmagic or
16326 -N/--omagic, set -static.
16327 * layout.cc (Layout::attach_allocated_section_to_segment): If
16328 -N/--omagic, don't put read-only and read-write sections in
16329 different segments.
16330 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16331 finding a read-only segment.
16332 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16333 don't set the minimum segment alignment to the common page size,
16334 and don't set the file offset to the address modulo the page size.
16335 * script-sections.cc (Script_sections::create_segments): If
16336 -n/--omagic, don't put read-only and read-write sections in
16337 different segments.
16338
92de84a6
ILT
16339 * cref.cc: New file.
16340 * cref.h: New file.
16341 * options.h (class General_options): Add --print-symbol-counts.
16342 * main.cc (main): Issue defined symbol report if requested.
16343 * archive.cc (Archive::interpret_header): Make into a const member
16344 function.
16345 (Archive::add_symbols): Call Input_objects::archive_start and
16346 archive_stop.
16347 (Archive::const_iterator): Define new class.
16348 (Archive::begin, Archive::end): New functions.
16349 (Archive::include_all_members): Rewrite to use iterator.
16350 (Archive::count_members): New function.
16351 * archive.h (class Archive): Update declarations.
16352 (Archive::filename): New function.
16353 * object.cc: Include "cref.h".
16354 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16355 (Sized_relobj::do_get_global_symbol_counts): New function.
16356 (Input_objects::add_object): Add object to cross-referencer.
16357 (Input_objects::archive_start): New function.
16358 (Input_objects::archive_stop): New function.
16359 (Input_objects::print_symbol_counts): New function.
16360 * object.h: Declare Cref and Archive.
16361 (Object::get_global_symbol_counts): New function.
16362 (Object::do_get_global_symbol_counts): New pure virtual function.
16363 (class Sized_relobj): Add defined_count_ field. Update
16364 declarations.
16365 (class Input_objects): Add cref_ field. Update constructor.
16366 Update declarations.
16367 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16368 defined_count_.
16369 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16370 symbol counts.
16371 (Sized_dynobj::do_get_global_symbol_counts): New function.
16372 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16373 defined_count_. Update declarations. Define Symbols typedef.
16374 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16375 parameter. Change all callers.
16376 (Symbol_table::add_from_dynobj): Add sympointers and defined
16377 parameters. Change all callers.
16378 * symtab.h (class Symbol_table): Update declarations.
16379 * Makefile.am (CCFILES): Add cref.cc.
16380 (HFILES): Add cref.h.
16381 * Makefile.in: Rebuild.
16382
3f7c5e1d
CD
163832008-07-22 Simon Baldwin <simonb@google.com>
16384
16385 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16386 to zero when writing undefined symbols.
16387
e0b64032
ILT
163882008-07-22 Ian Lance Taylor <iant@google.com>
16389
16390 * output.cc (Output_section::add_input_section): Don't try to
16391 merge empty merge sections.
16392
096b02cf
CS
163932008-07-21 Craig Silverstein <csilvers@google.com>
16394
16395 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16396 Include symbol version in error message.
cd536b21 16397
1d1f116d
CD
163982008-07-20 Chris Demetriou <cgd@google.com>
16399
cd536b21 16400 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16401 (RANDOM_SEED_CFLAGS): New substituted variable.
16402 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16403 * configure: Rebuild.
16404 * Makefile.in: Likewise.
16405 * testsuite/Makefile.in: Likewise.
16406
a18f591e
ILT
164072008-07-18 Ian Lance Taylor <iant@google.com>
16408
16409 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16410 where we see NAME/NULL and NAME/VERSION as separate symbols.
16411 * testsuite/ver_test_main.cc (main): Call t4.
16412 (t4, t4_2a): Define.
16413 * testsuite/ver_test_2.cc (t4_2): Define.
16414 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16415 * testsuite/ver_test_4.cc (t4_2a): Define.
16416 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16417 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16418
c6e3f6ed
ILT
164192008-07-17 Ian Lance Taylor <iant@google.com>
16420
16421 * dynobj.cc (Versions::add_def): If we give an error about a
16422 missing version, go ahead and create the version anyhow.
16423
ef9beddf
ILT
164242008-07-10 Ian Lance Taylor <iant@google.com>
16425
16426 Handle output sections with more than 0x7fffffff bytes.
16427 * object.h (class Relobj): Change map_to_output_ to
16428 output_sections_, and just keep a section pointer. Change all
16429 uses. Move comdat group support to Sized_relobj.
16430 (Relobj::is_section_specially_mapped): Remove.
16431 (Relobj::output_section): Remove poff parameter. Change all
16432 callers.
16433 (Relobj::output_section_offset): New function.
16434 (Relobj::set_section_offset): Rewrite.
16435 (Relobj::map_to_output): Remove.
16436 (Relobj::output_sections): New function.
16437 (Relobj::do_output_section_offset): New pure virtual function.
16438 (Relobj::do_set_section_offset): Likewise.
16439 (class Sized_relobj): Add section_offsets_ field. Add comdat
16440 group support from Relobj. Update declarations.
16441 (Sized_relobj::get_output_section_offset): New function.
16442 (Sized_relobj::do_output_section_offset): New function.
16443 (Sized_relobj::do_set_section_offset): New function.
16444 * object.cc (Relobj::output_section_address): Remove.
16445 (Sized_relobj::Sized_relobj): Initialize new fields.
16446 (Sized_relobj::include_section_group): Cast find_kept_object to
16447 Sized_relobj.
16448 (Sized_relobj::include_linkonce_section): Likewise.
16449 (Sized_relobj::do_layout): Use separate arrays for output section
16450 and output offset.
16451 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16452 output_sections.
16453 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16454 output_sections and section_offsets.
16455 (Sized_relobj::write_local_symbols): Likewise.
16456 (map_to_kept_section): Compute output address directly.
16457 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16458 output_sections and section_offsets.
16459 (Sized_relobj::write_sections): Likewise.
16460 (Sized_relobj::relocate_sections): Likewise.
16461 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16462 * output.h (class Output_reloc): Update declarations. Change
16463 u2_.relobj to Sized_relobj*.
16464 (class Output_data_reloc): Change add functions to use
16465 Sized_relobj*.
16466 * output.cc (Output_reloc::Output_reloc): Change relobj to
16467 Sized_relobj*.
16468 (Output_reloc::local_section_offset): Change return type to
16469 Elf_Addr. Use get_output_section_offset.
16470 (Output_reloc::get_address): Likewise.
16471 (Output_section::is_input_address_mapped): Don't call
16472 is_section_specially_mapped.
16473 (Output_section::output_offset): Likewise.
16474 (Output_section::output_address): Likewise.
16475 (Output_section::starting_output_address): Likewise.
16476 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16477 parameter to Sized_relobj*.
16478 (Copy_relocs::need_copy_reloc): Likewise.
16479 (Copy_relocs::save): Likewise.
16480 * copy-relocs.h (class Copy_relocs): Update declarations.
16481 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16482 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16483 * target-reloc.h (relocate_for_relocatable): Change
16484 offset_in_output_section type to Elf_Addr. Change code that uses
16485 it as well.
16486 * layout.cc (Layout::layout): Always set *off.
16487 * mapfile.cc (Mapfile::print_input_section): Use
16488 output_section_offset.
16489 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16490 Sized_relobj*.
16491 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16492 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16493 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16494
5cb66f97
ILT
164952008-07-03 Ian Lance Taylor <iant@google.com>
16496
16497 * layout.cc (Layout::include_section): Do not discard unrecognized
16498 SHT_STRTAB sections.
16499
afe47622
CS
165002008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16501
16502 * script.cc (Lex::can_continue_name): Make '?' allowable in
16503 version-script names.
16504 * testsuite/version_script.map: Change glob pattern to use '?'
16505
5adf9721
ILT
165062008-06-30 Manish Singh <yosh@gimp.org>
16507
16508 PR 6585
16509 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16510 Correct typo.
16511
e6fde208
ILT
165122008-06-30 Ian Lance Taylor <iant@google.com>
16513
16514 PR 6660
16515 PR 6682
16516 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16517 versions]: Don't try to read the value in the contents, since we
16518 don't use it. Use the template endianness when writing.
16519
3f2e6a2d
CC
165202008-06-25 Cary Coutant <ccoutant@google.com>
16521
16522 * fileread.cc (File_read::make_view): Assert on zero-length view.
16523 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16524 symbol table when there are no symbols to read.
16525
c43d3a48
CS
165262008-06-23 Craig Silverstein <csilvers@google.com>
16527
16528 * version.cc (version_string): Bump to 1.7
16529
5f494ea0
CS
165302008-06-18 Craig Silverstein <csilvers@google.com>
16531
16532 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16533 constant 0xFFFF to type Valtype.
16534 (Powerpc_relocate_functions::rel16_ha): Likewise.
16535
c42e122e
ILT
165362008-06-17 Ian Lance Taylor <iant@google.com>
16537
f34787f8
ILT
16538 * output.h (Output_section::Input_section): Initialize p2align_ to
16539 zero for Output_section_data constructors.
16540 (Output_section::Input_section::addralign): If not an input
16541 section, return the alignment of the Output_section_data.
16542 * testsuite/copy_test.cc: New file.
16543 * testsuite/copy_test_1.cc: New file.
16544 * testsuite/copy_test_2.cc: New file.
16545 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16546 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16547 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16548 (copy_test_1_pic.o, copy_test_1.so): New targets.
16549 (copy_test_2_pic.o, copy_test_2.so): New targets.
16550 * testsuite/Makefile.in: Rebuild.
16551
c42e122e
ILT
16552 * script-sections.cc (Script_sections::place_orphan): Initialize
16553 local variable exact.
16554
ce3ac18a
DE
165552008-06-13 David Edelsohn <edelsohn@gnu.org>
16556
16557 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16558
42cacb20
DE
165592008-06-12 David Edelsohn <edelsohn@gnu.org>
16560 David S. Miller <davem@davemloft.net>
16561
16562 * powerpc.cc: New file.
16563 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16564 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16565 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16566 * Makefile.in: Rebuild.
16567
7b308235
ILT
165682008-06-09 Ian Lance Taylor <iant@google.com>
16569
16570 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16571 <exception>.
16572 (throwing, orig_terminate): New static variables.
16573 (terminate_handler): New static function.
16574 (t2): Set terminate handler.
16575
f0b886e3
ILT
165762008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16577
16578 PR 6584
cd536b21 16579 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16580 alignment.
16581
3e90f135
CC
165822008-05-30 Cary Coutant <ccoutant@google.com>
16583
16584 * archive.cc (Archive::include_all_members) Correct to step
16585 over symbol table and extended name table in thin archives.
16586
e09ad04a
ILT
165872008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16588
16589 PR 6407
16590 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16591 calculation.
16592
62b01cb5
ILT
165932008-05-28 Caleb Howe <cshowe@google.com>
16594
16595 * reduced_debug_output.cc: New file.
16596 * reduced_debug_output.h: New file.
92de84a6 16597 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16598 * options.cc (General_options::finalize): Add strip_debug_non_line
16599 to the strip heirarchy.
16600 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16601 fields.
16602 * layout.cc: Include "reduced_debug_output.h".
16603 (Layout::Layout): Initialize new fields.
16604 (line_only_debug_sections): New static array.
16605 (is_lines_only_debug_sections): New static inline function.
16606 (Layout::include_section): Handle --strip-debug-non-line.
16607 (Layout::make_output_section): If --strip-debug-non-line, build
16608 new output sections for .debug_abbrev and .debug_info.
16609 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16610 gold. Warn about possible overflow.
16611 (read_signed_LEB_128): Likewise.
16612 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16613 (read_signed_LEB_128): Declare.
16614 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16615 (HFILES): Add reduced_debug_output.h.
16616 * Makefile.in: Rebuild.
16617
7d9e3d98
ILT
166182008-05-21 Ian Lance Taylor <iant@google.com>
16619
16620 * mapfile.cc: New file.
16621 * mapfile.h: New file.
16622 * options.h (class General_options): Add -M/--print-map and -Map.
16623 * options.cc (General_options::finalize): Make -M equivalent to
16624 -Map -.
16625 * main.cc: Include <cstdio> and "mapfile.h".
16626 (main): Open mapfile if requested.
16627 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16628 constructor. Change caller.
16629 (queue_initial_tasks): Add mapfile parameter. Change caller.
16630 (queue_middle_tasks): Likewise.
16631 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16632 declarations.
16633 * archive.cc: Include "mapfile.h".
16634 (Archive::add_symbols): Add mapfile parameter. Change all
16635 callers. Pass mapfile, symbol, and reason to include_member.
16636 (Archive::include_all_members): Add mapfile parameter. Change all
16637 callers.
16638 (Archive::include_member): Add mapfile, sym, and why parameters.
16639 Change all callers. Report inclusion to map file.
16640 * archive.h: Include "fileread.h".
16641 (class Archive): Update declarations.
16642 (Archive::file): New const method.
16643 (class Add_archive_symbols): Add mapfile_ field. Update
16644 constructor. Change all callers.
16645 * readsyms.h (class Read_symbols): Likewise.
16646 (class Finish_group): Likewise.
16647 (class Read_script): Likewise.
16648 * common.cc: Include "mapfile.h".
16649 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16650 all callers.
16651 (Symbol_table::do_allocate_commons): Likewise.
16652 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16653 symbol allocation to mapfile.
16654 * common.h (class Allocate_commons_task): Add mapfile_ field.
16655 Update constructor. Change all callers.
16656 * symtab.h (class Symbol_table): Update declarations.
16657 * layout.cc: Include "mapfile.h".
16658 (Layout_task_runner::run): Print information to mapfile.
16659 (Layout::create_gold_note): Change Output_data_fixed_space to
16660 Output_data_zero_fill.
16661 (Layout::create_build_id): Likewise.
16662 (Layout::print_to_mapfile): New function.
16663 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16664 constructor. Change caller.
16665 (class Layout): Declare print_to_mapfile.
16666 * output.cc (Output_section::Input_section::print_to_mapfile): New
16667 function.
16668 (Output_section::add_input_section): If producing a map, always
16669 add to input_sections_ list.
16670 (Output_section::do_print_to_mapfile): New function.
16671 (Output_segment::print_sections_to_mapfile): New function.
16672 (Output_segment::print_section_list_to_mapfile): New function.
16673 * output.h: Include "mapfile.h".
16674 (Output_data::print_to_mapfile): New function.
16675 (Output_data::do_print_to_mapfile): New virtual function.
16676 (Output_segment_headers::do_print_to_mapfile): New function.
16677 (Output_file_header::do_print_to_mapfile): New function.
16678 (Output_data_const::do_print_to_mapfile): New function.
16679 (class Output_data_const_buffer): Add map_name_ field. Update
16680 constructor. Change all callers. Add do_print_to_mapfile
16681 function.
16682 (class Output_data_fixed_space): Likewise.
16683 (class Output_data_space): Likewise.
16684 (class Output_data_zero_fill): New class.
16685 (Output_data_strtab::do_print_to_mapfile): New function.
16686 (Output_data_reloc_base::do_print_to_mapfile): New function.
16687 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16688 (Output_data_group::do_print_to_mapfile): New function.
16689 (Output_data_got::do_print_to_mapfile): New function.
16690 (Output_data_dynamic::do_print_to_mapfile): New function.
16691 (Output_symtab_xindex::do_print_to_mapfile): New function.
16692 (class Output_section): Declare do_print_to_mapflie. Declare
16693 print_to_mapfile in Input_section.
16694 (class Output_segment): Declare new functions.
16695 * object.h (Sized_relobj::symbol_count): New function.
16696 * script-sections.cc
16697 (Output_section_element_dot_assignment::set_section_addresses):
16698 Change Output_data_fixed_space to Output_data_zero_fill.
16699 (Output_data_expression::do_print_to_mapfile): New function.
16700 * script.cc (read_input_script): Add mapfile parameter. Change
16701 all callers.
16702 * script.h (read_input_script): Update declaration.
16703 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16704 (Eh_frame::do_print_to_mapfile): New function.
16705 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16706 (Output_merge_string::do_print_to_mapfile): New function.
16707 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16708 function.
16709 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16710 function.
16711 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16712 function.
16713 * Makefile.am (CCFILES): Add mapfile.cc.
16714 (HFILES): Add mapfile.h.
16715 * Makefile.in: Rebuild.
16716
9f1d377b
ILT
167172008-05-19 Ian Lance Taylor <iant@google.com>
16718
16719 * options.h (class General_options): Add -z relro.
16720 * layout.cc (Layout::Layout): Initialize relro_segment_.
16721 (Layout::add_output_section_data): Return the output section.
16722 (Layout::make_output_section): Rcognize relro sections and mark
16723 them appropriately.
16724 (Layout::attach_allocated_section_to_segment): Put relro sections
16725 in a PT_GNU_RELRO segment.
16726 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16727 section as relro.
16728 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16729 PT_TLS segments.
16730 (Layout::linkonce_mapping): Map d.rel.ro.local to
16731 .data.rel.ro.local.
16732 (Layout::output_section_name): Us .data.rel.ro.local for any
16733 section which begins with that.
16734 * layout.h (class Layout): Update add_output_section_data
16735 declaration. Add relro_segment_ field.
16736 * output.cc (Output_section::Output_section): Initialize is_relro_
16737 and is_relro_local_ fields.
16738 (Output_segment::add_output_section): Group relro sections.
16739 (Output_segment::is_first_section_relro): New function.
16740 (Output_segment::maximum_alignment): If there is a relro section,
16741 align the segment to the common page size.
16742 (Output_segment::set_section_addresses): Track whether we are
16743 looking at relro sections. If the last section is a relro
16744 section, align to the common page size.
16745 (Output_segment::set_section_list_addresses): Add in_relro
16746 parameter. Change all callers. Align to the page size when
16747 moving from relro to non-relro section.
16748 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16749 segment.
16750 * output.h (class Output_section): Add is_relro_ and
16751 is_relro_local_ fields.
16752 (Output_section::is_relro): New function.
16753 (Output_section::set_is_relro): New function.
16754 (Output_section::is_relro_local): New function.
16755 (Output_section::set_is_relro_local): New function.
16756 (class Output_segment): Update declarations.
16757 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16758 * sparc.cc (Target_sparc::got_section): Likewise.
16759 * x86_64.cc (Target_x86_64::got_section): Likewise.
16760 * testsuite/relro_test_main.cc: New file.
16761 * testsuite/relro_test.cc: New file.
16762 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16763 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16764 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16765 (relro_test.so, relro_test_pic.o): New targets.
16766 * testsuite/Makefile.in: Rebuild.
16767
a984ee1d
ILT
167682008-05-16 Ian Lance Taylor <iant@google.com>
16769
01676dcd
ILT
16770 * output.cc (Output_segment::add_output_section): Remove front
16771 parameter.
16772 * output.h (class Output_segment): Remove
16773 add_initial_output_section and overloaded add_output_section.
16774 Update declaration of remaining add_output_section.
16775 * layout.cc (Layout::create_interp): Call add_output_section
16776 rather than add_initial_output_section.
16777 (Layout::finish_dynamic_section): Likewise.
16778
497897f9
ILT
16779 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16780 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16781 know the dynamic type.
16782 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16783 field. Initialize it in constructor.
16784 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16785 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16786 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16787 reloc.
16788
a984ee1d
ILT
16789 * output.cc (Output_reloc::get_address): Change return type to
16790 Elf_Addr.
16791 * output.h (class Output_reloc): Update get_address declaration.
16792 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16793 for section addresses.
16794
55ba0940
ILT
167952008-05-09 Ian Lance Taylor <iant@google.com>
16796
16797 PR 6493
16798 * gold.cc (gold_nomem): Use return value of write.
16799
75517b77
ILT
168002008-05-08 Ian Lance Taylor <iant@google.com>
16801
16802 * symtab.c (Symbol::init_base_output_data): Add version
16803 parameter. Change all callers.
16804 (Symbol::init_base_output_segment): Likewise.
16805 (Symbol::init_base_constant): Likewise.
16806 (Symbol::init_base_undefined): Likewise.
16807 (Sized_symbol::init_output_data): Likewise.
16808 (Sized_symbol::init_output_segment): Likewise.
16809 (Sized_symbol::init_constant): Likewise.
16810 (Sized_symbol::init_undefined): Likewise.
16811 (Symbol_table::do_define_in_output_data): If the new symbol has a
16812 version, mark it as the default.
16813 (Symbol_table::do_define_in_output_segment): Likewise.
16814 (Symbol_table::do_define_as_constant): Likewise.
16815 * symtab.h (class Symbol): Update declarations.
16816 (class Sized_symbol): Likewise.
16817 * resolve.cc (Symbol::override_version): New function.
c42e122e 16818 (Symbol::override_base): Call override_version.
75517b77
ILT
16819 (Symbol::override_base_with_special): Likewise.
16820 * testsuite/ver_script_8.script: New file.
16821 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16822 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16823 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16824 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16825
f1f70eae
ILT
168262008-05-06 Ian Lance Taylor <iant@google.com>
16827
f3e9c5c5
ILT
16828 PR 6049
16829 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16830 functions.
16831 (class General_options): Remove existing --undefined, and add
16832 --no-undefined instead. Add new --undefined as synonym for -u.
16833 * archive.cc (Archive::add_symbols): Check whether symbol was
16834 named with -u.
16835 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16836 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16837 all uses. Add IS_UNDEFINED. Update declarations to split
16838 different versions of init_base. Declare init_base_undefined.
16839 (Symbol::is_defined): Handle IS_UNDEFINED.
16840 (Symbol::is_undefined): Likewise.
16841 (Symbol::is_weak_undefined): Call is_undefined.
16842 (Symbol::is_absolute): Handle IS_CONSTANT.
16843 (class Sized_symbol): Update declarations to split different
16844 versions of init. Declare init_undefined.
16845 (class Symbol_table): Declare new functions.
16846 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16847 Change all callers.
16848 (Symbol::init_base_output_data): Likewise.
16849 (Symbol::init_base_output_segment): Likewise.
16850 (Symbol::init_base_constant): Likewise.
16851 (Symbol::init_base_undefined): New function.
16852 (Sized_symbol::init_object): Rename from init. Change all
16853 callers.
16854 (Sized_symbol::init_output_data): Likewise.
16855 (Sized_symbol::init_output_segment): Likewise.
16856 (Sized_symbol::init_constant): Likewise.
16857 (Sized_symbol::init_undefined): New function.
16858 (Symbol_table::add_undefined_symbols_from_command_line): New
16859 function.
16860 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16861 function.
16862 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16863 (Symbol::output_section): Likewise.
16864 (Symbol::set_output_section): Likewise.
16865 (Symbol_table::sized_finalize_symbol): Likewise.
16866 (Symbol_table::sized_write_globals): Likewise.
16867 * resolve.cc (Symbol_table::should_override): Likewise.
16868 (Symbol::override_base_with_special): Likewise.
16869
8bdcdf2c
ILT
16870 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16871 symbol, change it to have default visibility.
16872 * testsuite/protected_1.cc: New file.
16873 * testsuite/protected_2.cc: New file.
16874 * testsuite/protected_3.cc: New file.
16875 * testsuite/protected_main_1.cc: New file.
16876 * testsuite/protected_main_2.cc: New file.
16877 * testsuite/protected_main_3.cc: New file.
16878 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16879 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16880 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16881 (protected_1.so): New target.
16882 (protected_1_pic.o, protected_2_pic.o): New targets.
16883 (protected_3_pic.o): New target.
16884 (check_PROGRAMS): Add protected_2.
16885 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16886 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16887 * testsuite/Makefile.in: Rebuild.
16888
2b706932
ILT
16889 * options.h (DEFINE_var): Add set_user_set_##varname__.
16890 (DEFINE_bool_alias): New macro.
16891 (class General_options): Define -Bstatic using DEFINE_bool_alias
16892 rather than DEFINE_special. Add --undefined as an alias for -z
16893 defs.
16894 * options.cc (General_options::parse_Bstatic): Remove.
16895
d82a5bcc
ILT
16896 * options.h (class General_options): Add --fatal-warnings.
16897 * main.cc (main): Implement --fatal-warnings.
16898 * errors.h (Errors::warning_count): New function.
16899
f1f70eae
ILT
16900 * options.h (class General_options): Add -Bsymbolic-functions.
16901 * symtab.h (Symbol::is_preemptible): Check for
16902 -Bsymbolic-functions.
16903
8825ac63
ILT
169042008-05-05 Ian Lance Taylor <iant@google.com>
16905
d98bc257
ILT
16906 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16907 as noVARNAME rather than no-VARNAME.
16908 (class General_options): Add option -z combreloc.
16909 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16910 get_address.
16911 (Output_reloc::sort_before) [SHT_REL]: New function.
16912 (Output_reloc::sort_before) [SHT_RELA]: New function.
16913 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16914 Sort_relocs_comparison.
16915 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16916 parameter. Change all callers.
16917 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16918 sort_relocs parameter. Change all callers.
16919 * output.cc (Output_reloc::get_address): New function, broken out
16920 of write_rel.
16921 (Output_reloc::write_rel): Call it.
16922 (Output_reloc::compare): New function.
16923 (Output_data_reloc_base::do_write): Optionally sort relocs.
16924
60b2b4e7
ILT
16925 * configure.ac: If targ_extra_obj is set, link it in.
16926 * configure.tgt: Initialize all variables.
16927 (x86_64*): Set targ_extra_obj and targ_extra_size.
16928 * configure: Rebuild.
16929
8825ac63
ILT
16930 * object.cc (Sized_relobj::include_section_group): Adjust section
16931 indexes read from group data. Build vector to pass to
16932 layout_group.
16933 * layout.cc (Layout::layout_group): Add flags and shndxes
16934 parameters. Remove contents parameter. Change caller. Update
16935 explicit instantiations.
16936 * layout.h (class Layout): Update layout_group declaration.
16937 * output.cc (Output_data_group::Output_data_group): Add flags and
16938 input_shndxes parameters. Remove contents parameter. Change
16939 caller.
16940 (Output_data_group::do_write): Change input_sections_ to
16941 input_shndxes_.
16942 * output.h (class Output_data_group): Update constructor
16943 declaration. Rename input_sections_ to input_shndxes_.
16944 * testsuite/many_sections_test.cc: Add template.
16945
e94cf127
CC
169462008-04-30 Cary Coutant <ccoutant@google.com>
16947
4418b2d5
CC
16948 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16949
e94cf127
CC
16950 * layout.cc (Layout::include_section): Refactored check for debug
16951 info section.
16952 (Layout::add_comdat): Add new parameters. Change type
16953 of signature parameter. Add object and shndx to signatures table.
16954 (Layout::find_kept_object): New function.
16955 * layout.h: Include <cstring>.
16956 (Layout::is_debug_info_section): New function.
16957 (Layout::add_comdat): Add new parameters.
16958 (Layout::find_kept_object): New function.
16959 (Layout::Kept_section): New struct.
16960 (Layout::Signatures): Change type of map range.
16961 * object.cc (Relobj::output_section_address): New function.
16962 (Sized_relobj::include_section_group): Add new parameters. Change
16963 calls to Layout::add_comdat. Change to build table of kept comdat
16964 groups and table mapping discarded sections to kept sections.
16965 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16966 (Sized_relobj::do_layout): Change calls to include_section_group and
16967 include_linkonce_section.
16968 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16969 value to zero when section is discarded.
16970 (Sized_relobj::map_to_kept_section): New function.
16971 * object.h (Relobj::output_section_address): New function.
16972 (Relobj::Comdat_group): New type.
16973 (Relobj::find_comdat_group): New function.
16974 (Relobj::Comdat_group_table): New type.
16975 (Relobj::Kept_comdat_section): New type.
16976 (Relobj::Kept_comdat_section_table): New type.
16977 (Relobj::add_comdat_group): New function.
16978 (Relobj::set_kept_comdat_section): New function.
16979 (Relobj::get_kept_comdat_section): New function.
16980 (Relobj::comdat_groups_): New field.
16981 (Relobj::kept_comdat_sections_): New field.
16982 (Symbol_value::input_value): Update comment.
16983 (Sized_relobj::map_to_kept_section) New function.
16984 (Sized_relobj::include_linkonce_section): Add new parameter.
16985 * target-reloc.h (Comdat_behavior): New type.
16986 (get_comdat_behavior): New function.
16987 (relocate_section): Add code to map a discarded section to the
16988 corresponding kept section when applying a relocation.
16989
e4e5049b
CS
169902008-04-30 Craig Silverstein <csilvers@google.com>
16991
16992 * dwarf_reader.cc (next_generation_count): New static var.
16993 (Addr2line_cache_entry): New struct.
16994 (addr2line_cache): New static var.
16995 (Dwarf_line_info::one_addr2line): Added caching.
16996 (Dwarf_line_info::clear_addr2line_cache): New function.
16997 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16998 cache-size parameter.
16999 (Dwarf_line_info::one_addr2line_cache): New function.
17000 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17001 new cache-size argument to one_addr2line(), and clear cache.
17002
d09e9154
CC
170032008-04-28 Cary Coutant <ccoutant@google.com>
17004
17005 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17006 R_386_PC8 relocations.
17007
7ef73768
ILT
170082008-04-23 Ian Lance Taylor <iant@google.com>
17009
55438702
ILT
17010 * object.cc (Sized_relobj::include_section_group): Check for
17011 invalid section group.
17012
c165fb93
ILT
17013 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17014 header size.
17015
7ef73768
ILT
17016 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17017 than read for file header.
17018 * archive.cc (Archive::include_member): Likewise.
17019
6194aaab
L
170202008-04-23 Paolo Bonzini <bonzini@gnu.org>
17021
17022 * aclocal.m4: Regenerate.
17023 * configure: Regenerate.
17024
d491d34e
ILT
170252008-04-19 Ian Lance Taylor <iant@google.com>
17026
5ea2bac6
ILT
17027 * version.cc (version_string): Bump to 1.6.
17028
7bc3e21a
ILT
17029 * testsuite/Makefile.am (many_sections_r_test): New target.
17030 (many_sections_r_test_SOURCES): Remove.
17031 (many_sections_r_test_DEPENDENCIES): Remove.
17032 (many_sections_r_test_LDFLAGS): Remove.
17033 (many_sections_r_test_LDADD): Remove.
17034
7fcd3aa9
ILT
17035 * object.cc (Sized_relobj::do_add_symbols): Always pass
17036 local_symbol_count_ to add_from_relobj.
17037
4c94d6ae
ILT
17038 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17039 every thousand variables.
17040 * testsuite/Makefile.in: Rebuild.
17041
d491d34e
ILT
17042 * object.cc (Xindex::initialize_symtab_xindex): New function.
17043 (Xindex::read_symtab_xindex): New function.
17044 (Xindex::sym_xindex_to_shndx): New function.
17045 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17046 available.
17047 (Sized_relobj::do_initialize_xindex): New function.
17048 (Sized_relobj::do_read_symbols): Adjust section links.
17049 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17050 parameter. Change all callers.
17051 (Sized_relobj::include_section_group): Adjust section links and
17052 symbol section indexes.
17053 (Sized_relobj::do_layout): Adjust section links.
17054 (Sized_relobj::do_count_local_symbols): Adjust section links and
17055 symbol section indexes.
17056 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17057 ordinary and special symbols.
17058 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17059 dynsym_xindex parameters. Change all callers. Adjust section
17060 links. Use SHN_XINDEX when needed.
17061 (Sized_relobj::get_symbol_location_info): Adjust section links.
17062 Don't get fooled by special symbols.
17063 * object.h (class Xindex): Define.
17064 (class Object): Add xindex_ parameter. Declare virtual functoin
17065 do_initialize_xindex.
17066 (Object::adjust_sym_shndx): New function.
17067 (Object::set_xindex): New protected function.
17068 (class Symbol_value): Add is_ordinary_shndx_ field.
17069 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17070 (Symbol_value::value): Assert ordinary section.
17071 (Symbol_value::initialize_input_to_output_map): Likewise.
17072 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17073 Change all callers.
17074 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17075 all callers.
17076 (class Sized_relobj): Update declarations.
17077 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17078 parameter. Change all callers.
17079 (Sized_relobj::adjust_shndx): New function.
17080 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17081 field.
17082 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17083 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17084 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17085 (Sized_dynobj::read_dynsym_section): Adjust section links.
17086 (Sized_dynobj::read_dynamic): Likewise.
17087 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17088 section links.
17089 (Sized_dynobj::do_initialize_xindex): New function.
17090 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17091 do_initialize_xindex.
17092 (Sized_dynobj::adjust_shndx): New function.
17093 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17094 dynsym_xindex_ fields.
17095 (Layout::finalize): Add a call to set_section_indexes before
17096 creating the symtab sections.
17097 (Layout::set_section_indexes): Don't do anything if the section
17098 already has a section index.
17099 (Layout::create_symtab_sections): Add shnum parameter. Change
17100 caller. Create .symtab_shndx section if needed.
17101 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17102 caller.
17103 (Layout::allocated_output_section_count): New function.
17104 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17105 needed.
17106 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17107 fields. Update declarations.
17108 (Layout::symtab_xindex): New function.
17109 (Layout::dynsym_xindex): New function.
17110 (class Write_symbols_task): Add layout_ field.
17111 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17112 Change caller.
17113 * output.cc (Output_section_headers::Output_section_headers): Add
17114 shstrtab_section parameter. Change all callers.
17115 (Output_section_headers::do_sized_write): Store overflow values
17116 for section count and section string table section index in
17117 section header zero.
17118 (Output_file_header::do_sized_write): Check for overflow of
17119 section count and section string table section index.
17120 (Output_symtab_xindex::do_write): New function.
17121 (Output_symtab_xindex::endian_do_write): New function.
17122 * output.h (class Output_section_headers): Add shstrtab_section_.
17123 Update declarations.
17124 (class Output_symtab_xindex): Define.
17125 (Output_section::has_out_shndx): New function.
17126 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17127 field.
17128 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17129 Change all callers.
17130 (Sized_symbol::init): Likewise.
17131 (Symbol::output_section): Check for ordinary symbol.
17132 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17133 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17134 callers.
17135 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17136 Change all callers. Simplify handling of symbols from sections
17137 not included in the link.
17138 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17139 distinction.
17140 (Weak_alias_sorter::operator()): Assert that symbols are
17141 ordinary.
17142 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17143 distinction.
17144 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17145 parameters. Change all callers.
17146 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17147 symbol distinction. Use SHN_XINDEX when needed.
17148 (Symbol_table::write_section_symbol): Add symtab_xindex
17149 parameter. Change all callers.
17150 (Symbol_table::sized_write_section_symbol): Likewise. Use
17151 SHN_XINDEX when needed.
17152 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17153 declarations.
17154 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17155 (Symbol::is_defined): Check is_ordinary.
17156 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17157 (Symbol::is_absolute, Symbol::is_common): Likewise.
17158 (class Sized_symbol): Update declarations.
17159 (class Symbol_table): Update declarations.
17160 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17161 parameters. Change all callers.
17162 (Sized_symbol::override): Likewise.
17163 (Symbol_table::override): Likewise.
17164 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17165 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17166 is_ordinary, and orig_st_shndx parameters. Change all callers.
17167 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17168 to be in an ordinary section.
17169 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17170 object and is_ordinary parameters. Change all callers.
17171 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17172 Change all callers. Don't add undefined or non-ordinary symbols
17173 to reloc_map_.
17174 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17175 Change all callers.
17176 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17177 declarations.
17178 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17179 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17180 (Sized_relobj::relocate_sections): Likewise.
17181 * target-reloc.h (scan_relocs): Adjust section symbol index.
17182 (scan_relocatable_relocs): Likewise.
17183 * i386.cc (Scan::local): Check for ordinary symbols.
17184 * sparc.cc (Scan::local): Likewise.
17185 * x86_64.cc (Scan::local): Likewise.
17186 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17187 to symbol_section_and_value.
17188 * testsuite/many_sections_test.cc: New file.
17189 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17190 (check_PROGRAMS): Add many_sections_test.
17191 (many_sections_test_SOURCES): Define.
17192 (many_sections_test_DEPENDENCIES): Define.
17193 (many_sections_test_LDFLAGS): Define.
17194 (BUILT_SOURCES): Add many_sections_define.h.
17195 (many_sections_define.h): New target.
17196 (BUILT_SOURCES): Add many_sections_check.h.
17197 (many_sections_check.h): New target.
17198 (check_PROGRAMS): Add many_sections_r_test.
17199 (many_sections_r_test_SOURCES): Define.
17200 (many_sections_r_test_DEPENDENCIES): Define.
17201 (many_sections_r_test_LDFLAGS): Define.
17202 (many_sections_r_test_LDADD): Define.
17203 (many_sections_r_test.o): New target.
17204 * testsuite/Makefile.in: Rebuild.
17205
c5818ff1
CC
172062008-04-17 Cary Coutant <ccoutant@google.com>
17207
17208 * errors.cc (Errors::info): New function.
17209 (gold_info): New function.
17210 * errors.h (Errors::info): New function.
17211 * gold.h (gold_info): New function.
17212 * object.cc (Input_objects::add_object): Print trace output.
17213 * options.cc (options::parse_set): New function.
17214 (General_options::parse_wrap): Deleted.
17215 (General_options::General_options): Deleted initializer.
17216 * options.h (options::String_set): New typedef.
17217 (options::parse_set): New function.
17218 (DEFINE_set): New macro.
17219 (General_options::wrap): Changed to use DEFINE_set. Changed
17220 callers of any_wrap_symbols and is_wrap_symbol.
17221 (General_options::trace, General_options::trace_symbol):
17222 New options.
17223 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17224 (General_options::wrap_symbols_): Deleted.
17225 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17226
b5be4a7c
DM
172272008-04-17 David S. Miller <davem@davemloft.net>
17228
17229 * options.cc (General_options::parse_V): New function.
17230 * options.h: Add entries for -V and -Qy.
17231
155a0dd7
ILT
172322008-04-17 Ian Lance Taylor <iant@google.com>
17233
17234 * common.cc (Symbol_table::allocate_commons): Remove options
17235 parameter. Change caller.
17236 (Symbol_table::do_allocate_commons): Remove options parameter.
17237 Change caller. Just call do_allocate_commons_list twice.
17238 (Symbol_table::do_allocate_commons_list): New function, broken out
17239 of do_allocate_commons.
17240 * common.h (class Allocate_commons_task): Remove options_ field.
17241 Update constructor.
17242 * symtab.cc (Symbol_table::Symbol_table): Initialize
17243 tls_commons_.
17244 (Symbol_table::add_from_object): Put TLS common symbols on
17245 tls_commons_ list.
17246 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17247 which are IN_OUTPUT_DATA.
17248 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17249 allocate_commons and do_allocate_commons declarations. Declare
17250 do_allocate_commons_list.
17251 * gold.cc (queue_middle_tasks): Update creation of
17252 Allocate_commons_task to not pass options.
17253 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17254 (TLS_TEST_C_FLAGS): New variable.
17255 (tls_test_c_pic.o): New target.
17256 (tls_test_shared.so): Link in tls_test_c_pic.o.
17257 (tls_test_c_pic_ie.o): New target.
17258 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17259 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17260 (tls_test_c.o): New target.
17261 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17262 (tls_pic_test_LDADD): Likewise.
17263 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17264 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17265 (tls_test_c_gnu2.o): New target.
17266 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17267 tls_test_c_gnu2.o.
17268 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17269 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17270 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17271 * testsuite/tls_test.cc: Include "config.h".
17272 (t_last): Call t11_last.
17273 * testsuite/tls_test.h (t11, t11_last): Declare.
17274 * testsuite/tls_test_c.c: New file.
17275 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17276 * configure.ac: Check for OpenMP support.
17277 * configure, config.in, Makefile.in: Rebuild.
17278 * testsuite/Makefile.in: Rebuild.
17279
edfbb029
CC
172802008-04-16 Cary Coutant <ccoutant@google.com>
17281
17282 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17283 (Target_i386::tls_base_symbol_defined_): New field.
17284 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17285 (Target_i386::Scan::global): Likewise.
17286 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17287 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17288 (Target_x86_64::tls_base_symbol_defined_): New field.
17289 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17290 (Target_x86_64::Scan::global): Likewise.
17291
f3c69fca
CC
172922008-04-16 Cary Coutant <ccoutant@google.com>
17293
17294 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17295 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17296 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17297 building shared libraries.
17298 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17299 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17300 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17301 * testsuite/Makefile.in: Rebuild.
17302 * testsuite/weak_undef.h: New file.
17303 * testsuite/weak_undef_file1.cc: Add extra test cases.
17304 * testsuite/weak_undef_file2.cc: Likewise.
17305 * testsuite/weak_undef_test.cc: Likewise.
17306
7c414435
DM
173072008-04-16 David S. Miller <davem@davemloft.net>
17308
32b769e1
DM
17309 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17310 Add issued_non_pic_error_ field. Declare check_non_pic.
17311 (Target_sparc::Scan::check_non_pic): New function.
17312 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17313 (Target_sparc::Scan::global): Likewise.
17314
11936fb1
DM
17315 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17316 * configure: Rebuild.
17317
7c414435
DM
17318 * options.h (DEFINE_enable): New macro.
17319 (new_dtags): New enable option.
17320 (initfirst, interpose, loadfltr, nodefaultlib,
17321 nodelete, nodlopen, nodump): New -z options.
17322 * layout.cc (Layout:finish_dynamic_section): If new
17323 dtags enabled, emit DT_RUNPATH. Also, emit a
17324 DT_FLAGS_1 containing any specified -z flags.
17325
85c7bf8b
ILT
173262008-04-16 Ian Lance Taylor <iant@google.com>
17327
12c0daef
ILT
17328 * copy-relocs.cc: New file.
17329 * copy-relocs.h: New file.
17330 * reloc.cc: Remove Copy_relocs code.
17331 * reloc.h: Likewise.
17332 * reloc-types.h (struct Reloc_types) [both versions]: Add
17333 get_reloc_addend_noerror.
17334 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17335 variants of add_global which take an addend which must be zero.
17336 * i386.cc: Include "copy-relocs.h".
17337 (class Target_i386): Change type of copy_relocs_ to variable,
17338 update initializer.
17339 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17340 Change all callers.
17341 (Target_i386::do_finalize_sections): Change handling of
17342 copy_relocs_.
17343 * sparc.cc: Include "copy-relocs.h".
17344 (class Target_sparc): Change type of copy_relocs_ to variable,
17345 update initializer.
17346 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17347 Change all callers.
17348 (Target_sparc::do_finalize_sections): Change handling of
17349 copy_relocs_.
17350 * x86_64.cc: Include "copy-relocs.h".
17351 (class Target_x86_64): Change type of copy_relocs_ to variable,
17352 update initializer.
17353 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17354 class. Change all callers.
17355 (Target_x86_64::do_finalize_sections): Change handling of
17356 copy_relocs_.
17357 * Makefile.am (CCFILES): Add copy-relocs.cc.
17358 (HFILES): Add copy-relocs.h.
17359
4f4995b6
ILT
17360 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17361
85c7bf8b
ILT
17362 * testsuite/script_test_4.sh: Permit leading zeroes.
17363
4f2a9edd
ILT
173642008-04-15 Ian Lance Taylor <iant@google.com>
17365
e6188289
ILT
17366 * script-sections.cc (Script_sections::create_segments): Use
17367 header_size_adjustment even when there is enough room for the
17368 headers.
17369 * testsuite/script_test_4.sh: New file.
17370 * testsuite/script_test_4.t: New file.
17371 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17372 (check_DATA): Add script_test_4.stdout.
17373 (MOSTLYCLEANFILES): Likewise.
17374 (script_test_4): New target.
17375 (script_test_4.stdout): New target.
17376 * testsuite/Makefile.in: Rebuild.
17377
4f2a9edd
ILT
17378 * sparc.cc: Add definitions for Output_data_plt_sparc class
17379 constants.
17380
f5314dd5
DM
173812008-04-14 David S. Miller <davem@davemloft.net>
17382
17383 * sparc.cc: New file.
17384 * Makefile.am (TARGETSOURCES): Add sparc.cc
17385 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17386 * configure.tgt: Document targ_extra_size and
17387 targ_extra_big_endian. Add entries for sparc-* and
17388 sparc64-*.
17389 * configure.ac: Handle targ_extra_size and
17390 targ_extra_big_endian.
17391 * Makefile.in: Rebuild.
17392 * configure: Likewise.
17393 * po/POTFILES.in: Likewise.
17394 * po/gold.pot: Likewise.
17395
154e0e9a
ILT
173962008-04-14 Ian Lance Taylor <iant@google.com>
17397
17398 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17399 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17400 in the name/type/flags to section mapping. Don't call
17401 allocate_output_section.
17402 (Layout::choose_output_section): Change parameter from adjust_name
17403 to is_input_section. Don't permit input sections after sections
17404 are attached to segments. Don't call allocate_output_section.
17405 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17406 not write_enable_output_section.
17407 (Layout::make_output_section): Don't push to
17408 unattached_section_list_ nor call attach_to_segment. Call
17409 attach_section_to_segment if sections are attached.
17410 (Layout::attach_sections_to_segments): New function.
17411 (Layout::attach_section_to_segment): New function.
17412 (Layout::attach_allocated_section_to_segment): Rename from
17413 attach_to_segment. Remove flags parameter.
17414 (Layout::allocate_output_section): Remove function.
17415 (Layout::write_enable_output_section): Remove function.
17416 * layout.h (class Layout): Update for above changes. Add new
17417 field sections_are_attached_.
17418 * output.h (Output_section::update_flags_for_input_section): New
17419 function.
17420 * output.cc (Output_section::add_input_section): Call
17421 update_flags_for_input_section.
17422 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17423
009a67a2
CC
174242008-04-11 Cary Coutant <ccoutant@google.com>
17425
17426 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17427 thought unnecessary.
17428 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17429
759b1a24
ILT
174302008-04-11 Ian Lance Taylor <iant@google.com>
17431
17432 * output.h (class Output_section_data): Remove inline definition
17433 of set_addralign.
17434 * output.cc (Output_section_data::set_addralign): New function.
17435
c2b45e22
CC
174362008-04-11 Cary Coutant <ccoutant@google.com>
17437
17438 Add support for TLS descriptors for i386 and x86_64.
17439 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17440 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17441 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17442 GOT_TYPE_TLS_DESC.
17443 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17444 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17445 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17446 relocations.
17447 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17448 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17449 Fix problem with initial-exec relocations.
17450 (Target_i386::Relocate::relocate_tls): Likewise.
17451 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17452 relaxation.
17453 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17454 support for section-plus-offset dynamic table entries.
17455 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17456 (Output_data_dynamic::Dynamic_entry): Add support for
17457 section-plus-offset dynamic table entries.
17458 (Output_data_dynamic::Classification): Likewise.
17459 (Output_data_dynamic::classification_): Renamed offset_.
17460 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17461 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17462 (Target_x86_64::make_plt_section): New function.
17463 (Target_x86_64::reserve_tlsdesc_entries): New function.
17464 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17465 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17466 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17467 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17468 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17469 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17470 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17471 add extra PLT entry for TLS descriptors.
17472 (Output_data_plt_x86_64::got_): New field.
17473 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17474 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17475 fields.
17476 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17477 descriptors.
17478 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17479 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17480 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17481 R_386_TLS_DESC_CALL relocations.
17482 (Target_x86_64::Scan::global): Likewise.
17483 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17484 for TLS descriptors.
17485 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17486 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17487 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17488 GD-to-IE relaxation.
17489 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17490 and TLS_DESCRIPTORS.
17491 * Makefile.in: Rebuild.
17492 * configure: Rebuild.
17493 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17494 (tls_test_shared2.so): New target.
17495 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17496 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17497 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17498 (tls_shared_gd_to_ie_test_LDADD): New variable.
17499 (tls_shared_gnu2_gd_to_ie_test): New target.
17500 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17501 New targets.
17502 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17503 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17504 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17505 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17506 (tls_shared_gnu2_test): New target.
17507 (tls_test_gnu2_shared.so): New target.
17508 (tls_shared_gnu2_test_SOURCES): New variable.
17509 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17510 (tls_shared_gnu2_test_LDFLAGS): New variable.
17511 (tls_shared_gnu2_test_LDADD): New variable.
17512 * testsuite/Makefile.in: Rebuild.
17513 * testsuite/Makefile.
17514
83bfb6b7
ILT
175152008-04-11 Ian Lance Taylor <iant@google.com>
17516
17517 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17518 justsyms.t.
17519 * testsuite/Makefile.in: Rebuild.
17520
17521 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17522 long.
17523 * testsuite/script_test_2.cc (main): Adjust test.
17524
706e1f5e
ILT
175252008-04-11 David S. Miller <davem@davemloft.net>
17526 Ian Lance Taylor <iant@google.com>
17527
17528 * options.h (General_options): Add entries for '-Y' and
17529 '-relax'.
17530 * options.cc (General_options:finalize): If -Y was used, add those
17531 entries to the library path instead of the default "/lib" and
17532 "/usr/lib".
17533
7c98e6bb
DM
175342008-04-11 David S. Miller <davem@davemloft.net>
17535
17536 * testsuite/justsyms.t: Start at 0x100.
17537 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17538 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17539 long.
17540 * testsuite/script_test_2.cc: Adjust string and section length
17541 checks.
7c98e6bb 17542
99a37bfd
ILT
175432008-04-09 Ian Lance Taylor <iant@google.com>
17544
2cefc357
ILT
17545 PR gold/5996
17546 * script-sections.cc (Sections_element::allocate_to_segment): Add
17547 orphan parameter.
17548 (Output_section_definition::allocate_to_segment): Likewise.
17549 (Orphan_output_section::allocate_to_segment): Likewise.
17550 (Script_sections::attach_sections_using_phdrs_clause): Don't
17551 propagate non-PT_LOAD segments to orphan sections.
17552 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17553 readelf rather than objdump.
17554 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17555 .interp section and PT_INTERP segment are the same size.
17556 * testsuite/Makefile.in: Rebuild.
17557
99a37bfd
ILT
17558 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17559 aliases for symbols defined in the same object.
17560 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17561 (weak_alias_test_SOURCES): New variable.
17562 (weak_alias_test_DEPENDENCIES): New variable.
17563 (weak_alias_test_LDFLAGS): New variable.
17564 (weak_alias_test_LDADD): New variable.
17565 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17566 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17567 (weak_alias_test_3.o): New target.
17568 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17569 * testsuite/weak_alias_test_main.cc: New file.
17570 * testsuite/weak_alias_test_1.cc: New file.
17571 * testsuite/weak_alias_test_2.cc: New file.
17572 * testsuite/weak_alias_test_3.cc: New file.
17573
780e49c5
ILT
175742008-04-08 Ian Lance Taylor <iant@google.com>
17575
cdb0b8f5
ILT
17576 * options.h (class General_options): Add --noinhibit-exec option.
17577 * main.cc (main): Check --noinhibit-exec.
17578
0864d551
ILT
17579 * options.h (class General_options): Define --wrap as a special
17580 option. Add wrap_symbols_ field.
17581 (General_options::any_wrap_symbols): New function.
17582 (General_options::is_wrap_symbol): New function.
17583 * options.cc (General_options::parse_wrap): New function.
17584 (General_options::General_options): Initialize wrap_symbols_.
17585 * symtab.cc (Symbol_table::wrap_symbol): New function.
17586 (Symbol_table::add_from_object): Handle --wrap.
17587 * symtab.h (class Symbol_table): Declare wrap_symbol.
17588 * target.h (Target::wrap_char): New function.
17589 (Target::Target_info): Add wrap_char field.
17590 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17591 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17592 * testsuite/testfile.cc (Target_test::test_target_info):
17593 Likewise.
17594
789aa6de
ILT
17595 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17596 there is one.
17597
2c38906f
ILT
17598 * layout.h (class Layout): Add added_eh_frame_data_ field.
17599 * layout.cc (Layout::Layout): Initialize new field.
17600 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17601 output section until we find a section we merged successfully.
17602 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17603 that the size be non-zero.
17604
780e49c5
ILT
17605 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17606 qualifier.
17607
7fcd0256
ILT
176082008-04-08 Craig Silverstein <csilvers@google.com>
17609
17610 * configure.ac: Export new conditional variable HAVE_ZLIB.
17611 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17612 on HAVE_ZLIB.
17613 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17614 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17615
6835af53
ILT
176162008-04-07 Ian Lance Taylor <iant@google.com>
17617
e24f324c
ILT
17618 * version.cc (version_string): Set to "1.5".
17619
a036edd8
ILT
17620 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17621 Add issued_non_pic_error_ field. Declare check_non_pic.
17622 (Target_x86_64::Scan::check_non_pic): New function.
17623 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17624 (Target_x86_64::Scan::global): Likewise.
17625
624f8810
ILT
17626 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17627 addend parameter. Change caller. Handle merge sections.
17628 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17629 Address to Addend. Don't add in the result of
17630 local_section_offset, pass down the addend and use the returned
17631 value.
17632 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17633 Update declarations of local_section_offset and symbol_value.
17634 * testsuite/two_file_test_1.cc (t18): New function.
17635 * testsuite/two_file_test_2.cc (f18): New function.
17636 * testsuite/two_file_test_main.cc (main): Call t18.
17637 * testsuite/two_file_test.h (t18, f18): Declare.
17638
6835af53
ILT
17639 * configure.ac: Don't test for objdump, c++filt, or readelf.
17640 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17641 conditionals.
17642 (TEST_READELF): New variable.
17643 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17644 (check_PROGRAMS): Add two_file_strip_test.
17645 (two_file_strip_test): New target.
17646 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17647 (two_file_same_shared_strip_test_SOURCES): New variable.
17648 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17649 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17650 (two_file_same_shared_strip_test_LDADD): New variable.
17651 (two_file_shared_strip.so): New target.
17652 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17653 (ver_test_5.syms, ver_test_7.syms): Likewise.
17654 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17655 (strip_test_3.stdout): Use TEST_OBJDUMP.
17656 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17657
86925eef
CC
176582008-04-04 Cary Coutant <ccoutant@google.com>
17659
17660 * symtab.h (Symbol::is_weak_undefined): New function.
17661 (Symbol::is_strong_undefined): New function.
17662 (Symbol::is_absolute): New function.
17663 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17664 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17665 absolute symbols.
17666 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17667 (weak_undef_test): New target.
17668 * testsuite/Makefile.in: Rebuild.
17669 * testsuite/weak_undef_file1.cc: New file.
17670 * testsuite/weak_undef_file2.cc: New file.
17671 * testsuite/weak_undef_test.cc: New file.
17672
126f3ece
ILT
176732008-04-03 Craig Silverstein <csilvers@google.com>
17674
17675 * compressed_output.h (class Output_compressed_section): Use
17676 unsigned buffer.
17677 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17678 add zlib header.
17679 (zlib_compressed_suffix): Removed.
17680 (Output_compressed_section::set_final_data_size): Use unsigned
17681 buffers.
17682 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17683 Fix linker invocation.
17684 (flagstest_o_specialfile_and_compress_debug_sections):
17685 Likewise.
17686 * testsuite/Makefile.in: Regenerated.
17687
deae2a14
DM
176882008-04-02 David S. Miller <davem@davemloft.net>
17689
17690 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17691 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17692
70752818
ILT
176932008-04-02 Craig Silverstein <csilvers@google.com>
17694
17695 * TODO: New file.
17696
39d0cb0e
ILT
176972008-04-02 Ian Lance Taylor <iant@google.com>
17698
17699 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17700 parameters. Update for new key type to views_. Change all
17701 callers.
17702 (File_read::read): Adjust for byteshift in returned view.
17703 (File_read::add_view): New function, broken out of
17704 find_and_make_view.
17705 (File_read::make_view): New function, broken out of
17706 find_and_make_view.
17707 (File_read::find_or_make_view): Add offset and aligned
17708 parameters. Rewrite accordingly. Change all callers.
17709 (File_read::get_view): Add offset and aligned parameters. Adjust
17710 for byteshift in return value.
17711 (File_read::get_lasting_view): Likewise.
17712 * fileread.h (class File_read): Update declarations.
17713 (class File_read::View): Add byteshift_ field. Add byteshift to
17714 constructor. Add byteshift method.
17715 * archive.h (Archive::clear_uncached_views): New function.
17716 (Archive::get_view): Add aligned parameter. Change all callers.
17717 * object.h (Object::get_view): Add aligned parameter. Change all
17718 callers.
17719 (Object::get_lasting_view): Likewise.
17720
17721 * fileread.cc (File_read::release): Don't call clear_views if
17722 there are multiple objects.
17723 * fileread.h (File_read::clear_uncached_views): New function.
17724 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17725 on the archive.
17726
a1207466
CC
177272008-03-31 Cary Coutant <ccoutant@google.com>
17728
17729 Add thin archive support.
17730 * archive.cc (Archive::armagt): New const.
17731 (Archive::setup): Remove task parameter and calls to unlock.
17732 (Archive::unlock_nested_archives): New function.
17733 (Archive::read_header): Add nested_off parameter. Change
17734 all callers.
17735 (Archive::interpret_header): Likewise.
17736 (Archive::include_all_members): Change to handle thin
17737 archives.
17738 (Archive::include_member): Likewise.
17739 * archive.h (Archive::Archive): Add new parameters and
17740 initializers.
17741 (Archive::armagt): New const.
17742 (Archive::setup): Remove task parameter.
17743 (Archive::unlock_nested_archives): New function.
17744 (Archive::read_header): Add nested_off parameter.
17745 (Archive::interpret_header): Likewise.
17746 (Archive::Nested_archive_table): New typedef.
17747 (Archive::is_thin_archive_): New field.
17748 (Archive::nested_archives_): New field.
17749 (Archive::options_): New field.
17750 (Archive::dirpath_): New field.
17751 (Archive::task_): New field.
17752 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17753 for thin archives. Pass additional parameters to
17754 Archive::Archive. Unlock the archive file after calling
17755 Archive::setup.
cd536b21 17756
479f6503
ILT
177572008-03-29 Ian Lance Taylor <iant@google.com>
17758
686c8caf
ILT
17759 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17760 version symbol to be local.
17761 * testsuite/ver_test_4.sh: New file.
17762 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17763 (check_DATA): Add ver_test_4.syms.
17764 (ver_test_4.syms): New target.
17765 * testsuite/Makefile.in: Rebuild.
17766
ab794b6b
ILT
17767 * output.cc
17768 (Output_section::Input_section_sort_entry::has_priority): New
17769 function.
17770 (Output_section::Input_section_sort_entry::match_file_name): New
17771 function.
17772 (Output_section::Input_section_sort_entry::match_section_name):
17773 Remove.
17774 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17775 Remove.
17776 (Output_section::Input_section_sort_entry::match_section_file):
17777 Remove.
17778 (Output_section::Input_section_sort_compare::operator()): Rewrite
17779 using new Input_section_sort_entry functions. Sort crtbegin and
17780 crtend first. Sort sections with no priority before sections with
17781 a priority.
17782 * testsuite/initpri1.c (d3): Check j != 4.
17783 (cd5): New constructor/destructor function.
17784 (main): Check j != 2.
17785
479f6503
ILT
17786 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17787 new symbol when resolving, don't call set_is_default.
17788 * testsuite/ver_test_7.cc: New file.
17789 * testsuite/ver_test_7.sh: New file.
17790 * testsuite/Makefile.am (ver_test_7.so): New target.
17791 (ver_test_7.o): New target.
17792 (check_SCRIPTS): Add ver_test_7.sh.
17793 (check_DATA): Add ver_test_7.syms.
17794 (ver_test_7.syms): New target.
17795
2fd32231
ILT
177962008-03-28 Ian Lance Taylor <iant@google.com>
17797
17798 * layout.cc (Layout::layout): If we see an input section with a
17799 name that needs sorting, set the must_sort flag for the output
17800 section.
17801 (Layout::make_output_section): If the name of the output section
17802 indicates that it might require sorting, set the may_sort flag.
17803 * output.h (Output_section::may_sort_attached_input_sections): New
17804 function.
17805 (Output_section::set_may_sort_attached_input_sections): New
17806 function.
17807 (Output_section::must_sort_attached_input_sections): New
17808 function.
17809 (Output_section::set_must_sort_attached_input_sections): New
17810 function.
17811 (class Output_section): Declare Input_section_sort_entry. Define
17812 Input_section_sort_compare. Declare
17813 sort_attached_input_sections. Add new fields:
17814 may_sort_attached_input_sections_,
17815 must_sort_attached_input_sections_,
17816 attached_input_sections_are_sorted_.
17817 * output.cc (Output_section::Output_section): Initialize new
17818 fields.
17819 (Output_section::add_input_section): Add an entry to
17820 input_sections_ if may_sort or must_sort are true.
17821 (Output_section::set_final_data_size): Call
17822 sort_attached_input_sections if necessary.
17823 (Output_section::Input_section_sort_entry): Define new class.
17824 (Output_section::Input_section_sort_compare::operator()): New
17825 function.
17826 (Output_section::sort_attached_input_sections): New function.
17827 * configure.ac: Check whether the compiler supports constructor
17828 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17829 * testsuite/initpri1.c: New file.
17830 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17831 CONSTRUCTOR_PRIORITY.
17832 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17833 (initpri1_LDFLAGS): New variable.
17834 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17835
18e6b24e
ILT
178362008-03-27 Ian Lance Taylor <iant@google.com>
17837
49bdd526
ILT
17838 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17839 * testsuite/common_test_1.c: New file.
17840 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17841 (common_test_1_SOURCES): New variable.
17842 (common_test_1_DEPENDENCIES): New variable.
17843 (common_test_1_LDFLAGS): New variable.
17844
18e6b24e
ILT
17845 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17846 and commons_ correctly when NAME/VERSION does not override
17847 NAME/NULL.
17848 * testsuite/ver_test_6.c: New file.
17849 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17850 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17851 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17852
04bf7072
ILT
178532008-03-26 Ian Lance Taylor <iant@google.com>
17854
5871526f
ILT
17855 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17856 of an undefined symbol from a version script.
17857 * testsuite/Makefile.am (ver_test_5.so): New target.
17858 (ver_test_5.o): New target.
17859 (check_SCRIPTS): Add ver_test_5.sh.
17860 (check_DATA): Add ver_test_5.syms.
17861 (ver_test_5.syms): New target.
17862 * testsuite/ver_test_5.cc: New file.
17863 * testsuite/ver_test_5.script: New file.
17864 * testsuite/ver_test_5.sh: New file.
17865 * Makefile.in, testsuite/Makefile.in: Rebuild.
17866
04bf7072
ILT
17867 PR gold/5986
17868 Fix problems building gold with gcc 4.3.0.
17869 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17870 (gold_error_at_location, gold_warning_at_location): Use it.
17871 * configure.ac: Check whether we can compile and use a template
17872 function with a printf attribute.
17873 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17874 when jumping over bytes.
17875 * object.cc: Instantiate Object::read_section_data.
17876 * debug.h: Include <cstring>
17877 * dwarf_reader.cc: Include <algorithm>
17878 * main.cc: Include <cstring>.
17879 * options.cc: Include <cstring>.
17880 * output.cc: Include <cstring>.
17881 * script.cc: Include <cstring>.
17882 * script.h: Include <string>.
17883 * symtab.cc: Include <cstring> and <algorithm>.
17884 * target-select.cc: Include <cstring>.
17885 * version.cc: Include <string>.
17886 * testsuite/testmain.cc: Include <cstdlib>.
17887 * configure, config.in: Rebuild.
17888
874c5b28
ILT
178892008-03-25 Ian Lance Taylor <iant@google.com>
17890
819d6c3a
ILT
17891 * options.cc: Include "../bfd/bfdver.h".
17892 (options::help): Print bug reporting address.
17893
f4b2c6f5
ILT
17894 * version.cc (print_version): Adjust output for current value of
17895 BFD_VERSION_STRING.
17896
17897 * NEWS: New file.
17898
e96caa79
ILT
17899 * options.cc (options::help): Print list of supported targets.
17900 * target-select.h: Include <vector>.
17901 (class Target_selector): Make machine_, size_, and is_big_endian_
17902 fields const. Add bfd_name_ and instantiated_target_ fields.
17903 (Target_selector::Target_selector): Add bfd_name parameter.
17904 (Target_selector::recognize): Make non-virtual, call
17905 do_recognize.
17906 (Target_selector::recognize_by_name): Make non-virtual, call
17907 do_recognize_by_name.
17908 (Target_selector::supported_names): New function.
17909 (Target_selector::bfd_name): New function.
17910 (Target_selector::do_instantiate_target): New pure virtual
17911 function.
17912 (Target_selector::do_recognize): New virtual function.
17913 (Target_selector::do_recognize_by_name): New virtual function.
17914 (Target_selector::instantiate_target): New private function.
17915 (supported_target_names): Declare.
17916 * target-select.cc (Target_selector::Target_selector): Update for
17917 new parameter and fields.
17918 (select_target_by_name): Check that the name matches before
17919 calling recognize_by_name.
17920 (supported_target_names): New function.
17921 * i386.cc (class Target_selector_i386): Update Target_selector
17922 constructor call. Remove recognize and recognize_by_name. Add
17923 do_instantiate_target.
17924 * x86_64.cc (class Target_selector_x86_64): Likewise.
17925 * testsuite/testfile.cc (class Target_selector_test): Update for
17926 changes to Target_selector.
17927
874c5b28
ILT
17928 * README: Rewrite, with some notes on unsupported features.
17929
0a65a3a7
CC
179302008-03-24 Cary Coutant <ccoutant@google.com>
17931
17932 * i386.cc (Target_i386::Got_type): New enum declaration.
17933 (Target_i386::Scan::local): Updated callers of Output_data_got
17934 member functions.
17935 (Target_i386::Scan::global): Likewise.
17936 (Target_i386::Relocate::relocate): Likewise.
17937 (Target_i386::Relocate::relocate_tls): Likewise.
17938 * object.h (Got_offset_list): New class.
17939 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17940 (Sized_relobj::local_got_offset): Likewise.
17941 (Sized_relobj::set_local_got_offset): Likewise.
17942 (Sized_relobj::local_has_tls_got_offset): Removed.
17943 (Sized_relobj::local_tls_got_offset): Removed.
17944 (Sized_relobj::set_local_tls_got_offset): Removed.
17945 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17946 * output.cc (Output_data_got::add_global): Added got_type parameter.
17947 (Output_data_got::add_global_with_rel): Likewise.
17948 (Output_data_got::add_global_with_rela): Likewise.
17949 (Output_data_got::add_global_pair_with_rel): New function.
17950 (Output_data_got::add_global_pair_with_rela): New function.
17951 (Output_data_got::add_local): Added got_type parameter.
17952 (Output_data_got::add_local_with_rel): Likewise.
17953 (Output_data_got::add_local_with_rela): Likewise.
17954 (Output_data_got::add_local_pair_with_rel): New function.
17955 (Output_data_got::add_local_pair_with_rela): New function.
17956 (Output_data_got::add_global_tls): Removed.
17957 (Output_data_got::add_global_tls_with_rel): Removed.
17958 (Output_data_got::add_global_tls_with_rela): Removed.
17959 (Output_data_got::add_local_tls): Removed.
17960 (Output_data_got::add_local_tls_with_rel): Removed.
17961 (Output_data_got::add_local_tls_with_rela): Removed.
17962 * output.h (Output_data_got::add_global): Added got_type parameter.
17963 (Output_data_got::add_global_with_rel): Likewise.
17964 (Output_data_got::add_global_with_rela): Likewise.
17965 (Output_data_got::add_global_pair_with_rel): New function.
17966 (Output_data_got::add_global_pair_with_rela): New function.
17967 (Output_data_got::add_local): Added got_type parameter.
17968 (Output_data_got::add_local_with_rel): Likewise.
17969 (Output_data_got::add_local_with_rela): Likewise.
17970 (Output_data_got::add_local_pair_with_rel): New function.
17971 (Output_data_got::add_local_pair_with_rela): New function.
17972 (Output_data_got::add_global_tls): Removed.
17973 (Output_data_got::add_global_tls_with_rel): Removed.
17974 (Output_data_got::add_global_tls_with_rela): Removed.
17975 (Output_data_got::add_local_tls): Removed.
17976 (Output_data_got::add_local_tls_with_rel): Removed.
17977 (Output_data_got::add_local_tls_with_rela): Removed.
17978 * resolve.cc (Symbol::override_base_with_special): Removed
17979 reference to has_got_offset_ field.
17980 * symtab.cc (Symbol::init_fields): Replaced initialization
17981 of got_offset_ with got_offsets_. Removed initialization
17982 of has_got_offset_
53fcba31 17983 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17984 (Symbol::got_offset): Likewise.
17985 (Symbol::set_got_offset): Likewise.
17986 (Symbol::has_tls_got_offset): Removed.
17987 (Symbol::tls_got_offset): Removed.
17988 (Symbol::set_tls_got_offset): Removed.
17989 (Symbol::got_offset_): Removed.
17990 (Symbol::tls_mod_got_offset_): Removed.
17991 (Symbol::tls_pair_got_offset_): Removed.
17992 (Symbol::got_offsets_): New field.
17993 (Symbol::has_got_offset): Removed.
17994 (Symbol::has_tls_mod_got_offset): Removed.
17995 (Symbol::has_tls_pair_got_offset): Removed.
17996 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17997 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17998 member functions.
17999 (Target_x86_64::Scan::global): Likewise.
18000 (Target_x86_64::Relocate::relocate): Likewise.
18001 (Target_x86_64::Relocate::relocate_tls): Likewise.
18002
bd52eafb
BE
180032008-03-25 Ben Elliston <bje@au.ibm.com>
18004
18005 * yyscript.y: Fix spelling error in comment.
18006
8b105e34
ILT
180072008-03-24 Ian Lance Taylor <iant@google.com>
18008
8ed814a9
ILT
18009 * options.h (class General_options): Define build_id option.
18010 * layout.h (class Layout): Declare write_build_id, create_note,
18011 create_build_id. Add build_id_note_ member.
18012 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18013 "libiberty.h", "md5.h", "sha1.h".
18014 (Layout::Layout): Initialize eh_frame_data_,
18015 eh_frame_hdr_section_, and build_id_note_.
18016 (Layout::finalize): Call create_build_id.
18017 (Layout::create_note): New function, broken out of
18018 Layout::create_gold_note.
18019 (Layout::create_gold_note): Call create_note.
18020 (Layout::create_build_id): New function.
18021 (Layout::write_build_id): New function.
18022 (Close_task_runner::run): Call write_build_id.
18023
8b105e34
ILT
18024 * x86_64.cc: Correct license to GPLv3.
18025
086a1841
ILT
180262008-03-23 Ian Lance Taylor <iant@google.com>
18027
18028 * options.cc: Include "demangle.h".
18029 (parse_optional_string): New function.
18030 (parse_long_option): Handle takes_optional_argument.
18031 (parse_short_option): Update dash_z initializer. Handle
18032 takes_optional_argument.
18033 (General_options::General_options): Initialize do_demangle_.
18034 (General_options::finalize): Set do_demangle_. Handle demangling
18035 style.
18036 * options.h (parse_optional_string): Declare.
18037 (struct One_option): Add optional_arg field. Update constructor.
18038 Update call constructor calls. Add takes_optional_argument
18039 function.
18040 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18041 (DEFINE_optional_string): Define.
18042 (General_options::demangle): Change from DEFINE_bool to
18043 DEFINE_optional_string.
18044 (General_options::no_demangle): New function.
18045 (General_options::do_demangle): New function.
18046 (General_options::set_do_demangle): New function.
18047 (General_options::execstack_status_): Move definition to end of
18048 class definition.
18049 (General_options::static_): Likewise.
18050 (General_options::do_demangle_): New field.
18051 * object.cc (big_endian>::get_symbol_location_info): Call
18052 Options::do_demangle, not Options::demangle.
18053 * symtab.cc (demangle): Likewise.
18054
cbb93e63
ILT
180552008-03-22 Ian Lance Taylor <iant@google.com>
18056
18057 * gold.h: Include <cstddef> and <sys/types.h>
18058 * options.h: Include <cstring>.
18059
ec531623
ILT
180602008-03-21 Ian Lance Taylor <iant@google.com>
18061
18062 * Added source code to GNU binutils.
752937aa 18063\f
b90efa5b 18064Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18065
18066Copying and distribution of this file, with or without modification,
18067are permitted in any medium without royalty provided the copyright
18068notice and this notice are preserved.
18069
18070Local Variables:
18071mode: change-log
18072left-margin: 8
18073fill-column: 74
18074version-control: never
18075End:
This page took 1.204314 seconds and 4 git commands to generate.