[GOLD] Relocate::relocate() params
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
91a65d2f
AM
12015-12-09 Alan Modra <amodra@gmail.com>
2
3 * object.h (struct Relocate_info): Add "rr".
4 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
5 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
6 relinfo.rr for relocate_section and relocate_relocs.
7 * powerpc.cc (relocate): Add rel_type and preloc parameters.
8 Delete rela and r_type params, instead recalculate these from
9 preloc.
10 (relocate_relocs): Delete Relocatable_relocs* param, instead
11 use relinfo->rr.
12 * aarch64.cc: Likewise.
13 * arm.cc: Likewise.
14 * i386.cc: Likewise.
15 * mips.cc: Likewise.
16 * s390.cc: Likewise.
17 * sparc.cc: Likewise.
18 * target.h: Likewise.
19 * tilegx.cc: Likewise.
20 * x86_64.cc: Likewise.
21 * testsuite/testfile.cc: Likewise.
22 * target-reloc.h (relocate_section): Adjust to suit.
23 (apply_relocation, relocate_relocs): Likewise.
24
549dba71
AM
252015-12-07 Alan Modra <amodra@gmail.com>
26
27 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
28 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
29 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
30
7ef8ae7c
VR
312015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
32
33 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
34 Local_got_entry_key for searching in local_got_offsets_.
35 * object.h (class Local_got_entry_key): New class.
36 (Relobj::local_has_got_offset): New overloaded method.
37 (Relobj::local_got_offset): Likewise.
38 (Relobj::set_local_got_offset): Likewise.
39 (Relobj::do_local_has_got_offset): Add addend argument.
40 (Relobj::do_local_got_offset): Likewise.
41 (Relobj::do_set_local_got_offset): Likewise.
42 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
43 Local_got_entry_key for searching through local_got_offsets_.
44 (Sized_relobj::do_local_got_offset): Likewise.
45 (Sized_relobj::do_set_local_got_offset): Likewise.
46 (Sized_relobj::Local_got_offsets): Change type of the key from
47 unsigned int to Local_got_entry_key, and add hash and equal_to.
48 * output.cc (Got_entry::write): Take addend into account for
49 calculating value of the local symbol for GOT.
50 (Output_data_got::add_local): New definition of overloaded method.
51 (Output_data_got::add_local_with_rel): Likewise.
52 (Output_data_got::add_local_pair_with_rel): Likewise.
53 * output.h (Output_data_got::add_local): New declaration of overloaded
54 method.
55
74b03b91
CC
562015-11-25 Cary Coutant <ccoutant@gmail.com>
57
58 PR gold/19291
59 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
60 subtract section address from symbol value.
61
751e4d66
AM
622015-11-25 Alan Modra <amodra@gmail.com>
63
64 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
65 to 256 byte boundary.
66
32d849b3
AM
672015-11-19 Alan Modra <amodra@gmail.com>
68
69 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
70 GOT16 and TOC16 relocs to RELATIVE_REF.
71
db1ff028
CC
722015-11-14 Cary Coutant <ccoutant@gmail.com>
73
74 PR gold/19244
75 PR gold/18548
76 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
77 local symbols only for predefined symbols.
78
a680de9a
PB
792015-11-11 Alan Modra <amodra@gmail.com>
80 Peter Bergner <bergner@vnet.ibm.com>
81
82 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
83 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
84 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
85 (Target_powerpc::Scan::global): Likewise.
86 (Target_powerpc::Relocate::relocate): Likewise.
87
cc203475
VR
882015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
89
90 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
91 sections.
92
859d7987
CC
932015-11-09 Cary Coutant <ccoutant@gmail.com>
94 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
95
96 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
97 with type, offset, addend.
98 (Copy_relocs::save): Likewise.
99 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
100 (Copy_relocs::save): Likewise.
101 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
102 and r_addend to Copy_relocs::copy_reloc.
103 * arm.cc (Target_arm::copy_reloc): Likewise.
104 * i386.cc (Target_i386::copy_reloc): Likewise.
105 * mips.cc (Target_mips::copy_reloc): Likewise.
106 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
107 * s390.cc (Target_s390::copy_reloc): Likewise.
108 * sparc.cc (Target_sparc::copy_reloc): Likewise.
109 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
110 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
111
96f9814d
CC
1122015-11-05 Cary Coutant <ccoutant@gmail.com>
113
114 PR gold/19119
115 PR gold/19172
116 PR gold/19197
117 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
118 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
119 * options.h (General_options): Remove "obsolete" from -m.
120 * parameters.cc (set_parameters_target): Check if input target
121 is compatible with output emulation set by "-m emulation".
122
0eccf19f
CC
1232015-11-05 Cary Coutant <ccoutant@gmail.com>
124
125 PR gold/19163
126 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
127 certain relocations if --no-apply-dynamic-relocs is set.
128 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
129
c1e7d6a8
AM
1302015-11-03 Alan Modra <amodra@gmail.com>
131
132 * po/POTFILES.in: Regenerate.
133
26f187cd
NC
1342015-10-30 Nick Clifton <nickc@redhat.com>
135
136 * po/zh_CN.po: New (simplified) Chinese translation.
137
41e83f2b
L
1382015-10-29 H.J. Lu <hongjiu.lu@intel.com>
139
140 PR gold/19184
141 * incremental.cc (Got_plt_view_info): Add got_entry_size.
142 (Local_got_offset_visitor::visit): Replace got_entry_size_
143 with info_.got_entry_size.
144 (Local_got_offset_visitor::got_entry_size_): Removed.
145 (Global_got_offset_visitor::visit): Replace got_entry_size_
146 with info_.got_entry_size.
147 (Global_got_offset_visitor::got_entry_size_): Removed.
148 (Output_section_incremental_inputs::write_got_plt): Initialize
149 view_info.got_entry_size.
150 * target.h (Sized_target::got_entry_size): New virtual function.
151 * x86_64.cc (Target_x86_64::got_entry_size): New function.
152
238830c6
MK
1532015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
154
155 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
156 * testsuite/script_test_12a.c: Likewise.
157 * testsuite/script_test_1a.cc: Likewise.
158 * testsuite/script_test_2.cc: Likewise.
159
bd890911
MK
1602015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
161
162 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
163
a817ff49
MK
1642015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
165
166 PR gold/18959
167 * stringpool.cc (Stringpool_template::new_key_offset): Align all
168 strings, even zero-length.
169 (Stringpool_template::set_string_offsets): Likewise.
170
e79a4bad
MK
1712015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
172
173 * s390.cc: New file.
174 * Makefile.am (TARGETSOURCES): Add s390.cc.
175 (ALL_TARGETOBJS): Add s390.o.
176 * Makefile.in: Regenerate.
177 * configure.ac: Add s390 support.
178 * configure: Regenerate.
179 * configure.tgt: Add s390-*-* and s390x-*-*.
180 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
181 support.
182
6f97897d
MK
1832015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
184
185 * archive.cc (Archive::sym64name): New const.
186 (Archive::setup): Add support for SYM64 armap.
187 (Archive::read_armap): Likewise.
188 (Archive::interpret_header): Likewise.
189 (Archive::const_iterator::read_next_header): Likewise.
190 * archive.h (Archive::sym64name): New const.
191 (Archive::read_armap): Add mapsize template parameter.
192
8d9743bd
MK
1932015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
194
195 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
196 target-specific entry size.
197 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
198 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
199 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
200 hash_entry_size.
201 * target.h (Target::hash_entry_size): New method.
202 (Target::Target_info::hash_entry_size): New data member.
203
204 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
205 * arm.cc (Target_arm::arm_info): Likewise.
206 (Target_arm_nacl::arm_nacl_info): Likewise.
207 * i386.cc (Target_i386::i386_info): Likewise.
208 (Target_i386_nacl::i386_nacl_info): Likewise.
209 (Target_iamcu::iamcu_info): Likewise.
210 * mips.cc (Target_mips::mips_info): Likewise.
211 (Target_mips_nacl::mips_nacl_info): Likewise.
212 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
213 * sparc.cc (Target_sparc::sparc_info): Likewise.
214 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
215 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
216 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
217 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
218
3043c1ab
L
2192015-10-28 H.J. Lu <hongjiu.lu@intel.com>
220
221 PR gold/19177
222 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
223 and R_386_GOT32X relocations without base register.
224
4d2f5d58
HS
2252015-10.27 Han Shen <shenhan@google.com>
226
227 PR gold/19042 - unsupported reloc 311/312.
228
229 * aarch64.cc (Target_aarch64::Scan::local): Add support for
230 reloc 311/312.
231
2891b491
L
2322015-10-22 H.J. Lu <hongjiu.lu@intel.com>
233
234 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
235 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
236 as R_X86_64_GOTPCREL.
237 (Target_x86_64<size>::Scan::local): Likewise.
238 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
239 Likewise.
240 (Target_x86_64<size>::Scan::global): Likewise.
241 (Target_x86_64<size>::Relocate::relocate): Likewise.
242 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
243 Likewise.
244
493d4b48
L
2452015-10-22 H.J. Lu <hongjiu.lu@intel.com>
246
247 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
248 R_386_GOT32X the same as R_386_GOT32.
249 (Target_i386::Scan::local): Likewise.
250 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
251 (Target_i386::Scan::global): Likewise.
252 (Target_i386::Relocate::relocate): Likewise.
253 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
254 Likewise.
255
0fd15345
L
2562015-10-20 H.J. Lu <hongjiu.lu@intel.com>
257
258 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
259 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
260 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
261 x86_64_mov_to_lea1.o.
262 * testsuite/Makefile.in: Regenerated.
263
64571972
L
2642015-10-16 H.J. Lu <hongjiu.lu@intel.com>
265
266 PR gold/19119
267 * options.h (General_options): Remove "obsolete" from -m.
268 * parameters.cc (set_parameters_target): Check if input target
269 is compatible with output emulation set by "-m emulation".
270
01f573ad
L
2712015-10-13 H.J. Lu <hongjiu.lu@intel.com>
272
273 PR gold/19118
274 * i386.cc (Target_iamcu): New class.
275 (Target_selector_iamcu): Likewise.
276 (Target_iamcu::iamcu_info): New variable.
277 (target_selector_iamcu): Likewise.
278
3b0357da
AS
2792015-10-07 Andreas Schwab <schwab@suse.de>
280
281 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
282
9eacb935
CC
2832015-10-06 Cary Coutant <ccoutant@gmail.com>
284
285 PR gold/18855
286 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
287 parameter.
288 (Sparc_relocate_functions::gdop_lox10): Likewise.
289 (Target_sparc::Relocate::relocate): Use addend when computing
290 symbol value for R_SPARC_GOTDATA_OP*.
291
3d4fde69
CC
2922015-09-07 Cary Coutant <ccoutant@gmail.com>
293
294 PR gold/18930
295 PR gold/18886
296 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
297 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
298
358de988
L
2992015-09-02 H.J. Lu <hongjiu.lu@intel.com>
300
301 PR gold/18886
302 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
303 shared libraries into normal FUNC symbols.
304 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
305 symbols aren't from shared libraries.
306
d49044c7
AM
3072015-09-02 Alan Modra <amodra@gmail.com>
308
309 PR 18878
310 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
311 (Target_powerpc::Branch_info::make_stub): Determine whether long
312 branch stub is for save/restore function.
313 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
314 (Stub_table): Add need_save_res_.
315 (Stub_table:clear_stubs): Clear need_save_res_.
316 (Stub_table:set_address_and_size): Add save/restore section size.
317 (Stub_table::add_long_branch_entry): Add save_res param. Set
318 need_save_res_, but don't add space for save/restore stubs.
319 (Stub_table::find_long_branch_entry): Return offset to local copy
320 of save/restore func.
321 (Stub_table::do_write): Don't output save/restore stubs. Instead
322 copy the save/restore functions.
323 (Output_data_save_res:contents): New accessor.
324 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
325
7c61d651
CC
3262015-08-25 Cary Coutant <ccoutant@gmail.com>
327
328 PR gold/18847
329 * script-sections.cc (Memory_region::set_address): New method.
330 (Script_sections::find_memory_region): Add explicit_only parameter.
331 (Output_section_definition::set_section_addresses): Handle case where
332 script specifies both address and vma region.
333 * script-sections.h (Script_sections::find_memory_region): Add
334 explicit_only parameter.
335
4bfacfd3
CC
3362015-08-25 Cary Coutant <ccoutant@gmail.com>
337
338 PR gold/18859
339 * object.cc (Input_objects::add_object): Store objects in a map,
340 indexed by soname; update as-needed flag when necessary.
341 * object.h (Object::clear_as_needed): New method.
342 (Input_objects::so_names_): Change from set to map.
343
1757d35c
CC
3442015-08-25 Cary Coutant <ccoutant@gmail.com>
345
346 PR gold/14746
347 * expression.cc (Expression::Expression_eval_info): Add
348 is_valid_pointer field.
349 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
350 Adjust all callers.
351 (Addr_expression::value_from_output_section): Check whether address
352 is valid.
353 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
354 if evaluation failed due to address that is not yet valid.
355 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
356 parameter.
357
3ac0a36c
CC
3582015-08-25 Cary Coutant <ccoutant@gmail.com>
359
360 PR gold/18866
361 PR gold/18703
362 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
363
9215b98b
AM
3642015-08-20 Alan Modra <amodra@gmail.com>
365
366 PR gold/18846
367 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
368 Subtract os->address() from addend.
369 * powerpc.cc (relocate_relocs): Likewise.
370
40fc1451
SD
3712015-08-12 Simon Dardis <simon.dardis@imgtec.com>
372
373 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
374 lazy_stub_normal_1, lazy_stub_normal_1_n64,
375 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
376 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
377 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
378 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
379 of 'addu/daddu'.
380
37a42ee9
L
3812015-07-27 H.J. Lu <hongjiu.lu@intel.com>
382
383 * configure: Regenerated.
384
ab3b14b0
DK
3852015-07-26 Doug Kwan <dougkwan@google.com>
386
387 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
388 disassembler output format.
389
cdb06167
HS
3902015-07-23 Ian Coolidge <icoolidge@google.com>
391 Plumb --pic-veneer option for gold.
392
393 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
394 generation.
395 * options.h (General_options): Add --pic-veneer option.
396
5b2af7dd
L
3972015-07-22 H.J. Lu <hongjiu.lu@intel.com>
398
399 PR gold/18663
400 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
401 script_test_1a.cc script_test_1b.cc.
402 (script_test_11_r.o): Replace script_test_11.o with
403 script_test_11a.o script_test_11b.o.
404 (script_test_11.o): Removed.
405 (script_test_11a.o): New.
406 (script_test_11b.o): Likewise.
407 * testsuite/Makefile.in: Regenerated.
408 * testsuite/script_test_1.h: New file.
409 * testsuite/script_test_1b.cc: Likewise.
410 * testsuite/script_test_11.h: Likewise.
411 * testsuite/script_test_11b.c: Likewise.
412 * testsuite/script_test_1.cc: Renamed to ...
413 * testsuite/script_test_1a.cc: This.
414 Include "script_test_1.h".
415 (main): Call check_int and check_ptr.
416 * testsuite/script_test_11.c: Renamed to ...
417 * testsuite/script_test_11a.c: This.
418 Include "script_test_11.h".
419 (main): Call ptr_equal.
420
cd78ea77
L
4212015-07-22 H.J. Lu <hongjiu.lu@intel.com>
422
423 PR gold/18628
424 * testsuite/ifuncdep2.c (global): Change protected to hidden.
425 * testsuite/ifuncmod1.c (global): Likewise.
426 * testsuite/ifuncmod5.c (global): Likewise.
427
f945ba50
AM
4282015-07-22 Alan Modra <amodra@gmail.com>
429
430 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
431
5417c94d
CC
4322015-07-21 Cary Coutant <ccoutant@gmail.com>
433
434 PR gold/18548
435 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
436 forced local symbol even when oldsym != NULL.
437 (Symbol_table::do_define_in_output_segment): Likewise.
438 (Symbol_table::do_define_as_constant): Likewise.
439
cb5cf5e2
CC
4402015-07-21 Cary Coutant <ccoutant@gmail.com>
441
b8c6c5ef 442 PR gold/18698
cb5cf5e2
CC
443 * archive.cc (Library_base::should_include_member): Don't use entry
444 point for relocatable links, or if target is not yet valid.
445 * parameters.cc (Parameters::entry): Check target_valid().
446
0ef3814f
HS
4472015-07-20 Han Shen <shenhan@google.com>
448
449 Optimize erratum 843419 fix.
450
451 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
452 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
453 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
454 (E843419_stub): New sub-class of Erratum_stub.
455 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
456 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
457 (AArch64_relobj::create_erratum_stub): Add 1 argument.
458 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
459
2bca0377
HS
4602015-07-20 Han Shen <shenhan@google.com>
461
462 Fix arm elf header flags wrt hardfp bit.
463
464 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
465
f54f5e31
L
4662015-07-20 H.J. Lu <hongjiu.lu@intel.com>
467
468 PR gold/18689
469 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
470 from input group section for relocatable link.
471 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
472 (check_DATA): Add pr18689.stdout.
473 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
474 (pr18689.stdout): New rule.
475 (pr18689a.o): Likewise.
476 (pr18689b.o): Likewise.
477 (pr18689.o): Likewise.
478 * testsuite/pr18689.c: New file.
479 * testsuite/pr18689.sh: Likewise.
480 * testsuite/Makefile.in: Regenerated.
481
c20ceeb2
YW
4822015-07-20 Yiran Wang <yiran@google.com>
483 Cary Coutant <ccoutant@gmail.com>
484
485 PR gold/15574
486 * resolve.cc (Symbol_table): Remove warning about references
487 from shared objects to hidden symbols.
488 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
489 * testsuite/Makefile.in: Regenerate.
490 * testsuite/hidden_test.sh: Check dynamic symbol table; update
491 expected error messages.
492
19a7fe52
L
4932015-07-14 H.J. Lu <hongjiu.lu@intel.com>
494
495 * compressed_output.cc (Output_compressed_section::set_final_data_size):
496 Make --compress-debug-sections=zlib the same as
497 --compress-debug-sections=zlib-gabi.
498 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
499 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
500 ".zdebug_".
501 * testsuite/Makefile.in: Regenerated.
502
fb8b9dbc
L
5032015-07-12 H.J. Lu <hongjiu.lu@intel.com>
504
505 PR gold/18322
506 * compressed_output.cc (zlib_compress): Add argument for
507 compression header size. Set header size to compression header
508 size if it isn't 0. Don't write out the zlib header here.
509 (Output_compressed_section::set_final_data_size): Support
510 zlib-gnu and zlib-gabi compressions. Pass compression header
511 size to zlib_compress and write out compression header. Set
512 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
513 clear the SHF_COMPRESSED bit
514 * options.h (compress_debug_sections): Add zlib-gnu and
515 zlib-gabi.
516 * output.h (Output_section::set_flags): New.
517 * testsuite/Makefile.am (check_PROGRAMS): Add
518 flagstest_compress_debug_sections_none,
519 flagstest_compress_debug_sections_gnu and
520 flagstest_compress_debug_sections_gabi.
521 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
522 flagstest_compress_debug_sections.stdout,
523 flagstest_compress_debug_sections.cmp,
524 flagstest_compress_debug_sections.check,
525 flagstest_compress_debug_sections_gnu.stdout,
526 flagstest_compress_debug_sections_gnu.cmp,
527 flagstest_compress_debug_sections_gnu.check,
528 flagstest_compress_debug_sections_gabi.stdout,
529 flagstest_compress_debug_sections_gabi.cmp and
530 flagstest_compress_debug_sections_gabi.check.
531 (flagstest_compress_debug_sections_none): New.
532 (flagstest_compress_debug_sections_none.stdout): Likewise.
533 (flagstest_compress_debug_sections.stdout): Likewise.
534 (flagstest_compress_debug_sections.check): Likewise.
535 (flagstest_compress_debug_sections.cmp): Likewise.
536 (flagstest_compress_debug_sections_gnu): Likewise.
537 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
538 (flagstest_compress_debug_sections_gnu.check): Likewise.
539 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
540 (flagstest_compress_debug_sections_gabi): Likewise.
541 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
542 (flagstest_compress_debug_sections_gnu.check): Likewise.
543 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
544 * testsuite/Makefile.in: Regenerated.
545
48058663
L
5462015-07-12 H.J. Lu <hongjiu.lu@intel.com>
547
548 PR gold/18321
549 * compressed_output.h (decompress_input_section): Add arguments
550 for ELF class, big endian and sh_flags.
551 * compressed_output.cc (decompress_input_section): Likewise.
552 Support the SHF_COMPRESSED section.
553 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
554 functions.
555 * plugin.h (Pluginobj): Likewise.
556 * layout.cc (Layout::get_output_section_flags): Also clear the
557 SHF_COMPRESSED bit.
558 * object.h (Compressed_section_info): Add flag to store sh_flags.
559 (Object): Add pure virtual elfsize and is_big_endian member
560 functions.
561 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
562 prefix here.
563 (build_compressed_section_map): Check SHF_COMPRESSED for
564 uncompressed size. Store sh_flags in Compressed_section_info.
565 Pass size, big_endian and sh_flags to decompress_input_section.
566 Skip the ".debug"/".zdebug" prefix when passing section name to
567 need_decompressed_section.
568 (Sized_relobj_file<size, big_endian>::do_find_special_section):
569 Don't check ".zdebug_*" sections.
570 (Object::decompressed_section_contents): Pass ELF class, big
571 endian and sh_flags to decompress_input_section.
572 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
573 Likewise.
574 * testsuite/Makefile.am (check_DATA): Add
575 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
576 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
577 gdb_index_test_2_gabi.stdout.
578 (debug_msg_cdebug_gabi.o): New.
579 (odr_violation1_cdebug_gabi.o): Likewise.
580 (odr_violation2_cdebug_gabi.o): Likewise.
581 (debug_msg_cdebug_gabi.err): Likewise.
582 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
583 (gdb_index_test_cdebug_gabi.o): Likewise.
584 (gdb_index_test_2_gabi): Likewise.
585 (gdb_index_test_2_gabi.stdout): Likewise.
586 * testsuite/gdb_index_test_2_gabi.sh: New file.
587 * testsuite/Makefile.in: Regenerated.
588
73854cdd
HS
5892015-07-09 Han Shen <shenhan@google.com>
590
591 Use "gold_info" instead of "gold_warning" for erratum fix.
592
593 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
594 'gold_info'.
595 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
596
61163dfa
HS
5972015-07-09 Han Shen <shenhan@google.com>
598
599 Drop missing symbol warning for arm/aarch64.
600
601 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
602 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
603 symbol warning.
604
b91deca9
HS
6052015-07-07 Han Shen <shenhan@google.com>
606
607 Make gold aarch64 accept long form of mapping symbols.
608
609 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
610 of mapping symbols.
611
15162bef
DK
6122015-06-29 Doug Kwan <dougkwan@google.com>
613
614 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
615 at address expected by test.
616 * testsuite/arm_cortex_a8_b.s: Ditto.
617 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
618 * testsuite/arm_cortex_a8_bl.s: Ditto.
619 * testsuite/arm_cortex_a8_blx.s: Ditto.
620 * testsuite/arm_cortex_a8_local.s: Ditto.
621 * testsuite/arm_fix_v4bx.s: Ditto.
622 * testsuite/arm_unaligned_reloc.s: Ditto.
623 * testsuite/thumb_bl_out_of_range.s: Ditto.
624 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
625 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 626
56b06706
HS
6272015-06-29 Han Shen <shenhan@google.com>
628
629 Patch for erratum 843419 internal error.
630
72f4393d
L
631 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
632 (Erratum_stub::update_erratum_insn): New method.
633 (Stub_table::relocate_stubs): Modified to place relocated insn.
634 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 635
2f0c79aa
HS
6362015-06-12 Han Shen <shenhan@google.com>
637
638 Fix erratum 835769.
639
72f4393d
L
640 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
641 defintion outside class definition.
642 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
643 (AArch64_insn_utilities::aarch64_op31): New member.
644 (AArch64_insn_utilities::aarch64_ra): New member.
645 (AArch64_insn_utilities::aarch64_mac): New member.
646 (AArch64_insn_utilities::aarch64_mlxl): New member.
647 (ST_E_835769): New global enum member.
648 (Stub_table::relocate_stubs): Add 835769 handler.
649 (Stub_template_repertoire::Stub_template_repertoire): Install new
650 stub type.
651 (AArch64_relobj::scan_errata): This func is renamed from
652 scan_erratum_843419.
653 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
654 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
655 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
656 (Target_aarch64::scan_erratum_835769_span): New method.
657 (Target_aarch64::create_erratum_stub): New method.
658 (Target_aarch64::is_erratum_835769_sequence): New method.
659 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
660 code into create_erratum_stub.
661 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 662
5d7908e0
CC
6632015-06-11 Cary Coutant <ccoutant@gmail.com>
664
665 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
666 outside class body.
667 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
668
dd68f8fa
CC
6692015-06-11 Cary Coutant <ccoutant@gmail.com>
670
671 PR gold/17731
672 * layout.cc (corresponding_uncompressed_section_name): New function.
673 (Layout::choose_output_section): Call it.
674 * layout.h (corresponding_uncompressed_section_name): New function.
675 * script-sections.cc (Input_section_info::set_section_name): Check
676 for compressed debug section (.zdebug style).
677
a3a0c391
JY
6782015-06-11 Jing Yu <jingyu@google.com>
679
680 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
681 * testsuite/Makefile.in: Regenerate.
682
970cdef2
DI
6832015-06-11 Davide Italiano <dccitaliano@gmail.com>
684
685 * gold.h (is_cident): Correct typo.
686
a48d0c12
HS
6872015-06-10 Han Shen <shenhan@google.com>
688 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
689
690 Now fixing for 843419 is fully functional.
691
692 The first part of the erratum fix CL is here -
693 https://sourceware.org/ml/binutils/2015-04/msg00229.html
694
695 * aarch64.cc(global enum): New constants representing stub types.
696 (Stub_template): New POD struct.
697 (Stub_template_repertoire): New class.
698 (Stub_base): New class.
699 (Erratum_stub): New class.
700 (Reloc_stub): Refactored to be a subclass of Stub_base.
701 (Reloc_stub::Stub_type): Removed.
702 (Reloc_stub::offset): Moved to Stub_base.
703 (Reloc_stub::set_offset): Moved to Stub_base.
704 (Reloc_stub::destination_address): Moved to Stub_base.
705 (Reloc_stub::set_destination_address): Moved to Stub_base.
706 (Reloc_stub::reset_destination_address): Moved to Stub_base.
707 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
708 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
709 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
710 (Reloc_stub::write): Moved to Stub_base.
711 (Reloc_stub::invalid_offset): Moved to Stub_base.
712 (Reloc_stub::invalid_address): Moved to Stub_base.
713 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
714 (Reloc_stub::stub_insns_): Moved to Stub_base.
715 (Reloc_stub::offset_): Moved to Stub_base.
716 (Reloc_stub::destination_address_): Moved to Stub_base.
717 (Stub_table::The_aarch64_relobj): New typedef.
718 (Stub_table::The_erratum_stub): New typedef.
719 (Stub_table::The_erratum_stub_less): New typedef.
720 (Stub_table::The_erratum_stub_set): New typedef.
721 (Stub_table::The_erratum_stub_set_iter): New typedef.
722 (Stub_table::empty): Added emptiness testing for erratum stubs.
723 (Stub_table::add_erratum_stub): New method to add an erratum stub.
724 (Stub_table::find_erratum_stub): New method.
725 (Stub_table::find_erratum_stubs_for_input_section): New method.
726 (Stub_table::erratum_stub_address): New method.
727 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
728 (Stub_table::do_addralign): Modified to handle erratum stubs.
729 (Stub_table::erratum_stubs_): New member.
730 (Stub_table::erratum_stub_size_): New member.
731 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
732 (Stub_table::do_write): Modified to handle erratum stubs.
733 (AArch64_relobj::The_erratum_stub): New typedef.
734 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
735 (AArch64_relobj::fix_errata): New method.
736 (Target_aarch64::The_reloc_stub_type): Removed.
737 (Target_aarch64::The_erratum_stub): New typede.
738 (AArch64_relocate_functions::construct_b): New method.
739
1e1b2efc
NC
7402015-06-08 Nick Clifton <nickc@redhat.com>
741
742 * po/fr.po: New French Translation.
743
b8cf5075
CC
7442015-06-07 Cary Coutant <ccoutant@gmail.com>
745
746 PR gold/18288
747 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
748 callers. Don't use STT_COMMON to check for common symbols.
749 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
750 symbol that's not in a common section.
751 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
752 common symbols.
753
bdd2d2b7
CC
7542015-06-04 Cary Coutant <ccoutant@gmail.com>
755
756 PR gold/18200
757 * Makefile.am (diststuff): Add target.
758 * Makefile.in: Regenerate.
759
cd3c333f
CC
7602015-06-04 Cary Coutant <ccoutant@gmail.com>
761
762 PR gold/17498
763 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
764 temporary locals in merge sections.
765 * options.cc (General_options::parse_discard_all): New method.
766 (General_options::parse_discard_locals): New method.
767 (General_options::parse_discard_none): New method.
768 (General_options::General_options): Initialize discard_locals_.
769 * options.h (--discard-all): Convert to special option.
770 (--discard-locals): Likewise.
771 (--discard-none): New option.
772 (General_options::discard_all): New method.
773 (General_options::discard_locals): New method.
774 (General_options::discard_sec_merge): New method.
775 (General_options::Discard_locals): New enum.
776 (General_options::discard_locals_): New data member.
777
8086551f
CC
7782015-06-03 Cary Coutant <cary@google.com>
779
780 * script-sections.cc (Script_sections::Script_sections): Initialize
781 segments_created_.
782 (Script_sections::create_note_and_tls_segments): Set flag when
783 segments are created.
784 (Script_sections::expected_segment_count): Count PT_INTERP.
785 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
786 segments are created.
787 * script-sections.h (Script_sections::segments_created_): New data
788 member.
789
374082df
CC
7902015-06-03 Cary Coutant <ccoutant@gmail.com>
791
792 PR gold/15370
793 * script-sections.cc
794 (Output_section_element_input::set_section_addresses): When there
795 are several patterns with no sort spec, put all sections in the same
796 bin.
797 * testsuite/Makefile.am (script_test_12): New testcase.
798 (script_test_12i): New testcase.
799 * testsuite/Makefile.in: Regenerate.
800 * testsuite/script_test_12.t: New test linker script.
801 * testsuite/script_test_12i.t: New test linker script.
802 * testsuite/script_test_12a.c: New test source file.
803 * testsuite/script_test_12b.c: New test source file.
804
775ed62e
CC
8052015-06-02 Cary Coutant <ccoutant@gmail.com>
806
807 * nacl.h (Sniff_file): Switch parameters to get_view to get an
808 aligned view.
809
9c7fe3c5
CC
8102015-06-03 Cary Coutant <ccoutant@gmail.com>
811
72f4393d
L
812 PR gold/17819
813 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
814 separate task to schedule the build id computation.
815 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
816 add Output_file and offset.
817 (Hash_task::run): Get and release the input views.
818 (Hash_task::is_runnable): Always return NULL (always runnable).
819 (Layout::queue_build_id_tasks): Remove.
820 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
821 parameters; use them instead of class members.
822 (Build_id_task_runner::run): New function.
823 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
824 to write_build_id.
825 * layout.h (Layout::queue_build_id_tasks): Remove.
826 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
827 parameters.
828 (Layout::array_of_hashes_): Remove.
829 (Layout::size_of_array_of_hashes_): Remove.
830 (Layout::input_view_): Remove.
831 (Build_id_task_runner): New class.
832 (Close_task_runner::Close_task_runner): Add array_of_hashes and
833 size_of_hashes parameters.
834 (Close_task_runner::array_of_hashes_): New data member.
835 (Close_task_runner::size_of_hashes_): New data member.
836 * testsuite/Makefile.am
837 (flagstest_compress_debug_sections_and_build_id_tree): New test.
838 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 839
400f8944
RÁE
8402015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
841
842 * merge.cc (get_input_merge_map): Update for data structure change.
843 (get_or_make_input_merge_map): Update for data structure change.
844 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
845 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
846
bbec1a5d
AM
8472015-05-16 Alan Modra <amodra@gmail.com>
848
849 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
850 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
851 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
852 (lis_0): Rename from lis_0_0.
853
efc6fa12
CC
8542015-04-29 Cary Coutant <cary@google.com>
855 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
856
857 * gc.h (Garbage_collection::is_section_garbage): Change Object*
858 to Relobj*.
859 (Garbage_collection::add_reference): Likewise.
860 (Garbage_collection::gc_process_relocs): Likewise. Don't push
861 object/shndx pair onto *secvec for dynamic objects. Don't follow
862 relocations pointing to dynamic objects for GC.
863 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
864 (Icf::unfold_section): Likewise.
865 (Icf::is_section_folded): Likewise.
866 (Icf::get_folded_section): Likewise.
867 * icf.h: (Icf::get_folded_section): Likewise.
868 (Icf::unfold_section): Likewise.
869 (Icf::is_section_folded): Likewise.
870 (Icf::section_has_function_pointers): Likewise.
871 (Icf::set_section_has_function_pointers): Likewise.
872 * object.h (Section_id): Likewise.
873 (Const_section_id): Likewise.
874 * output.cc (Output_section::update_section_layout): Likewise.
875 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
876 Likewise.
877 * plugin.cc (update_section_order): Likewise.
878 (unique_segment_for_sections): Likewise.
879 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
880 (Target_powerpc::do_gc_add_reference): Likewise.
881 (Target_powerpc::gc_process_relocs): Likewise.
882 (Target_powerpc::do_gc_add_reference): Likewise.
883 * symtab.cc (Symbol_table::is_section_folded): Likewise.
884 (Symbol_table::gc_mark_symbol): Likewise.
885 * symtab.h: (Symbol_table::is_section_folded): Likewise.
886 * target.h: (Sized_target::gc_add_reference): Likewise.
887 (Sized_target::do_gc_add_reference): Likewise.
888
f9d3ecaa
NC
8892015-04-29 Nick Clifton <nickc@redhat.com>
890
891 * po/fi.po: Updated Finnish translation.
892
faa2211d
AM
8932015-04-28 Alan Modra <amodra@gmail.com>
894
895 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
896 than unsigned int for find_global_entry result temp. Compare
897 against invalid_address.
898 (Target_powerpc::do_plt_address_for_global): Likewise.
899 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
900 on plt call stub existence for debug info. Do assert for plt
901 and global entry stub existence if an alloc section.
902
6ec65f28
AM
9032015-04-28 Alan Modra <amodra@gmail.com>
904
905 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
906 on missing global entry stub due to bogus debug info.
907
7a2a1c79
HS
9082015-04-27 Han Shen <shenhan@google.com>
909
910 * options.h (--fix-cortex-a53-843419): Rename option.
911 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
912 option.
913 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
914
cfbf0e3c
RÁE
9152015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
916
917 PR gold/18327
918 * output.cc (Output_section::is_input_address_mapped): Assume a missing
919 entry is mapped.
920 * testsuite/Makefile.am: Add the eh_test test.
921 * testsuite/Makefile.in: Regenerate.
922 * testsuite/eh_test_a.cc: New test.
923 * testsuite/eh_test_b.cc: New test.
924
6ec65f28
AM
9252015-04-23 Sriraman Tallam <tmsriram@google.com>
926
a100d66f
ST
927 * options.h (--weak-unresolved-symbols): New option.
928 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
929 binding to weak with new option.
930 * symtab.h (is_weak_undefined): Check for new option.
931 (is_strong_undefined): Check for new option.
932 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
933 * testsuite/Makefile.in: Regenerate.
934 * testsuite/weak_unresolved_symbols_test.cc: New file.
935
4b889c30
IC
9362015-04-20 Ian Coolidge <icoolidge@google.com>
937
938 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
939 GNU_UNIQUE.
940
4277535c
RÁE
9412015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
942
943 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
944 push_back.
945 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
946 * object.cc (Sized_relobj_file::do_layout): Use push_back.
947 * powerpc.cc (process_gc_mark): Use push_back.
948 (Target_powerpc::do_gc_mark_symbol): Use push_back.
949 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
950
7a2a1c79 9512015-04-16 Han Shen <shenhan@google.com>
5019d64a 952
6ec65f28
AM
953 * aarch64.cc (AArch64_insn_utilities): New utility class.
954 (AArch64_relobj::Mapping_symbol_position): New struct.
955 (AArch64_relobj::Mapping_symbol_info): New typedef.
956 (AArch64_relobj::do_count_local_symbols): New function overriding
957 parent's implementation.
958 (AArch64_relobj::mapping_symbol_info_): New member
959 (AArch64_relobj::scan_erratum_843419): New method.
960 (Target_aarch64::scan_erratum_843419_span): New method.
961 (Target_aarch64::is_erratum_843419_sequence): New method.
962 * options.h (fix_cortex_a53): New option.
5019d64a 963
a6a17750
CC
9642015-04-09 Cary Coutant <ccoutant@google.com>
965
966 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
967 in a PIE link.
968 * testsuite/Makefile.am (tls_pie_test.sh): New test.
969 * testsuite/Makefile.in: Regenerate.
970 * testsuite/tls_pie_test.sh: New.
971
437ddf0c
CC
9722015-04-09 Cary Coutant <ccoutant@google.com>
973
974 * debug.h (DEBUG_LOCATION): New.
975 (DEBUG_ALL): Include DEBUG_LOCATION.
976 (debug_string_to_enum): Add DEBUG_LOCATION.
977 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
978 output to print correct context.
979 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
980 up to 4 more locations at the beginning of the function.
981 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
982 result before sorting list of line numbers.
983 * testsuite/debug_msg.sh: Allow range of line numbers for
984 canonical results on optimized code.
985
24491327
HS
9862015-04-07 HC Yen <hc.yen@mediatek.com>
987
988 Add AArch32 support for gold linker.
989 gold/
990 * arm.cc: Add V8 arch combine table.
991
7fa5525f
RÁE
9922015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
993
994 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
995
5368dcf2
RÁE
9962015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
997
998 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
999 to find by using the return value of insert.
1000
9dbb4b02
RÁE
10012015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1002
1003 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1004 constructor call.
1005
1fa29f10
IT
10062015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1007
1008 PR gold/17641
1009 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1010 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1011 can convert mov to lea.
1012 (Target_x86_64::Scan::global): Ditto.
1013 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1014 %reg to lea foo(%rip), %reg if possible.
1015 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1016 * testsuite/x86_64_mov_to_lea1.s: New.
1017 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1018 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1019 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1020 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1021
39f3de7c
L
10222015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1023
1024 * configure: Regenerated.
1025
c4fc4724
IT
10262015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1027
1028 PR gold/17640
1029 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1030 (Target_i386::Scan::local): Don't create GOT entry, when we
1031 can convert GOT to GOTOFF.
1032 (Target_i386::Scan::global): Ditto.
1033 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1034 lea foo@GOTOFF(%reg), %reg if possible.
1035 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1036 * testsuite/i386_mov_to_lea1.s: New.
1037 * testsuite/i386_mov_to_lea2.s: Ditto.
1038 * testsuite/i386_mov_to_lea3.s: Ditto.
1039 * testsuite/i386_mov_to_lea4.s: Ditto.
1040 * testsuite/i386_mov_to_lea5.s: Ditto.
1041 * testsuite/i386_mov_to_lea.sh: Ditto.
1042
918357b9
L
10432015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1044
1045 * Makefile.am (ZLIB): New.
1046 (ZLIBINC): Likewise.
1047 (AM_CFLAGS): Add $(ZLIBINC).
1048 (AM_CXXFLAGS): Likewise.
1049 (ldadd_varldadd_var): Add $(ZLIB).
1050 (incremental_dump_LDADD): Likewise.
1051 (dwp_LDADD): Likewise.
1052 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1053 <zlib.h>.
1054 (zlib_compress): Don't check HAVE_ZLIB_H.
1055 (zlib_decompress): Likewise.
1056 * options.h (compress_debug_sections): Likewise.
1057 * configure.ac (AM_CONDITIONAL): Removed.
1058 * testsuite/Makefile.am (ZLIB): New.
1059 (LDADD): Add $(ZLIB).
1060 Don't check HAVE_ZLIB.
1061 * Makefile.in: Regenerated.
1062 * config.in: Likewise.
1063 * configure: Likewise.
1064 * testsuite/Makefile.in: Likewise.
1065
6b0ad2eb
JY
10662015-03-30 Jing Yu <jingyu@google.com>
1067
1068 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1069 TLSLD_ADD_DTPREL_LO12_NC.
1070 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1071 _TLS_MODULE_BASE_ point to the start of tls segment.
1072 (Target_aarch64::optimize_tls_reloc): Add cases for
1073 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1074 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1075 (Target_aarch64::Scan::local): Likewise.
1076 (Target_aarch64::Scan::global): Likewise.
1077 (Target_aarch64::Relocate::relocate): Likewise.
1078 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1079 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1080 relocations.
1081
0916f9e7
RÁE
10822015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1083
1084 * merge.cc (Object_merge_map::add_mapping): call
1085 Object_merge_map::Input_merge_map::add_mapping.
1086 (Object_merge_map::Input_merge_map::add_mapping): New.
1087 (Output_merge_data::do_add_input_section): Call
1088 get_or_make_input_merge_map before a loop.
1089 (Output_merge_string<Char_type>::finalize_merged_data): Call
1090 get_or_make_input_merge_map before a loop.
1091 * merge.h (Object_merge_map): Make Input_merge_map public.
1092 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1093 (Relobj::get_or_create_merge_map): New.
1094 * object.h (Relobj::get_or_create_merge_map): New.
1095
282c9750
AM
10962015-03-24 Alan Modra <amodra@gmail.com>
1097
1098 PR 18147
1099 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1100 relocation errors for branches to strong undefined symbols.
1101
67f95b96
RÁE
11022015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1103
1104 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1105 (Object_merge_map::is_merge_section_for): Remove.
1106 (Object_merge_map::find_merge_section): New.
1107 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1108 (Object_merge_map::find_merge_section): New.
1109 (Object_merge_map::get_input_merge_map): Add a const version.
1110 * object.cc (Relobj::is_merge_section_for): Remove.
1111 (Relobj::find_merge_section): New.
1112 * object.h (Relobj::is_merge_section_for): Remove.
1113 (Relobj::find_merge_section): New.
1114 * output.cc
1115 (Output_section::Input_section::is_merge_section_for): Remove.
1116 (Output_section::add_merge_input_section): Don't call
1117 add_merge_input_section.
1118 (Output_section::find_merge_section): Return const. Use
1119 object->find_merge_section.
1120 (Output_section::build_lookup_maps): Don't build a map for
1121 merge sections.
1122 (Output_section::is_input_address_mapped): Return false if
1123 section is not found.
1124 (Output_section::find_starting_output_address): Use
1125 find_merge_section instead of is_merge_section_for.
1126 (Output_section::add_script_input_section): Don't build a map for
1127 merge sections.
1128 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1129 (Output_section_lookup_maps::find_merge_section): Remove.
1130 (Output_section_lookup_maps::add_merge_input_section) Remove.
1131 (Output_section::find_merge_section): Return const.
1132
152f7024
CC
11332015-03-22 Cary Coutant <cary@google.com>
1134
1135 PR gold/18106
1136 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1137 non-SIB form of lea, with nop after the call.
1138
bccffdfd
CC
11392015-03-21 Cary Coutant <cary@google.com>
1140
1141 PR gold/14217
1142 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1143 .tdata section.
1144 (Output_segment::set_section_addresses): Don't align size of relro
1145 segment for .tbss.
1146
1c582fe7
CC
11472015-03-21 Cary Coutant <cary@google.com>
1148
1149 PR gold/18010
1150 * stringpool.cc (Stringpool_template): Don't optimize if section
1151 alignment is greater than sizeof(char).
1152
410da591
CC
11532015-03-21 Cary Coutant <cary@google.com>
1154
1155 PR gold/18048
1156 * script-c.h (script_include_directive): Add first_token parameter.
1157 * script.cc (script_include_directive): Add first_token parameter, and
1158 pass it to read_script_file.
1159 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1160 (PARSING_MEMORY_DEF): New tokens.
1161 (top): Add new productions for INCLUDE files.
1162 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1163 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1164 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1165 (section_cmd): Pass PARSING_SECTION_CMDS.
1166 (file_or_sections_cmd): Remove.
1167 (memory_def): Pass PARSING_MEMORY_DEF.
1168 * testsuite/Makefile.am (memory_test_2): New test.
1169 * testsuite/Makefile.in: Regenerate.
1170 * testsuite/memory_test_inc.t: New script file.
1171 * testsuite/memory_test_inc_1.t.src: New script file.
1172 * testsuite/memory_test_inc_2.t.src: New script file.
1173 * testsuite/memory_test_inc_3.t.src: New script file.
1174
0d5bbdb0
CC
11752015-03-21 Cary Coutant <cary@google.com>
1176
1177 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1178 (Sized_relobj_dwo::setup): Build compressed section map.
1179 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1180 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1181 section map.
1182 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1183 compressed_sections_ field.
1184 (build_compressed_section_map): Take Object instead of
1185 Sized_relobj_file parameter; add decompress_if_needed parameter.
1186 (Sized_relobj_file::do_find_special_sections): Store compressed
1187 section map in parent Object.
1188 (Sized_relobj_file::do_decompressed_section_contents): Move
1189 implementation to Object::decompressed_section_contents.
1190 (Sized_relobj_file::do_discard_decompressed_sections): Move
1191 implementation to Object::discard_decompressed_sections.
1192 * object.h (build_compressed_section_map): Declare.
1193 (Object::Object): Add compressed_sections_ field.
1194 (Object::section_is_compressed): Move implementation here.
1195 (Object::decompressed_section_contents): De-virtualize.
1196 (Object::discard_decompressed_sections): De-virtualize.
1197 (Object::do_section_is_compressed): Delete.
1198 (Object::do_decompressed_section_contents): Delete.
1199 (Object::set_compressed_sections): New method.
1200 (Object::compressed_sections): New method.
1201 (Object::compressed_sections_): New data member.
1202 (Compressed_section_info, Compressed_section_map): Move to top of file.
1203 (Sized_relobj_file::do_section_is_compressed): Delete.
1204 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1205 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1206 (Sized_relobj_file::compressed_sections_): Move to Object class.
1207
bd9e0d46
CC
12082015-03-21 Cary Coutant <ccoutant@google.com>
1209
1210 PR gold/18152
1211 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1212 deferred objects.
1213
943c8b43
CC
12142015-03-11 Cary Coutant <ccoutant@google.com>
1215
1216 * options.cc (General_options::finalize): Don't allow -z relro
1217 with incremental linking.
1218 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1219 (incremental_test_2): Likewise.
1220 (incremental_test_3): Likewise.
1221 (incremental_test_4): Likewise.
1222 (incremental_test_5): Likewise.
1223 (incremental_test_6): Likewise.
1224 (incremental_copy_test): Likewise.
1225 (incremental_common_test_1): Likewise.
1226 (incremental_comdat_test_1): Likewise.
1227 * testsuite/Makefile.in: Regenerate.
1228
e1663197
CC
12292015-03-09 Cary Coutant <ccoutant@google.com>
1230
1231 PR gold/14675
1232 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1233 return enum indicating whether .eh_frame section is empty, optimizable,
1234 unrecognized, or an end marker. Adjust explicit instantiations.
1235 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1236 (Eh_frame::add_ehframe_input_section): Change return type.
1237 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1238 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1239 to the .eh_frame output section until we see the end marker.
1240 (Layout::finalize_eh_frame_section): New.
1241 * layout.h: (Layout::finalize_eh_frame_section): New.
1242
beb8418f
L
12432015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1244
1245 * output.cc (Relobj::initialize_input_to_output_map<size>):
1246 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1247
48c73428
CC
12482015-03-04 Cary Coutant <ccoutant@google.com>
1249
1250 * parameters.cc (Parameters::set_target_once): Call
1251 Target::select_as_default_target just once from here...
1252 (set_parameters_target): ...instead of from here.
1253
12542015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1255
1256 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1257 Output_section_data instead of a Merge_map.
1258 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1259 (Eh_frame::read_cie): Use add_merge_mapping instead of
1260 Merge_map::add_mapping.
1261 (Eh_frame::read_fde): Ditto.
1262 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1263 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1264 merge_map_->get_output_offset.
1265 (Eh_frame::do_is_merge_section_for): Delete.
1266 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1267 instead of a Merge_map.
1268 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1269 Merge_map.
1270 (Eh_frame::do_is_merge_section_for): Delete.
1271 (Eh_frame::merge_map_): Delete.
1272 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1273 and use a Output_section_data instead of a Merge_map.
1274 (Object_merge_map::add_mapping): Ditto.
1275 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1276 (Object_merge_map::is_merge_section_for): Pass in and use a
1277 Output_section_data instead of a Merge_map.
1278 (Merge_map): Delete.
1279 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1280 of merge_map_.get_output_offset.
1281 (Output_merge_base::do_is_merge_section_for): Delete.
1282 (Output_merge_data::do_add_input_section): Use
1283 object->add_merge_mapping instead of add_mapping.
1284 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1285 * merge.h (Merge_map): Delete forward declaration.
1286 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1287 instead of a Merge_map.
1288 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1289 (Object_merge_map::is_merge_section_for): Pass in and use a
1290 Output_section_data instead of a Merge_map.
1291 (Input_merge_map::Object_merge_map::merge_map): Replace with
1292 output_data.
1293 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1294 Output_section_data instead of a Merge_map.
1295 (Merge_map): Delete.
1296 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1297 (Output_merge_base::do_is_merge_section_for): Delete.
1298 (Output_merge_base::add_mapping): Delete.
1299 (Output_merge_base::merge_map_): Delete.
1300 * object.cc (Relobj::initialize_input_to_output_map): New.
1301 (Relobj::initialize_input_to_output_map): New.
1302 (Relobj::merge_output_offset): New.
1303 (Relobj::is_merge_section_for): New.
1304 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1305 bits.
1306 * object.h (Relobj::merge_map): Delete.
1307 (initialize_input_to_output_map): New.
1308 (set_merge_map): Delete.
1309 (add_merge_mapping): New.
1310 (merge_output_offset): New.
1311 (is_merge_section_for): New.
1312 * output.cc (Output_section::Input_section::is_merge_section_for):
1313 Use object->is_merge_section_for.
1314 * output.h (Output_section_data::is_merge_section_for): Delete.
1315 (Output_section_data::do_is_merge_section_for): Delete.
1316 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1317 Use object->initialize_input_to_output_map.
1318 (Merged_symbol_value<size>::value_from_output_section): Use
1319 object->merge_output_offset.
1320
48c73428 13212015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1322 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1323
1324 * output.cc (Output_section::add_merge_input_section): Do not
1325 attempt to merge sections with an entsize of 0.
1326
48c73428 13272015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1328
1329 * attributes.h (class Output_attributes_section_data ): Add
1330 do_print_to_mapfile function.
1331
ec86f434
AM
13322015-02-24 Alan Modra <amodra@gmail.com>
1333
1334 PR 18010
1335 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1336 complain if value is not a multiple of four.
1337 (Target_powerpc::Relocate::relocate): Correct handling of
1338 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1339
be66981e
L
13402015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1341
1342 * configure.ac (default_size): Set to 32 for x32.
1343 * configure: Regenerated.
1344
e3ee8ed4
AM
13452015-02-18 Alan Modra <amodra@gmail.com>
1346
1347 PR 17954
1348 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1349 visibility.
1350
3a935c6c
RÁE
13512015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1352
1353 * gc.h (Garbage_collection::add_reference): Don't use find.
1354
e0a1e121
RÁE
13552015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1356
1357 * object.cc (write_local_symbols): avoid std::vector copy.
1358
45a4fb1a
RÁE
13592015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1360
1361 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1362
2d9afefe
MW
13632015-02-09 Mark Wielaard <mjw@redhat.com>
1364
1365 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1366 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1367
e9c1bdad
CC
13682015-02-16 Cary Coutant <ccoutant@google.com>
1369
1370 PR gold/13577
1371 PR gold/16992
1372 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1373 DF_SYMBOLIC if --dynamic-list option is used.
1374 * options.cc (General_options::finalize): --dynamic-list is not
1375 mutually exclusive with -Bsymbolic.
1376 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1377 listed in --dynamic-list.
1378 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1379 -Bsymbolic-functions.
1380 * testsuite/Makefile.in: Regenerate.
1381
0ed4b0bf
CC
13822015-02-16 Cary Coutant <ccoutant@google.com>
1383
1384 PR gold/17971
1385 * incremental.cc: Remove redundant include of "output.h".
1386
1a920511
JY
13872015-02-12 Jing Yu <jingyu@google.com>
1388
1389 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1390 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1391 New relocation.
1392 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1393 TLSLE_MOVW_* relocations.
1394 (Target_aarch64::Scan::global): Likewise.
1395 (Target_aarch64::Relocate::relocate): Likewise.
1396 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1397 for new TLSLE_MOVW_* relocations.
1398
07f107f3
WN
13992015-02-11 Will Newton <will.newton@linaro.org>
1400
1401 PR gold/13321
1402 * arm.cc (Target_arm::make_plt_section): Create an ARM
1403 state mapping symbol at the start of the PLT.
1404
e051a5b5
L
14052015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1406
1407 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1408 Replace two_file_shared_2.so with two_file_shared_1.so.
1409 * testsuite/Makefile.in: Regenerated.
1410
dddcc5b9
AM
14112015-02-09 Alan Modra <amodra@gmail.com>
1412
1413 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1414 plugin_test_thin.a and defsym_test.
1415 * testsuite/Makefile.in: Regenerate.
1416
b39b8b9d
RÁE
14172015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1418
1419 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1420 body.
1421
b66d1c52
CC
14222015-02-04 Peter Collingbourne <pcc@google.com>
1423
1424 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1425 forwarding symbols when computing symbol resolution info for plugins.
1426 * plugin.h (Plugin_manager::symtab): New method.
1427 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1428
23081de0
CC
14292015-02-03 Cary Coutant <ccoutant@google.com>
1430 Peter Collingbourne <pcc@google.com>
1431
1432 PR gold/15660
1433 * archive.cc (Thin_archive_object_unlocker): New class.
1434 (Archive::include_member): Unlock external members of thin archives.
1435 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1436 (plugin_test_2): Likewise.
1437 (plugin_test_3): Likewise.
1438 (plugin_test_4): Likewise.
1439 (plugin_test_5): Likewise.
1440 (plugin_test_6): Likewise.
1441 (plugin_test_7): Likewise.
1442 (plugin_test_8): Likewise.
1443 (plugin_test_9): Likewise.
1444 (plugin_test_10): Likewise.
1445 (plugin_test_11): New test case.
1446 * testsuite/Makefile.in: Regenerate.
1447 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1448 file to decide whether to claim file.
1449 (all_symbols_read_hook): Likewise.
1450 * testsuite/plugin_test_1.sh: Adjust expected output.
1451 * testsuite/plugin_test_2.sh: Likewise.
1452 * testsuite/plugin_test_3.sh: Likewise.
1453 * testsuite/plugin_test_6.sh: Likewise.
1454 * testsuite/plugin_test_tls.sh: Likewise.
1455 * testsuite/plugin_test_11.sh: New testcase.
1456
14572015-02-03 Cary Coutant <ccoutant@google.com>
1458
1459 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1460 file descriptors when debugging enabled. Add debug output.
1461 (Descriptors::release): Add debug output.
1462 (Descriptors::close_some_descriptor): Likewise.
1463 (Descriptors::close_all): Likewise.
1464 * fileread.cc (File_read::lock): Likewise.
1465 (File_read::unlock): Likewise.
1466
24dd5808
CC
14672015-02-02 Cary Coutant <ccoutant@google.com>
1468
1469 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1470 executable output file.
1471
fa89cc82
HS
14722015-01-22 Han Shen <shenhan@google.com>
1473
1474 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1475 (Target_arm::do_plt_address_for_global): New method.
1476 (Target_arm::do_plt_address_for_local): New method.
1477 (Target_arm::rel_irelative_section): New method.
1478 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1479 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1480 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1481 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1482 (Target_arm::Scan::check_non_pic): Add ifunc support.
1483 (Target_arm::Scan::local): Add ifunc support.
1484 (Target_arm::Scan::global): Add ifunc support.
1485 (Target_arm::make_plt_section): New method.
1486 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1487 (Target_arm::make_local_ifunc_plt_entry): New method.
1488 (Target_arm::got_irelative_): New member.
1489 (Target_arm::rel_irelative_): New member.
1490 (Target_arm::got_section): Add creation for got_irelative_.
1491 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1492 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1493 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1494 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1495 (Output_data_plt_arm::IRelative_data): New type.
1496 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1497 (Output_data_plt_arm::add_entry): Add more parameters.
1498 (Output_data_plt_arm::add_relocation): New method.
1499 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1500 (Output_data_plt_arm::rel_irelative): New method.
1501 (Output_data_plt_arm::entry_count): Modified.
1502 (Output_data_plt_arm::address_for_global): New method.
1503 (Output_data_plt_arm::address_for_local): New method.
23081de0 1504gold/
fa89cc82
HS
1505 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1506 (Output_data_plt_arm::insert_irelative_data): New method.
1507 (Output_data_plt_arm::irelative_rel_): New member.
1508 (Output_data_plt_arm::got_): New member.
1509 (Output_data_plt_arm::got_irelative_): New member.
1510 (Output_data_plt_arm::irelative_count_): New member.
1511 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1512 (Output_data_plt_arm::irelative_data_vec_): New member.
1513 (Output_data_plt_arm::do_write): Write out irelative entries.
1514 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1515 more parameters to ctor.
1516 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1517 more parameters to ctor.
1518 * output.h (Output_data_reloc::add_local_relative): New method.
1519 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1520
0f81d3f0
AM
15212015-01-29 Alan Modra <amodra@gmail.com>
1522
1523 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1524 and GOT_TLSGD to LE optimization.
1525
65d92137
CC
15262015-01-28 Cary Coutant <ccoutant@google.com>
1527
1528 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1529 for undef TLS symbols.
1530 (Target_x86_64::Relocate::relocate_tls): Likewise.
1531 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1532
5485698a
CC
15332015-01-25 Cary Coutant <ccoutant@google.com>
1534
1535 * output.cc (Output_segment::set_section_addresses): Fix calculation
1536 of size of relro segment.
1537
b01a4b04
AM
15382015-01-22 Alan Modra <amodra@gmail.com>
1539
1540 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1541 condition for need of ifunc plt entry.
1542 (Target_powerpc::Scan::global <got relocs>): Likewise.
1543
3d0064a9
CC
15442015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1545
1546 * mips.cc (reloc_high): Add r_sym.
1547 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1548 reloc_high constructor.
1549 (Mips_relocate_functions::relgot16_local): Likewise.
1550 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1551 r_type to decide whether LO16 matches HI16.
1552 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1553 rello16 and relgot16_local.
1554
a5cd8f05
CC
15552015-01-09 Cary Coutant <ccoutant@google.com>
1556
1557 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1558 unless alignment is larger than page size.
1559
4fc1b9d4
L
15602015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1561 Cary Coutant <ccoutant@google.com>
1562
1563 PR gold/17729
1564 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1565 (DEFAULT_TARGET_X32): Set for x32.
1566 * x86_64.cc (cmp_insn_32): New.
1567 (lea_r10_insn_32): Likewise.
1568 (lea_r11_insn_32): Likewise.
1569 (cmp_insn_64): Likewise.
1570 (lea_r10_insn_64): Likewise.
1571 (lea_r11_insn_64): Likewise.
1572 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1573 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1574 (check_DATA): Add split_x32 files.
1575 (split_x32_[1234n].o): New targets.
1576 (split_x32_[124]): New targets.
1577 (split_x32_[1234r].stdout): New targets.
1578 * testsuite/split_x32.sh: New file.
1579 * testsuite/split_x32_1.s: Likewise.
1580 * testsuite/split_x32_2.s: Likewise.
1581 * testsuite/split_x32_3.s: Likewise.
1582 * testsuite/split_x32_4.s: Likewise.
1583 * testsuite/split_x32_n.s: Likewise.
1584 * configure: Regenerated.
1585 * testsuite/Makefile.in: Likewise.
1586
e749cab8
L
15872015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1588
1589 PR gold/17809
1590 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1591 x32.
1592
af759df0
AM
15932015-01-02 Alan Modra <amodra@gmail.com>
1594
1595 * version.cc (print_version): Just print current year.
1596 * dwp.cc (print_version): Likewise.
1597
b90efa5b
AM
15982015-01-01 Alan Modra <amodra@gmail.com>
1599
1600 Update year range in copyright notice of all files.
1601
f12d1e8a
AM
16022014-12-25 Alan Modra <amodra@gmail.com>
1603
1604 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1605 new enums.
1606 (Target_arm::merge_object_attributes, ): Likewise.
1607
5c294fee
TG
16082014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1609
1610 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1611 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1612 AEABI_VFP_args_vfp to check that.
1613 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1614 value and replace hardcoded values by enum values.
1615
e30880c2
CC
16162014-12-22 Cary Coutant <ccoutant@google.com>
1617
1618 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1619
bd040da1
L
16202014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1621
1622 PR gold/14608
1623 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1624 to "return i * i * 3;".
1625
e02a4046
CC
16262014-12-16 Cary Coutant <ccoutant@google.com>
1627
1628 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1629 (Mapfile::print_output_data): Use current_data_size() to avoid
1630 assert for sections requiring postprocessing; if address is not valid,
1631 print 0.
1632 (Mapfile::print_output_section): Use current_data_size(); print note
1633 that addresses and sizes are before compression.
1634
add6016b
L
16352014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1636
1637 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1638 Cast current_group_size to unsigned long when reporting error.
1639
0bf32ea9
JY
16402014-12-10 Jing Yu <jingyu@google.com>
1641
1642 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1643 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1644 Update error message.
1645 (Target_aarch64::do_relax): Use absolute value of option
1646 stub_group_size. Replace local variable with class member
1647 stub_group_size_.
1648
cbcb23fa
AM
16492014-12-04 Alan Modra <amodra@gmail.com>
1650
1651 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1652 addend of PLTREL24 reloc when not generating a plt stub. Make
1653 max_branch_offset an "Address".
fbad6518 1654 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1655 (Target_powerpc::Relocate::relocate): Likewise.
1656
1611bc4a
AM
16572014-12-04 Alan Modra <amodra@gmail.com>
1658
1659 PR 17670
1660 * symtab.cc (Symbol::set_undefined): Remove assertion.
1661 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1662 on symbols defined in discarded sections, instead return false.
1663 Rearrange params, update all callers.
1664 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1665 branches to syms in discarded sections.
1666 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1667 undefined and flag as discarded.
1668 (Target_powerpc::Relocate::relocate): Localize variable.
1669
4759c34e
L
16702014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1671
1672 PR gold/17675
1673 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1674 * testsuite/Makefile.in: Regenerated.
1675
1f98a074
AM
16762014-12-03 Alan Modra <amodra@gmail.com>
1677
1678 PR 17566
1679 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1680 when adding dynamic relocations against section symbols.
1681
fb257835
DI
16822014-12-01 Dimitry Ivanov <dimitry@google.com>
1683
1684 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1685 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1686 * options.h (General_options): New -z option (global).
1687
d8e60314
CC
16882014-12-01 Cary Coutant <ccoutant@google.com>
1689
1690 PR gold/17578
1691 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1692 is given.
1693 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1694 given but some inputs require executable stack.
1695
982bbd97
CC
16962014-11-26 Cary Coutant <ccoutant@google.com>
1697
1698 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1699 .debug_str_offsets; strip .debug_gnu_pubnames and
1700 .debug_gnu_pubtypes.
1701 (lines_only_debug_sections): Strip all four new sections.
1702
bb779192
HS
17032014-11-26 Jing Yu <jingyu@google.com>
1704
1705 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1706 register to be x0 when to relax TLSDESC_LD64_LO12.
1707
a3e60ddb
AM
17082014-11-26 Alan Modra <amodra@gmail.com>
1709
1710 * powerpc.cc (struct Stub_table_owner): New.
1711 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1712 unsigned int vector. Update all references.
1713 (powerpc_relobj::set_stub_table): Take an unsigned int param
1714 rather than a Stub_table. Update callers.
1715 (Powerpc_relobj::clear_stub_table): New function.
1716 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1717 stub_group_size_ vars.
1718 (Target_powerpc::new_stub_table): Delete.
1719 (max_branch_delta): New function, extracted from..
1720 (Target_powerpc::Relocate::relocate): ..here..
1721 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1722 status on whether stub created successfully.
1723 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1724 default sizing to..
1725 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1726 reduce on relax failure.
1727 (Target_powerpc::group_sections): Add "no_size_errors" param.
1728 Use stub_group_size_. Set up group info in a temp vector,
1729 before building Stub_table vector. Account for input sections
1730 possibly already converted to relaxed sections.
1731 (Stub_table::init): Delete. Merge into..
1732 (Stub_table::Stub_table): ..here.
1733 (Stub_table::can_reach_stub): New function.
1734 (Stub_table::add_plt_call_entry): Add "from" parameter and
1735 return true iff stub could be reached.
1736 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1737 param too.
1738 (Stub_table::clear_stubs): Add "all" param.
1739
a20605cf
AM
17402014-11-26 Alan Modra <amodra@gmail.com>
1741
1742 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1743 (Target_powerpc::group_sections): Use it.
1744
43b64deb
CC
17452014-11-25 Cary Coutant <ccoutant@google.com>
1746
1747 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1748 (Binary_to_elf::write_symbol): Add st_size parameter.
1749 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1750
c924eb67
CC
17512014-11-25 Cary Coutant <ccoutant@google.com>
1752
1753 PR gold/17639
1754 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1755 (Sized_relobj_file::do_layout): Handle deferred sections properly
1756 during GC pass 1. Don't add reloc sections to deferred list twice.
1757 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1758 (Sized_relobj_file::is_deferred_layout_): New data member.
1759
9d585188
L
17602014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1761
1762 PR gold/17619
1763 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1764 Check PC-relative offset overflow in PLT entry.
1765
3ffaac20
AM
17662014-11-21 Alan Modra <amodra@gmail.com>
1767
1768 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1769 for undefined weaks.
1770
0cfb0717
AM
17712014-11-20 Alan Modra <amodra@gmail.com>
1772
1773 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1774 from --stub-group-size parameter divided by 1024.
1775 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1776 template parameter. Update all uses.
1777 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1778 has_stub_value. Set for long branches. Don't report overflow for
1779 branch to undefined weak symbols. Print info message on
1780 overflowing branch to stub.
1781
f9dffbf0
AM
17822014-11-20 Alan Modra <amodra@gmail.com>
1783
1784 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1785
e88ba8d5
L
17862014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1787
1788 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1789 entry for R_X86_64_GOTPLT64.
1790 (Target_x86_64<size>::Relocate::relocate): Update comments for
1791 R_X86_64_GOTPLT64.
1792
d37ffe25
ED
17932014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1794
1795 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1796 * plugin.h: add lock definition
1797
9726c3c1
HS
17982014-10-29 Han Shen <shenhan@google.com>
1799 Jing Yu <jingyu@google.com>
1800
1801 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1802 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1803 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1804 Symbol::TLS_REF.
1805 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1806 method.
1807 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1808 (Target_aarch64::tls_ld_to_le): New method.
1809 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1810 for 64bit targets.
1811 (Output_data_plt_aarch64::irelative_rel_): New data member.
1812 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1813 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1814 (Output_data_plt_aarch64::add_relocation): New method.
1815 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1816 offset. Add got_irelative size to got size.
1817 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1818 type string with the new typename.
1819 (AArch64_relocate_functions::update_adr): Replace parameter x with
1820 immed.
1821 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1822 (AArch64_relocate_functions::reloc_common): New method.
1823 (AArch64_relocate_funcsions::rela_general): Extract common part out
1824 into reloc_common method.
1825 (AArch64_relocate_functions::rela_general): Likewise.
1826 (AArch64_relocate_functions::pcrela_general): Likewise.
1827 (AArch64_relocate_functions::adr): New method.
1828 (AArch64_relocate_functions::adrp): Calculate immed before calling
1829 update_adr.
1830 (AArch64_relocate_functions::adrp): Likewise.
1831 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1832 comparing x to 0. Calculate immed from ~x when x < 0.
1833 (Target_aarch64::optimize_tls_reloc): Add new cases for
1834 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1835 TLSLD_MOVW_DTPREL_G0_NC.
1836 (Target_aarch64::possible_function_pointer_reloc): Implement this
1837 method.
1838 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1839 comment.
1840 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1841 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1842 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1843 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1844 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1845 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1846 (Target_aarch64::make_plt_entry): Call add_entry with two more
1847 parameters.
1848 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1849 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1850 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1851 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1852 (Target_aarch64::Relocate::relocate_tls): Add cases for
1853 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1854 TLSLD_MOVW_DTPREL_G0_NC.
1855 * testsuite/icf_safe_so_test.cc: Correct test comment.
1856 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1857
80272b8c
AM
18582014-10-22 Alan Modra <amodra@gmail.com>
1859
1860 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1861 thread_starter.
1862
998a69f4
AS
18632014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1864
1865 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1866
aed56ec5
CC
18672014-10-17 Cary Coutant <ccoutant@google.com>
1868
1869 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1870 Add "typename" keyword.
1871
bb779192 18722014-10-15 Han Shen <shenhan@google.com>
72f4393d 1873 Jing Yu <jingyu@google.com>
83a01957
HS
1874
1875 Patch for gold aarch64 backend to support relaxation.
1876 * aarch64-reloc.def: Change format.
1877 * aarch64.cc (class Reloc_stub): New class.
1878 (class Stub_table): New class.
1879 (class AArch64_relobj): New class.
1880 (class AArch64_input_section): New class.
1881 (class AArch64_output_section): New class.
1882 (Target_aarch64::new_stub_table): New method.
1883 (Target_aarch64::new_aarch64_input_section): New method.
1884 (Target_aarch64::find_aarch64_input_section): New method.
1885 (Target_aarch64::scan_section_for_stubs): New method.
1886 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1887 (Target_aarch64::relocate_stub): New method.
1888 (Target_aarch64::current_target): New method.
1889 (Target_aarch64::do_make_elf_object): New method.
1890 (Target_aarch64::do_may_relax): New method.
1891 (Target_aarch64::do_relax): New method.
1892 (Target_aarch64::group_sections): New method.
1893 (Target_aarch64::scan_reloc_for_stub): New method.
1894 (Target_aarch64::do_make_output_section): New method.
1895 (Target_aarch64::stub_tables_): New data member.
1896 (Target_aarch64::aarch64_input_section_map_): New data member.
1897 (AArch64_relocate_functions::maybe_apply_stub): New method.
1898
db4c9594
CC
18992014-09-30 Cary Coutant <ccoutant@google.com>
1900
1901 PR gold/17432
1902 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1903
cd6da036
KC
19042014-09-30 Kito Cheng <kito@0xlab.org>
1905
1906 PR gold/13597
1907 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1908 hash table before sysv-style hash table.
1909
5f772412
ST
19102014-09-29 Sriraman Tallam <tmsriram@google.com>
1911
1912 * options.h (--pic-executable): Add negative to alias to -no-pie.
1913
5efeedf6
CC
19142014-09-26 Cary Coutant <ccoutant@google.com>
1915
1916 PR gold/16773
1917 * object.cc (Sized_relobj_file): Compute value of section symbols
1918 for TLS sections the same as TLS symbols.
1919
1707f183
CC
19202014-09-25 Cary Coutant <ccoutant@google.com>
1921
1922 PR gold/17432
1923 * resolve.cc (Symbol_table::resolve): Override common placeholder
1924 symbols, but adjust sizes.
1925 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1926 symbols to common lists.
1927
00cac886
AM
19282014-09-24 Alan Modra <amodra@gmail.com>
1929
1930 * po/POTFILES.in: Regenerate.
1931
635aa30e 19322014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1933 Cary Coutant <ccoutant@google.com>
635aa30e 1934
71b9b91b 1935 PR gold/14860
635aa30e
CC
1936 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1937 on input_sections_blocker.
1938 * layout.cc (Write_sections_task::locks): Unblock
1939 input_sections_blocker_.
1940 * layout.h (Write_sections_task::Write_sections_task): Add
1941 input_sections_blocker.
1942 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1943 to DEPENDENCIES.
1944 * testsuite/Makefile.in: Regenerate.
1945
c0c71592
RÁE
19462014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1947
1948 * testsuite/Makefile.am (plugin_test_10): New test.
1949 * testsuite/Makefile.in: Regenerate
1950 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1951 * testsuite/plugin_test_10.sh: New file.
1952
6168c2a1
RÁE
19532014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1954
1955 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1956 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1957 during the replacement phase.
1958
3a531937
JY
19592014-09-17 Han Shen <shenhan@google.com>
1960 Jing Yu <jingyu@google.com>
1961
1962 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1963 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1964 * aarch64.cc (Target_aarch64): Add data members
1965 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1966 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1967 constructor.
1968 (Target_aarch64::do_reloc_symbol_index): New method.
1969 (Target_aarch64::do_reloc_addend): New method.
1970 (Target_aarch64::add_tlsdesc_info): New method.
1971 (Target_aarch64::do_dynsym_value): New method.
1972 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1973 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1974 (Target_aarch64::make_data_plt): Add new parameters: got,
1975 got_irelative. Pass them to do_make_data_plt.
1976 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1977 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1978 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1979 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1980 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1981 (Target_aarch64::got_tlsdesc_section): New method.
1982 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1983 (Target_aarch64::define_tls_base_symbol): New method.
1984 (Target_aarch64::reserve_tlsdesc_entries): New method.
1985 (Target_aarch64::got_mod_index_entry): New method.
1986 (Target_aarch64::rela_tlsdesc_section): New method.
1987 (Target_aarch64::rela_irelative_section): New method.
1988 (Target_aarch64::Tlsdesc_info): New struct.
1989 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1990 relocations and tlsdesc relocations.
1991 (Target_aarch64::optimize_tls_reloc): Implement method.
1992 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1993 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1994 in constructor.
1995 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1996 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1997 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1998 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1999 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2000 (Output_data_plt_aarch64::rela_irelative): New method.
2001 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2002 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2003 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2004 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2005 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2006 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2007 (Output_data_plt_aarch64_standard): New member variables:
2008 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2009 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2010 New parameter: got, got_irelative.
2011 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2012 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2013 (Output_data_plt_aarch64::do_write): Replace got_address with
2014 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2015 (AArch64_relocate_functions::update_movnz): New method.
2016 (AArch64_relocate_functions): Correct format.
2017 (AArch64_relocate_functions::movnz): New method.
2018 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2019 before the switch. Add new cases to switch.
00cac886 2020 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
2021 tlsgd tlsdesc cases.
2022 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2023 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2024 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2025 Call reloc_name_in_error_message to print unsupported reloc.
2026 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2027 make_data_plt.
2028 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2029 relocs. Fill in some more dynamic tags.
2030 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2031 Skip call tls_get_addr when tlsgd is relaxed.
2032 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2033 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2034 tlsdesc->ie relaxation.
2035
62661c93
SS
20362014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2037
2038 * mips.cc (Target_mips_nacl): New class.
2039 (Target_selector_mips_nacl): New class.
2040 (target_selector_mips32): Rename from target_selector_mips32be and use
2041 Target_selector_mips_nacl instead of Target_selector_mips.
2042 (target_selector_mips32el): Rename from target_selector_mips32 and use
2043 Target_selector_mips_nacl instead of Target_selector_mips.
2044 (target_selector_mips64): Rename from target_selector_mips64be and use
2045 Target_selector_mips_nacl instead of Target_selector_mips.
2046 (target_selector_mips64el): Rename from target_selector_mips64 and use
2047 Target_selector_mips_nacl instead of Target_selector_mips.
2048 (Target_mips::mips_info): Add const attribute.
2049
54674d38
CC
20502014-09-02 Cary Coutant <ccoutant@google.com>
2051
2052 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2053 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2054 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2055 (Sized_incr_dynobj::do_section_name): Likewise.
2056 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2057 (Sized_incr_dynobj::do_section_name): Likewise.
2058 * object.h (Object::section_name): Likewise.
2059 (Object::do_section_name): Likewise.
2060 (Sized_relobj_file::do_section_name): Likewise.
2061 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2062 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2063
9860cbcf
CC
20642014-09-02 Cary Coutant <ccoutant@google.com>
2065
2066 PR gold/17005
2067 * ehframe.cc (Fde::write): Add output_offset parameter.
2068 (Cie::write): Likewise.
2069 (Eh_frame::set_final_data_size): Account for offset within output
2070 section.
2071 (Eh_frame::do_sized_write): Likewise.
2072 * ehframe.h (Fde::write): Add output_offset parameter.
2073 (Cie::write): Likewise.
2074 * output.cc (Output_section::Input_section_sort_entry): Remove
2075 section_has_name_; add output_section_name parameter. Use
2076 output section name for non-input sections.
2077 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2078 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2079 (Output_section::Input_section_sort_compare): Remove logic for
2080 sections without names.
2081 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2082 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2083 Likewise.
2084 (Output_section::Input_section_sort_section_name_compare): Likewise.
2085
8e33481e
HS
20862014-08-29 Han Shen <shenhan@google.com>
2087 Jing Yu <jingyu@google.com>
2088
2089 * aarch64-reloc-property.cc
2090 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2091 reference reloc property in the table.
2092 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2093 3 other entries.
2094 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2095 2 new overloaded methods.
2096 (Output_data_got_aarch64::do_write): Add code to write out
2097 static relocs.
2098 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2099 static relocs.
2100 (Output_data_got_aarch64::static_relocs): New vector to
2101 hold static relocs.
2102 (Target_aarch64::TCB_SIZE): New const static memeber.
2103 (Target_aarch64::tcb_size): New method.
2104 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2105 (Target_aarch64::Relocate::relocate_tls): New method.
2106 (Target_aarch64::Scan::local): Add code handling new reloc types.
2107 (Target_aarch64::Scan::global): Add code handling new reloc types.
2108
81233653
ST
21092014-08-13 Sriraman Tallam <tmsriram@google.com>
2110
2111 * options.h (-no-pie): Add option.
2112
9363c7c3
JY
21132014-08-08 Jing Yu <jingyu@google.com>
2114 Han Shen <shenhan@google.com>
2115
2116 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2117 (DEFFILES): add aarch64-reloc.def.
2118 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2119 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2120 * Makefile.in: Regenerate.
2121 * aarch64-reloc-property.cc: New file.
2122 * aarch64-reloc-property.h: New file.
2123 * aarch64-reloc.def: New file.
2124 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2125 with tab to make the format consistent.
2126 (Output_data_got_aarch64::symbol_table_): New method.
2127 (Target_aarch64::do_plt_address_for_global): New method.
2128 (Target_aarch64::do_plt_address_for_local): New method.
2129 (Target_aarch64::do_select_as_default_target): New method.
2130 (Target_aarch64::do_make_data_plt): New method.
2131 (Target_aarch64::make_data_plt): New method.
2132 (Output_data_plt_aarch64::has_irelative_section): New method.
2133 (Output_data_plt_aarch64::address_for_global): New method.
2134 (Output_data_plt_aarch64::address_for_local): New method.
2135 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2136 (Output_data_plt_aarch64::add_entry): Implement contents.
2137 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2138 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2139 the got_pov entry to plt0.
2140 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2141 Implement contents.
2142 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2143 (AArch64_howto): New struct.
2144 (aarch64_howto[]): New static const array.
2145 (AArch64_relocate_functions): New class.
2146 (Target_aarch64::Scan::get_reference_flags): Remove method.
2147 (Target_aarch64::Scan::local): Implement to support a few relocations.
2148 (Target_aarch64::Scan::global): Implement to support a few relocations.
2149 (Target_aarch64::make_plt_section): Implement contents.
2150 (Target_aarch64::make_plt_entry): Implement contents.
2151 (Target_aarch64::do_finalize_sections): Implement contents.
2152 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2153 (Target_aarch64::relocate_section): Implement contents.
2154
ad9fe6c1
AM
21552014-08-06 Alan Modra <amodra@gmail.com>
2156
2157 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2158
7cd4e5b7
AM
21592014-08-06 Alan Modra <amodra@gmail.com>
2160
2161 PR 13227
2162 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2163
5ad9b0a7
ST
21642014-07-21 Sriraman Tallam <tmsriram@google.com>
2165
2166 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2167 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2168
e051745c
CC
21692014-07-08 Cary Coutant <ccoutant@google.com>
2170
2171 * expression.cc (struct Expression::Expression_eval_info): Add
2172 new fields type_pointer, vis_pointer, and nonvis_pointer.
2173 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2174 nonvis_pointer parameters. Adjust all calls.
2175 (Symbol_expression::value): Update type, visibility, and nonvis bits
2176 in caller.
2177 * script.cc (Symbol_assignment::sized_finalize): Update type,
2178 visibility, and remaining st_other bits for new symbol.
2179 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2180 vis_pointer, and nonvis_pointer parameters.
2181 * symtab.h (Symbol::set_type): New method.
2182
2183 * testsuite/Makefile.am (defsym_test): New test.
2184 * testsuite/Makefile.in: Regenerate.
2185 * testsuite/defsym_test.c: New file.
2186 * testsuite/defsym_test.sh: New file.
2187
f35c4853
CC
21882014-07-08 Cary Coutant <ccoutant@google.com>
2189
2190 PR gold/15639
2191 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2192 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2193 (Sized_dynobj::base_read_symbols): ...new method.
2194 * object.h (Sized_relobj_file::base_read_symbols): New method.
2195 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2196 (Sized_relobj_file::base_read_symbols): ...new method.
2197 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2198 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2199 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2200
2900af2d
AM
22012014-07-04 Alan Modra <amodra@gmail.com>
2202
2203 * po/POTFILES.in: Regenerate.
2204
053a4d68
JY
22052014-07-02 Jing Yu <jingyu@google.com>
2206
2207 * aarch64.cc: New file
2208 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2209 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2210 * Makefile.in: Regenerate.
2211 * configure.tgt: Add entries for aarch64*.
2212 * configure.ac: Likewise.
2213 * configure: Likewise.
2214
7b549045
AM
22152014-06-27 Alan Modra <amodra@gmail.com>
2216
2217 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2218
cb818dbf
CC
22192014-06-24 Cary Coutant <ccoutant@google.com>
2220
2221 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2222 sections.
2223 (Dwo_file::sized_read_unit_index): Likewise.
2224
9810d34d
SS
22252014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2226
2227 * mips.cc: New file.
2228 * Makefile.am (TARGETSOURCES): Add mips.cc
2229 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2230 * configure.tgt: Add entries for mips*.
2231 * configure.ac: Likewise.
2232 * Makefile.in: Regenerate.
2233 * configure: Likewise.
2234
9baa787b
CC
22352014-06-09 Cary Coutant <ccoutant@google.com>
2236
2237 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2238 unit_length is within section bounds.
2239
8f89af0a
CC
22402014-06-09 Cary Coutant <ccoutant@google.com>
2241
2242 PR gold/16980
2243 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2244 map.
2245
a47622ac
AM
22462014-06-07 Alan Modra <amodra@gmail.com>
2247
2248 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2249
4320c691
CC
22502014-06-06 Cary Coutant <ccoutant@google.com>
2251
2252 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2253 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2254 (Dwarf_pubnames_table::read_header): Likewise.
2255 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2256 .debug_gnu_pubtypes.
2257
270c9937
JB
22582014-06-05 Joel Brobecker <brobecker@adacore.com>
2259
2260 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2261 * Makefile.in, configure: Regenerate.
2262
397998fc
AM
22632014-06-03 Alan Modra <amodra@gmail.com>
2264
2265 * powerpc.cc (addis_12_2): Define.
2266 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2267
61f5c66f
AM
22682014-06-03 Alan Modra <amodra@gmail.com>
2269
2270 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2271 st_other output.
2272
f6971787
AM
22732014-06-02 Alan Modra <amodra@gmail.com>
2274
2275 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2276 Only ignore relocs on ELFv1.
2277 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2278
f6fb8322
CC
22792014-05-30 Cary Coutant <ccoutant@google.com>
2280
2281 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2282 * testsuite/Makefile.in: Regenerate.
2283 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2284
c23dd342
L
22852014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2286
2287 PR gold/16945
2288 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2289 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2290
5fe7ffdc
AM
22912014-05-15 Alan Modra <amodra@gmail.com>
2292
2293 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2294 Compare FDE contents with DW_CFA_nop rather than 0.
2295
a82bef93
ST
22962014-05-13 Sriraman Tallam <tmsriram@google.com>
2297
2298 * symtab.h (may_need_copy_reloc): Remove check for position independent
2299 code.
2300 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2301 position independence before pc absolute may_need_copy_reloc call.
2302 Add check for executable output befor pc relative may_need_copy_reloc
2303 call.
2304 * i386.cc: Ditto.
2305 * arm.cc: Ditto.
2306 * sparc.cc: Ditto.
2307 * tilegx.cc: Ditto.
2308 * powerpc.cc: Add check for no position independence before
2309 may_need_copy_reloc calls.
2310 * testsuite/pie_copyrelocs_test.cc: New file.
2311 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2312 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2313 * Makefile.in: Regenerate.
a82bef93 2314
53c66605
ML
23152014-05-08 Martin Liška <mliska@suse.cz>
2316
2317 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2318
57b2284c
CC
23192014-05-06 Cary Coutant <ccoutant@google.com>
2320
2321 PR gold/16900
2322 * i386.cc (Output_data_got_plt_i386): New class.
2323 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2324 parameter. Change all callers.
2325 (Output_data_plt_i386::layout_): Remove.
2326 (Output_data_plt_i386::got_plt_): Change type.
2327 (Target_i386::got_plt_): Change type. Change all references.
2328 (Target_i386::got_section): Create instance of new class.
2329 (Output_data_got_plt_i386::do_write): New function.
2330 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2331 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2332 parameter. Change all callers.
2333 (Output_data_plt_x86_64::layout_): Remove.
2334 (Output_data_plt_x86_64::got_plt_): Change type.
2335 (Target_x86_64::got_plt_): Change type. Change all references.
2336 (Target_x86_64::got_section): Create instance of new class.
2337 (Output_data_got_plt_x86_64::do_write): New function.
2338 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2339 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2340 class.
2341
6b97515d 23422014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2343
6b97515d
CC
2344 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2345 if we have pubnames/pubtypes.
2346
d1bddd3c
CC
23472014-05-02 Cary Coutant <ccoutant@google.com>
2348
5fe7ffdc
AM
2349 * defstd.cc (in_segment): Define __ehdr_start here...
2350 * layout.cc (Layout::finalize): ...Instead of here. Set the
2351 output segment when known.
2352 * resolve.cc (Symbol::override_base_with_special): Remember
2353 the original binding.
2354 * symtab.cc (Symbol::set_output_segment): New function.
2355 (Symbol::set_undefined): New function.
2356 * symtab.h (Symbol::is_weak_undefined): Check original undef
2357 binding.
2358 (Symbol::is_strong_undefined): New function.
2359 (Symbol::set_output_segment): New function.
2360 (Symbol::set_undefined): New function.
2361 * target-reloc.h (is_strong_undefined): Remove.
2362 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2363 Check for hidden undefs.
2364 (relocate_section): Call Symbol::is_strong_undefined.
2365
2366 * testsuite/Makefile.am (ehdr_start_test_1)
2367 (ehdr_start_test_2, ehdr_start_test_3)
2368 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2369 * testsuite/Makefile.in: Regenerate.
2370 * testsuite/ehdr_start_def.cc: New source file.
2371 * testsuite/ehdr_start_test.cc: New source file.
2372 * testsuite/ehdr_start_test.t: New linker script.
2373 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2374
7849f6d8
CC
23752014-04-23 Cary Coutant <ccoutant@google.com>
2376
bf2cc635 2377 PR gold/16870
7849f6d8
CC
2378 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2379
99fd8cff
CC
23802014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2381
2382 * layout.cc (Layout::include_section): Allow a target to decide
2383 whether to include a section.
2384 * target.h (Target::should_include_section): New function.
2385 (Target::do_should_include_section): New function.
2386
91f43acd
CC
23872014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2388
2389 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2390 inline into ...
2391 (Copy_relocs::emit): ... here.
2392 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2393 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2394 (Copy_reloc_entry::entries_): Change from private to protected.
2395
c4eb27e1
ST
23962014-04-02 Sriraman Tallam <tmsriram@google.com>
2397
2398 * icf.cc (get_section_contents): Replace copies of reloc
2399 vectors with const references.
2400
ae447ddd
CC
24012014-04-02 Cary Coutant <ccoutant@google.com>
2402
2403 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2404 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2405 * configure: Regenerate.
2406 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2407 -fno-use-linker-plugin.
2408 (LINK1, CXXLINK1): Add it to the link command.
2409 * testsuite/Makefile.in: Regenerate.
2410
fa47fa92
AM
24112014-03-12 Alan Modra <amodra@gmail.com>
2412
2413 * Makefile.in: Regenerate.
2414
9b12c500
CC
24152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2416
2417 * symtab.h (Symbol::set_nonvis): New function.
2418
beacaa96
CC
24192014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2420
2421 * symtab.cc (Sized_symbol<32>::init_output_data):
2422 Instantiate the template.
2423 (Sized_symbol<64>::init_output_data): Likewise.
2424
800d9823
CC
24252014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2426
2427 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2428 adjust dynamic symbol value.
2429 * target.h (Target::adjust_dyn_symbol): New function.
2430 (Target::do_adjust_dyn_symbol): New function.
2431
918fc1f8 24322014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2433
918fc1f8
CC
2434 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2435 Get the value of DYNAMIC_CUSTOM dynamic entry.
2436 * output.h (Output_data_dynamic::add_custom): New function.
2437 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2438 dynamic entry.
2439 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2440 * target.h (Target::dynamic_tag_custom_value): New function.
2441 (Target::do_dynamic_tag_custom_value): New function.
2442
98ff9231
CC
24432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2444
2445 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2446 dynsym indexes.
2447 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2448 (Target::do_has_custom_set_dynsym_indexes): New function.
2449 (Target::set_dynsym_indexes): New function.
2450 (Target::do_set_dynsym_indexes): New function.
2451
b80eed39
AM
24522014-03-07 Alan Modra <amodra@gmail.com>
2453
2454 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2455 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2456 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2457 (Powerpc_relocate_functions::has_overflow_bitfield,
2458 overflowed): Use the above.
2459 (Target_powerpc::Relocate::relocate): Correct overflow checking
2460 for a number of relocations. Modify overflow test for 16-bit
2461 fields in instructions to signed/unsigned according to whether
2462 the field takes a signed or unsigned value.
2463
4b95cf5c
AM
24642014-03-05 Alan Modra <amodra@gmail.com>
2465
2466 Update copyright years.
2467
45965137
AM
24682014-03-05 Alan Modra <amodra@gmail.com>
2469
2470 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2471 R_PPC64_ADDR64_LOCAL.
2472 (Target_powerpc::Relocate::relocate): Likewise.
2473
2c80b753
AM
24742014-03-03 Alan Modra <amodra@gmail.com>
2475
2476 * dwp.cc (print_version): Update copyright year to current.
2477
c1c69e83
AM
24782014-02-10 Alan Modra <amodra@gmail.com>
2479
2480 * po/gold.pot: Regenerate.
2481
dd0c4e70
CC
24822014-02-06 Cary Coutant <ccoutant@google.com>
2483
2484 Fix problem where -u is ignored when a weak undef is seen.
2485
2486 * archive.cc (Library_base::should_include_member): Reorder
2487 code to check for -u option if a weak undef has already been seen.
2488 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2489 * testsuite/Makefile.in: Regenerate.
2490 * testsuite/weak_undef_file3.cc: New file.
2491 * testsuite/weak_undef_file4.cc: New file.
2492 * testsuite/weak_undef_test_2.cc: New file.
2493
1a221d3d
CC
24942014-02-05 Cary Coutant <ccoutant@google.com>
2495
2496 Fix issues with gold undefined symbol diagnostics.
2497
2498 PR binutils/15435
2499 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2500 check to here.
2501 * target-reloc.h (is_strong_undefined): New function.
2502 (relocate_section): Move undef vtable symbol check from here.
2503 Check for is_strong_undefined.
2504
e889f0a4 25052014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2506
e889f0a4
CC
2507 Fix problems with the --dynamic-list option.
2508
2509 PR gold/13577
2510 * options.cc (General_options::parse_dynamic_list):
2511 Set have_dynamic_list_.
2512 (General_options::General_options): Initialize have_dynamic_list_.
2513 (General_options::finalize): Turn off -Bsymbolic and
2514 -Bsymbolic-functions if --dynamic-list provided.
2515 * options.h (General_options::have_dynamic_list): New function.
2516 (General_options::have_dynamic_list_): New data member.
2517 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2518 correctly.
5fe7ffdc 2519
e889f0a4
CC
2520 PR gold/16530
2521 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2522 in --dynamic-list, mark it.
5fe7ffdc 2523
e889f0a4
CC
2524 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2525 (dynamic_list_2): New test case.
2526 * testsuite/Makefile.in: Regenerate.
2527 * testsuite/dynamic_list_2.cc: New file.
2528 * testsuite/dynamic_list_2.t: New file.
2529 * testsuite/dynamic_list_lib1.cc: New file.
2530 * testsuite/dynamic_list_lib2.cc: New file.
2531 * testsuite/gc_dynamic_list_test.c: New file.
2532 * testsuite/gc_dynamic_list_test.sh: New file.
2533 * testsuite/gc_dynamic_list_test.t: New file.
2534
ec673e64
CC
25352014-01-28 Cary Coutant <ccoutant@google.com>
2536
2537 Add .gdb_index version 7 support.
2538
2539 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2540 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2541 debug sections.
2542 (Dwarf_ranges_table::read_ranges_table): Likewise.
2543 (Dwarf_pubnames_table::read_section): Check for GNU-style
2544 sections, and for compressed debug sections.
2545 (Dwarf_pubnames_table::read_header): Compute end address of table.
2546 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2547 for end of list by offset, not by offset == 0.
2548 (Dwarf_info_reader::do_read_string_table): Check for compressed
2549 debug sections.
2550 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2551 Initialize new data members.
2552 (Dwarf_pubnames_table::next_name): return flag_byte.
2553 (Dwarf_pubnames_table::end_of_table_): New data member.
2554 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2555 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2556 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2557 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2558 read skeleton type unit DIEs.
2559 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2560 (Gdb_index::do_write): Write flag_byte.
2561 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2562 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2563 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2564 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2565
221fd5d5
L
25662014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2567
2568 * version.cc (print_version): Update copyright year to 2014.
2569
6c09fb0b
ILT
25702013-12-19 Dimitry Andric <dimitry@andric.com>
2571
2572 * stringpool.cc (Stringpool_template::reserve): Add
2573 HAVE_UNORDERED_MAP case.
2574 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2575
8356f2d0
CC
25762013-12-18 Cary Coutant <ccoutant@google.com>
2577
2578 * configure.ac: Check for <unordered_set> and <unordered_map>.
2579 * config.in: Regenerate.
2580 * configure: Regenerate.
2581 * system.h: Use <unordered_set> and <unordered_map> if available.
2582
f2c7d7ee
RM
25832013-12-10 Roland McGrath <mcgrathr@google.com>
2584
2585 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2586 with $(INSTALL_PROGRAM_ENV).
2587 * Makefile.in: Regenerate.
2588
6632e8cc
CC
25892013-11-22 Cary Coutant <ccoutant@google.com>
2590
2591 * configure.ac: Add check for which library is needed for
2592 dlopen.
2593 * configure: Regenerate.
2594
0c075858
CC
25952013-11-22 Cary Coutant <ccoutant@google.com>
2596
2597 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2598 assembler.
2599 * testsuite/Makefile.in: Regenerate.
2600
f49fe902
L
26012013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2602
2603 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2604 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2605 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2606 (Target_x86_64<size>::Scan::local): Likewise.
2607 (Target_x86_64<size>::Scan::global): Likewise.
2608 (Target_x86_64<size>::Relocate::relocate): Likewise.
2609 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2610 Likewise.
2611 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2612 R_X86_64_PC32_BND.
2613
2614 * testsuite/Makefile.am (check_PROGRAMS): Add
2615 exception_x86_64_bnd_test.
2616 (exception_x86_64_bnd_test_SOURCES): New macro.
2617 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2618 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2619 (exception_x86_64_bnd_test_LDADD): Likewise.
2620 (exception_x86_64_bnd_1.o): New rule.
2621 (exception_x86_64_bnd_2.o): Likewise.
2622 * testsuite/Makefile.in: Regenerated.
2623
9055360d
AM
26242013-11-15 Alan Modra <amodra@gmail.com>
2625
2626 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2627 accessor.
2628 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2629 Only call ppc64_local_entry_offset for 64-bit. Restrict
2630 symval_for_branch lookup to ELFv1.
2631 (Stub_table::add_plt_call_entry): Use unsigned int off.
2632 (Output_data_glink::Address, invalid_address): New.
2633 (Output_data_glink::add_eh_frame): Move out of line. Add
2634 support for ELFv2.
2635 (Output_data_glink::add_global_entry, find_global_entry,
2636 global_entry_address): New functions.
2637 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2638 ge_size): New variables.
2639 (Output_data_glink::set_final_data_size): Add global entry
2640 stub sizing.
2641 (Output_data_glink::do_write): Write global entry stubs.
2642 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2643 parameter. Return true for ELFv2. Adjust callers.
2644 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2645 ELFv1. Similarly for ifunc and dynamic relocation processing
2646 specific to ELFv1. Recognize that symbols are defined on
2647 their plt entries for ELFv2.
2648 (Target_powerpc::symval_for_branch): Assert if called for
2649 ELFv2 or ppc32.
2650 (Target_powerpc::Relocate::relocate): Use global entry plt
2651 stub for symbol value if such exists on ELFv2.
2652 (Target_powerpc::Relocate::relocate): Don't call
2653 symval_for_branch when ELFv2. Do adjust for local entry
2654 offset when ELFv2.
2655 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2656 plt stub for ELFv2.
2657 (Target_powerpc::do_plt_address_for_global): Similarly.
2658
cafdd569
CC
26592013-11-14 Cary Coutant <ccoutant@google.com>
2660
2661 Revert patch -- this did not fix the problem, and there is
2662 no race there.
2663
2664 2013-11-14 Cary Coutant <ccoutant@google.com>
2665
2666 PR gold/14860
2667 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2668 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2669 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2670 updating fde_offsets_.
2671 (Eh_frame_hdr::lock_): New data member.
2672
94e49e16
CC
26732013-11-14 Cary Coutant <ccoutant@google.com>
2674
2675 * dwp.cc (Dwo_file_entry): New type.
2676 (File_list): Use Dwo_file_entry.
2677 (Dwo_file::verify): New function.
2678 (Dwo_file::verify_dwo_list): New function.
2679 (Dwo_file::sized_verify_dwo_list): New function.
2680 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2681 list.
2682 (Dwp_options): New enum type.
2683 (dwp_options): Add --verify-only.
2684 (usage): Likewise.
2685 (main): Likewise.
2686 * dwp.h (gold_info): Add declaration.
2687
7cdd7d57
CC
26882013-11-14 Cary Coutant <ccoutant@google.com>
2689
2690 PR gold/14860
2691 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2692 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2693 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2694 updating fde_offsets_.
2695 (Eh_frame_hdr::lock_): New data member.
2696
1d946cb3
CC
26972013-11-06 Cary Coutant <ccoutant@google.com>
2698
2699 PR gold/15758
2700 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2701 before reloc sections.
2702
4f65b40e
AM
27032013-11-04 Alan Modra <amodra@gmail.com>
2704
2705 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2706 (Symbol::needs_dynamic_reloc): Test new flag.
2707 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2708 (Target_powerpc::Scan::get_reference_flags): Add target param.
2709 Return FUNC_DESC_ABI for 64-bit ELFv1.
2710 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2711 call.
2712 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2713 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2714
908794a9
CC
27152013-10-31 Cary Coutant <ccoutant@google.com>
2716
2717 Restore support for dwp v2 DWARF package file format.
2718
2719 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2720 tu_length parameter. Adjust all callers.
2721 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2722 * dwp.cc: Include dwarf.h.
2723 (Section_bounds): New struct type.
2724 (Unit_set): New struct type.
2725 (Dwo_file::Dwo_file): Initialize new data member.
2726 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2727 Combine and rename to...
2728 (Dwo_file::read_unit_index): ...this.
2729 (Dwo_file::sized_read_compunit_index)
2730 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2731 (Dwo_file::sized_read_unit_index): ...this.
2732 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2733 parameters; add section_id parameter.
2734 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2735 (Dwo_file::add_unit_set): ...this.
2736 (Dwo_file::shndx_map_): Remove.
2737 (Dwo_file::sect_offsets_): New data member.
2738 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2739 (Dwp_output_file::add_section): Rename to...
2740 (Dwp_output_file::add_contribution): ...this.
2741 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2742 (Dwp_output_file::add_tu_set): Likewise.
2743 (Dwp_output_file::Contribution): New type.
2744 (Dwp_output_file::Section::contributions): New data member.
2745 (Dwp_output_file::Cu_or_tu_set): Remove.
2746 (Dwp_output_file::Section::Section): New ctor.
2747 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2748 (Dwp_output_file::Dwp_index::Section_table): New type.
2749 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2750 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2751 parameter.
2752 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2753 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2754 (Dwp_output_file::Dwp_index::section_table): New member function.
2755 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2756 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2757 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2758 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2759 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2760 (Dwp_output_file::Dwp_index::section_table_): New data member.
2761 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2762 (Dwp_output_file::add_output_section): New member function.
2763 (Dwp_output_file::write_new_section): New member function.
2764 (Dwp_output_file::write_contributions): New member function.
2765 (Dwp_output_file::section_id_map_): New data member.
2766 (class Dwo_id_info_reader): Remove.
2767 (class Unit_reader): New class.
2768 (get_dwarf_section_name): New function.
2769 (Dwo_file::read_executable): Adjust initializations of class data.
2770 (Dwo_file::read): Add support for v2 package file format.
2771 (Dwo_file::read_unit_index): Likewise.
2772 (Dwo_file::sized_read_unit_index): Likewise.
2773 (Dwo_file::copy_section): Likewise.
2774 (Dwo_file::add_unit_set): Likewise.
2775 (Dwp_output_file::add_output_section): Likewise.
2776 (Dwp_output_file::add_contribution): Likewise.
2777 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2778 for empty slot.
2779 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2780 file format.
2781 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2782 slot.
2783 (Dwp_output_file::initialize): Remove unused function.
2784 (Dwp_output_file::finalize): Add support for v2 package file format.
2785 (Dwp_output_file::write_index): Likewise.
2786 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2787 function prototype.
2788
2500c017
CC
27892013-10-31 Cary Coutant <ccoutant@google.com>
2790
2791 * configure.ac: Fix check for -fmerge-constants.
2792 * configure.ac: Regenerate.
2793
dd0845d7
RM
27942013-10-30 Roland McGrath <mcgrathr@google.com>
2795
2796 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2797 Correct 9-byte nop sequence to match what the assembler generates.
2798
b4f7960d
AM
27992013-10-30 Alan Modra <amodra@gmail.com>
2800
2801 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2802 ppc64_local_entry_offset, ppc64_local_entry_offset,
2803 do_read_symbols): New functions.
2804 (Powerpc_relobj::e_flags_, st_other_): New vars.
2805 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2806 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2807 (Powerpc_relobj::e_flags_): New var.
2808 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2809 and adjust for ELFv2.
2810 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2811 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2812 (Powerpc_dynobj::do_find_special_sections): Likewise.
2813 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2814 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2815 to ELFv2 local entry.
2816 (Target_powerpc::do_relax): No thread safe barriers needed for
2817 ELFv2.
2818 (Output_data_plt_powerpc::initial_plt_entry_size_,
2819 plt_entry_size): Delete. Replace all uses with
2820 first_plt_entry_offset() and plt_entry_size().
2821 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2822 reserved_size parm. Update callers.
2823 (Output_data_plt_powerpc::entry_count): Update.
2824 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2825 and use Target_powerpc::first_plt_entry_offset().
2826 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2827 rename to plt_entry_size.
2828 (Output_data_plt_powerpc::add_ifunc_entry,
2829 add_local_ifunc_entry): Adjust reloc for ELFv2.
2830 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2831 (glink_eh_frame_fde_64v2): New.
2832 (Stub_table::plt_call_size): Support ELFv2 sizing.
2833 (Output_data_glink::add_eh_frame): Use the new FDE.
2834 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2835 (Stub_table::do_write): Write ELFv2 stubs and glink.
2836 (Target_powerpc::Relocate::relocate): Replaces nop after call
2837 with ld 2,24(1) and adjust local offset destination for ELFv2.
2838
f9c6b907
AM
28392013-10-30 Alan Modra <amodra@gmail.com>
2840
2841 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2842 (Target_powerpc::Scan::global, local): Likewise.
2843 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2844 on all ppc64 @h and @ha relocs.
2845
e84fe78f
AM
28462013-10-14 Alan Modra <amodra@gmail.com>
2847
2848 * output.h (Output_data_got::add_constant): Tidy.
2849 (Output_data_got::add_constant_pair): New function.
2850 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2851 methods used so as to first call reserve_ent().
2852
679e4abf
RM
28532013-10-11 Roland McGrath <mcgrathr@google.com>
2854
44dcb735
RM
2855 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2856 add_got_entry and add_got_entry_pair.
2857
13323c49
RM
2858 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2859 (HAVE_PUBNAMES): Likewise.
2860 * configure: Regenerate.
2861
1496b446
RM
2862 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2863 * testsuite/Makefile.in: Regenerate.
2864
cc84c10b
RM
2865 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2866 Remove const from declaration.
2867 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2868 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2869 * output.h (Output_file_header): Remove const from member target_
2870 and corresponding constructor argument.
2871 * output.cc (Output_file_header::Output_file_header): Update prototype.
2872 (Output_file_header::do_sized_write): Use this->target_ in place
2873 of parameters()->target().
2874
52f66a2c
RM
2875 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2876
2b64b551
RM
2877 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2878 * configure: Regenerate.
2879 * Makefile.in: Regenerate.
2880 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2881 * testsuite/merge_string_literals_2.c: Likewise.
2882 * testsuite/Makefile.am
2883 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2884 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2885 literal -fmerge-constants.
2886 * testsuite/Makefile.in: Regenerate.
2887
43819297
RM
2888 * i386.cc (Target_i386): Remove unused member dynbss_.
2889 * arm.cc (Target_arm): Likewise.
2890 * powerpc.cc (Target_powerpc): Likewise.
2891 * sparc.cc (Target_sparc): Likewise.
2892 * tilegx.cc (Target_tilegx): Likewise.
2893 * x86_64.cc (Target_x86_64): Likewise.
2894 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2895 type_signature_, type_offset_.
2896 * plugin.h (Plugin_hook): Remove unused member layout_.
2897 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2898 mapfile_.
2899 (Read_member): Remove unused members input_objects_, symtab_,
2900 mapfile_, layout_.
2901 (Check_library): Remove unused member symtab_.
2902 * archive.h (Lib_group): Remove unused member lib_.
2903 * archive.cc (Lib_group::Lib_group): Update initializer.
2904 * incremental.h (Incremental_binary): Remove unused member target_.
2905 (Incremental_script_entry): Removed unused member script_.
2906 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2907 * icf.h (Icf): Remove unused member num_tracked_relocs.
2908
39d9ead7
RM
2909 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2910 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2911 its only use.
2912 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2913
679e4abf
RM
2914 * archive.h: Use struct rather than class for forward declaration
2915 of Read_symbols_data.
2916
54de2ea6
CC
29172013-10-07 Cary Coutant <ccoutant@google.com>
2918
2919 PR gold/16010
2920 * testsuite/Makefile.am (icf_test): Fix dependencies.
2921 (icf_safe_test): Likewise.
2922 (icf_safe_so_test): Likewise.
2923 (large_symbol_alignment): Add empty _LDADD rule.
2924 * testsuite/Makefile.in: Regenerate.
2925
b14016f0
L
29262013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2927
2928 PR gold/15927
2929 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2930 relocation for R_X86_64_32 on x32.
2931
eb426534
RM
29322013-08-27 Roland McGrath <mcgrathr@google.com>
2933
2934 * output.cc (Output_segment::set_section_addresses): Take new
2935 Target* argument. If target->isolate_execinstr() and the segment
2936 is executable and starts at a target->abi_pagesize() boundary,
2937 pad its end out to a target->abi_pagesize() boundary with code fill.
2938 * output.h (Output_segment::set_section_addresses): Update decl.
2939 * layout.h (Layout::check_output_data_for_reset_values): Take new
2940 argument RELAX_OUTPUTS.
2941 (Layout): New member relax_output_list_.
2942 (Layout::add_relax_output): New method.
2943 * layout.cc (Layout::Layout): Update constructor.
2944 (Layout::reset_relax_output): New method.
2945 (Layout::clean_up_after_relaxation): Call it.
2946 (Layout::prepare_for_relaxation): Update caller.
2947 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2948 Call reset_relax_output before re-processing segments for
2949 isolate_execinstr case.
2950 (Layout::write_data): Handle relax_output_list_.
2951 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2952 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2953
9aff4b7a
NC
29542013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2955
2956 PR binutils/15834
2957 * object.h: Fix typos.
2958
93f8221c
RM
29592013-08-16 Roland McGrath <mcgrathr@google.com>
2960
2961 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2962 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2963
e44c3715
CC
29642013-08-07 Cary Coutant <ccoutant@google.com>
2965
2966 Revert support for v2 DWP files:
2967
2968 2013-03-01 Cary Coutant <ccoutant@google.com>
2969
2970 Add dwp support for v2 DWARF package file format.
2971 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2972 tu_length parameter. Adjust all callers.
2973 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2974 * dwp.cc: Include dwarf.h.
2975 (Section_bounds): New struct type.
2976 (Unit_set): New struct type.
2977 (Dwo_file::Dwo_file): Initialize new data member.
2978 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2979 Combine and rename to...
2980 (Dwo_file::read_unit_index): ...this.
2981 (Dwo_file::sized_read_compunit_index)
2982 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2983 (Dwo_file::sized_read_unit_index): ...this.
2984 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2985 parameters; add section_id parameter.
2986 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2987 (Dwo_file::add_unit_set): ...this.
2988 (Dwo_file::shndx_map_): Remove.
2989 (Dwo_file::sect_offsets_): New data member.
2990 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2991 (Dwp_output_file::add_section): Rename to...
2992 (Dwp_output_file::add_contribution): ...this.
2993 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2994 (Dwp_output_file::add_tu_set): Likewise.
2995 (Dwp_output_file::Contribution): New type.
2996 (Dwp_output_file::Section::contributions): New data member.
2997 (Dwp_output_file::Cu_or_tu_set): Remove.
2998 (Dwp_output_file::Section::Section): New ctor.
2999 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3000 (Dwp_output_file::Dwp_index::Section_table): New type.
3001 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3002 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3003 parameter.
3004 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3005 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3006 (Dwp_output_file::Dwp_index::section_table): New member function.
3007 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3008 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3009 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3010 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3011 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3012 (Dwp_output_file::Dwp_index::section_table_): New data member.
3013 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3014 (Dwp_output_file::add_output_section): New member function.
3015 (Dwp_output_file::write_new_section): New member function.
3016 (Dwp_output_file::write_contributions): New member function.
3017 (Dwp_output_file::section_id_map_): New data member.
3018 (class Dwo_id_info_reader): Remove.
3019 (class Unit_reader): New class.
3020 (get_dwarf_section_name): New function.
3021 (Dwo_file::read_executable): Adjust initializations of class data.
3022 (Dwo_file::read): Add support for v2 package file format.
3023 (Dwo_file::read_unit_index): Likewise.
3024 (Dwo_file::sized_read_unit_index): Likewise.
3025 (Dwo_file::copy_section): Likewise.
3026 (Dwo_file::add_unit_set): Likewise.
3027 (Dwp_output_file::add_output_section): Likewise.
3028 (Dwp_output_file::add_contribution): Likewise.
3029 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3030 for empty slot.
3031 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3032 file format.
3033 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3034 slot.
3035 (Dwp_output_file::initialize): Remove unused function.
3036 (Dwp_output_file::finalize): Add support for v2 package file format.
3037 (Dwp_output_file::write_index): Likewise.
3038 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3039 function prototype.
3040
c6905c28
CC
30412013-07-31 Cary Coutant <ccoutant@google.com>
3042
3043 * object.cc (Sized_relobj::do_output_section_address): New function.
3044 (Sized_relobj): Instantiate explicitly.
3045 * object.h (Object::output_section_address): New function.
3046 (Object::do_output_section_address): New function.
3047 (Sized_relobj::do_output_section_address): New function.
3048 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3049
30502013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3051 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3052
3053 * parameters.cc (Parameters::entry): Return target-specific entry
3054 symbol name.
3055 * target.h (Target::entry_symbol_name): New function.
3056 (Target_info::entry_symbol_name): New data member.
3057
3058 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3059 * i386.cc (Target_i386::i386_info): Likewise.
3060 (Target_i386_nacl::i386_nacl_info): Likewise.
3061 * sparc.cc (Target_sparc::sparc_info): Likewise.
3062 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3063 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3064 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3065 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3066
234d4ab8
SA
30672013-07-22 Sterling Augustine <saugustine@google.com>
3068
3069 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3070 Convert parameter shndx to local variable. Add parameters symtab
3071 and symtab_size. Scan over section names. Find relocation
3072 section corresponding to current section. Create and initialize
3073 reloc_mapper_ and reloc_type_.
3074 (Dwarf_pubnames_table::read_header): Add assertion. Change
3075 unit_length to off_t. Initialize member unit_length_. Fill in field
3076 cu_offset_.
3077 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3078 Initialize new fields unit_length_ and cu_offset_.
3079 (Dwarf_pubnames_table::read_section): Update prototype.
3080 (Dwarf_pubnames_table::cu_offset): New member function.
3081 (Dwarf_pubnames_table::subsection_size): Likewise.
3082 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3083 New fields.
3084 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3085 member functions public.
3086 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3087 Update comment. Rework logic. Move repeated parts to...
3088 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3089 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3090 pubtypes_table_, and stmt_list_offset.
3091 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3092 Gdb_index::find_pubtype_offset,
3093 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3094 (Gdb_index::pubnames_read): Update prototype and rework logic.
3095 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3096 Forward declare.
3097 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3098 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3099 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3100 Gdb_index::map_pubtable_to_dies):
3101 Declare functions.
3102 (Gdb_index::pubnames_read): Update declaration.
3103 (Gdb_index::Pubname_offset_map): New type.
3104 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3105 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3106 Gdb_index::stmt_list_offset): Declare.
3107 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3108 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3109 Gdb_index::pubtypes_offset_): Remove.
3110
a3ed37d8
RM
31112013-07-19 Roland McGrath <mcgrathr@google.com>
3112
3113 * options.h (General_options): Add -Trodata-segment option.
3114 * parameters.cc (Parameters::check_rodata_segment): New function.
3115 (Parameters::set_target_once): Call it.
3116 * parameters.h (Parameters): Declare it (private member function).
3117 * layout.cc (load_seg_unusable_for_headers): New function, broken
3118 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3119 then validate rodata segment rather than text segment.
3120 (relaxation_loop_body): Call that.
3121 (is_text_segment): New function. Don't admit a non-executable
3122 segment if TARGET->isolate_execinstr().
3123 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3124
eb5b4ded
CC
31252013-07-15 Shawn Landden <shawnlandden@gmail.com>
3126
3127 PR gold/15070
3128 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3129 * nacl.h (Sniff_file::View::View): Request aligned view.
3130
4d5effb9
CC
31312013-07-11 Cary Coutant <ccoutant@google.com>
3132
3133 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3134 correct BRLT entry size.
3135
ba8ca3e7
AM
31362013-07-03 Alan Modra <amodra@gmail.com>
3137
3138 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3139 comment.
3140
267257d2
CC
31412013-07-01 Cary Coutant <ccoutant@google.com>
3142
3143 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3144 reloc_type_.
3145 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3146 (Dwarf_ranges_table::lookup_reloc): New function.
3147 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3148 reloc_type_.
3149 (Dwarf_ranges_table::lookup_reloc): New function.
3150 (Dwarf_ranges_table::reloc_type_): New data member.
3151
06f30c9d
CC
31522013-06-27 Jing Yu <jingyu@google.com>
3153
3154 PR gold/15662
3155 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3156 function.
3157 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3158 (Target_powerpc::do_relax): Call the above.
3159
a2d7bf59
AM
31602013-06-27 Cary Coutant <ccoutant@google.com>
3161
3162 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3163 on garbage collected .opd section.
3164
31652013-06-27 Alan Modra <amodra@gmail.com>
3166
3167 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3168 is non-zero.
3169 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3170 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3171
32364e50
CC
31722013-06-14 Cary Coutant <ccoutant@google.com>
3173
3174 * resolve.cc (Symbol::override_base): Don't override st_type
3175 from plugin placeholder symbols.
3176 (Symbol_table::resolve): Likewise.
3177 (Symbol_table::should_override): Don't complain about TLS mismatch
3178 if the TO symbol is a plugin placeholder.
3179 * testsuite/Makefile.am (plugin_test_tls): New test.
3180 * testsuite/Makefile.in: Regenerate.
3181 * testsuite/plugin_test_tls.sh: New test script.
3182 * testsuite/two_file_test_2_tls.cc: New test source.
3183 * testsuite/two_file_test_tls.cc: New test source.
3184
7fb47cc9
CC
31852013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3186
3187 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3188 the maximum segment alignment is larger than the page size.
3189 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3190 correctly aligns the symbols with large alignemnt.
3191 * testsuite/Makefile.in: Regenerate.
3192 * testsuite/large_symbol_alignment.cc: New file.
3193
6934001a
CC
31942013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3195 Sriraman Tallam <tmsriram@google.com>
3196
3197 * options.h (sort_section): New option.
3198 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3199 Rename from Input_section_sort_section_name_special_ordering_compare.
3200 (Input_section_sort_section_name_compare): New struct.
3201 * output.cc (Output_section::Input_section_sort_section_name_compare::
3202 operator()): New function.
3203 (Output_section::sort_attached_input_sections): Use new sort function
3204 for .text if --sort-section=name is specified.
3205 * layout.cc (Layout::make_output_section):
3206 Add sorting by name when --sort-section=name is specified.
3207 * testsuite/Makefile.am (text_section_grouping): Test option
3208 --sort-section=name.
3209 * testsuite/Makefile.in: Regenerate.
3210 * testsuite/section_sorting_name.cc: New file.
3211 * testsuite/section_sorting_name.sh: New file.
3212
93acabad
CC
32132013-05-21 Cary Coutant <ccoutant@google.com>
3214
3215 * symtab.h (Symbol::is_cxx_vtable): New function.
3216 * target-reloc.h (relocate_section): Check for vtable symbol.
3217 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3218 * testsuite/Makefile.in: Regenerate.
3219 * testsuite/missing_key_func.cc: New test source.
3220 * testsuite/missing_key_func.sh: New test script.
3221
60e8b3fc
CC
32222013-05-21 Cary Coutant <ccoutant@google.com>
3223
2b64b551
RM
3224 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3225 type of enclosing symbol.
3226 (Relocate_info::location): Check symbol type when describing symbol.
3227 * object.h (Symbol_location_info): Remove unused line_number;
3228 add enclosing_symbol_type.
3229 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3230
9df9de2c
CC
32312013-05-13 Cary Coutant <ccoutant@google.com>
3232
2b64b551
RM
3233 * configure.ac: Export DEFAULT_TARGET.
3234 * configure: Regenerate.
3235 * Makefile.in: Regenerate.
3236 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3237 * testsuite/Makefile.in: Regenerate.
3238 * testsuite/debug_msg.sh: Delete duplicate tests.
3239 Don't check undef_int error message match for powerpc where the
3240 source file and line number aren't available.
9df9de2c 3241
bbc5ae17
RM
32422013-05-10 Roland McGrath <mcgrathr@google.com>
3243
3244 * options.h (General_options): Add --rosegment-gap option.
3245 * options.cc (finalize): --rosegment-gap implies --rosegment.
3246 * layout.cc (set_segment_offsets): Let user option override
3247 target->rosegment_gap().
3248
0c6e6c39
RM
32492013-05-10 Roland McGrath <mcgrathr@google.com>
3250
3251 * options.h (General_options): Remove leading space from help
3252 messages for -nostdlib and --rosegment.
3253
cde7cb01
MR
32542013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3255
3256 PR ld/15365
3257 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3258
f31ae5b8
AM
32592013-05-03 Alan Modra <amodra@gmail.com>
3260
3261 * merge.cc (Output_merge_string::do_add_input_section): Correct
3262 scan for number of strings. Rename vars to avoid shadowing.
3263 Include missing terminator in input_size_.
3264
d3a7cd45
L
32652013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3266
3267 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3268 Restore empty string handling.
3269
6ad3daba
CC
32702013-05-01 Cary Coutant <ccoutant@google.com>
3271
3272 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3273 uninitialized warning.
3274
e31908b6
CC
32752013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3276
3277 * output.cc (Output_section::add_merge_input_section): Allow
3278 to merge sections if the alignment is more than character size.
3279 * merge.h (Output_merge_string::Output_merge_string): Remove
3280 assert.
3281 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3282 only not-null strings. Check the alignment of strings.
3283 * stringpool.h
3284 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3285 alignment as the argument.
3286 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3287 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3288 Align non-zero length strings according to the addralign_.
3289 (Stringpool_template<Stringpool_char>::set_string_offsets):
3290 Updating offsets according to the given alignment.
3291 * testsuite/Makefile.am (text_section_grouping): Test if string
3292 literals are getting merged.
3293 * testsuite/Makefile.in: Regenerate.
3294 * testsuite/merge_string_literals_1.c: New file.
3295 * testsuite/merge_string_literals_2.c: Ditto.
3296 * testsuite/merge_string_literals.sh: Ditto.
3297
0e804863
ILT
32982013-04-26 Ian Lance Taylor <iant@google.com>
3299
3300 * target-reloc.h (relocate_section): If the reloc offset is out of
3301 range, pass VIEW as NULL to relocate.relocate.
3302 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3303 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3304 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3305 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3306 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3307 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3308
e7c5ea40
CC
33092013-04-26 Geoff Pike <gpike@chromium.org>
3310
3311 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3312 * layout.cc (Hash_task): New class.
3313 (Layout::queue_build_id_tasks): New function.
3314 (Layout::write_build_id): Handle single-thread portion of build ID
3315 computation. (In some cases, all of it is single-threaded.) Replace
3316 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3317 functionality in fewer lines of code.
3318 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3319 * options.h (General_options): make "--build-id" default to tree
3320 rather than sha1. Add two new options related to --build-id=tree:
3321 --build-id-chunk-size-for-treehash and
3322 --build-id-min-file-size-for-treehash.
3323 * Makefile.am: add testing of --build-id=tree and related new options
3324 (these tests will be invoked by "make check").
3325 * Makefile.in: Regenerate.
3326
49926cd0
AM
33272013-04-25 Alan Modra <amodra@gmail.com>
3328
3329 * configure.tgt: Add powerpcle and powerpc64le.
3330
a4034750
AM
33312013-04-22 Alan Modra <amodra@gmail.com>
3332
3333 PR gold/15355
3334 * layout.cc (Layout::segment_precedes): Allow more than one
3335 segment with the same type and flags.
3336
e79c84aa
CC
33372013-04-15 Cary Coutant <ccoutant@google.com>
3338
3339 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3340 allocate space in file for BSS sections.
3341
2199fbe7
CC
33422013-04-15 Cary Coutant <ccoutant@google.com>
3343
3344 * script-sections.cc (Orphan_output_section): Reset address
3345 to zero after each orphaned section for relocatable links.
3346
502e8a84
CC
33472013-04-15 Cary Coutant <ccoutant@google.com>
3348
a4034750
AM
3349 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3350 section starting address for relocatable link.
3351 * testsuite/Makefile.am (script_test_11): New test.
3352 * testsuite/Makefile.in: Regenerate.
3353 * testsuite/script_test_11.c: New source file.
3354 * testsuite/script_test_11.t: New linker script.
502e8a84 3355
0cfdc767
AM
33562013-04-13 Alan Modra <amodra@gmail.com>
3357
3358 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3359 owner when sections are not adjacent and exceed group size.
3360 (Target_powerpc::group_sections): Handle corner case.
3361 (Target_powerpc::Branch_info::make_stub): Handle case where
3362 stub table doesn't exist due to branches in non-exec sections.
3363 (Target_powerpc::Relocate::relocate): Likewise.
3364
6830ee24
AM
33652013-04-11 Alan Modra <amodra@gmail.com>
3366
3367 PR gold/15354
3368 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3369 .branch_lt to match bfd ld. Adjust comments throughout file.
3370
54a3d865
ILT
33712013-04-04 Ian Lance Taylor <iant@google.com>
3372
3373 GCC PR c++/56840
3374 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3375 sections before checking whether they are included in the link.
3376
9993ba11
ST
33772013-03-29 Sriraman Tallam <tmsriram@google.com>
3378
3379 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3380 object before calling the plugin claim_file handler. Pass the elf
3381 object of the archive to the plugin. Delete the elf object if the
3382 plugin claims the file.
3383
ebacd51e
AM
33842013-03-21 Alan Modra <amodra@gmail.com>
3385
3386 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3387 segment when omagic.
3388
117be58f
AM
33892013-03-21 Alan Modra <amodra@gmail.com>
3390
3391 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3392 comparison warning.
3393 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3394 uninitialized" warning.
3395
32e2b61d
AM
33962013-03-20 Alan Modra <amodra@gmail.com>
3397
3398 * symtab.h (Symbol::clear_version): New function.
3399 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3400 is_needed by weak references. Clear version for symbols defined
3401 in as-needed objects that are not needed.
3402
b3ccdeb5
AM
34032013-03-15 Alan Modra <amodra@gmail.com>
3404
3405 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3406 static and public. Add report_err param. Return false for data refs.
3407 (Target_powerpc::rela_dyn_section): New overloaded function.
3408 (Target_powerpc::plt_, iplt_): Elucidate.
3409 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3410 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3411 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3412 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3413 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3414 push_branch and make_plt_entry for ifunc syms when
3415 reloc_needs_plt_for_ifunc.
3416 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3417 for ifunc unless reloc_needs_plt_for_ifunc.
3418
ad3d8a2f
AM
34192013-03-15 Alan Modra <amodra@gmail.com>
3420
3421 * gc.h (gc_process_relocs): Don't look through function descriptors.
3422 * icf.cc (get_section_contents): Do so here instead.
3423
4d9aa155
AM
34242013-03-13 Alan Modra <amodra@gmail.com>
3425
3426 * powerpc.cc (is_branch_reloc): Forward declare.
3427 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3428 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3429 false for 64-bit, true for 32-bit non-branch relocs.
3430 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3431 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3432 nm output.
3433 (icf_safe_test): Generate linker map file as well as nm output.
3434 (icf_safe_so_test): Likewise.
3435 * testsuite/Makefile.in: Regenerate.
3436 * testsuite/icf_test.sh: Parse linker map file to determine
3437 section folding.
3438 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3439 * testsuite/icf_safe_so_test.sh: Likewise.
3440 (X86_32_or_ARM_specific_safe_fold): Merge into..
3441 (arch_specific_safe_fold): ..this.
3442 (X86_64_specific_safe_fold): Delete unused function.
3443
57420c20
AM
34442013-03-12 Alan Modra <amodra@gmail.com>
3445
3446 * gc.h (gc_process_relocs): Look through function descriptors
3447 to determine shndx, symvalue and addend used by ICF. Tidy
3448 variable duplication.
3449
dc3714f3
AM
34502013-03-11 Alan Modra <amodra@gmail.com>
3451
3452 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3453 * layout.cc (Layout_task_runner::run): ..to here.
3454 * symtab.h (struct Symbol_location): Extract from..
3455 (class Symbol_table): ..here.
3456 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3457 * target.h (class Target): Add function_location and
3458 do_function_location functions.
3459 (class Sized_target): Add do_function_location.
3460 * object.h (class Sized_relobj_file): Move find_shdr..
3461 (class Object): ..to here.
3462 * object.cc: Likewise. Update to suit. Instantiate.
3463 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3464 * powerpc.cc (class Powerpc_dynobj): New.
3465 (Target_powerpc::do_function_location): New function.
3466 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3467 (Powerpc_dynobj::do_read_symbols): New function.
3468 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3469
956b03bb
ILT
34702013-03-08 Ian Lance Taylor <iant@google.com>
3471
3472 * options.cc (General_options::string_to_object_format): Accept
3473 "default".
3474
4bead2d5
AM
34752013-03-08 Alan Modra <amodra@gmail.com>
3476
3477 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3478 pointer to Post_fde.
3479 (struct Post_fde): Move definition to here..
3480 * ehframe.cc (struct Post_fde): ..from here.
3481 (Cie::write): Don't alloc Post_fde.
3482 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3483
02e60bf7
AM
34842013-03-07 Alan Modra <amodra@gmail.com>
3485
3486 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3487 relocation referencing .LC0.
3488 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3489
8343f03a
AM
34902013-03-07 Alan Modra <amodra@gmail.com>
3491
3492 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3493 always_inline. Add assembly for powerpc to avoid GOT.
3494
3366d57c
AM
34952013-03-07 Alan Modra <amodra@gmail.com>
3496
3497 * testsuite/script_test_10.sh: Don't test .bss section
3498 header number.
3499
6c77229c
AM
35002013-03-06 Alan Modra <amodra@gmail.com>
3501
3502 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3503 (Target_powerpc::symval_for_branch): Add symtab param. Update
3504 all callers. Handle folded sections.
3505 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3506 to Powerpc_relobj.
3507 (Global_symbol_visitor_opd::operator()): Likewise.
3508
a39e4af6
AM
35092013-03-04 Alan Modra <amodra@gmail.com>
3510
3511 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3512 * testsuite/Makefile.in: Regenerate.
3513
d5834edb
CC
35142013-03-01 Cary Coutant <ccoutant@google.com>
3515
3516 Add dwp support for v2 DWARF package file format.
3517 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3518 tu_length parameter. Adjust all callers.
3519 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3520 * dwp.cc: Include dwarf.h.
3521 (Section_bounds): New struct type.
3522 (Unit_set): New struct type.
3523 (Dwo_file::Dwo_file): Initialize new data member.
3524 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3525 Combine and rename to...
3526 (Dwo_file::read_unit_index): ...this.
3527 (Dwo_file::sized_read_compunit_index)
3528 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3529 (Dwo_file::sized_read_unit_index): ...this.
3530 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3531 parameters; add section_id parameter.
3532 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3533 (Dwo_file::add_unit_set): ...this.
3534 (Dwo_file::shndx_map_): Remove.
3535 (Dwo_file::sect_offsets_): New data member.
3536 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3537 (Dwp_output_file::add_section): Rename to...
3538 (Dwp_output_file::add_contribution): ...this.
3539 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3540 (Dwp_output_file::add_tu_set): Likewise.
3541 (Dwp_output_file::Contribution): New type.
3542 (Dwp_output_file::Section::contributions): New data member.
3543 (Dwp_output_file::Cu_or_tu_set): Remove.
3544 (Dwp_output_file::Section::Section): New ctor.
3545 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3546 (Dwp_output_file::Dwp_index::Section_table): New type.
3547 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3548 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3549 parameter.
3550 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3551 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3552 (Dwp_output_file::Dwp_index::section_table): New member function.
3553 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3554 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3555 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3556 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3557 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3558 (Dwp_output_file::Dwp_index::section_table_): New data member.
3559 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3560 (Dwp_output_file::add_output_section): New member function.
3561 (Dwp_output_file::write_new_section): New member function.
3562 (Dwp_output_file::write_contributions): New member function.
3563 (Dwp_output_file::section_id_map_): New data member.
3564 (class Dwo_id_info_reader): Remove.
3565 (class Unit_reader): New class.
3566 (get_dwarf_section_name): New function.
3567 (Dwo_file::read_executable): Adjust initializations of class data.
3568 (Dwo_file::read): Add support for v2 package file format.
3569 (Dwo_file::read_unit_index): Likewise.
3570 (Dwo_file::sized_read_unit_index): Likewise.
3571 (Dwo_file::copy_section): Likewise.
3572 (Dwo_file::add_unit_set): Likewise.
3573 (Dwp_output_file::add_output_section): Likewise.
3574 (Dwp_output_file::add_contribution): Likewise.
3575 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3576 for empty slot.
3577 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3578 file format.
3579 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3580 slot.
3581 (Dwp_output_file::initialize): Remove unused function.
3582 (Dwp_output_file::finalize): Add support for v2 package file format.
3583 (Dwp_output_file::write_index): Likewise.
3584 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3585 function prototype.
3586
a68a081d
CC
35872013-03-01 Cary Coutant <ccoutant@google.com>
3588
3589 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3590 function into class definition in header file.
3591 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3592 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3593 New function.
3594 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3595
9d5781f8
AM
35962013-02-28 Alan Modra <amodra@gmail.com>
3597
3598 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3599 * target.cc (Target::do_plt_fde_location): New function.
3600 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3601 accessor function, and constructor param.
3602 (struct Post_fde, Post_fdes): Declare.
3603 (Cie::write): Add post_fdes param.
3604 * ehframe.cc (Fde::write): Use plt_fde_location.
3605 (struct Post_fde): Define.
3606 (Cie::write): Stash FDEs added post merge mapping.
3607 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3608 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3609 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3610 other FDEs.
3611 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3612 (Target_powerpc::has_glink): New function.
3613 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3614 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3615 glink_eh_frame_fde_32, default_fde): New data.
3616 (Stub_table::eh_frame_added_): New var.
3617 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3618 Make const.
3619 (Stub_table::add_eh_frame): New function.
3620 (Output_data_glink::add_eh_frame): New function.
3621 (Target_powerpc::make_glink_section): Call add_eh_frame.
3622
214383dd
ILT
36232013-02-15 Ian Lance Taylor <iant@google.com>
3624
3625 * options.h (DEFINE_uint64_alias): Define.
3626 (class General_options): Add -Ttext-segment as an alias for
3627 -Ttext.
3628
91c2b899
AM
36292013-02-15 Alan Modra <amodra@gmail.com>
3630
3631 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3632 (Stub_table::do_write): ..here, two places.
3633 (Stub_table::plt_call_size): Use it here too.
3634
20e2a8aa
ILT
36352013-02-11 Ian Lance Taylor <iant@google.com>
3636
3637 * descriptors.cc (Descriptors::close_all): New function.
3638 * descriptors.h (class Descriptors): Declare close_all.
3639 (close_all_descriptors): New inline function.
3640 * plugin.cc: Include "descriptors.h".
3641 (Plugin_manager::cleanup): Call close_all_descriptors.
3642
8952bc69
AM
36432013-02-06 Alan Modra <amodra@gmail.com>
3644
3645 * README: Update coding style link.
3646
29bd8b6b
CC
36472013-01-28 Cary Coutant <ccoutant@google.com>
3648
a4034750
AM
3649 * dwp.cc (File_list): New typedef.
3650 (Dwo_name_info_reader): New class.
3651 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3652 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3653 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3654 (Dwo_file::read_executable): New function.
3655 (Dwo_file::read): Move common setup code to ...
3656 (Dwo_file::make_object): ... here.
3657 (dwp_options): Add --exec/-e.
3658 (usage): Likewise.
3659 (main): Likewise.
29bd8b6b 3660
c6ac678d
ST
36612013-01-24 Sriraman Tallam <tmsriram@google.com>
3662
3663 * layout.cc (Layout::layout): Check for option text_reorder.
3664 (Layout::make_output_section): Ditto.
3665 * options.h (text_reorder): New option.
3666 * output.cc (Input_section_sort_compare): Remove special ordering
3667 of section names.
3668 (Output_section::
3669 Input_section_sort_section_name_special_ordering_compare::
3670 operator()): New function.
3671 (Output_section::sort_attached_input_sections): Use new sort function
3672 for .text.
3673 * output.h (Input_section_sort_section_name_special_ordering_compare):
3674 New struct.
3675 * testsuite/Makefile.am (text_section_grouping): Test option
3676 --no-text-reorder
3677 * testsuite/Makefile.in: Regenerate.
3678 * testsuite/text_section_grouping.sh: Check order of functions without
3679 default text reordering.
3680
50701cc1
MF
36812013-01-18 Mike Frysinger <vapier@gentoo.org>
3682
3683 * options.h (General_options): Change default to true for new_dtags.
3684
b1b00fcc
MF
36852013-01-18 Mike Frysinger <vapier@gentoo.org>
3686
3687 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3688 when enable_new_dtags is false. Only add DT_RUNPATH when
3689 enable_new_dtags is true.
3690
ec5b8187
AM
36912013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3692
3693 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3694 used in declaration and definition consistent.
3695 (Target_powerpc::symval_for_branch): Ditto.
3696
a880d4c4
ST
36972013-01-16 Sriraman Tallam <tmsriram@google.com>
3698
3699 * testsuite/plugin_final_layout.cc: Fix comment.
3700
7c381248
ST
37012013-01-16 Sriraman Tallam <tmsriram@google.com>
3702
3703 * layout.cc (Layout::layout): Do not do default sorting for
3704 text sections when section ordering is specified.
3705 (make_output_section): Ditto.
3706 * testsuite/plugin_final_layout.cc: Name the function sections
3707 to catch reordering issues.
3708
e2458743
AM
37092013-01-15 Alan Modra <amodra@gmail.com>
3710
3711 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3712 plt-thread-safe.
3713
431ed302
AM
37142013-01-15 Alan Modra <amodra@gmail.com>
3715
3716 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3717 * testsuite/Makefile.in: Regenerate.
3718
0ec6429b
AM
37192013-01-14 Alan Modra <amodra@gmail.com>
3720
3721 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3722 * testsuite/Makefile.in: Regenerate.
3723
0bf402d5
ILT
37242013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3725
36af3926 3726 PR bfd/14430
0bf402d5
ILT
3727 Fix mingw gold build with plugins enabled
3728 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3729 * configure.ac: Export DLOPEN_LIBS and add headers check.
3730 * plugin.cc: Handle non-dlfcn case.
3731 * Makefile.in: Regenerate.
3732 * config.in: Regenerate.
3733 * configure: Regenerate.
3734 * testsuite/Makefile.in: Regenerate.
3735
9e9143bc
ST
37362013-01-09 Sriraman Tallam <tmsriram@google.com>
3737
3738 * output.h (sort_attached_input_sections): Change to be public.
3739 * script-sections.cc
3740 (Output_section_definition::set_section_addresses): Sort
3741 attached input sections according to section order before linker
3742 script assigns section addresses.
3743 (Orphan_output_section::set_section_addresses): Sort
3744 attached input sections according to section order before linker
3745 script assigns section addresses.
3746 * Makefile.am (final_layout.sh): Use a simple linker script to
3747 check if section ordering still works.
3748 * Makefile.in: Regenerate.
3749
679af368
ILT
37502013-01-09 Ben Cheng <bccheng@google.com>
3751
3752 * arm.cc (Target_arm::attributes_accept_div): New function.
3753 (Target_arm::attributes_forbid_div): New function.
3754 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3755 attribute using the same new functions as what bfd/elf32_arm.c
3756 does.
3757
3136a00e
CC
37582013-01-07 Cary Coutant <ccoutant@google.com>
3759
3760 PR gold/14993
3761 * output.cc (Output_section::add_input_section): For incremental
3762 updates, don't track input sections that are allocated from patch
3763 space.
3764
f2a6224b
L
37652013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3766 Ian Lance Taylor <iant@google.com>
3767
3768 PR gold/14897
3769 * configure.ac (--enable-ld): Removed.
3770 (install_as_default): Set to yes only for --enable-gold=default
3771 or --disable-ld.
3772 * configure: Regenerated.
3773
4f46f626
L
37742013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3775
3776 * options.h (General_options): Add -fuse-ld= for GCC linker
3777 option compatibility.
3778
26e4ef59
CC
37792013-01-04 Cary Coutant <ccoutant@google.com>
3780
3781 * configure.ac: Fix typo restoring CXXFLAGS.
3782 * configure: Regenerate.
3783
3d587466
CC
37842013-01-04 Cary Coutant <ccoutant@google.com>
3785
4f46f626
L
3786 * testsuite/Makefile.am (CXXLINK_S): New macro.
3787 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3788 * testsuite/Makefile.in: Regenerate.
3d587466 3789
44db6695
L
37902013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3791
3792 * version.cc (print_version): Update copyright year to 2013.
3793
edcac0c1
ILT
37942012-12-20 Ian Lance Taylor <iant@google.com>
3795
3796 * layout.cc (Layout::special_ordering_of_input_section): New
3797 function.
3798 (Layout::layout): If input section requires special ordering, must
3799 sort input sections.
3800 (Layout::make_output_section): May sort .text input sections.
3801 (Layout::is_section_name_prefix_grouped): Remove.
3802 * layout.h (class Layout): Declare
3803 special_ordering_of_input_section. Don't declare
3804 is_section_name_prefix_grouped.
3805 * output.cc (Output_section::add_input_section): Revert last
3806 change.
3807 (Output_section::Input_section_sort::match_file_name): Don't crash
3808 if called on output section data.
3809 (Output_section::Input_section_sort_compare): Sort based on
3810 special ordering.
3811 (Output_section::Input_section_sort_section_order_index_compare):
3812 Revert last patch.
3813 (Output_section::sort_attached_input_sections): Likewise.
3814
28f2a4ac
ST
38152012-12-18 Sriraman Tallam <tmsriram@google.com>
3816
edcac0c1 3817 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3818 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3819 * output.cc (Output_section::add_input_section): Check if section
3820 name contains special prefix. Keep input sections to sort such
3821 sections.
3822 (Output_section::Input_section_sort_section_order_index_compare
3823 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3824 (Output_section::sort_attached_input_sections): Add condition to
3825 Input_section_entry constructor call.
28f2a4ac
ST
3826 * testsuite/Makefile.am (text_section_grouping): New test.
3827 * testsuite/Makefile.in: Regenerate.
3828 * testsuite/text_section_grouping.cc: New file.
3829 * testsuite/text_section_grouping.sh: New file.
3830
5bf135a7
NC
38312012-12-17 Nick Clifton <nickc@redhat.com>
3832
3833 * Makefile.am: Add copyright notice.
3834 * NEWS: Likewise.
3835 * README: Likewise.
3836 * configure.ac: Likewise.
3837 * ftruncate.c: Likewise.
3838 * Makefile.in: Regenerate.
3839
59965708
CC
38402012-12-14 Cary Coutant <ccoutant@google.com>
3841
a4034750
AM
3842 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3843 --no-as-needed flag.
3844 (exception_separate_shared_12_test): Likewise.
3845 (incremental_copy_test): Likewise.
3846 * testsuite/Makefile.in: Regenerate.
59965708 3847
2a77e2ab
CC
38482012-12-14 Cary Coutant <ccoutant@google.com>
3849
3850 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3851 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3852
e3deeb9c
AM
38532012-12-12 Alan Modra <amodra@gmail.com>
3854
3855 * powerpc.cc (class Track_tls): New.
3856 (class Relocate, class Scan): Inherit Track_tls.
3857 (Target_powerpc::Scan::local, global): Track tls optimization
3858 and avoid creating plt entry for __tls_get_addr if all uses
3859 are optimized away.
3860 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3861
d8f5a274
AM
38622012-12-12 Alan Modra <amodra@gmail.com>
3863
3864 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3865 Replace no_toc_optimize with toc_optimize.
3866 * output.h (Output_section::input_sections): Provide non-const variant.
3867 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3868 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3869 accessors.
3870 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3871 (class Sort_toc_sections): New.
3872 (Target_powerpc::do_finalize_sections): Sort toc sections.
3873 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3874
4c8a1de1
RM
38752012-12-10 Roland McGrath <mcgrathr@google.com>
3876
3877 * testsuite/binary_unittest.cc (read_all): New function.
3878 (Sized_binary_test): Use it instead of ::read.
3879 * fileread.cc (do_read): Don't assume pread always reads the whole
3880 amount in a single call.
3881
edc27beb
AM
38822012-12-10 Alan Modra <amodra@gmail.com>
3883
3884 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3885 Set EM_PPC64 or EM_PPC here.
3886 (Target_selector_powerpc::do_recognize): Delete.
3887
906b9150
AM
38882012-12-10 Alan Modra <amodra@gmail.com>
3889
3890 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3891 stub_table_.
3892 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3893
418c15ae
RM
38942012-12-07 Roland McGrath <mcgrathr@google.com>
3895
3896 * testsuite/binary_unittest.cc (Sized_binary_test):
3897 Use open_descriptor rather than ::open.
3898
decdd3bc
AM
38992012-12-07 Alan Modra <amodra@gmail.com>
3900
3901 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3902 typedef and invalid_address constant.
3903 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3904 instantiate constants.
3905
db399005
ILT
39062012-12-06 Roland McGrath <mcgrathr@google.com>
3907
3908 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3909 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3910 * aclocal.m4: Regenerate.
3911 * configure: Regenerate.
3912 * Makefile.in: Regenerate.
3913 * testsuite/Makefile.in: Regenerate.
3914
aba6bc71
AM
39152012-12-07 Alan Modra <amodra@gmail.com>
3916
3917 * options.h (General_options): Add no_toc_optimize.
3918 * powerpc.cc (ok_lo_toc_insn): New function.
3919 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3920
9e69ed50
AM
39212012-12-06 Alan Modra <amodra@gmail.com>
3922
3923 * options.h (General_options): Add plt_align, plt_static_chain,
3924 plt_thread_safe. Update stub_group_size help text.
3925 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3926 for new plt_thread_safe_ var.
3927 (use_plt_offset): Correct comments.
3928 (Target_powerpc::do_relax): Look for thread creation symbols to
3929 determine default plt_thread_safe value. Clear plt call stubs
3930 as well as branch stubs each iteration.
3931 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3932 insn constants.
3933 (l, hi, ha, write_insn): Move earlier.
3934 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3935 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3936 plt stubs too.
3937 (Stub_table::update_size): Adjust.
3938 (Stub_table::prev_size, set_prev_size): Delete.
3939 (Stub_table::stub_align): Let --plt-align affect result.
3940 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3941 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3942 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3943 (Stub_table::do_write): Support more stub variants.
3944
f43ba157
AM
39452012-12-04 Alan Modra <amodra@gmail.com>
3946
3947 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3948 (Target_powerpc::do_define_standard_symbols): New function.
3949
34171bc5
AM
39502012-12-03 Alan Modra <amodra@gmail.com>
3951
3952 * output.h: Formatting, whitespace.
3953
dc9589e9 39542012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3955
3956 * layout.h (Layout::get_executable_sections): Declare.
3957 * layout.cc (Layout::get_executable_sections): New function.
3958 * arm.cc (Target_arm::group_sections): Use it.
3959 (Arm_output_section::group_sections): Delete now redundant test.
3960 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3961 param to handle relative relocs.
3962 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3963 (Output_data_reloc::add_absolute): Adjust.
3964 (Output_data_reloc::add_relative): New function.
3965 (Output_data::reset_data_size): New function.
3966 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3967 (Output_section::set_addralign): New function.
3968 (Output_section::checkpoint_set_addralign): New function.
3969 (Output_section::clear_section_offsets_need_adjustment): New function.
3970 (Output_section::input_sections): Make public.
3971 * powerpc.cc (class Output_data_brlt_powerpc): New.
3972 (class Stub_table, class Stub_control): New.
3973 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3974 stub_table_, set_stub_table, stub_table): New vectors and accessor
3975 functions.
3976 (Target_powerpc::do_may_relax, do_relax, push_branch,
3977 new_stub_table, stub_tables, brlt_section, group_sections,
3978 add_branch_lookup_table, find_branch_lookup_table,
3979 write_branch_lookup_table, make_brlt_section): New functions.
3980 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3981 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3982 branch_info_): New vars.
3983 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3984 make call stubs here.
3985 (Output_data_glink): Remove all call stub handling from this class.
3986 (Target_powerpc::Scan::local, global): Save interesting branch
3987 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3988 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3989 functions on final link.
3990 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3991 Handle long branch destinations too.
3992 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3993 do_plt_address_for_local): Adjust lookup of plt call stubs.
3994
627b30b7
AM
39952012-11-30 Alan Modra <amodra@gmail.com>
3996
3997 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3998 relocs against protected symbols when building 32-bit shared libs.
3999
40b469d7
AM
40002012-11-30 Alan Modra <amodra@gmail.com>
4001
4002 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4003 param. Call got_section() to make .got. Update all callers
4004 and their callers and so on.
4005
bb66a627
AM
40062012-11-30 Alan Modra <amodra@gmail.com>
4007
4008 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4009 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4010 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4011 value if it already exists.
4012
d2cf1c6c
L
40132012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4014
4015 PR gold/14858
4016 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4017
edccdf7c
RM
40182012-11-14 Roland McGrath <mcgrathr@google.com>
4019
4020 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4021 than bfc instruction for data sandboxing.
4022
6febeb74
AM
40232012-11-08 Alan Modra <amodra@gmail.com>
4024
4025 * po/POTFILES.in: Regenerate.
4026
0a6f1bf2
AM
40272012-11-05 Alan Modra <amodra@gmail.com>
4028
4029 * configure.ac: Apply 2012-09-10 change to config.in here.
4030 * configure: Regenerate.
4031
26a4e9cb
AM
40322012-11-05 Alan Modra <amodra@gmail.com>
4033
4034 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4035 (struct Opd_ent): Use "Address" rather than "Offset".
4036 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4037 (Target_powerpc::got_section): Make public.
4038 (Target_powerpc::scan_relocs): Move code setting symbols..
4039 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4040 Create _SDA_BASE_ only when referenced.
4041
cc928013
RM
40422012-11-02 Roland McGrath <mcgrathr@google.com>
4043
4044 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4045 from last change.
4046
50ed5eb1
RM
40472012-11-01 Roland McGrath <mcgrathr@google.com>
4048
62fe925a
RM
4049 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4050 for offset_in_output_section parameter.
4051 (Sized_target::relocate_special_relocatable): Likewise.
4052 * arm.cc (Target_arm::relocate_relocs): Likewise.
4053 (Target_arm::relocate_special_relocatable): Likewise.
4054 * i386.cc (Target_i386::relocate_relocs): Likewise.
4055 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4056 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4057 * target-reloc.h (relocate_relocs): Likewise.
4058 * testsuite/testfile.cc (Target_test): Likewise.
4059 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4060 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4061
4062 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4063 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4064
4065 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4066 parameter, which is unused in the [!F_SETFD] case.
4067
50ed5eb1
RM
4068 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4069 SYMNDX to off_t before comparing it to this->data_size().
4070 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4071 * incremental.cc (Output_section_incremental_inputs::do_write):
4072 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4073
2cadc0bf
RM
4074 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4075
3bfcb652
NC
40762012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4077
4078 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4079 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4080 in EABI_VER5.
4081
c1a8d56e
CC
40822012-10-29 Cary Coutant <ccoutant@google.com>
4083
4084 * dwp.cc (usage): Add file and exit status parameters;
4085 add --help and --version options.
4086 (print_version): New function.
4087 (main): Add --help and --version options.
4088
b2490a7b
L
40892012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4090
4091 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4092 final_layout_sequence.txt.
4093 * testsuite/Makefile.in: Regenerated.
4094
aa543512
L
40952012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4096
4097 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4098 COMPILE generated by automake.
4099 (LINK1): Likewise.
4100 (CXXCOMPILE1): Likewise.
4101 (CXXLINK1): Likewise.
4102 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4103 (LINK): Likewise.
4104 (CXXCOMPILE): Likewise.
4105 (CXXLINK): Likewise.
4106 * testsuite/Makefile.in: Regenerated.
4107
d361fafb
L
41082012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4109
4110 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4111 on bad fwrite return.
4112
598c7410
L
41132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4114
4115 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4116 on val.
4117
35c813e2
CC
41182012-10-23 Cary Coutant <ccoutant@google.com>
4119
4120 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4121 * testsuite/Makefile.in: Regenerate.
4122 * testsuite/dwp_test.h: New source file.
4123 * testsuite/dwp_test_1.cc: New source file.
4124 * testsuite/dwp_test_1.s: New source file.
4125 * testsuite/dwp_test_1.sh: New source file.
4126 * testsuite/dwp_test_1b.cc: New source file.
4127 * testsuite/dwp_test_1b.s: New source file.
4128 * testsuite/dwp_test_2.cc: New source file.
4129 * testsuite/dwp_test_2.s: New source file.
4130 * testsuite/dwp_test_2.sh: New source file.
4131 * testsuite/dwp_test_main.cc: New source file.
4132 * testsuite/dwp_test_main.s: New source file.
4133
77429909
CC
41342012-10-23 Cary Coutant <ccoutant@google.com>
4135
4136 * dwp.h: New header file.
4137 * dwp.cc: New source file.
4138 * gold.h: Move shared declarations to system.h.
4139 * system.h: New header file.
4140 * Makefile.am: Add dwp.
4141 * Makefile.in: Regenerate.
4142
ed5d6712
CC
41432012-10-23 Cary Coutant <ccoutant@google.com>
4144
4145 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4146 Dwarf_info_reader::read_from_pointer.
4147 (Dwarf_pubnames_table::read_header): Likewise.
4148 (Dwarf_pubnames_table::next_name): Likewise.
4149 (Dwarf_die::read_attributes): Likewise.
4150 (Dwarf_die::skip_attributes): Likewise.
4151 (Dwarf_info_reader::read_from_pointer): New function template.
4152 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4153 (Dwarf_pubnames_table): Likewise.
4154 (Dwarf_info_reader::read_from_pointer): New function template.
4155 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4156 Dwarf_pubnames_table ctor.
4157
8787852d
CC
41582012-10-23 Cary Coutant <ccoutant@google.com>
4159
4160 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4161 abbrev_shndx.
4162 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4163 abbrev_shndx_.
4164 (Dwarf_info_reader::set_abbrev_shndx): New method.
4165 (Dwarf_info_reader::abbrev_shndx_): New data member.
4166
9fc236f3
CC
41672012-10-23 Cary Coutant <ccoutant@google.com>
4168
4169 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4170 from object, not parameters.
4171 (Dwarf_info_reader::parse): Likewise.
4172 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4173 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4174 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4175 methods.
4176
effe8365
CC
41772012-10-23 Cary Coutant <ccoutant@google.com>
4178
4179 * fileread.cc (Input_file::Input_file): New constructor.
4180 * fileread.h (class Input_file): Add new constructor.
4181
1698990d
AM
41822012-10-18 Alan Modra <amodra@gmail.com>
4183
4184 PR gold/14727
4185 * object.cc (Relobj::is_section_name_included): Also match
4186 .sdata personality section.
4187
168a4726
AM
41882012-10-18 Alan Modra <amodra@gmail.com>
4189
4190 * target-reloc.h (class Default_comdat_behavior): New, package up..
4191 (get_comdat_behaviour): ..this.
4192 (relocate_section): Add Relocate_comdat_behavior template arg,
4193 adjust code to suit.
4194 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4195 (Target_arm::scan_reloc_section): Likewise.
4196 * i386.cc (Target_i386::relocate_section): Likewise.
4197 * sparc.cc (Target_sparc::relocate_section): Likewise.
4198 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4199 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4200 * powerpc.cc (class Relocate_comdat_behavior): New.
4201 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4202 gold::relocate_section with new template arg.
4203
acc276d8
AM
42042012-10-18 Alan Modra <amodra@gmail.com>
4205
4206 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4207 dynamic relocs for GOT_TPREL got entries, without symbol if
4208 resolving locally.
4209 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4210 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4211 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4212
e10f9870
AM
42132012-10-17 Alan Modra <amodra@gmail.com>
4214
4215 PR gold/14726
4216 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4217
ae034989
ST
42182012-10-16 Sriraman Tallam <tmsriram@google.com>
4219
4220 * layout.cc (Layout::include_section): Keep sections marked
4221 SHF_EXCLUDE when doing relocatable links.
4222
f3a0ed29
AM
42232012-10-16 Alan Modra <amodra@gmail.com>
4224
4225 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4226 (Target_powerpc::do_finalize_sections): Call it.
4227 (Output_data_save_res): New class and supporting functions.
4228 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4229 normal symbols defined in object files.
4230
c6de8ed4
AM
42312012-10-12 Alan Modra <amodra@gmail.com>
4232
4233 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4234 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4235 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4236 section if scan_opd_relocs not yet called.
4237 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4238
03e25981
AM
42392012-10-12 Alan Modra <amodra@gmail.com>
4240
4241 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4242 add_local_ifunc_entry): Revert last change.
4243 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4244
c9824451
AM
42452012-10-05 Alan Modra <amodra@gmail.com>
4246
4247 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4248 do_plt_address_for_global): New functions.
4249 (Output_data_got_powerpc::do_write): Don't segfault when linking
4250 statically.
4251 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4252 add_local_ifunc_entry): Return true on adding entry..
4253 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4254 glink->add_entry call. Remove unused symtab param. Adjust calls.
4255 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4256 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4257 set up symbols here.
4258 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4259 syms here. Do so even when no .iplt. Don't segfault when linking
4260 statically.
4261 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4262 new variants without reloc param.
4263 (Glink_sym_ent::Glink_sym_ent): Likewise.
4264 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4265 reloc when refs will resolve to plt call stub.
4266 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4267 R_PPC_PLTREL24 to resolve locally.
4268 (Target_powerpc::Scan::global): Correct ifunc handling.
4269 (Target_powerpc::Relocate::relocate): Correct local sym glink
4270 lookup. Don't destroy "value" when we have a plt call stub,
4271 and when checking plt call validity.
4272 (Target_powerpc::do_dynsym_value): Simplify.
4273
19fec8c1
AM
42742012-10-05 Alan Modra <amodra@gmail.com>
4275
4276 * i386.cc (Output_data_plt_i386::address_for_global,
4277 address_for_local): Add plt offset to returned value. Adjust uses.
4278 * sparc.cc (Output_data_plt_sparc::address_for_global,
4279 address_for_local): Likewise.
4280 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4281 address_for_local): Likewise.
4282 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4283 address_for_local): Likewise.
4284 * target.h (Target::plt_address_for_global, plt_address_for_local):
4285 Update comment.
4286 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4287 (Output_data_got::Got_entry::write): Nor here.
4288 * output.h: Comment fix.
4289
e867b647
WL
42902012-10-02 Jiong Wang <jiwang@tilera.com>
4291
4292 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4293 global_offset_table_ value for larget got.
4294 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4295
e5d5f5ed
AM
42962012-09-29 Alan Modra <amodra@gmail.com>
4297
4298 * powerpc.cc (Target_powerpc::iplt_): New output section.
4299 (Target_powerpc::iplt_section, make_iplt_section,
4300 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4301 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4302 Target_powerpc::plt_entry_count): Count iplt entries too.
4303 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4304 reloc section in constructor. New params.
4305 (Target_powerpc::make_plt_section): Create reloc section here instead.
4306 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4307 functions.
4308 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4309 (Output_data_glink::add_entry, find_entry): New functions to
4310 deal with local syms.
4311 (Glink_sym_ent): Add support for local syms.
4312 (Output_data_glink::do_write): Handle ifunc plt entries.
4313 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4314 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4315 (Target_powerpc::Relocate::relocate): Likewise.
4316 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4317
ec4dbad3
AM
43182012-09-25 Alan Modra <amodra@gmail.com>
4319
4320 * object.h (Sized_relobj_file::adjust_local_symbol,
4321 do_adjust_local_symbol): New functions.
4322 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4323 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4324 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4325 and irregular opd entry spacing.
4326 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4327 (Global_symbol_visitor_opd): New functor.
4328 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4329 on deleted opd entries.
4330
5c0b3823
WL
43312012-09-15 Jiong Wang <jiwang@tilera.com>
4332
4333 * tilegx.cc: New file.
4334 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4335 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4336 * configure.tgt: Add entries for tilegx*.
4337 * configure.ac: Likewise.
4338 * Makefile.in: Rebuild.
4339 * configure: Likewise.
4340 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4341 tilegx.
4342
bfdfa4cd
AM
43432012-09-13 Alan Modra <amodra@gmail.com>
4344
4345 * target-reloc.h (scan_relocs): Call scan.local for relocs
4346 against symbols in discarded sections. Pass is_discarded
4347 param.
4348 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4349 Add is_discarded param.
4350 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4351 is_discarded to flag opd entry as discarded. Don't emit dyn
4352 relocs on such entries.
4353 (Target_powerpc::Scan::global): Similarly detect and handle
4354 such opd entries.
4355 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4356 opd_ent_. Update all uses.
4357 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4358 (Target_powerpc::relocate_section): Zero out discarded opd
4359 entry relocs.
4360
d77a0555
ILT
43612012-09-12 Ian Lance Taylor <iant@google.com>
4362
4363 PR gold/14570
4364 * output.cc: Rename Output_data_got template parameter from size
4365 to got_size for all functions. Compile all variants of
4366 Output_data_got.
4367 (Output_data_got::Got_entry::write): Correct use of size for
4368 symbol value. Use local_is_tls rather than casting to
4369 Sized_relobj_file.
4370 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4371 (class Sized_relobj_file): Add do_local_is_tls.
4372 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4373
815a1205
AM
43742012-09-11 Alan Modra <amodra@gmail.com>
4375
4376 PR gold/14566
4377 * layout.cc (Layout::set_segment_offsets): When using
4378 common-page-size alignment, ensure we are on a new max-page-size
4379 page.
4380 * output.cc (Output_segment::set_section_addresses): Use
4381 abi_pagesize, not common_pagesize for relro boundary.
4382 (Output_segment::set_offset): Likewise.
4383
bd73a62d
AM
43842012-09-11 Alan Modra <amodra@gmail.com>
4385
4386 * output.h (Output_data_got::add_global_tls, add_local_tls,
4387 add_local_tls_pair): New functions.
4388 (Output_data_got::add_local_pair_with_rel): Remove second
4389 reloc param. Expand comment.
4390 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4391 use_plt_or_tls_offset_, similarly for constructor param.
4392 (Output_data_got::Got_entry::write): Add got_index param.
4393 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4394 add_local_tls_pair): New functions.
4395 (Output_data_got::Got_entry::write): Handle tls symbols
4396 with use_plt_or_tls_offset_ set specially.
4397 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4398 (Output_data_got::do_write): Replace iterator with index, pass
4399 index to entry write function.
4400 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4401 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4402 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4403 call.
4404 * i386.cc (Target_i386::Scan::local): Likewise.
4405 * sparc.cc (Target_sparc::Scan::local): Likewise.
4406 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4407 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4408 do_tls_offset_for_global): New functions.
4409 (Target_powerpc::Scan::local): Correct TLS relocations and got
4410 entry values.
4411 (Target_powerpc::Scan::global): Don't emit unnecessary
4412 dynamic relocations on TLS GOT entries.
4413
00716ab1
AM
44142012-09-10 Matthias Klose <doko@ubuntu.com>
4415
4416 * config.in: Disable sanity check for kfreebsd.
4417
c891b3f9
SA
44182012-09-10 Sterling Augustine <saugustine@google.com>
4419
4420 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4421 (Gdb_index::pubtypes_read): New parameter.
4422 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4423 to calls.
4424 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4425 pubtypes_object_.
4426
e81fea4d
AM
44272012-09-09 Alan Modra <amodra@gmail.com>
4428
4429 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4430 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4431 * gc.h (gc_process_relocs): Call target gc_add_reference.
4432 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4433 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4434 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4435 unnecessary cast.
4436 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4437 to cater for when we don't need code offset. Update use.
4438 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4439 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4440 set_opd_valid): New functions.
4441 (Target_powerpc::do_gc_add_reference): New function.
4442 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4443 stashed refs.
4444 (Target_powerpc::do_gc_mark_symbol): New function.
4445
d2d60eef
CC
44462012-09-06 Cary Coutant <ccoutant@google.com>
4447
4448 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4449 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4450 (Dwarf_die::skip_attributes): Likewise.
4451 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4452 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4453 (main): Call it.
4454 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4455
32ed4573
L
44562012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4457
4458 * testsuite/script_test_3.t: Add .got.plt output section
4459 statement.
4460 * testsuite/script_test_4.t: Likewise.
4461
f4baf0d4
AM
44622012-09-05 Alan Modra <amodra@gmail.com>
4463
4464 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4465 update all uses and lose "enum" when using type.
4466
864a1b56
AM
44672012-09-05 Alan Modra <amodra@gmail.com>
4468
4469 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4470 * configure: Regenerate.
4471 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4472 (plugin_final_layout.stdout): Likewise.
4473 (memory_test): Set page sizes to 0x1000.
4474 * testsuite/Makefile.in: Regenerate.
4475 * testsuite/discard_locals_test.sh: Add FIXME comment.
4476 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4477 * testsuite/pr14265.t: Add .got output section statement.
4478 * testsuite/script_test_2.t: Likewise.
4479 * testsuite/script_test_3.t: Likewise.
4480 * testsuite/script_test_4.t: Likewise.
4481 * testsuite/script_test_5.t: Likewise.
4482 * testsuite/script_test_6.t: Likewise.
4483 * testsuite/script_test_7.t: Likewise.
4484 * testsuite/script_test_9.t: Likewise.
4485
3ea0a085
AM
44862012-09-05 Alan Modra <amodra@gmail.com>
4487
4488 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4489 (Powerpc_relocate_functions::Status): New typedef.
4490 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4491 (Target_powerpc::Scan::local): Handle REL64.
4492 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4493 for REL32 and REL64.
4494 (Target_powerpc::symval_for_branch): New function, extracted from..
4495 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4496 checks. Report overflow errors.
4497
7404fe1b
AM
44982012-09-05 Alan Modra <amodra@gmail.com>
4499
4500 * object.h (Sized_relobj_file::emit_relocs): Delete.
4501 (Sized_relobj_file::emit_relocs_reltype): Delete.
4502 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4503 relocate_relocs for --emit-relocs.
4504 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4505 * output.h: Update comment.
4506 (Output_segment::first_section): New function.
4507 (Output_segment::first_section_load_address): Use first_section.
4508 * output.cc (Output_segment::first_section): New function extracted..
4509 (Output_segment::first_section_load_address): ..from here. Delete.
4510 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4511 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4512 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4513 adjust call to target.h function.
4514 * i386.cc (Target_i386): Likewise.
4515 * sparc.cc (Target_sparc): Likewise.
4516 * x86_64.cc (Target_x86_64): Likewise.
4517 * powerpc.cc (Target_powerpc): Likewise.
4518 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4519 first tls section has section symbol for optimised local dynamic
4520 output relocs.
4521 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4522 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4523 optimised tls code.
4524 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4525 Rename to relocate_relocs. Update error message.
4526
957564c9
AS
45272012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4528
4529 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4530 --just-symbols.
4531
dd93cd0a
AM
45322012-08-31 Alan Modra <amodra@gmail.com>
4533
4534 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4535 (Powerpc_relobj::toc_base_offset): New stub function.
4536 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4537 got_mod_index_offset to tlsld_got_offset. Update all refs.
4538 (Target_powerpc::Relocate::enum skip_tls): New.
4539 (Target_powerpc::call_tls_get_addr_): New var.
4540 (Target_powerpc::is_branch_reloc): Move to file scope.
4541 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4542 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4543 New functions.
4544 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4545 (powerpc_info): Correct common_pagesize for ppc64.
4546 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4547 (Powerpc_relocate_functions): Add overflow check enums and functions.
4548 Add non-shift version of rela, rela_ua. Delete all rel public
4549 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4550 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4551 addr16_ha3, addr14 functions.
4552 (Output_data_got_powerpc::add_constant_pair): New function.
4553 (Output_data_got_powerpc::got_base_offset): Likewise.
4554 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4555 (instruction constants): Sort, add some more.
4556 (Output_data_glink::do_write): Add and use Address typedef. Use
4557 object->toc_base_offset() stub for 64-bit.
4558 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4559 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4560 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4561 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4562 Always treat .opd relocs as against locally defined symbol.
4563 Correct condition for RELATIVE relocs.
4564 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4565 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4566 for 32-bit syms with a plt entry. Correct ppc64 toc base
4567 calculations. Handle TLS relocs, and more. Add overflow
4568 checking and adjust for Powerpc_relocate_functions changes.
4569 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4570 Reinstate --emit-relocs code with FIXME.
4571
a1373b60
AM
45722012-08-30 Alan Modra <amodra@gmail.com>
4573
4574 * layout.cc (Layout::set_segment_offsets): Set p_align to
4575 abi_pagesize, not common_pagesize.
4576 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4577 to determine whether file header can go in segment.
4578
703d02da
AM
45792012-08-30 Alan Modra <amodra@gmail.com>
4580
4581 * output.h (Output_reloc::Output_reloc <output section>): Add
4582 is_relative param. Adjust calls.
4583 (Output_reloc::add_output_section_relative): New functions.
4584 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4585 is_relative.
4586 (Output_reloc::symbol_value): Handle SECTION_CODE.
4587
16164a6b
ST
45882012-08-24 Sriraman Tallam <tmsriram@google.com>
4589
4590 * gold.cc (queue_middle_tasks): Call layout again when unique
4591 segments for sections is desired.
4592 * layout.cc (Layout::Layout): Initialize new members.
4593 (Layout::get_output_section_flags): New function.
4594 (Layout::choose_output_section): Call get_output_section_flags.
4595 (Layout::layout): Make output section for mapping to a unique segment.
4596 (Layout::insert_section_segment_map): New function.
4597 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4598 output sections marked so.
16164a6b
ST
4599 (Layout::segment_precedes): Check for unique segments when sorting.
4600 * layout.h (Layout::Unique_segment_info): New struct.
4601 (Layout::Section_segment_map): New typedef.
4602 (Layout::insert_section_segment_map): New function.
4603 (Layout::get_output_section_flags): New function.
4604 (Layout::is_unique_segment_for_sections_specified): New function.
4605 (Layout::set_unique_segment_for_sections_specified): New function.
4606 (Layout::unique_segment_for_sections_specified_): New member.
4607 (Layout::section_segment_map_): New member.
4608 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4609 Rename is_gc_pass_one to is_pass_one.
4610 Rename is_gc_pass_two to is_pass_two.
4611 Rename is_gc_or_icf to is_two_pass.
4612 Check for which pass based on whether symbols data is present.
4613 Make it two pass when unique segments for sections is desired.
4614 * output.cc (Output_section::Output_section): Initialize new
4615 members.
4616 * output.h (Output_section::is_unique_segment): New function.
4617 (Output_section::set_is_unique_segment): New function.
4618 (Output_section::is_unique_segment_): New member.
4619 (Output_section::extra_segment_flags): New function.
4620 (Output_section::set_extra_segment_flags): New function.
4621 (Output_section::extra_segment_flags_): New member.
4622 (Output_section::segment_alignment): New function.
4623 (Output_section::set_segment_alignment): New function.
4624 (Output_section::segment_alignment_): New member.
4625 (Output_segment::Output_segment): Initialize is_unique_segment_.
4626 (Output_segment::is_unique_segment): New function.
4627 (Output_segment::set_is_unique_segment): New function.
4628 (Output_segment::is_unique_segment_): New member.
4629 * plugin.cc (allow_unique_segment_for_sections): New function.
4630 (unique_segment_for_sections): New function.
4631 (Plugin::load): Add new functions to transfer vector.
4632 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4633 * Makefile.in: Regenerate.
4634 * testsuite/plugin_final_layout.sh: Check if unique segment
4635 functionality works.
4636 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4637 are available.
4638 (allow_unique_segment_for_sections): New global.
4639 (unique_segment_for_sections): New global.
4640 (claim_file_hook): Call allow_unique_segment_for_sections.
4641 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4642
1e2bee4f
CC
46432012-08-22 Cary Coutant <ccoutant@google.com>
4644
4645 * layout.cc (Layout::include_section): Don't assert on GROUP
4646 sections with --emit-relocs.
4647
1d5dfe78
CC
46482012-08-21 Cary Coutant <ccoutant@google.com>
4649
4650 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4651 if --export-dynamic-symbol names an undef symbol.
4652
c9269dff
AM
46532012-08-18 Alan Modra <amodra@gmail.com>
4654
4655 * powerpc.cc: Formatting and white space.
4656 (Powerpc_relobj): Rename got2_section_ to special_.
4657 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4658 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4659 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4660 (Target_powerpc): Add Address typedef and invalid_address. Use
4661 throughout.
4662 (Target_powerpc::is_branch_reloc): New function.
4663 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4664 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4665 for dst_mask, value and addend.
4666 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4667 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4668 (Output_data_glink::do_write): Correct toc base. Don't try to use
4669 uint16_t for 24-bit offset. Use get_output_section_offset and
4670 check return.
4671 (Target_powerpc::Scan::local): Handle more relocs.
4672 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4673 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4674 Plug in toc restoring insn after plt calls. Translate branches
4675 to function descriptor symbols to corresponding entry point.
4676 (Target_powerpc::relocate_for_relocatable): Check return from
4677 get_output_section_offset.
4678 * symtab.h: Comment typo.
4679
b1759dce
ILT
46802012-08-14 Ian Lance Taylor <iant@google.com>
4681
4682 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4683 unsupported_relocal_local to call unsupported_reloc_global.
4684
b9b2ae8b
NC
46852012-08-14 Nick Clifton <nickc@redhat.com>
4686
4687 PR ld/14265
4688 * script-sections.cc (Sections_element::output_section_name): Add
4689 keep return parameter.
4690 (Output_section_element::match_name): Add keep return parameter.
4691 Return the value of the keep_ member.
4692 * script-sections.h (class Output_section): Update
4693 output_section_name prototype.
4694 * layout.cc (Layout::keep_input_section): New public member
4695 function.
4696 (Layout::choose_output_section): Pass keep parameter to
4697 output_section_name.
4698 * layout.h (class Layout): Add keep_input_section.
4699 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4700 sections.
4701 * testsuite/Makefile.am: Add a test.
4702 * testsuite/Makefile.in: Regenerate.
4703 * testsuite/pr14265.c: Source file for the test.
4704 * testsuite/pr14265.t: Linker script for the test.
4705 * testsuite/pr14265.sh: Shell script for the test.
4706
921b5322
AM
47072012-08-14 Alan Modra <amodra@gmail.com>
4708
4709 * target.h (Target::output_section_name): New function.
4710 (Target::do_output_section_name): New function.
4711 * layout.cc (Layout::choose_output_section): Call the above.
4712 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4713
6ce78956
AM
47142012-08-14 Alan Modra <amodra@gmail.com>
4715
4716 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4717 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4718 for replace_constant call.
4719 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4720 (Output_data_glink::do_print_to_mapfile): New function.
4721 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4722 (Target_powerpc::Relocate::relocate): Likewise.
4723
d1a8cabd
AM
47242012-08-14 Alan Modra <amodra@gmail.com>
4725
4726 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4727 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4728 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4729 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4730 all references to shndx_. Handle special case for R_PPC_PLTREL24
4731 here.
4732 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4733 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4734 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4735 here.
4736 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4737 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4738
d83ce4e3
AM
47392012-08-12 Alan Modra <amodra@gmail.com>
4740
4741 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4742 (glink insn constants): Use uint32_t.
4743 (Output_data_glink::add_entry): Use insert, not [] operator.
4744
cf43a2fe
AM
47452012-08-11 Alan Modra <amodra@gmail.com>
4746
4747 * object.h (Sized_relobj_file::find_shdr): New function.
4748 (Sized_relobj_file::find_special_sections): New function.
4749 * object.cc (Sized_relobj_file::find_shdr): New function.
4750 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4751 (Sized_relobj_file::find_special_sections): New function, split out..
4752 (Sized_relobj_file::do_read_symbols): ..from here.
4753 * output.h (Output_data_got::replace_constant): New function.
4754 (Output_data_got::num_entries): New function.
4755 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4756 (Output_data_got::got_offset): Protected rather than private.
4757 (Output_data_got::replace_got_entry): New function.
4758 * output.cc (Output_data_got::replace_got_entry): New function.
4759 * powerpc.cc (class Powerpc_relobj): New.
4760 (class Powerpc_relocate_functions): Delete all psymval variants or
4761 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4762 Implement _ha functions using corresponding _hi function.
4763 (Powerpc_relobj::find_special_sections): New function.
4764 (Target_powerpc::do_make_elf_object): New function.
4765 (class Output_data_got_powerpc): New.
4766 (class Output_data_glink): New.
4767 (class Powerpc_scan_relocatable_reloc): New.
4768 Many more changes througout file.
4769
3c892704
NC
47702012-08-09 Nick Clifton <nickc@redhat.com>
4771
4772 * po/vi.po: Updated Vietnamese translation.
4773
82435b3b
ILT
47742012-08-07 Ian Lance Taylor <iant@google.com>
4775
4776 * layout.cc (Layout::add_target_dynamic_tags): If
4777 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4778 plt_rel.
4779
a6dc81d2
NC
47802012-07-30 Nick Clifton <nickc@redhat.com>
4781
4782 * po/gold.pot: Updated template.
4783 * po/es.po: Updated Spanish translation.
4784
f1415016
CC
47852012-07-18 Cary Coutant <ccoutant@google.com>
4786
4787 PR gold/14344
4788 * configure.ac: Add check for -gpubnames support.
4789 * configure: Regenerate.
4790 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4791 support; force -gno-pubnames.
4792 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4793 support.
4794 (gdb_index_test_4): New test.
4795 * testsuite/Makefile.in: Regenerate.
4796 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4797 * testsuite/gdb_index_test_2.sh: Likewise.
4798 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4799 * testsuite/gdb_index_test_4.sh: New script.
4800 * testsuite/gdb_index_test_comm.sh: New script with common code;
4801 don't look for space after colon.
4802
b7fd7c37
ST
48032012-07-16 Sriraman Tallam <tmsriram@google.com>
4804
4805 * gold.cc (queue_middle_tasks): Update function order only after
4806 deferred objects due to plugins are processed.
4807
1f3212db
ILT
48082012-07-11 Ian Lance Taylor <iant@google.com>
4809
4810 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4811 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4812 (Target_arm::scan_reloc_for_stub): Likewise.
4813 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4814 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4815 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4816 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4817 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4818
81c82a68
ILT
48192012-07-10 Dodji Seketeli <dodji@redhat.com>
4820 Ian Lance Taylor <iant@google.com>
4821
4822 PR gold/14309
4823 * configure.ac: Test whether std::tr1::hash<off_t> works.
4824 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4825 needed.
4826 * output.h (class Output_fill): Add virtual destructor.
4827 * configure, config.in: Rebuild.
4828
eabc84f4
RM
48292012-06-22 Roland McGrath <mcgrathr@google.com>
4830
4831 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4832
370e30b6
RÁE
48332012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4834
4835 * plugin.cc (Plugin::load): Handle position independent executables.
4836
fb1b895d
CC
48372012-06-06 Cary Coutant <ccoutant@google.com>
4838
4839 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4840 add .debug_macro.
4841 (lines_only_debug_sections): Likewise.
4842 (gdb_fast_lookup_sections): New static array.
4843 (is_gdb_debug_section): Rename formal parameter.
4844 (is_lines_only_debug_section): Likewise.
4845 (is_gdb_fast_lookup_section): New function.
4846 (Layout::include_section): Check for ".zdebug_" prefix; pass
4847 section name suffix to is_gdb_debug_section, et al.; check for
4848 fast-lookup sections when building .gdb_index.
4849 * options.h (--strip-debug-gdb): Update GDB version number.
4850
7c0640fa
CC
48512012-06-06 Cary Coutant <ccoutant@google.com>
4852
4853 * configure.ac: Add check for fallocate.
4854 * configure: Regenerate.
4855 * config.in: Regenerate.
4856
4857 * options.h (class General_options): Add --mmap-output-file and
4858 --posix-fallocate options.
4859 * output.cc: (posix_fallocate): Remove; replace with...
4860 (gold_fallocate): New function.
4861 (Output_file::map_no_anonymous): Call gold_fallocate.
4862 (Output_file::map): Check --mmap-output-file option.
4863
2a49eb69
DK
48642012-06-05 Jing Yu <jingyu@google.com>
4865
4866 * gold.h (textdomain): Add do {} to empty while(0).
4867 (bindtextdomain): Likewise.
4868
fad072ac
CC
48692012-06-04 Cary Coutant <ccoutant@google.com>
4870
4871 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4872 has_dynsym_index.
4873
8cc69fb6
ST
48742012-05-25 Sriraman Tallam <tmsriram@google.com>
4875
4876 * symtab.cc (Symbol_table::define_special_symbol):
4877 Initialize *poldsym to prevent uninitialized variable errors.
4878
1be75daa
CC
48792012-05-23 Cary Coutant <ccoutant@google.com>
4880
4881 * layout.cc (Layout::section_name_mapping): Add rules to handle
4882 exact match on .data.rel.ro.local or .data.rel.ro.
4883 (Layout::output_section_name): Check for exact matches.
4884
9b689de0
CC
48852012-05-23 Cary Coutant <ccoutant@google.com>
4886
4887 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4888 more carefully.
4889
b24fdbf5
CC
48902012-05-22 Cary Coutant <ccoutant@google.com>
4891
4892 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4893 object before exporting symbol.
4894
e550e1a2
L
48952012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4896
4897 * testsuite/tls_test.cc: Include "config.h" first.
4898 * testsuite/tls_test_c.c: Likewise.
4899
df7b86aa
NC
49002012-05-17 Daniel Richard G. <skunk@iskunk.org>
4901 Nick Clifton <nickc@redhat.com>
4902
4903 PR 14072
4904 * configure.in: Add check that sysdep.h has been included before
4905 any system header files.
4906 * configure: Regenerate.
4907 * config.in: Regenerate.
4908
1007b503
CC
49092012-05-14 Cary Coutant <ccoutant@google.com>
4910
4911 * layout.cc (Layout::make_output_section): Mark .tdata section
4912 as RELRO.
4913 * testsuite/relro_test.cc: Add a TLS variable.
4914
fd885f3a
L
49152012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4916
4917 PR gold/14091
4918 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4919 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4920 R_X86_64_64.
4921
80f5885c
CC
49222012-05-08 Cary Coutant <ccoutant@google.com>
4923
4924 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4925 (lines_only_debug_sections): Likewise.
4926
2e702c99
RM
49272012-05-02 Roland McGrath <mcgrathr@google.com>
4928
4929 * nacl.cc: New file.
4930 * nacl.h: New file.
4931 * Makefile.am (CCFILES, HFILES): Add them.
4932 * Makefile.in: Regenerate.
4933 * i386.cc (Output_data_plt_i386_nacl): New class.
4934 (Output_data_plt_i386_nacl_exec): New class.
4935 (Output_data_plt_i386_nacl_dyn): New class.
4936 (Target_i386_nacl): New class.
4937 (Target_selector_i386_nacl): New class.
4938 (target_selector_i386): Use it instead of Target_selector_i386.
4939 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4940 (Target_x86_64_nacl): New class.
4941 (Target_selector_x86_64_nacl): New class.
4942 (target_selector_x86_64, target_selector_x32): Use it instead of
4943 Target_selector_x86_64.
4944 * arm.cc (Output_data_plt_arm_nacl): New class.
4945 (Target_arm_nacl): New class.
4946 (Target_selector_arm_nacl): New class.
4947 (target_selector_arm, target_selector_armbe): Use it instead of
4948 Target_selector_arm.
4949
4950 * target-select.cc (select_target): Take new Input_file* and off_t
4951 arguments, pass them on to recognize method of selector.
4952 * object.cc (make_elf_sized_object): Update caller.
4953 * parameters.cc (parameters_force_valid_target): Likewise.
4954 * incremental.cc (make_sized_incremental_binary): Likewise.
4955 * target-select.h: Update decl.
4956 (Target_selector::recognize): Take new Input_file* argument,
4957 pass it on to do_recognize.
4958 (Target_selector::do_recognize): Take new Input_file* argument.
4959 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4960 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4961 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4962 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4963
4964 * target.h (Target::Target_info): New members isolate_execinstr
4965 and rosegment_gap.
4966 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4967 * arm.cc (Target_arm::arm_info): Update initializer.
4968 * i386.cc (Target_i386::i386_info): Likewise.
4969 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4970 * sparc.cc (Target_sparc::sparc_info): Likewise.
4971 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4972 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4973 * layout.cc (Layout::attach_allocated_section_to_segment):
4974 Take new const Target* argument. If target->isolate_execinstr(), act
4975 like --rosegment.
4976 (Layout::find_first_load_seg): Take new const Target* argument;
4977 if target->isolate_execinstr(), reject PF_X segments.
4978 (Layout::relaxation_loop_body): Update caller.
4979 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4980 reset file offset to zero when we hit LOAD_SEG, and then do a second
4981 loop over the segments before LOAD_SEG to reassign offsets after
4982 addresses have been determined. Handle target->rosegment_gap().
4983 (Layout::attach_section_to_segment): Take new const Target* argument;
4984 pass it to attach_allocated_section_to_segment.
4985 (Layout::make_output_section): Update caller.
4986 (Layout::attach_sections_to_segments): Take new const Target* argument;
4987 pass it to attach_section_to_segment.
4988 * gold.cc (queue_middle_tasks): Update caller.
4989 * layout.h (Layout): Update method decls with new arguments.
4990
4991 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4992 Target_info pointer to use.
4993 (Target_arm::do_make_data_plt): New virtual method.
4994 (Target_arm::make_data_plt): New method that calls it.
4995 (Target_arm::make_plt_entry): Use it.
4996 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4997 for the section alignment.
4998 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4999 method.
5000 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5001 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5002 method.
5003 (Output_data_plt_arm::get_plt_entry_size): Call it.
5004 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5005 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5006 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5007 method.
5008 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5009 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5010 method instead of sizeof(plt_entry).
5011 (Output_data_plt_arm::add_entry): Likewise.
5012 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5013 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5014 than static method.
5015 (Target_arm::plt_entry_size): Likewise.
5016 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5017 Move to ...
5018 (Output_data_plt_arm_standard): ... here, new class.
5019 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5020 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5021 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5022
5023 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5024 Take additional argument for the PLT entry size.
5025 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5026 Use get_plt_entry_size method rather than plt_entry_size variable.
5027 (Output_data_plt_x86_64::reserve_slot): Likewise.
5028 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5029 (Output_data_plt_x86_64::add_entry): Likewise.
5030 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5031 (Output_data_plt_x86_64::address_for_global): Likewise.
5032 (Output_data_plt_x86_64::address_for_local): Likewise.
5033 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5034 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5035 Make method non-static.
5036 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5037 method.
5038 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5039 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5040 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5041 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5042 virtual method.
5043 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5044 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5045 virtual method.
5046 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5047 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5048 virtual method.
5049 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5050 (Output_data_plt_x86_64::plt_entry_size)
5051 (Output_data_plt_x86_64::first_plt_entry)
5052 (Output_data_plt_x86_64::plt_entry)
5053 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5054 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5055 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5056 (Output_data_plt_x86_64_standard): ... here, new class.
5057 (Target_x86_64::Target_x86_64): Take optional argument for the
5058 Target_info pointer to use.
5059 (Target_x86_64::do_make_data_plt): New virtual method.
5060 (Target_x86_64::make_data_plt): New method to call it.
5061 (Target_x86_64::init_got_plt_for_update): Use that.
5062 Call this->plt_->add_eh_frame method here.
5063 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5064 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5065 rather than static method.
5066 (Target_x86_64::plt_entry_size): Likewise.
5067 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5068 rather than plt_entry_size variable. Move guts of PLT filling to...
5069 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5070 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5071 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5072
5073 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5074 additional argument for the section alignment.
5075 Don't do add_eh_frame_for_plt here.
5076 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5077 non-static. Use get_plt_entry_size method rather than plt_entry_size
5078 variable.
5079 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5080 method.
5081 (Output_data_plt_i386::get_plt_entry_size): Call it.
5082 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5083 (Output_data_plt_i386::add_eh_frame): New method to call it.
5084 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5085 method.
5086 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5087 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5088 method.
5089 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5090 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5091 method instead of plt_entry_size.
5092 (Output_data_plt_i386::plt_entry_size)
5093 (Output_data_plt_i386::plt_eh_frame_fde_size)
5094 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5095 (Output_data_plt_i386_standard): ... here, new class.
5096 (Output_data_plt_i386_exec): New class.
5097 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5098 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5099 (Output_data_plt_i386::exec_plt_entry): Move to ...
5100 (Output_data_plt_i386_exec::plt_entry): ... here.
5101 (Output_data_plt_i386_dyn): New class.
5102 (Output_data_plt_i386::first_plt_entry): Move to ...
5103 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5104 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5105 (Output_data_plt_i386_dyn::plt_entry): ... here.
5106 (Target_i386::Target_i386): Take optional argument for the Target_info
5107 pointer to use.
5108 (Target_i386::do_make_data_plt): New virtual method.
5109 (Target_i386::make_data_plt): New method to call it.
5110 (Target_i386::make_plt_section): Use that.
5111 Call this->plt_->add_eh_frame method here.
5112 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5113 rather than plt_entry_size variable.
5114 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5115 (Output_data_plt_i386::address_for_local): Likewise.
5116 (Output_data_plt_i386::do_write): Likewise.
5117 Move guts of PLT filling to...
5118 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5119 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5120 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5121 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5122
b9b9f2ee
CC
51232012-05-01 Cary Coutant <ccoutant@google.com>
5124
5125 * dwarf_reader.cc (Dwarf_die::read_attributes)
5126 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5127 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5128 * reduced_debug_output.cc
5129 (Output_reduced_debug_info_section::get_die_end): Remove
5130 DW_FORM_GNU_ref_index. Add default case.
5131
57923f48
MW
51322012-04-26 Mark Wielaard <mjw@redhat.com>
5133
5134 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5135 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5136 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5137 DW_AT_high_pc as offset from DW_AT_low_pc.
5138
5139 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5140 * testsuite/Makefile.in: Regenerate.
5141 * testsuite/gdb_index_test_3.c: New test source file.
5142 * testsuite/gdb_index_test_3.sh: New test source file.
5143
2c54b4f4
ILT
51442012-04-25 Ian Lance Taylor <iant@google.com>
5145
5146 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5147 pointer.
5148 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5149 as a class, not a struct.
5150 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5151 (Target_arm::apply_cortex_a8_workaround): Likewise.
5152 * gc.h: Declare Reloc_types as a struct, not a class.
5153 * object.h: Declare Symbols_data as a struct.
5154 * reloc.h: Declare Read_relocs_data as a struct.
5155 * target.h: Declare Relocate_info as a struct.
5156
a5a5f7a3
DM
51572012-04-24 David S. Miller <davem@davemloft.net>
5158
5159 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5160 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5161 and R_SPARC_WPLT30.
5162
f038d496
CC
51632012-04-24 Cary Coutant <ccoutant@google.com>
5164
5165 * incremental-dump.cc (find_input_containing_global): Replace
5166 magic number with symbolic constant.
5167 (dump_incremental_inputs): Update version number.
5168 * incremental.cc (Output_section_incremental_inputs): Update version
5169 number; import symbolic constants from Incremental_inputs_reader.
5170 (Incremental_inputs::create_data_sections): Align relocations
5171 section correctly for 64-bit targets.
5172 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5173 constants; add padding.
5174 (Output_section_incremental_inputs::write_header): Add assert for
5175 header_size.
5176 (Output_section_incremental_inputs::write_input_files): Add assert
5177 for input_entry_size.
5178 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5179 add assert for object_info_size, input_section_entry_size,
5180 global_sym_entry_size.
5181 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5182 for data structure sizes; use them.
5183 (Incremental_input_entry_reader): Import symbolic constants from
5184 Incremental_inputs_reader; use them.
5185
a4d85145
DM
51862012-04-23 David S. Miller <davem@davemloft.net>
5187
5188 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5189 and elf_flags_set_.
5190 (Target_sparc::Target_sparc): Initialize new fields.
5191 (Target_sparc::do_make_elf_object): New function.
5192 (Target_sparc::do_adjust_elf_header): New function.
5193
1d509098
CC
51942012-04-23 Cary Coutant <ccoutant@google.com>
5195
5196 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5197 CU range table of gdb index.
5198
7ebeff7f
DM
51992012-04-20 David S. Miller <davem@davemloft.net>
5200
5201 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5202 instead of false.
5203
13cf9988
DM
52042012-04-16 David S. Miller <davem@davemloft.net>
5205
2a1079e8
DM
5206 * sparc.cc (Target_sparc::got_address): New function.
5207 (Sparc_relocate_functions::gdop_hix22): New function.
5208 (Sparc_relocate_functions::gdop_lox10): New function.
5209 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5210 relocs.
5211 (Target_sparc::Scan::local): Likewise if the global symbol is not
5212 preemptible and is not IFUNC.
5213 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5214 transformations for local and non-preemptible non-IFUNC global
5215 symbols.
5216
0bc964fc
DM
5217 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5218 writing out 64-bit part of ranges.
5219
661d7a80
DM
5220 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5221 -fpic and -fpie respectively.
5222 * Makefile.in: Regenerate.
5223
8c2bf391
DM
5224 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5225 (Target_sparc::Target_sparc): Initialize new field.
5226 (Target_sparc::do_plt_section_for_global): New function.
5227 (Target_sparc::do_plt_section_for_local): New function.
5228 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5229 (Target_sparc::make_plt_section): New function, broken out of
5230 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5231 (Target_sparc::make_plt_entry): Call make_plt_section.
5232 (Target_sparc::make_local_ifunc_plt_entry): New function.
5233 (Target_sparc::rela_ifunc_section): New function.
5234 (Target_sparc::plt_section): Remove const.
5235 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5236 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5237 and ifunc_count_ fields.
5238 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5239 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5240 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5241 (Output_data_plt_sparc::rela_ifunc): New function.
5242 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5243 (Output_data_plt_sparc::has_ifunc_section): New function.
5244 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5245 (Output_data_plt_sparc::address_for_global): New function.
5246 (Output_data_plt_sparc::address_for_local): New function.
5247 (Output_data_plt_sparc::plt_index_to_offset): New function.
5248 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5249 and entry_count.
5250 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5251 entry_count.
5252 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5253 R_SPARC_JMP_IREL to switch.
5254 (Target_sparc::Scan::check_non_pic): Likewise.
5255 (Target_sparc::Scan::local): Handle IFUNC symbols.
5256 (Target_sparc::Scan::local): Likewise.
5257 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5258 and plt_address_for_local.
5259 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5260 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5261
13cf9988
DM
5262 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5263 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5264 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5265 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5266 global relocs too.
5267 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5268 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5269 calls.
5270 * sparc.cc (Target_sparc::Scan::global): Likewise.
5271 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5272
31821be0
CC
52732012-04-16 Cary Coutant <ccoutant@google.com>
5274
5275 * archive.cc (Library_base::should_include_member): Check for
5276 --export-dynamic-symbol.
5277 * options.h (class General_options): Add --export-dynamic-symbol.
5278 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5279 --export-dynamic-symbol.
5280 (Symbol_table::gc_mark_undef_symbols): Likewise.
5281 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5282
2615994e
DM
52832012-04-12 David S. Miller <davem@davemloft.net>
5284
5285 * sparc.cc (Reloc::wdisp10): New relocation method.
5286 (Reloc::h34): Likewise.
5287 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5288 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5289 R_SPARC_WDISP10.
5290 (Target_sparc::Scan::local): Likewise.
5291 (Target_sparc::Scan::global): Likewise.
5292 (Target_sparc::Relocate::relocate): Likewise.
5293
6782735d
CC
52942012-04-09 Cary Coutant <ccoutant@google.com>
5295
5296 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5297 low_pc == 0.
5298
8c7a0b00
ILT
52992012-04-06 Ian Lance Taylor <iant@google.com>
5300
5301 * timer.cc: #include <unistd.h>.
5302
58797674
RM
53032012-04-06 Roland McGrath <mcgrathr@google.com>
5304
5305 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5306 * config.in: Regenerate.
5307 * configure: Regenerate.
5308
44350750
NC
53092012-04-05 Nick Clifton <nickc@redhat.com>
5310
5311 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5312 (AM_LC_MESSAGES): Add.
5313 * aclocal.m4: Regenerate.
5314 * config.in: Regenerate.
5315 * configure: Regenerate.
5316
c1027032
CC
53172012-03-21 Cary Coutant <ccoutant@google.com>
5318
5319 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5320 * Makefile.in: Regenerate.
5321 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5322 (Sized_elf_reloc_mapper::symbol_section): New function.
5323 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5324 (make_elf_reloc_mapper): New function.
5325 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5326 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5327 (Dwarf_abbrev_table::do_get_abbrev): New function.
5328 (Dwarf_ranges_table::read_ranges_table): New function.
5329 (Dwarf_ranges_table::read_range_list): New function.
5330 (Dwarf_pubnames_table::read_section): New function.
5331 (Dwarf_pubnames_table::read_header): New function.
5332 (Dwarf_pubnames_table::next_name): New function.
5333 (Dwarf_die::Dwarf_die): New function.
5334 (Dwarf_die::read_attributes): New function.
5335 (Dwarf_die::skip_attributes): New function.
5336 (Dwarf_die::set_name): New function.
5337 (Dwarf_die::set_linkage_name): New function.
5338 (Dwarf_die::attribute): New function.
5339 (Dwarf_die::string_attribute): New function.
5340 (Dwarf_die::int_attribute): New function.
5341 (Dwarf_die::uint_attribute): New function.
5342 (Dwarf_die::ref_attribute): New function.
5343 (Dwarf_die::child_offset): New function.
5344 (Dwarf_die::sibling_offset): New function.
5345 (Dwarf_info_reader::check_buffer): New function.
5346 (Dwarf_info_reader::parse): New function.
5347 (Dwarf_info_reader::do_parse): New function.
5348 (Dwarf_info_reader::do_read_string_table): New function.
5349 (Dwarf_info_reader::lookup_reloc): New function.
5350 (Dwarf_info_reader::get_string): New function.
5351 (Dwarf_info_reader::visit_compilation_unit): New function.
5352 (Dwarf_info_reader::visit_type_unit): New function.
5353 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5354 Sized_elf_reloc_mapper.
5355 (Sized_dwarf_line_info::symbol_section): Remove function.
5356 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5357 (Sized_dwarf_line_info::read_line_mappings): Remove object
5358 parameter, adjust callers.
5359 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5360 * dwarf_reader.h: Include <sys/types.h>.
5361 (class Track_relocs): Remove forward declaration.
5362 (class Elf_reloc_mapper): New class.
5363 (class Sized_elf_reloc_mapper): New class.
5364 (class Dwarf_abbrev_table): New class.
5365 (class Dwarf_range_list): New class.
5366 (class Dwarf_ranges_table): New class.
5367 (class Dwarf_pubnames_table): New class.
5368 (class Dwarf_die): New class.
5369 (class Dwarf_info_reader): New class.
5370 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5371 (Sized_dwarf_line_info::symbol_section): Remove member function.
5372 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5373 base class.
5374 * gdb-index.cc: New source file.
5375 * gdb-index.h: New source file.
5376 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5377 and .debug_types sections, call Layout::add_to_gdb_index.
5378 (Sized_relobj_incr::do_section_name): Implement.
5379 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5380 return type; Implement.
5381 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5382 return type.
5383 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5384 parameter list and return type.
5385 (Sized_incr_dynobj::do_section_contents): Likewise.
5386 * layout.cc: Include gdb-index.h.
5387 (Layout::Layout): Initialize gdb_index_data_.
5388 (Layout::init_fixed_output_section): Check for .gdb_index section.
5389 (Layout::add_to_gdb_index): New function. Instantiate.
5390 * layout.h: Add forward declaration for class Gdb_index.
5391 (Layout::add_to_gdb_index): New member function.
5392 (Layout::gdb_index_data_): New data member.
5393 * main.cc: Include gdb-index.h.
5394 (main): Print statistics for gdb index.
5395 * object.cc (Object::section_contents): Move code into
5396 do_section_contents.
5397 (need_decompressed_section): Check for sections needed when building
5398 gdb index.
5399 (build_compressed_section_map): Likewise.
5400 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5401 gdb index.
5402 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5403 sections; call Layout::add_to_gdb_index.
5404 (Sized_relobj_file::do_decompressed_section_contents): Call
5405 do_section_contents directly.
5406 * object.h (Object::do_section_contents): Adjust parameter list and
5407 return type.
5408 (Object::do_decompressed_section_contents): Call do_section_contents
5409 directly.
5410 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5411 return type.
5412 * options.h (class General_options): Add --gdb-index option.
5413 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5414 list and return type.
5415 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5416 * reloc.h (Track_relocs::checkpoint): New function.
5417 (Track_relocs::reset): New function.
5418
5419 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5420 New test cases.
5421 * testsuite/Makefile.in: Regenerate.
5422 * testsuite/gdb_index_test.cc: New test source file.
5423 * testsuite/gdb_index_test_1.sh: New test source file.
5424 * testsuite/gdb_index_test_2.sh: New test source file.
5425
647f1574
DK
54262012-03-19 Doug Kwan <dougkwan@google.com>
5427
5428 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5429 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5430 __exidx_start and __exidx_end. Make symbol table parameter
5431 anonymous as it is not used.
5432 * gold.cc (queue_middle_tasks): Call target hook to define any
5433 target-specific symbols.
5434 * target.h (Target::define_standard_symbols): New method.
5435 (Target::do_define_standard_symbols): Same.
5436 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5437 * testsuite/Makefile.in: Regenerate.
5438 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5439 and __exidx_end.
5440 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5441 relocations are generated for __exidx_start and __exidx_end.
5442
7c6109da
DK
54432012-03-16 Doug Kwan <dougkwan@google.com>
5444
5445 * testsuite/Makefile.am: Disable test initpri3b.
5446 * testsuite/Makefile.in: Regenerate.
5447
7b8957f8
DK
54482012-03-15 Doug Kwan <dougkwan@google.com>
5449
5450 * arm.cc (Target_arm::got_section): Make .got section read-only
5451 if -z now is given.
5452
14dc9ef7
ILT
54532012-03-15 Ian Lance Taylor <iant@google.com>
5454
5455 PR gold/13850
5456 * layout.cc (Layout::make_output_section): Correctly mark
5457 SHT_INIT_ARRAY, et. al., as relro.
5458
fa40b62a
DK
54592012-03-14 Doug Kwan <dougkwan@google.com>
5460
5461 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5462 dynamic relocations for protected symbols in shared objects.
5463
fd325007
ILT
54642012-03-13 Ian Lance Taylor <iant@google.com>
5465
5466 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5467 keep the larger alignment.
5468
e8dd54e1
CC
54692012-03-12 Cary Coutant <ccoutant@google.com>
5470
5471 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5472 handling of DW_LNE_define_file.
5473
feb5f3b0
CC
54742012-03-12 Cary Coutant <ccoutant@google.com>
5475
5476 * reduced_debug_output.cc
5477 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5478 codes to switch.
5479
a1fb4256
CC
54802012-02-29 Cary Coutant <ccoutant@google.com>
5481
5482 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5483
5dd8762a
CC
54842012-02-29 Cary Coutant <ccoutant@google.com>
5485
5486 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5487 Call Object::decompressed_section_contents.
5488 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5489 New dtor.
5490 (Sized_dwarf_line_info::buffer_start_): New data member.
5491 * merge.cc (Output_merge_data::do_add_input_section): Call
5492 Object::decompressed_section_contents.
5493 (Output_merge_string::do_add_input_section): Likewise.
5494 * object.cc (need_decompressed_section): New function.
5495 (build_compressed_section_map): Decompress sections needed later.
5496 (Sized_relobj_file::do_decompressed_section_contents): New function.
5497 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5498 * object.h (Object::decompressed_section_contents): New function.
5499 (Object::discard_decompressed_sections): New function.
5500 (Object::do_decompressed_section_contents): New function.
5501 (Object::do_discard_decompressed_sections): New function.
5502 (Compressed_section_info): New type.
5503 (Compressed_section_map): Include decompressed section contents.
5504 (Sized_relobj_file::do_decompressed_section_contents): New function.
5505 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5506
7b5de7ee
CC
55072012-02-16 Cary Coutant <ccoutant@google.com>
5508
5509 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5510 * testsuite/Makefile.in: Regenerate.
5511
f9fa4a63
CC
55122012-02-14 Cary Coutant <ccoutant@google.com>
5513
5514 * options.cc (General_options::finalize): Disallow -pie and -static.
5515
2c175ebc
DK
55162012-02-03 Doug Kwan <dougkwan@google.com>
5517
5518 * arm.cc (Arm_relocate_functions::abs8,
5519 Arm_relocate_functions::abs16): Use
5520 Bits::has_signed_unsigned_overflow32.
5521 (Arm_relocate_functions::thm_abs8): Correct range of
5522 overflow check.
5523 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5524 in assertions.
5525
90cff06f
DK
55262012-02-02 Doug Kwan <dougkwan@google.com>
5527
5528 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5529 position independent outputs, not just shared objects.
5530
63887f3d
L
55312012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5532
5533 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5534 * configure: Regenerated.
5535
bef2b434
ILT
55362012-01-27 Ian Lance Taylor <iant@google.com>
5537
5538 * reloc.h (Bits): New class with static functions, copied from
5539 namespace utils in arm.cc.
5540 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5541 instead.
5542
c335b55d
L
55432012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5544
5545 * incremental.cc (write_info_blocks): Correct relocation offset.
5546
41194d9f
L
55472012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5548
5549 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5550 (Relocate::tls_gd_to_le): Likewise.
5551
1bae613c
L
55522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5553
5554 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5555
24482ca0
L
55562012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5557
5558 * configure.ac: Check if -mcmodel=medium works.
5559 * configure: Regenerated.
5560
c2c7840a
CC
55612012-01-24 Cary Coutant <ccoutant@google.com>
5562
5563 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5564 definition and ...
5565 (read_unsigned_LEB_128_x): ... this new function.
5566 (read_signed_LEB_128): Replaced with inline definition and ...
5567 (read_signed_LEB_128_x): ... this new function.
5568 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5569 (read_unsigned_LEB_128): Add inline definition.
5570 (read_signed_LEB_128_x): New function.
5571 (read_signed_LEB_128): Add inline definition.
5572 * testsuite/Makefile.am (leb128_unittest): New unit test.
5573 * testsuite/Makefile.in: Regenerate.
5574 * testsuite/leb128_unittest.cc: New unit test.
5575
833de760 55762012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5577
5578 PR gold/13617
5579 * i386.cc (Target_i386::do_code_fill): When using a jmp
5580 instruction, pad with nop instructions.
5581 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5582
618d6666
L
55832012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5584
5585 * x86_64.cc (gc_process_relocs): Add typename on types used in
5586 template.
5587 (scan_relocs): Likewise.
5588 (relocate_section): Likewise.
5589 (apply_relocation): Likewise.
5590
3660ff06
L
55912012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5592
5593 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5594 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5595 under x32.
5596
fc51264f
L
55972012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5598
5599 * x86_64.cc: Initial support for x32.
5600
dd74ae06
CC
56012012-01-03 Cary Coutant <ccoutant@google.com>
5602
5603 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5604 Use abstract base class for GOT.
5605 * gold/output.h (class Output_data_got_base): New abstract base class.
5606 (class Output_data_got): Derive from new base class, adjust ctors.
5607 (Output_data_got::reserve_slot): Make virtual; rename to
5608 do_reserve_slot; Adjust callers.
5609 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5610 pointer to abstract base class.
5611 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5612
83896202
ILT
56132011-12-18 Ian Lance Taylor <iant@google.com>
5614
5615 * object.h (Relobj::local_symbol_value): New function.
5616 (Relobj::local_plt_offset): New function.
5617 (Relobj::local_has_got_offset): New function.
5618 (Relobj::local_got_offset): New function.
5619 (Relobj::set_local_got_offset): New function.
5620 (Relobj::do_local_symbol_value): New pure virtual function.
5621 (Relobj::do_local_plt_offset): Likewise.
5622 (Relobj::do_local_has_got_offset): Likewise.
5623 (Relobj::do_local_got_offset): Likewise.
5624 (Relobj::do_set_local_got_offset): Likewise.
5625 (Sized_relobj::do_local_has_got_offset): Rename from
5626 local_has_got_offset.
5627 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5628 (Sized_relobj::do_set_local_got_offset): Rename from
5629 set_local_got_offset.
5630 (Sized_relobj_file::do_local_plt_offset): Rename from
5631 local_plt_offset.
5632 (Sized_relobj_file::do_local_symbol_value): New function.
5633 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5634 local_plt_offset.
5635 * output.cc (Output_data_got::Got_entry::write): Change object to
5636 Relobj. Use local_symbol_value.
5637 (Output_data_got::add_global_with_rel): Change rel_dyn to
5638 Output_data_reloc_generic*. Use add_global_generic.
5639 (Output_data_got::add_global_with_rela): Remove. Change all
5640 callers to use add_global_with_rel.
5641 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5642 Output_data_reloc_generic*. Use add_global_generic.
5643 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5644 callers to use add_global_pair_with_rel.
5645 (Output_data_got::add_local): Change object to Relobj*.
5646 (Output_data_got::add_local_plt): Likewise.
5647 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5648 change rel_dyn to Output_data_reloc_generic*. Use
5649 add_local_generic.
5650 (Output_data_got::add_local_with_rela): Remove. Change all
5651 callers to use all_local_with_rel.
5652 (Output_data_got::add_local_pair_with_rel): Change object to
5653 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5654 add_output_section_generic.
5655 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5656 callers to use add_local_pair_with_rel.
5657 (Output_data_got::reserve_local): Change object to Relobj*.
5658 * output.h: (class Output_data_reloc_generic): Add pure virtual
5659 declarations for add_global_generic, add_local_generic,
5660 add_output_section_generic.
5661 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5662 functions for Output_data_reloc_generic. Update declarations for
5663 changes listed in output.cc.
5664 (class Output_data_got): Change template parameter to got_size.
5665 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5666 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5667 function.
5668 (Sized_relobj_incr::do_local_plt_offset): New function.
5669 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5670 add_global_generic.
5671
76677ad0
CC
56722011-12-17 Cary Coutant <ccoutant@google.com>
5673
5674 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5675 * resolve.cc (Symbol_table::resolve): Likewise.
5676 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5677 arrays.
5678 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5679
8b8dd8d5
ILT
56802011-12-16 Ian Lance Taylor <iant@google.com>
5681
5682 * output.h (Output_data_reloc_generic::add): Only call
5683 add_dynamic_reloc if this is a dynamic reloc section.
5684
d55525b9
L
56852011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5686
5687 PR gold/13505
5688 * target-reloc.h (apply_relocation): Replace <64, false> with
5689 <size, big_endian>.
5690
ff81c7c1
NC
56912011-11-25 Nick Clifton <nickc@redhat.com>
5692
5693 * po/it.po: New Italian translation.
5694
628f39be
SA
56952011-11-17 Sterling Augustine <saugustine@google.com>
5696
5697 * script.cc (script_include_directive): Implement.
5698 (read_script_file): New local variables name and search_path. Update
5699 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5700 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5701 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5702
98ef3ea4
SA
57032011-11-11 Sterling Augustine <saugustine@google.com>
5704
5705 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5706 (file_or_sections_cmd): Likewise.
5707
f4a8b6d7
DK
57082011-11-11 Doug Kwan <dougkwan@google.com>
5709
5710 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5711 if --just-symbols is given.
5712
29ab395d
DK
57132011-11-10 Doug Kwan <dougkwan@google.com>
5714
5715 PR gold/13362
5716 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5717 when processing data relocs.
5718 * reloc.h (Relocate_functions::rel_unaligned): New method.
5719 (Relocate_functions::pcrel_unaligned): Ditto.
5720 (Relocate_functions::rel32_unaligned): Ditto.
5721 (Relocate_functions::pcrel32_unaligned): Ditto.
5722
2c339f71
DK
57232011-11-09 Doug Kwan <dougkwan@google.com>
5724
5725 PR gold/13362
5726 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5727 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5728 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5729 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5730 (Relocate_functions::rel_unaligned): New.
5731 (Relocate_functions::rel32_unaligned): New.
5732 * target-reloc.h (relocate_for_relocatable): Add code to handle
5733 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5734 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5735 arm_unaligned_reloc_r): New targets.
5736 * testsuite/Makefile.in: Regenerate.
5737 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5738 linking.
5739
3f3cddf1
ILT
57402011-11-02 Ian Lance Taylor <iant@google.com>
5741
5742 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5743 NATIVE_LINKER.
5744 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5745 * options.cc (General_options::finalize): Use library search path
5746 from configure script if specified. If not native and no sysroot,
5747 only search TOOLLIBDIR.
5748 * options.h (Search_directory::Search_directory): Change name to
5749 const std::string&.
5750 (General_options::add_to_library_path_with_sysroot): Change arg to
5751 const std::string&.
5752 * configure, Makefile.in, config.in: Rebuild.
5753
a8e2273b
ILT
57542011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5755
5756 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5757 we are working around the ARM1176 Erratum.
5758 * options.h (General_options::fix_arm1176): Add option.
5759 * testsuite/Makefile.am: Add testcases, and keep current ones
5760 working.
5761 * testsuite/Makefile.in: Regenerate.
5762 * testsuite/arm_fix_1176.s: New file.
5763 * testsuite/arm_fix_1176.sh: Likewise.
5764
cd6eab1c
ILT
57652011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5766
5767 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5768 may_use_blx_.
5769 (Target_arm::may_use_blx): Remove method.
5770 (Target_arm::set_may_use_blx): Likewise.
5771 (Target_arm::may_use_v4t_interworking): New method.
5772 (Target_arm::may_use_v5t_interworking): Likewise.
5773 (Target_arm::may_use_blx_): Remove member variable.
5774 (Arm_relocate_functions::arm_branch_common): Check for v5T
5775 interworking.
5776 (Arm_relocate_functions::thumb_branch_common): Likewise.
5777 (Reloc_stub::stub_type_for_reloc): Likewise.
5778 (Target_arm::do_finalize_sections): Correct interworking checks.
5779 * testsuite/Makefile.am: Add new tests.
5780 * testsuite/Makefile.in: Regenerate.
5781 * testsuite/arm_farcall_arm_arm.s: New test.
5782 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5783 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5784 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5785 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5786 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5787 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5788 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5789
286adcf4
CC
57902011-10-31 Cary Coutant <ccoutant@google.com>
5791
5792 PR gold/13023
5793 * expression.cc (Expression::eval_with_dot): Add
5794 is_section_dot_assignment parameter.
5795 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5796 absolute and assigning to dot within a section.
5797 * script-sections.cc
5798 (Output_section_element_assignment::set_section_addresses): Pass
5799 dot_section to set_if_absolute.
5800 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5801 as is_section_dot_assignment flag to eval_with_dot.
5802 (Output_section_element_dot_assignment::set_section_addresses):
5803 Likewise.
5804 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5805 parameter. Also set value if relative to dot_section; set the
5806 symbol's output_section.
5807 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5808 parameter. Adjust all callers.
5809 (Expression::eval_maybe_dot): Likewise.
5810 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5811 Adjust all callers.
5812 * testsuite/script_test_2.t: Test assignment of an absolute value
5813 to dot within an output section element.
5814
9634ed06
CC
58152011-10-31 Cary Coutant <ccoutant@google.com>
5816
5817 * options.h (class General_options): Add --[no-]gnu-unique options.
5818 * symtab.cc (Symbol_table::sized_write_globals): Convert
5819 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5820
de4101c7
CC
58212011-10-31 Cary Coutant <ccoutant@google.com>
5822
5823 PR gold/13359
5824 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5825 unnecessary assertion.
5826 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5827
7257cc92
ST
58282011-10-31 Sriraman Tallam <tmsriram@google.com>
5829
5830 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5831 gc_mark_symbol.
5832 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5833 gc_mark_symbol.
5834 Change to just keep the section associated with symbol.
5835 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5836 they are externally visible and --export-dynamic is turned on.
5837 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5838
bfc34b3f
ILT
58392011-10-19 Ian Lance Taylor <iant@google.com>
5840
5841 PR gold/13163
5842 * script-sections.cc
5843 (Output_section_element_dot_assignment::needs_output_section): New
5844 function.
5845
ea0d8c47
ILT
58462011-10-19 Ian Lance Taylor <iant@google.com>
5847
5848 PR gold/13204
5849 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5850 --section-start option was seen.
5851 * options.h (General_options::any_section_start): New function.
5852
abd242a9
DM
58532011-10-18 David S. Miller <davem@davemloft.net>
5854
5855 PR binutils/13301
5856 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5857 member to track relocation locations that have moved during TLS
5858 reloc optimizations.
5859 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5860 (Target_sparc::Relocate::relocate): Adjust view down by 4
5861 bytes if it matches reloc_adjust_addr_.
5862 (Target_sparc::Relocate::relocate_tls): Always move the
5863 __tls_get_addr call delay slot instruction forward 4 bytes when
5864 performing relaxation.
5865
bab9090f
CC
58662011-10-18 Cary Coutant <ccoutant@google.com>
5867
5868 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5869 (Output_file::map_no_anonymous): Check for non-zero
5870 return code from posix_fallocate.
5871
f7c5b166
CC
58722011-10-17 Cary Coutant <ccoutant@google.com>
5873
5874 PR gold/13245
5875 * plugin.cc (is_visible_from_outside): Check for symbols
5876 referenced from dynamic objects.
5877 * resolve.cc (Symbol_table::resolve): Don't count references
5878 from dynamic objects as references from real ELF files.
5879 * testsuite/plugin_test_2.sh: Adjust expected result.
5880
b490c0bb
CC
58812011-10-17 Cary Coutant <ccoutant@google.com>
5882
5883 * gold.cc: Include timer.h.
5884 (queue_middle_tasks): Stamp time.
5885 (queue_final_tasks): Likewise.
5886 * main.cc (main): Store timer in parameters. Print timers
5887 for each pass.
5888 * parameters.cc (Parameters::Parameters): Initialize timer_.
5889 (Parameters::set_timer): New function.
5890 (set_parameters_timer): New function.
5891 * parameters.h (Parameters::set_timer): New function.
5892 (Parameters::timer): New function.
5893 (Parameters::timer_): New data member.
5894 (set_parameters_timer): New function.
5895 * timer.cc (Timer::stamp): New function.
5896 (Timer::get_pass_time): New function.
5897 * timer.h (Timer::stamp): New function.
5898 (Timer::get_pass_time): New function.
5899 (Timer::pass_times_): New data member.
5900
f475cf7b
CC
59012011-10-17 Cary Coutant <ccoutant@google.com>
5902
5903 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5904 task for members of lib groups.
5905
cdd7e244
CC
59062011-10-17 Cary Coutant <ccoutant@google.com>
5907
5908 PR gold/13288
4f95c8b4 5909 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5910 (File_read::make_view): Move bounds check (replace with assert)...
5911 (File_read::find_or_make_view): ... to here.
5912
dfb45471
CC
59132011-10-12 Cary Coutant <ccoutant@google.com>
5914
4f95c8b4 5915 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5916 ::read returns less than requested size.
5917
53bbcc1b
CC
59182011-10-10 Cary Coutant <ccoutant@google.com>
5919
4f95c8b4 5920 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5921 Initialize defined_count_.
5922 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5923 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5924 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5925 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5926 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5927 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5928 member.
5929 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5930 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5931 Return zeroes instead of internal error.
5932
397b129b
CC
59332011-10-10 Cary Coutant <ccoutant@google.com>
5934
5935 PR gold/13249
4f95c8b4 5936 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5937 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5938 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5939 (Output_reloc::type_): Adjust size of bit field.
5940 (Output_reloc::use_plt_offset_): New bit field.
5941 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5942 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5943 flag. Adjust all callers.
4f95c8b4 5944 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5945 creating RELATIVE relocations.
5946
d5698657
NC
59472011-10-10 Nick Clifton <nickc@redhat.com>
5948
5949 * po/es.po: Updated Spanish translation.
5950 * po/fi.po: Updated Finnish translation.
5951
6a59a5c2
DN
59522011-10-03 Diego Novillo <dnovillo@google.com>
5953
5954 * options.cc (parse_uint): Fix dereference of RETVAL.
5955
f0558624
ST
59562011-09-29 Sriraman Tallam <tmsriram@google.com>
5957
5958 * layout.h (section_order_map_): New member.
5959 (get_section_order_map): New member function.
5960 * output.cc (Output_section::add_input_section): Check for patterns
5961 only when --section-ordering-file is specified.
5962 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5963 output_sections have been formed.
5964 * layout.cc (Layout_Layout): Initialize section_order_map_.
5965 * plugin.cc (update_section_order): Store order in order_map. Do not
5966 update the order.
5967 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5968 * testsuite/Makefile.in: Regenerate.
5969 * testsuite/plugin_section_order.c: New file.
5970 * testsuite/plugin_final_layout.cc: New file.
5971 * testsuite/plugin_final_layout.sh: New file.
5972
a7dac153
CC
59732011-09-29 Cary Coutant <ccoutant@google.com>
5974
4f95c8b4 5975 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5976 Check for NULL.
4f95c8b4 5977 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5978 symbols during incremental update.
5979 (Symbol_table::add_from_dynobj): Likewise.
5980
eebd87a5
ILT
59812011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5982 Ian Lance Taylor <iant@google.com>
5983
5984 * symtab.cc (Symbol_table::define_special_symbol): Always
5985 canonicalize version string.
5986
403a3331
CC
59872011-09-26 Cary Coutant <ccoutant@google.com>
5988
4f95c8b4
CC
5989 * gold.cc (queue_initial_tasks): Move option checks ...
5990 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5991 some options; make others fatal.
5992
235061c2
CC
59932011-09-26 Cary Coutant <ccoutant@google.com>
5994
5995 gcc PR lto/47247
5996 * plugin.cc (get_symbols_v2): New function.
5997 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5998 (is_referenced_from_outside): New function.
5999 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6000 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6001 (get_symbols): Pass version parameter.
6002 (get_symbols_v2): New function.
6003 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6004 parameter.
6005 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6006 (onload): Add LDPT_GET_SYMBOLS_V2.
6007 (all_symbols_read_hook): Use get_symbols_v2; check for
6008 LDPR_PREVAILING_DEF_IRONLY_EXP.
6009 * testsuite/plugin_test_3.sh: Update expected results.
6010
dc87f620
ILT
60112011-09-23 Simon Baldwin <simonb@google.com>
6012
6013 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6014 configuration options.
6015 * configure: Regenerate.
6016 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6017 * Makefile.in: Regenerate.
6018 * testsuite/Makefile.in: Regenerate.
6019
a8279f82
ST
60202011-09-19 Sriraman Tallam <tmsriram@google.com>
6021
6022 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6023
0c9350c8
CC
60242011-09-19 Cary Coutant <ccoutant@google.com>
6025
6026 * incremental.cc (can_incremental_update): Fix typo in comment.
6027 * incremental.h (can_incremental_update): Likewise.
6028
aa06ae28
CC
60292011-09-18 Cary Coutant <ccoutant@google.com>
6030
6031 * incremental.cc (can_incremental_update): New function.
6032 * incremental.h (can_incremental_update): New function.
6033 * layout.cc (Layout::init_fixed_output_section): Call it.
6034 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6035 * object.cc (Sized_relobj_file::do_layout): Call
6036 can_incremental_update.
6037
ebb300b2
CC
60382011-09-13 Cary Coutant <ccoutant@google.com>
6039
6040 * configure.ac: Check for glibc support for gnu_indirect_function
6041 support with static linking, setting automake conditional
6042 IFUNC_STATIC.
6043 * Makefile.in: Regenerate.
6044 * configure: Regenerate.
6045
6046 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6047 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6048 for IFUNC_STATIC.
6049 * testsuite/Makefile.in: Regenerate.
6050
1206d0d5
CC
60512011-09-13 Cary Coutant <ccoutant@google.com>
6052
6053 * incremental.cc (Sized_relobj_incr::do_layout): Call
6054 report_comdat_group for kept comdat sections.
6055 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6056 * testsuite/Makefile.in: Regenerate.
6057 * testsuite/incr_comdat_test_1.cc: New source file.
6058 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6059 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6060 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6061
40b29874
ILT
60622011-09-13 Ian Lance Taylor <iant@google.com>
6063
6064 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6065 variable external_symbols_offset.
6066
1b045aac
ILT
60672011-09-12 Ian Lance Taylor <iant@google.com>
6068
6069 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6070 triggered if object has no symbols.
6071
24c6c55a
DM
60722011-09-09 David S. Miller <davem@davemloft.net>
6073
6074 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6075 (Output_fill_debug_line::do_write): Likewise.
6076
66570254
CC
60772011-08-29 Cary Coutant <ccoutant@google.com>
6078
6079 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6080 casts to match formatting specs.
6081 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6082
8ea8cd50
CC
60832011-08-26 Cary Coutant <ccoutant@google.com>
6084
6085 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6086 remaining hole size when allocating.
6087 (Layout::make_output_section): Set fill methods for debug sections.
6088 * layout.h (Free_list::Free_list_node): Move from private to
6089 public.
6090 (Free_list::set_min_hole_size): New function.
6091 (Free_list::begin, Free_list::end): New functions.
6092 (Free_list::min_hole_): New data member.
6093 * output.cc: Include dwarf.h.
6094 (Output_fill_debug_info::do_minimum_hole_size): New function.
6095 (Output_fill_debug_info::do_write): New function.
6096 (Output_fill_debug_line::do_minimum_hole_size): New function.
6097 (Output_fill_debug_line::do_write): New function.
6098 (Output_section::Output_section): Initialize new data member.
6099 (Output_section::set_final_data_size): Ensure patch space is larger
6100 than minimum hole size.
6101 (Output_section::do_write): Fill holes in debug sections.
6102 * output.h (Output_fill): New class.
6103 (Output_fill_debug_info): New class.
6104 (Output_fill_debug_line): New class.
6105 (Output_section::set_free_space_fill): New function.
6106 (Output_section::free_space_fill_): New data member.
6107 * testsuite/Makefile.am (incremental_test_3): Add
6108 --incremental-patch option.
6109 (incremental_test_4): Likewise.
6110 (incremental_test_5): Likewise.
6111 (incremental_test_6): Likewise.
6112 (incremental_copy_test): Likewise.
6113 (incremental_common_test_1): Likewise.
6114 * testsuite/Makefile.in: Regenerate.
6115
7cf80422
NC
61162011-08-26 Nick Clifton <nickc@redhat.com>
6117
6118 * po/es.po: Updated Spanish translation.
6119
c3f7b0e5
CC
61202011-08-01 Cary Coutant <ccoutant@google.com>
6121
6122 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6123 * gold/testsuite/Makefile.in: Regenerate.
6124 * gold/testsuite/justsyms_exec.c: New source file.
6125 * gold/testsuite/justsyms_lib.c: New source file.
6126
9590bf25
CC
61272011-08-01 Cary Coutant <ccoutant@google.com>
6128
6129 * layout.cc (Layout::set_segment_offsets): Don't realign text
6130 segment if -Ttext was specified.
6131 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6132 file type.
6133 * object.h (Sized_relobj_file::e_type): New function.
6134 (Sized_relobj_file::e_type_): New data member.
6135 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6136 base address for ET_EXEC files.
6137 * target.cc (Target::do_make_elf_object_implementation): Allow
6138 ET_EXEC files with --just-symbols option.
6139
dcd8d12e
CC
61402011-07-28 Cary Coutant <ccoutant@google.com>
6141
6142 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6143 Add thread_number parameter.
6144 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6145 * workqueue-threads.cc
6146 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6147 current thread if its thread number is greater than desired thread
6148 count.
6149 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6150 Add thread_number parameter.
6151 (Workqueue::should_cancel_thread): Likewise.
6152 (Workqueue::find_runnable_or_wait): Pass thread_number to
6153 should_cancel_thread.
6154 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6155 parameter.
6156
804eb480
ST
61572011-07-22 Sriraman Tallam <tmsriram@google.com>
6158
6159 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6160 only after checking if it cannot be forced local.
6161 * symtab.h (is_externally_visible): Check if the symbol is not forced
6162 local.
6163
f1ddb600
ILT
61642011-07-15 Ian Lance Taylor <iant@google.com>
6165
6166 * options.h (class General_options): Add --print-output-format.
6167 Move -EL next to -EB, for better --help output.
6168 * target-select.cc: Include <cstdio>, "options.h", and
6169 "parameters.h".
6170 (Target_selector::do_target_bfd_name): New function.
6171 (print_output_format): New function.
6172 * target-select.h (class Target_selector): Update declarations.
6173 (Target_selector::target_bfd_name): New function.
6174 (print_output_format): Declare.
6175 * main.cc: Include "target-select.h".
6176 (main): Handle --print-output-format.
6177 * gold.cc: Include "target-select.h".
6178 (queue_initial_tasks): Handle --print-output-format when there are
6179 no input files.
6180 * parameters.cc (parameters_force_valid_target): Give a better
6181 error message if -EB/-EL does not match target.
6182 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6183 function.
6184
7d172687
ILT
61852011-07-15 Ian Lance Taylor <iant@google.com>
6186
6187 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6188 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6189 (Output_data_plt_i386::do_write): Write address of .dynamic
6190 section to first entry in .got.plt section.
6191 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6192 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6193 Initialize layout_.
6194 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6195 section to first entry in .got.plt section.
6196 * layout.h (Layout::dynamic_section): New function.
6197
e9552f7e
ST
61982011-07-13 Sriraman Tallam <tmsriram@google.com>
6199
6200 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6201 to claim_file call.
6202 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6203 input_section_position_, and input_section_glob_.
6204 (read_layout_from_file): Call function section_ordering_specified.
6205 * layout.h (is_section_ordering_specified): New function.
6206 (section_ordering_specified): New function.
6207 (section_ordering_specified_): New boolean member.
6208 * main.cc(main): Call load_plugins after layout object is defined.
6209 * output.cc (Output_section::add_input_section): Use
6210 function section_ordering_specified to check if section ordering is
6211 needed.
6212 * output.cc (Output_section::add_relaxed_input_section): Use
6213 function section_ordering_specified to check if section ordering is
6214 needed.
6215 (Output_section::update_section_layout): New function.
6216 (Output_section::sort_attached_input_sections): Check if input section
6217 must be reordered.
6218 * output.h (Output_section::update_section_layout): New function.
6219 * plugin.cc (get_section_count): New function.
6220 (get_section_type): New function.
6221 (get_section_name): New function.
6222 (get_section_contents): New function.
6223 (update_section_order): New function.
58797674 6224 (allow_section_ordering): New function.
e9552f7e
ST
6225 (Plugin::load): Add the new interfaces to the transfer vector.
6226 (Plugin_manager::load_plugins): New parameter.
6227 (Plugin_manager::all_symbols_read): New parameter.
6228 (Plugin_manager::claim_file): New parameter. Save the elf object for
6229 unclaimed objects.
6230 (Plugin_manager::get_elf_object): New function.
6231 (Plugin_manager::get_view): Change to directly use the bool to check
6232 if get_view is called from claim_file_hook.
6233 * plugin.h (input_objects): New function
6234 (Plugin__manager::load_plugins): New parameter.
6235 (Plugin_manager::claim_file): New parameter.
6236 (Plugin_manager::get_elf_object): New function.
6237 (Plugin_manager::in_claim_file_handler): New function.
6238 (Plugin_manager::in_claim_file_handler_): New member.
6239 (layout): New function.
6240 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6241 handler with an extra parameter. Make the elf object before calling
6242 claim_file handler.
6243 * testsuite/plugin_test.c (get_section_count): New function pointer.
6244 (get_section_type): New function pointer.
6245 (get_section_name): New function pointer.
6246 (get_section_contents): New function pointer.
6247 (update_section_order): New function pointer.
6248 (allow_section_ordering): New function pointer.
6249 (onload): Check if the new interfaces exist.
6250
9446efde
ILT
62512011-07-13 Ian Lance Taylor <iant@google.com>
6252
6253 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6254 relro section.
6255 * x86_64.cc (Target_x86_64::got_section): Likewise.
6256 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6257 (relro_now_test_SOURCES): New variable.
6258 (relro_now_test_DEPENDENCIES): New variable.
6259 (relro_now_test_LDFLAGS): New variable.
6260 (relro_now_test_LDADD): New variable.
6261 (relro_now_test.so): New target.
6262 * testsuite/Makefile.in: Rebuild.
6263
07aa62f2
ILT
62642011-07-12 Ian Lance Taylor <iant@google.com>
6265
6266 PR gold/12980
6267 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6268 GLOB_DAT relocation rather than a RELATIVE relocation for a
6269 protected symbol when creating a shared library.
6270 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6271 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6272 * testsuite/protected_main_1.cc (main): Test that protected
6273 function has same address.
6274
e2153196
ILT
62752011-07-11 Ian Lance Taylor <iant@google.com>
6276
6277 PR gold/12979
6278 * options.h (class General_options): Add -Bgroup.
6279 * options.cc (General_options::finalize): If -Bgroup is set,
6280 default to --unresolved-symbols=report-all.
6281 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6282 * target-reloc.h (issue_undefined_symbol_error): Handle
6283 --unresolved-symbols=report-all.
6284
6daf5215
ILT
62852011-07-08 Ian Lance Taylor <iant@google.com>
6286
6287 PR gold/11985
6288 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6289 if linker script discards key sections.
6290 (Layout::create_dynamic_symtab): Likewise.
6291 (Layout::assign_local_dynsym_offsets): Likewise.
6292 (Layout::sized_create_version_sections): Likewise.
6293 (Layout::create_interp): Likewise.
6294 (Layout::finish_dynamic_section): Likewise.
6295 (Layout::set_dynamic_symbol_size): Likewise.
6296
beabb2c6
ILT
62972011-07-08 Ian Lance Taylor <iant@google.com>
6298
6299 PR gold/12386
6300 * options.h (class General_options): Add --unresolved-symbols.
6301 * target-reloc.h (issue_undefined_symbol_error): Check
6302 --unresolved-symbols. Add comments.
6303
9c16daf1
ILT
63042011-07-08 Ian Lance Taylor <iant@google.com>
6305
6306 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6307 expression more complex.
6308
191f1a2d
ILT
63092011-07-08 Ian Lance Taylor <iant@google.com>
6310
6311 PR gold/11317
6312 * target-reloc.h (issue_undefined_symbol_error): New inline
6313 function, broken out of relocate_section.
6314 (relocate_section): Call issue_undefined_symbol_error.
6315 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6316 there is no TLS segment if we are about to issue an undefined
6317 symbol error.
6318 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6319
62855347
ILT
63202011-07-08 Ian Lance Taylor <iant@google.com>
6321
6322 PR gold/12279
6323 * resolve.cc (Symbol_table::should_override): Add fromtype
6324 parameter. Change all callers. Give error when linking together
6325 TLS and non-TLS symbol.
6326 (Symbol_table::should_override_with_special): Add fromtype
6327 parameter. Change all callers.
6328 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6329 there is no TLS segment if we have reported some errors.
6330 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6331
67181c72
ILT
63322011-07-08 Ian Lance Taylor <iant@google.com>
6333
6334 PR gold/12372
6335 * target.h (Target::plt_address_for_global): New function.
6336 (Target::plt_address_for_local): New function.
6337 (Target::plt_section_for_global): Remove.
6338 (Target::plt_section_for_local): Remove.
6339 (Target::do_plt_address_for_global): New virtual function.
6340 (Target::do_plt_address_for_local): New virtual function.
6341 (Target::do_plt_section_for_global): Remove.
6342 (Target::do_plt_section_for_local): Remove.
6343 (Target::register_global_plt_entry): Add Symbol_table and Layout
6344 parameters.
6345 * output.cc (Output_data_got::Got_entry::write): Use
6346 plt_address_for_global and plt_address_for_local.
6347 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6348 address of output section.
6349 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6350 got_irelative_, and irelative_count_ fields. Update
6351 declarations.
6352 (Output_data_plt_i386::has_irelative_section): New function.
6353 (Output_data_plt_i386::entry_count): Add irelative_count_.
6354 (Output_data_plt_i386::set_final_data_size): Likewise.
6355 (class Target_i386): Add got_irelative_ and rel_irelative_
6356 fields. Update declarations.
6357 (Target_i386::Target_i386): Initialize new fields.
6358 (Target_i386::do_plt_address_for_global): New function replacing
6359 do_plt_section_for_global.
6360 (Target_i386::do_plt_address_for_local): New function replacing
6361 do_plt_section_for_local.
6362 (Target_i386::got_section): Create got_irelative_.
6363 (Target_i386::rel_irelative_section): New function.
6364 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6365 fields. Don't define __rel_iplt_{start,end}.
6366 (Output_data_plt_i386::add_entry): Add symtab and layout
6367 parameters. Change all callers. Use different PLT and GOT for
6368 IFUNC symbols.
6369 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6370 layout parameters. Change all callers. Use different PLT and
6371 GOT.
6372 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6373 (Output_data_plt_i386::rel_irelative): New function.
6374 (Output_data_plt_i386::address_for_global): New function.
6375 (Output_data_plt_i386::address_for_local): New function.
6376 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6377 IRELATIVE GOT when changing IFUNC GOT entries.
6378 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6379 reloc.
6380 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6381 if we didn't create an IRELATIVE GOT.
6382 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6383 plt_address_for_local.
6384 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6385 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6386 got_irelative_, and irelative_count_ fields. Update
6387 declarations.
6388 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6389 Initialize new fields. Remove symtab parameter. Change all
6390 callers.
6391 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6392 irelative_count_.
6393 (Output_data_plt_x86_64::has_irelative_section): New function.
6394 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6395 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6396 fields. Update declarations.
6397 (Target_x86_64::Target_x86_64): Initialize new fields.
6398 (Target_x86_64::do_plt_address_for_global): New function replacing
6399 do_plt_section_for_global.
6400 (Target_x86_64::do_plt_address_for_local): New function replacing
6401 do_plt_section_for_local.
6402 (Target_x86_64::got_section): Create got_irelative_.
6403 (Target_x86_64::rela_irelative_section): New function.
6404 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6405 all callers. Don't create __rel_iplt_{start,end}.
6406 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6407 parameters. Change all callers. Use different PLT and GOT for
6408 IFUNC symbols.
6409 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6410 layout parameters. Change all callers. Use different PLT and
6411 GOT.
6412 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6413 parameters. Change all callers. Use different PLT and GOT for
6414 IFUNC symbols.
6415 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6416 (Output_data_plt_x86_64::rela_irelative): New function.
6417 (Output_data_plt_x86_64::address_for_global): New function.
6418 (Output_data_plt_x86_64::address_for_local): New function.
6419 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6420 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6421 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6422 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6423 parameters.
6424 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6425 reloc.
6426 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6427 symbols if we didn't create an IRELATIVE GOT.
6428 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6429 plt_address_for_local.
6430 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6431 * testsuite/ifuncvar1.c: New test file.
6432 * testsuite/ifuncvar2.c: New test file.
6433 * testsuite/ifuncvar3.c: New test file.
6434 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6435 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6436 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6437 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6438 * testsuite/Makefile.in: Rebuild.
6439
33c15b45
CC
64402011-07-07 Cary Coutant <ccoutant@google.com>
6441
6442 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6443 (two_file_test_1_ndebug.o): Likewise.
6444 (two_file_test_1b_ndebug.o): Likewise.
6445 (two_file_test_2_ndebug.o): Likewise.
6446 (two_file_test_main_ndebug.o): Likewise.
6447 (incremental_test_2): Link with no-debug versions.
6448
f48b5fb7
CC
64492011-07-06 Cary Coutant <ccoutant@google.com>
6450
6451 * gold/incremental.cc
6452 (Output_section_incremental_inputs::write_info_blocks): Check for
6453 hidden and internal symbols.
6454
221597a5
CC
64552011-07-06 Cary Coutant <ccoutant@google.com>
6456
6457 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6458 Check disposition for startup file.
6459 (Incremental_inputs::report_command_line): Ignore
6460 --incremental-startup-unchanged option.
6461 * options.cc (General_options::parse_incremental_startup_unchanged):
6462 New function.
6463 (General_options::General_options): Initialize new data member.
6464 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6465 (General_options): Add --incremental-startup-unchanged option.
6466 (General_options::incremental_startup_disposition): New function.
6467 (General_options::incremental_startup_disposition_): New data member.
6468
e24719f6
CC
64692011-07-06 Cary Coutant <ccoutant@google.com>
6470
6471 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6472 input file index to Script_info ctor.
6473 (Sized_incremental_binary::do_file_has_changed): Find the
6474 command-line argument for files named in scripts.
6475 * incremental.h (Script_info::Script_info): New ctor
6476 with input file index.
6477 (Script_info::input_file_index): New function.
6478 (Script_info::input_file_index_): New data member.
6479 (Incremental_binary::get_library): Add const.
6480 (Incremental_binary::get_script_info): Add const.
6481 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6482 * testsuite/Makefile.am (incremental_test_5): New test case.
6483 (incremental_test_6): New test case.
6484 * testsuite/Makefile.in: Regenerate.
6485
8f7c81e8
CC
64862011-07-06 Cary Coutant <ccoutant@google.com>
6487
6488 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6489 debug output when command lines differ.
6490
9fbd3822
CC
64912011-07-06 Cary Coutant <ccoutant@google.com>
6492
6493 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6494 --incremental-patch option.
6495 * layout.cc (Free_list::allocate): Extend allocation beyond original
6496 end if enabled.
6497 (Layout::make_output_section): Mark sections that should get
6498 patch space.
6499 * options.cc (parse_percent): New function.
6500 * options.h (parse_percent): New function.
6501 (DEFINE_percent): New macro.
6502 (General_options): Add --incremental-patch option.
6503 * output.cc (Output_section::Output_section): Initialize new data
6504 members.
6505 (Output_section::add_input_section): Print section name when out
6506 of patch space.
6507 (Output_section::add_output_section_data): Likewise.
6508 (Output_section::set_final_data_size): Add patch space when
6509 doing --incremental-full.
6510 (Output_section::do_reset_address_and_file_offset): Remove patch
6511 space.
6512 (Output_segment::set_section_list_addresses): Print debug output
6513 only if --incremental-update.
6514 * output.h (Output_section::set_is_patch_space_allowed): New function.
6515 (Output_section::is_patch_space_allowed_): New data member.
6516 (Output_section::patch_space_): New data member.
6517 * parameters.cc (Parameters::incremental_full): New function.
6518 * parameters.h (Parameters::incremental_full): New function
6519 * testsuite/Makefile.am (incremental_test_2): Add test for
6520 --incremental-patch option.
6521 * testsuite/Makefile.in: Regenerate.
6522 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6523 (t18): Remove function body.
6524
f6cccc2c
DK
65252011-07-05 Doug Kwan <dougkwan@google.com>
6526
6527 PR gold/12771
6528 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6529 Arm_Address type for relocation result.
6530 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6531 overflow check.
6532 (Arm_relocate_functions::abs32): Use unaligned access.
6533 (Arm_relocate_functions::rel32): Ditto.
6534 (Arm_relocate_functions::prel31): Ditto.
6535 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6536 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6537 static data relocations.
6538 * testsuite/Makefile.in: Regnerate.
6539 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6540
28a13fec
ILT
65412011-07-05 Ian Lance Taylor <iant@google.com>
6542
6543 PR gold/12392
6544 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6545 symbols if necessary.
6546 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6547
24d47b34
ILT
65482011-07-05 Ian Lance Taylor <iant@google.com>
6549
6550 PR gold/12952
6551 * resolve.cc (Symbol::override_base_with_special): Simply override
6552 version with special symbol version, ignoring previous version.
6553
41f9cbbe
ILT
65542011-07-05 Ian Lance Taylor <iant@google.com>
6555
6556 * object.cc (Sized_relobj_file::include_section_group): Add
6557 information to comment about signature location.
6558
886288f1
ILT
65592011-07-02 Ian Lance Taylor <iant@google.com>
6560
6561 PR gold/12957
6562 * options.h (class General_options): Add -f and -F.
6563 * options.cc (General_options::finalize): Fatal error if -f/-F
6564 are used without -shared.
6565 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6566
ae3a6d4f
ILT
65672011-07-02 Ian Lance Taylor <iant@google.com>
6568
6569 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6570
21131061
ILT
65712011-07-01 Ian Lance Taylor <iant@google.com>
6572
6573 PR gold/12525
6574 PR gold/12952
6575 * resolve.cc (Symbol::override_base_with_special): Don't override
6576 the version if the overriding symbol has a different name.
6577 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6578 all callers. If we give an error about an undefined version,
6579 define the base version if necessary.
6580 * dynobj.h (class Versions): Update declaration.
6581 * testsuite/weak_alias_test_5.cc: New file.
6582 * testsuite/weak_alias_test.script: New file.
6583 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6584 and versioned_alias have the right value, and call t2.
6585 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6586 weak_alias_test_5.so.
6587 (weak_alias_test_LDADD): Likewise.
6588 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6589 * testsuite/Makefile.in: Rebuild.
6590
611062c0
ILT
65912011-07-01 Ian Lance Taylor <iant@google.com>
6592
6593 PR gold/12525
6594 * options.h (class General_options): Support -z notext.
6595 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6596 -Wl,-z,notext.
6597 (two_file_shared_nonpic.so): Likewise.
6598 (two_file_shared_mixed.so): Likewise.
6599 (two_file_shared_mixed_1.so): Likewise.
6600 (weak_undef_lib_nonpic.so): Likewise.
6601 (alt/weak_undef_lib_nonpic.so): Likewise.
6602 (tls_test_shared_nonpic.so): Likewise.
6603 * testsuite/Makefile.in: Rebuild.
6604
328c7c2f
ILT
66052011-07-01 Ian Lance Taylor <iant@google.com>
6606
6607 PR gold/12525
6608 * configure.ac: Test whether static linking works, setting
6609 the automake conditional HAVE_STATIC.
6610 * testsuite/Makefile.am: Disable tests using -static if
6611 HAVE_STATIC is not true.
6612 * configure, testsuite/Makefile.in: Rebuild.
6613
02d7cd44
ILT
66142011-07-01 Ian Lance Taylor <iant@google.com>
6615
6616 PR gold/12525
6617 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6618 Assert if we see DW_EH_PE_indirect.
6619 * target.h (Target::ehframe_datarel_base): New function.
6620 (Target::do_ehframe_datarel_base): New target function.
6621 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6622 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6623 function.
6624
07a60597
ILT
66252011-07-01 Ian Lance Taylor <iant@google.com>
6626
6627 PR gold/12571
6628 * options.h (class General_options): Add
6629 --ld-generated-unwind-info.
6630 * ehframe.cc (Fde::write): Add address parameter. Change all
6631 callers. If associated with PLT, fill in address and size.
6632 (Cie::set_output_offset): Only add merge mapping if there is an
6633 object.
6634 (Cie::write): Add address parameter. Change all callers.
6635 (Eh_frame::add_ehframe_for_plt): New function.
6636 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6637 input_offset_ fields into union u_, with new plt field.
6638 (Fde::Fde): Adjust for new union field.
6639 (Fde::Fde) [Output_data version]: New constructor.
6640 (Fde::add_mapping): Only add merge mapping if there is an object.
6641 (class Cie): Update declarations.
6642 (class Eh_frame): Declare add_ehframe_for_plt.
6643 * layout.cc (Layout::layout_eh_frame): Break out code into
6644 make_eh_frame_section, and call it.
6645 (Layout::make_eh_frame_section): New function.
6646 (Layout::add_eh_frame_for_plt): New function.
6647 * layout.h (class Layout): Update declarations.
6648 * merge.cc (Merge_map::add_mapping): Add assertion.
6649 * i386.cc: Include "dwarf.h".
6650 (class Output_data_plt_i386): Make first_plt_entry,
6651 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6652 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6653 and plt_eh_frame_fde.
6654 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6655 boundary. Call add_eh_frame_for_plt if appropriate.
6656 * x86_64.cc: Include "dwarf.h".
6657 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6658 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6659 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6660 and plt_eh_frame_fde.
6661 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6662 appropriate.
6663
14788a3f
ILT
66642011-06-29 Ian Lance Taylor <iant@google.com>
6665
6666 PR gold/12629
6667 * object.cc (Sized_relobj_file::layout_section): Change shdr
6668 parameter to be const.
6669 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6670 out of do_layout.
6671 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6672 appropriate. Call layout_eh_frame_section.
6673 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6674 sections.
6675 * object.h (class Sized_relobj_file): Update declarations.
6676
6c21fce1
ILT
66772011-06-29 Ian Lance Taylor <iant@google.com>
6678
37e41b03 6679 PR gold/12652
6c21fce1
ILT
6680 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6681 modifier.
6682 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6683
4d5e4e62
ILT
66842011-06-29 Ian Lance Taylor <iant@google.com>
6685
6686 PR gold/12675
6687 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6688 SHT_X86_64_UNWIND.
6689 * layout.cc (Layout::layout_eh_frame): Likewise.
6690
886f533a
ILT
66912011-06-29 Ian Lance Taylor <iant@google.com>
6692
6693 PR gold/12695
6694 * layout.cc (Layout::symtab_section_shndx): New function.
6695 * layout.h (class Layout): Declare symtab_section_shndx.
6696 * output.cc (Output_section::write_header): Call it.
6697
f3ae1b28
ILT
66982011-06-29 Ian Lance Taylor <iant@google.com>
6699
6700 PR gold/12818
6701 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6702 symbols which are not used in a relocation.
6703
aecf301f
ILT
67042011-06-28 Ian Lance Taylor <iant@google.com>
6705
6706 PR gold/12898
6707 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6708 script create indistinguishable segments.
6709 (Layout::set_segment_offsets): Use stable_sort when sorting
6710 segments. Pass this to Compare_segments constructor.
6711 * layout.h (class Layout): Make segment_precedes non-static.
6712 (class Compare_segments): Change from struct to class. Add
6713 layout_ field. Add constructor.
6714 * script-sections.cc
6715 (Script_sections::attach_sections_using_phdrs_clause): Rename
6716 local orphan to is_orphan. Don't report failure to put empty
6717 section in segment. On attachment failure, report name of
6718 section, and attach to first PT_LOAD segment.
6719
03ef7571
ILT
67202011-06-28 Ian Lance Taylor <iant@google.com>
6721
6722 PR gold/12934
6723 * target-select.cc (Target_selector::Target_selector): Add
6724 emulation parameter. Change all callers.
6725 (select_target_by_bfd_name): Rename from select_target_by_name.
6726 Change all callers.
6727 (select_target_by_emulation): New function.
6728 (supported_emulation_names): New function.
6729 * target-select.h (class Target_selector): Add emulation_ field.
6730 Update declarations.
6731 (Target_selector::recognize_by_bfd_name): Rename from
6732 recognize_by_name. Change all callers.
6733 (Target_selector::supported_bfd_names): Rename from
6734 supported_names. Change all callers.
6735 (Target_selector::recognize_by_emulation): New function.
6736 (Target_selector::supported_emulations): New function.
6737 (Target_selector::emulation): New function.
6738 (Target_selector::do_recognize_by_bfd_name): Rename from
6739 do_recognize_by_name. Change all callers.
6740 (Target_selector::do_supported_bfd_names): Rename from
6741 do_supported_names. Change all callers.
6742 (Target_selector::do_recognize_by_emulation): New function.
6743 (Target_selector::do_supported_emulations): New function.
6744 (select_target_by_bfd_name): Change name in declaration.
6745 (select_target_by_emulation): Declare.
6746 (supported_emulation_names): Declare.
6747 * parameters.cc (parameters_force_valid_target): Try to find
6748 target based on emulation from -m option.
6749 * options.h (class General_options): Change doc string for -m.
6750 * options.cc (help): Print emulations.
6751 (General_options::parse_V): Likewise.
6752 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6753 Add emulation parameter. Change all callers.
6754
200b2bb9
ILT
67552011-06-28 Ian Lance Taylor <iant@google.com>
6756
6757 * target.h (class Target): Add osabi_ field.
6758 (Target::osabi): New function.
6759 (Target::set_osabi): New function.
6760 (Target::Target): Initialize osabi_.
6761 (Target::do_adjust_elf_header): Make pure virtual.
6762 (Sized_target::do_adjust_elf_header): Declare.
6763 * target.cc (Sized_target::do_adjust_elf_header): New function.
6764 (class Sized_target): Instantiate all versions.
6765 * freebsd.h (class Target_freebsd): Remove.
6766 (Target_selector_freebsd::do_recognize): Call set_osabi on
6767 Target.
6768 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6769 (Target_selector_freebsd::set_osabi): Remove.
6770 * i386.cc (class Target_i386): Inherit from Sized_target rather
6771 than Target_freebsd.
6772 * x86_64.cc (class Target_x86_64): Likewise.
6773
b3ce541e
ILT
67742011-06-28 Ian Lance Taylor <iant@google.com>
6775
6776 * target.h (Target::can_check_for_function_pointers): Rewrite.
6777 Make non-virtual.
6778 (Target::can_icf_inline_merge_sections): Likewise.
6779 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6780 (Target::Target_info): Add can_icf_inline_merge_sections field.
6781 (Target::do_can_check_for_function_pointers): New virtual
6782 function.
6783 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6784 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6785 from can_check_for_function_pointers, move in file.
6786 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6787 section_may_have_icf_unsafe_poineters, move in file.
6788 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6789 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6790 Rename from can_check_for_function_pointers, move in file.
6791 (Target_i386::can_icf_inline_merge_sections): Remove.
6792 (Target_i386::i386_info): Initialize
6793 can_icf_inline_merge_sections.
6794 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6795 Initialize can_icf_inline_merge_sections.
6796 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6797 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6798 Rename from can_check_for_function_pointers, move in file.
6799 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6800 (Target_x86_64::x86_64_info): Initialize
6801 can_icf_inline_merge_sections.
6802 * testsuite/testfile.cc (Target_test::test_target_info):
6803 Likewise.
6804 * icf.cc (get_section_contents): Correct formatting.
6805
6d1c4efb
ILT
68062011-06-27 Ian Lance Taylor <iant@google.com>
6807
6808 * symtab.cc (Symbol::versioned_name): New function.
6809 (Symbol_table::add_to_final_symtab): Use versioned_name when
6810 appropriate.
6811 (Symbol_table::sized_write_symbol): Likewise.
6812 * symtab.h (class Symbol): Declare versioned_name.
6813 * stringpool.h (class Stringpool_template): Add variant of add
6814 which takes a std::basic_string.
6815 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6816 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6817 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6818 (ver_test_12.o): New target.
6819 * testsuite/Makefile.in: Rebuild.
6820
57eb9b50
DK
68212011-06-27 Doug Kwan <dougkwan@google.com>
6822
6823 * arm.cc (Arm_relocate_functions::thm_jump8,
6824 Arm_relocate_functions::thm_jump11): Use a wider signed
6825 type to compute offset.
6826 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6827 arm_thm_jump8.
6828 * testsuite/Makefile.in: Regenerate.
6829 * testsuite/arm_branch_in_range.sh: Check test results of
6830 arm_thm_jump11 and arm_thm_jump8.
6831 * testsuite/arm_thm_jump11.s: New test source file.
6832 * testsuite/arm_thm_jump11.t: New linker script.
6833 * testsuite/arm_thm_jump8.s: New test source file.
6834 * testsuite/arm_thm_jump8.t: New linker script.
6835
487b39df
ILT
68362011-06-24 Ian Lance Taylor <iant@google.com>
6837
6838 * layout.cc: Include "object.h".
6839 (ctors_sections_in_init_array): New static variable.
6840 (Layout::is_ctors_in_init_array): New function.
6841 (Layout::layout): Add entry to ctors_sections_in_init_array if
6842 appropriate.
6843 * layout.h (class Layout): Declare is_ctors_in_init_array.
6844 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6845 is_ctors_reverse_view is set.
6846 (Sized_relobj_file::write_sections): Add layout parameter. Change
6847 all callers. Set is_ctors_reverse_view field of View_size.
6848 (Sized_relobj_file::reverse_words): New function.
6849 * object.h (Sized_relobj_file::View_size): Add
6850 is_ctors_reverse_view field.
6851 (class Sized_relobj_file): Update declarations.
6852 * testsuite/initpri3.c: New test.
6853 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6854 initpri3b.
6855 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6856 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6857 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6858 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6859 * testsuite/Makefile.in: Rebuild.
6860
472076e4
CC
68612011-06-24 Cary Coutant <ccoutant@google.com>
6862
6863 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6864 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6865 (debug_msg_cdebug.err): New targets.
6866 * testsuite/Makefile.in: Regenerate.
6867 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6868 Fix checks for link with shared library.
6869
a60af0db
DK
68702011-06-24 Doug Kwan <dougkwan@google.com>
6871
6872 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6873 skip empty text sections.
6874 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6875
5393d741
ILT
68762011-06-22 Ian Lance Taylor <iant@google.com>
6877
6878 PR gold/12910
6879 * options.h (class General_options): Add --ctors-in-init-array.
6880 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6881 friends as SHT_PROGBITS for merging sections.
6882 (Layout::layout): Remove special handling of .init_array and
6883 friends. Don't sort if doing relocatable link. Sort for .ctors
6884 and .dtors if ctors_in_init_array.
6885 (Layout::make_output_section): Force correct section types for
6886 .init_array and friends. Don't sort if doing relocatable link,
6887 Don't sort .ctors and .dtors if ctors_in_init_array.
6888 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6889 (Layout::output_section_name): Add relobj parameter. Change all
6890 callers. Handle .ctors. and .dtors. in code rather than table.
6891 Handle .ctors and .dtors if ctors_in_init_array.
6892 (Layout::match_file_name): New function, moved from output.cc.
6893 * layout.h (class Layout): Update declarations.
6894 * output.cc: Include "layout.h".
6895 (Input_section_sort_entry::get_priority): New function.
6896 (Input_section_sort_entry::match_file_name): Just call
6897 Layout::match_file_name.
6898 (Output_section::Input_section_sort_init_fini_compare::operator()):
6899 Handle .ctors and .dtors. Sort by explicit priority rather than
6900 by name.
6901 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6902 * testsuite/initpri2.c: New test.
6903 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6904 (check_PROGRAMS): Add initpri2.
6905 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6906 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6907 * configure, testsuite/Makefile.in: Rebuild.
6908
e1f74f98
ILT
69092011-06-19 Ian Lance Taylor <iant@google.com>
6910
6911 PR gold/12880
6912 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6913 .interp section to a PT_INTERP segment even if we have seen a
6914 --dynamic-linker option. Don't do it if we have seen a PHDRS
6915 clause in a linker script.
6916 (Layout::finalize): Don't create a .interp section if we've
6917 already create a PT_INTERP segment.
6918 (Layout::create_interp): Always call choose_output_section (revert
6919 patch of 2011-06-17). Don't create PT_INTERP segment.
6920 * script-sections.cc
6921 (Script_sections::create_note_and_tls_segments): Add a .interp
6922 section to a PT_INTERP segment even if we have seen a
6923 --dynamic-linker option.
6924
766f91bb
ILT
69252011-06-18 Ian Lance Taylor <iant@google.com>
6926
6927 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6928 merely because a non-PT_LOAD segment has a dynamic reloc.
6929
0d212c3a
ILT
69302011-06-18 Ian Lance Taylor <iant@google.com>
6931
6932 * layout.cc (Layout::finish_dynamic_section): Don't create
6933 DT_FLAGS entry if not needed.
6934
911a5072
ILT
69352011-06-18 Ian Lance Taylor <iant@google.com>
6936
6937 PR gold/12745
6938 * layout.cc (Layout::layout_eh_frame): Correct handling of
6939 writable .eh_frame section.
6940
534b4e5f
ILT
69412011-06-17 Ian Lance Taylor <iant@google.com>
6942
6943 PR gold/12893
6944 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6945 symbol is redefined with the exact same object and value.
6946
10b4f102
ILT
69472011-06-17 Ian Lance Taylor <iant@google.com>
6948
6949 PR gold/12880
6950 * layout.h (class Layout): Add interp_segment_ field.
6951 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6952 (Layout::attach_allocated_section_to_segment): If making shared
6953 library, put .interp section in PT_INTERP segment.
6954 (Layout::finalize): Also call create_interp if -dynamic-linker
6955 option was used.
6956 (Layout::create_interp): Assert that there is no PT_INTERP
6957 segment. If not using a SECTIONS clause, use make_output_section.
6958 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6959 * script-sections.cc
6960 (Script_sections::create_note_and_tls_segments): If making shared
6961 library, put .interp section in PT_INTERP segment.
6962
a29b0dad
ILT
69632011-06-17 Ian Lance Taylor <iant@google.com>
6964
e588ea8d
ILT
6965 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6966 when making a shared library.
6967
69682011-06-17 Ian Lance Taylor <iant@google.com>
6969
6970 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6971 parameter. Change all callers. Don't issue warning about PC32
6972 against locally defined symbol.
a29b0dad 6973
9d3b0698
ILT
69742011-06-16 Ian Lance Taylor <iant@google.com>
6975
6976 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6977 occurs in same object.
6978
85b0f90c
AM
69792011-06-14 Alan Modra <amodra@gmail.com>
6980
6981 * po/POTFILES.in: Regenerate.
6982
a94907d9
ILT
69832011-06-09 Ian Lance Taylor <iant@google.com>
6984
6985 * script-sections.cc
6986 (Orphan_output_section::set_section_addresses): For a relocatable
6987 link set address to 0.
6988
4fb3a1c3
CC
69892011-06-09 Cary Coutant <ccoutant@google.com>
6990
6991 PR gold/12804
6992 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6993 used with --compress-debug-sections.
6994 * gold/object.cc (Sized_relobj_file::do_layout): Report
6995 uncompressed size of compressed input sections.
6996
61220854
CC
69972011-06-08 Cary Coutant <ccoutant@google.com>
6998
6999 PR gold/12804
7000 * testsuite/two_file_test_2_v1.cc: Change initialization of
7001 v2 to keep it in .data.
7002
e6455dfb
CC
70032011-06-07 Cary Coutant <ccoutant@google.com>
7004
7005 * common.cc (Symbol_table::do_allocate_commons_list): Call
7006 gold_fallback.
7007 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7008 (Errors::fallback): New function.
7009 (gold_fallback): New function.
7010 * errors.h (Errors::fallback): New function.
7011 * gold.cc (gold_exit): Change status parameter to enum; adjust
7012 all callers.
7013 (queue_initial_tasks): Call gold_fallback.
7014 * gold.h: Include cstdlib.
7015 (Exit_status): New enum type.
7016 (gold_exit): Change status parameter to enum.
7017 (gold_fallback): New function.
7018 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7019 (Layout::create_symtab_sections): Likewise.
7020 (Layout::create_shdrs): Likewise.
7021 * main.cc (main): Adjust call to gold_exit.
7022 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7023 (Output_data_got::add_got_entry_pair): Likewise.
7024 (Output_section::add_input_section): Likewise.
7025 (Output_section::add_output_section_data): Likewise.
7026 (Output_segment::set_section_list_addresses): Likewise.
7027 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7028
fb0e076f
CC
70292011-06-07 Cary Coutant <ccoutant@google.com>
7030
7031 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7032 for incremental links.
7033 * output.cc (Output_segment::set_section_list_addresses): Remove
7034 FIXME and test for TLS or BSS.
7035
a5ee4d5d
CC
70362011-06-07 Cary Coutant <ccoutant@google.com>
7037
7038 * testsuite/Makefile.am: Add incremental_copy_test,
7039 incremental_common_test_1.
7040 * testsuite/Makefile.in: Regenerate.
7041 * testsuite/common_test_1_v1.c: New source file.
7042 * testsuite/common_test_1_v2.c: New source file.
7043 * testsuite/copy_test_v1.cc: New source file.
7044
5146f448
CC
70452011-06-07 Cary Coutant <ccoutant@google.com>
7046
7047 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7048 update, allocate common from bss section's free list.
7049 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7050 linker-defined symbols.
7051 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7052 Skip GOT and PLT entries that are no longer referenced.
7053 (Output_section_incremental_inputs::write_info_blocks): Mark
7054 linker-defined symbols.
7055 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7056 * output.cc (Output_section::allocate): New function.
7057 * output.h (Output_section::allocate): New function.
7058 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7059 linker-defined symbols.
7060 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7061 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7062 (Symbol::init_base_output_data): Likewise.
7063 (Symbol::init_base_output_segment): Likewise.
7064 (Symbol::init_base_constant): Likewise.
7065 (Sized_symbol::init_output_data): Likewise.
7066 (Sized_symbol::init_output_segment): Likewise.
7067 (Sized_symbol::init_constant): Likewise.
7068 (Symbol_table::do_define_in_output_data): Likewise.
7069 (Symbol_table::do_define_in_output_segment): Likewise.
7070 (Symbol_table::do_define_as_constant): Likewise.
7071 * symtab.h (Symbol::is_predefined): New function.
7072 (Symbol::init_base_output_data): Add is_predefined parameter.
7073 (Symbol::init_base_output_segment): Likewise.
7074 (Symbol::init_base_constant): Likewise.
7075 (Symbol::is_predefined_): New data member.
7076 (Sized_symbol::init_output_data): Add is_predefined parameter.
7077 (Sized_symbol::init_output_segment): Likewise.
7078 (Sized_symbol::init_constant): Likewise.
7079 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7080
26d3c67d
CC
70812011-06-07 Cary Coutant <ccoutant@google.com>
7082
7083 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7084 instead of emit_copy_reloc.
7085 (Copy_relocs::emit_copy_reloc): Refactor.
7086 (Copy_relocs::make_copy_reloc): New function.
7087 (Copy_relocs::add_copy_reloc): Remove.
7088 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7089 section.
7090 (Copy_relocs::make_copy_reloc): New function.
7091 (Copy_relocs::add_copy_reloc): Remove.
7092 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7093 unchanged input files.
7094 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7095 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7096 Reserve BSS space for COPY relocations.
7097 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7098 (Output_section_incremental_inputs::write_info_blocks): Record
7099 whether a symbol is copied from a shared object.
7100 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7101 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7102 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7103 (Incremental_input_entry_reader::get_output_symbol_index): Add
7104 is_copy parameter.
7105 (Incremental_binary::emit_copy_relocs): New function.
7106 (Incremental_binary::do_emit_copy_relocs): New function.
7107 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7108 new data member.
7109 (Sized_incremental_binary::add_copy_reloc): New function.
7110 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7111 (Sized_incremental_binary::Copy_reloc): New struct.
7112 (Sized_incremental_binary::Copy_relocs): New typedef.
7113 (Sized_incremental_binary::copy_relocs_): New data member.
7114 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7115 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7116 * target.h (Sized_target::emit_copy_reloc): New function.
7117 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7118
7cdb37d9
CC
71192011-06-02 Cary Coutant <ccoutant@google.com>
7120
7121 PR gold/12163
7122 * gold/archive.cc (Archive::Archive): Initialize new data member.
7123 (Archive::include_all_members): Return if archive has already been
7124 included.
7125 * gold/archive.h (Archive::include_all_members_): New data member.
7126
cc643b88
NC
71272011-06-02 Nick Clifton <nickc@redhat.com>
7128
7129 * dynobj.h: Fix spelling mistake in comment.
7130 * output.cc: Likewise.
7131
f62a3ca7 71322011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7133 Asier Llano
f62a3ca7
DK
7134
7135 PR gold/12826
cc643b88 7136 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7137 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7138 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7139 redundant arm_exidx_test.so.
7140 * testsuite/Makefile.in: Regenerate.
7141 (check_SCRIPTS): Add pr12826.sh
7142 (check_DATA): Add pr12826.stdout
7143 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7144 * testsuite/pr12826.sh: New file.
7145 * testsuite/pr12826_1.s: Ditto.
7146 * testsuite/pr12826_1.s: Ditto.
7147
8dbe1edc
ILT
71482011-05-30 Ian Lance Taylor <iant@google.com>
7149
7150 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7151 sections.
7152
c49875be
ILT
71532011-05-29 Ian Lance Taylor <iant@google.com>
7154
7155 PR gold/12804
7156 * testsuite/Makefile.am: Use different file name for two_file_test
7157 temporary file for each incremental test.
7158 * testsuite/Makefile.in: Rebuild.
7159
69d53f7a
ILT
71602011-05-29 Ian Lance Taylor <iant@google.com>
7161
7162 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7163 binary input file is empty.
7164
41d0ab5f
ILT
71652011-05-27 Ian Lance Taylor <iant@google.com>
7166
7167 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7168 (ver_test_9.so): Likewise.
7169 * testsuite/Makefile.in: Rebuild.
7170
89d8a36b
CC
71712011-05-26 Cary Coutant <ccoutant@google.com>
7172
7173 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7174 * incremental.cc (Incremental_inputs::report_input_section): Fix
7175 comment, indentation.
7176 (Incremental_inputs::report_comdat_group): New function.
7177 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7178 of data for incremental input file entry.
7179 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7180 group count, COMDAT group signatures.
7181 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7182 an unchanged input file.
7183 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7184 Initialize new data member.
7185 (Incremental_object_entry::add_comdat_group): New function.
7186 (Incremental_object_entry::get_comdat_group_count): New function.
7187 (Incremental_object_entry::get_comdat_signature_key): New function.
7188 (Incremental_object_entry::groups_): New data member.
7189 (Incremental_inputs::report_comdat_group): New function.
7190 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7191 data for incremental input file entry.
7192 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7193 (Incremental_input_entry_reader::get_input_section): Adjust size of
7194 data for incremental input file entry.
7195 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7196 (Incremental_input_entry_reader::get_comdat_group_signature): New
7197 function.
7198 * object.cc (Sized_relobj::include_section_group): Report kept
7199 COMDAT groups for incremental links.
7200
1706a06f
ILT
72012011-05-24 David Meyer <pdox@google.com>
7202
7203 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7204 with name parameter. Add found_name parameter.
7205 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7206 * dirsearch.h (class Dirsearch): Update declaration.
7207
a10ae760
ILT
72082011-05-24 Ian Lance Taylor <iant@google.com>
7209
7210 * archive.cc (Library_base::should_include_member): Pull in object
7211 from archive if it defines the entry symbol.
7212 * parameters.cc (Parameters::entry): New function.
7213 * parameters.h (class Parameters): Declare entry.
7214 * output.h (class Output_file_header): Remove entry_ field.
7215 * output.cc (Output_file_header::Output_file_header): Remove entry
7216 parameter. Change all callers.
7217 (Output_file_header::entry): Use parameters->entry.
7218 * gold.cc (queue_middle_tasks): Likewise.
7219 * plugin.cc (Plugin_hook::run): Likewise.
7220
aa92d6ed
CC
72212011-05-24 Cary Coutant <ccoutant@google.com>
7222
7223 * gold.cc (queue_initial_tasks): Pass incremental base filename
7224 to Output_file::open_base_file; don't print error message.
7225 * incremental-dump.cc (main): Adjust call to
7226 Output_file::open_for_modification.
7227 * incremental-dump.cc (main): Likewise.
7228 * incremental.cc (Incremental_inputs::report_command_line):
7229 Ignore --incremental-base option when comparing command lines.
7230 Ignore parameter when given as separate argument.
7231 * options.h (class General_options): Add --incremental-base.
7232 * output.cc (Output_file::Output_file):
7233 (Output_file::open_base_file): Add base_name and writable parameters;
7234 read base file into new file; print error message here.
7235 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7236 callers.
7237 * output.h (Output_file::open_for_modification): Rename to...
7238 (Output_file::open_base_file): ...this; add base_name and
7239 writable parameters; adjust all callers.
7240 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7241 callers.
7242 * testsuite/Makefile.am (incremental_test_4): Test
7243 --incremental-base.
7244 * testsuite/Makefile.in: Regenerate.
7245
2eedd706
CC
72462011-05-24 Cary Coutant <ccoutant@google.com>
7247
7248 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7249 incremental_test_4.
7250 * testsuite/Makefile.in: Regenerate.
7251 * testsuite/two_file_test_1_v1.cc: New test source file.
7252 * testsuite/two_file_test_1b_v1.cc: New test source file.
7253 * testsuite/two_file_test_2_v1.cc: New test source file.
7254
0f1c85a6
CC
72552011-05-24 Cary Coutant <ccoutant@google.com>
7256
7257 * dynobj.h (Dynobj::do_dynobj): New function.
7258 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7259 flag and soname for shared objects.
7260 * incremental.cc (Incremental_inputs::report_object): Make
7261 either Incremental_object_entry or Incremental_dynobj_entry; add
7262 soname to string table.
7263 (Incremental_inputs::report_input_section): Add assertion.
7264 (Output_section_incremental_inputs::set_final_data_size): Adjust
7265 type of input file entry for shared libraries; adjust size of
7266 shared library info entry.
7267 (Output_section_incremental_inputs::write_input_files): Write
7268 as_needed flag for shared libraries.
7269 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7270 of input file entry for shared libraries; write soname.
7271 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7272 soname from incremental info.
7273 * incremental.h (enum Incremental_input_flags): Add
7274 INCREMENTAL_INPUT_AS_NEEDED.
7275 (Incremental_input_entry::Incremental_input_entry): Initialize new
7276 data member.
7277 (Incremental_input_entry::set_as_needed): New function.
7278 (Incremental_input_entry::as_needed): New function.
7279 (Incremental_input_entry::do_dynobj_entry): New function.
7280 (Incremental_input_entry::as_needed_): New data member.
7281 (Incremental_object_entry::Incremental_object_entry): Don't check
7282 for shared library.
7283 (Incremental_object_entry::do_type): Likewise.
7284 (class Incremental_dynobj_entry): New class.
7285 (Incremental_input_entry_reader::as_needed): New function.
7286 (Incremental_input_entry_reader::get_soname): New function.
7287 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7288 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7289 size of shared library info entry.
58797674 7290 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7291 incremental link when adding DT_NEEDED entries.
7292 * object.h (Object::Object): Initialize new data member.
7293 (Object::dynobj): New function.
7294 (Object::set_as_needed): New function.
7295 (Object::as_needed): New function.
7296 (Object::do_dynobj): New function.
7297 (Object::as_needed_): New data member.
7298
6fa2a40b
CC
72992011-05-24 Cary Coutant <ccoutant@google.com>
7300
7301 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7302 info; adjust display of GOT entries.
7303 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7304 vector of input objects; remove file_status_.
7305 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7306 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7307 got_plt reader; call target hooks to reserve GOT entries.
7308 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7309 of input file info header and GOT info entry.
7310 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7311 relocation info.
7312 (Got_plt_view_info::got_descriptor): Remove.
7313 (Got_plt_view_info::sym_index): New data member.
7314 (Got_plt_view_info::input_index): New data member.
7315 (Local_got_offset_visitor::visit): Write input file index.
7316 (Global_got_offset_visitor::visit): Write 0 for input file index.
7317 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7318 with sym_index and input_index.
7319 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7320 incremental info GOT entry; replace got_descriptor with input_index.
7321 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7322 map from input file index to object.
7323 (Sized_relobj_incr::do_layout): Replace direct data member reference
7324 with accessor function.
7325 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7326 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7327 Adjust size of input file info header.
7328 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7329 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7330 (Incremental_input_entry_reader::get_input_section): Adjust size of
7331 input file info header.
7332 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7333 of incremental info GOT entry.
7334 (Incremental_got_plt_reader::get_got_desc): Remove.
7335 (Incremental_got_plt_reader::get_got_symndx): New function.
7336 (Incremental_got_plt_reader::get_got_input_index): New function.
7337 (Sized_incremental_binary::Sized_incremental_binary): Remove
7338 file_status_; add input_objects_.
7339 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7340 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7341 (Sized_incremental_binary::file_is_unchanged): Remove.
7342 (Sized_incremental_binary::set_input_object): New function.
7343 (Sized_incremental_binary::input_object): New function.
7344 (Sized_incremental_binary::file_status_): Remove.
7345 (Sized_incremental_binary::input_objects_): New data member.
7346 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7347 references.
7348 (Sized_relobj_incr::invalid_address): Move to base class.
7349 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7350 class.
7351 (Sized_relobj_incr::do_output_section_offset): Likewise.
7352 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7353 (Sized_relobj_incr::section_offsets_): Likewise.
7354 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7355 function.
7356 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7357 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7358 with accessor function.
7359 (Sized_relobj_file::do_layout): Likewise.
7360 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7361 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7362 (Sized_relobj_file::compute_final_local_value): Replace refs to
7363 section_offsets_ with accessor function.
7364 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7365 * object.h (Relobj::Relobj): Initialize new data members.
7366 (Relobj::add_dyn_reloc): New function.
7367 (Relobj::first_dyn_reloc): New function.
7368 (Relobj::dyn_reloc_count): New function.
7369 (Relobj::first_dyn_reloc_): New data member.
7370 (Relobj::dyn_reloc_count_): New data member.
7371 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7372 references.
7373 (Sized_relobj::Address): New typedef.
7374 (Sized_relobj::invalid_address): Move here from child class.
7375 (Sized_relobj::Sized_relobj): Initialize new data members.
7376 (Sized_relobj::sized_relobj): New function.
7377 (Sized_relobj::is_output_section_offset_invalid): Move here from
7378 child class.
7379 (Sized_relobj::get_output_section_offset): Likewise.
7380 (Sized_relobj::local_has_got_offset): Likewise.
7381 (Sized_relobj::local_got_offset): Likewise.
7382 (Sized_relobj::set_local_got_offset): Likewise.
7383 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7384 (Sized_relobj::clear_got_offsets): New function.
7385 (Sized_relobj::section_offsets): Move here from child class.
7386 (Sized_relobj::do_output_section_offset): Likewise.
7387 (Sized_relobj::do_set_section_offset): Likewise.
7388 (Sized_relobj::Local_got_offsets): Likewise.
7389 (Sized_relobj::local_got_offsets_): Likewise.
7390 (Sized_relobj::section_offsets_): Likewise.
7391 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7392 references.
7393 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7394 class.
7395 (Sized_relobj_file::sized_relobj): New function
7396 (Sized_relobj_file::local_has_got_offset): Move to base class.
7397 (Sized_relobj_file::local_got_offset): Likewise.
7398 (Sized_relobj_file::set_local_got_offset): Likewise.
7399 (Sized_relobj_file::get_output_section_offset): Likewise.
7400 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7401 (Sized_relobj_file::do_output_section_offset): Likewise.
7402 (Sized_relobj_file::do_set_section_offset): Likewise.
7403 (Sized_relobj_file::Local_got_offsets): Likewise.
7404 (Sized_relobj_file::local_got_offsets_): Likewise.
7405 (Sized_relobj_file::section_offsets_): Likewise.
7406 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7407 (all constructors).
7408 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7409 (Output_reloc::get_symbol_index): Likewise.
7410 (Output_reloc::local_section_offset): Likewise.
7411 (Output_reloc::get_address): Likewise.
7412 (Output_reloc::symbol_value): Likewise.
7413 (Output_data_got::reserve_slot): Move to class definition.
7414 (Output_data_got::reserve_local): New function.
7415 (Output_data_got::reserve_slot_for_global): Remove.
7416 (Output_data_got::reserve_global): New function.
7417 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7418 (all constructors, two instantiations).
7419 (Output_reloc::get_relobj): New function (two instantiations).
7420 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7421 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7422 (Output_data_reloc::add_global): Adjust type of relobj.
7423 (Output_data_reloc::add_global_relative): Likewise.
7424 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7425 (Output_data_reloc::add_local): Likewise.
7426 (Output_data_reloc::add_local_relative): Likewise.
7427 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7428 (Output_data_reloc::add_local_section): Likewise.
7429 (Output_data_reloc::add_output_section): Likewise.
7430 (Output_data_reloc::add_absolute): Likewise.
7431 (Output_data_reloc::add_target_specific): Likewise.
7432 (Output_data_got::reserve_slot): Move definition here.
7433 (Output_data_got::reserve_local): New function.
7434 (Output_data_got::reserve_global): New function.
7435 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7436 section_offsets_ with accessor function.
7437 (Sized_relobj_file::write_sections): Likewise.
7438 (Sized_relobj_file::do_relocate_sections): Likewise.
7439 * target.h (Sized_target::reserve_local_got_entry): New function.
7440 (Sized_target::reserve_global_got_entry): New function.
7441 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7442 (Target_x86_64::reserve_global_got_entry): New function.
7443 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7444
4829d394
CC
74452011-05-23 Cary Coutant <ccoutant@google.com>
7446
7447 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7448 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7449 bit when checking got_type.
7450 * incremental.cc (Sized_incremental_binary::setup_readers):
7451 Store symbol table and string table locations; initialize bit vector
7452 of file status flags.
7453 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7454 unchanged files.
7455 (Sized_incremental_binary::do_process_got_plt): New function.
7456 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7457 (Output_section_incremental_inputs::set_final_data_size): Record
7458 file index for each input file.
7459 (Output_section_incremental_inputs::write_got_plt): Store file index
7460 instead of input entry offset for each GOT entry.
7461 * incremental.h
7462 (Incremental_input_entry::Incremental_input_entry): Initialize new
7463 data member.
7464 (Incremental_input_entry::set_offset): Store file index.
7465 (Incremental_input_entry::get_file_index): New function.
7466 (Incremental_input_entry::file_index_): New data member.
7467 (Incremental_binary::process_got_plt): New function.
7468 (Incremental_binary::do_process_got_plt): New function.
7469 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7470 data members.
7471 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7472 (Sized_incremental_binary::set_file_is_unchanged): New function.
7473 (Sized_incremental_binary::file_is_unchanged): New function.
7474 (Sized_incremental_binary::do_process_got_plt): New function.
7475 (Sized_incremental_binary::file_status_): New data member.
7476 (Sized_incremental_binary::main_symtab_loc_): New data member.
7477 (Sized_incremental_binary::main_strtab_loc_): New data member.
7478 * output.cc (Output_data_got::Got_entry::write): Add case
7479 RESERVED_CODE.
7480 (Output_data_got::add_global): Call add_got_entry.
7481 (Output_data_got::add_global_plt): Likewise.
7482 (Output_data_got::add_global_with_rel): Likewise.
7483 (Output_data_got::add_global_with_rela): Likewise.
7484 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7485 (Output_data_got::add_global_pair_with_rela): Likewise.
7486 (Output_data_got::add_local): Call add_got_entry.
7487 (Output_data_got::add_local_plt): Likewise.
7488 (Output_data_got::add_local_with_rel): Likewise.
7489 (Output_data_got::add_local_with_rela): Likewise.
7490 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7491 (Output_data_got::add_local_pair_with_rela): Likewise.
7492 (Output_data_got::reserve_slot): New function.
7493 (Output_data_got::reserve_slot_for_global): New function.
7494 (Output_data_got::add_got_entry): New function.
7495 (Output_data_got::add_got_entry_pair): New function.
7496 (Output_section::add_output_section_data): Edit FIXME.
7497 * output.h
7498 (Output_section_data_build::Output_section_data_build): New
7499 constructor with size parameter.
7500 (Output_data_space::Output_data_space): Likewise.
7501 (Output_data_got::Output_data_got): Initialize new data member; new
7502 constructor with size parameter.
7503 (Output_data_got::add_constant): Call add_got_entry.
7504 (Output_data_got::reserve_slot): New function.
7505 (Output_data_got::reserve_slot_for_global): New function.
7506 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7507 (Output_data_got::add_got_entry): New function.
7508 (Output_data_got::add_got_entry_pair): New function.
7509 (Output_data_got::free_list_): New data member.
7510 * target.h (Sized_target::init_got_plt_for_update): New function.
7511 (Sized_target::register_global_plt_entry): New function.
7512 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7513 Initialize new data member; call init; add constructor with PLT count.
7514 (Output_data_plt_x86_64::init): New function.
7515 (Output_data_plt_x86_64::add_relocation): New function.
7516 (Output_data_plt_x86_64::reserve_slot): New function.
7517 (Output_data_plt_x86_64::free_list_): New data member.
7518 (Target_x86_64::init_got_plt_for_update): New function.
7519 (Target_x86_64::register_global_plt_entry): New function.
7520 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7521 incremental updates.
7522 (Output_data_plt_x86_64::add_relocation): New function.
7523 * testsuite/object_unittest.cc (Object_test): Set default options.
7524
ec69d6da
ILT
75252011-05-16 Ian Lance Taylor <iant@google.com>
7526
7527 * options.h (class General_options): Make -i a synonym for -r.
7528
732e31de
ILT
75292011-05-16 Ian Lance Taylor <iant@google.com>
7530
7531 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7532
403676b5
CC
75332011-05-10 Cary Coutant <ccoutant@google.com>
7534
7535 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7536 strip_all (-s).
7537
5b7b7d6e
ILT
75382011-05-06 Ian Lance Taylor <iant@google.com>
7539
7540 * layout.cc (Layout::layout): If the output section flags change,
7541 update the ordering.
7542
f0f9babf
CC
75432011-04-25 Cary Coutant <ccoutant@google.com>
7544
7545 * incremental-dump.cc (dump_incremental_inputs): Print local
7546 symbol info for each input file.
7547 * incremental.cc
7548 (Output_section_incremental_inputs::set_final_data_size): Add local
7549 symbol info to input file entries in incremental info.
7550 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7551 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7552 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7553 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7554 implementation.
7555 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7556 (Sized_incr_relobj::do_relocate): Write the local symbols.
7557 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7558 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7559 Adjust size of input file header.
7560 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7561 (Incremental_inputs_reader::get_local_symbol_count): New function.
7562 (Incremental_inputs_reader::get_input_section): Adjust size of input
7563 file header.
7564 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7565 (Sized_incr_relobj::This): New typedef.
7566 (Sized_incr_relobj::sym_size): New const data member.
7567 (Sized_incr_relobj::Local_symbol): New struct.
7568 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7569 (Sized_incr_relobj::do_local_symbol_offset): New function.
7570 (Sized_incr_relobj::local_symbol_count_): New data member.
7571 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7572 (Sized_incr_relobj::local_symbol_index_): New data member.
7573 (Sized_incr_relobj::local_symbol_offset_): New data member.
7574 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7575 (Sized_incr_relobj::local_symbols_): New data member.
7576 * object.h (Relobj::output_local_symbol_count): New function.
7577 (Relobj::local_symbol_offset): New function.
7578 (Relobj::do_output_local_symbol_count): New function.
7579 (Relobj::do_local_symbol_offset): New function.
7580 (Sized_relobj::do_output_local_symbol_count): New function.
7581 (Sized_relobj::do_local_symbol_offset): New function.
7582
d0a9ace3
ILT
75832011-04-22 Vladimir Simonov <sv@sw.ru>
7584
7585 * descriptors.cc (set_close_on_exec): New function.
7586 (Descriptors::open): Use set_close_on_exec.
7587 * output.cc (S_ISLNK): Define if not defined.
7588
94a3fc8b
CC
75892011-04-22 Cary Coutant <ccoutant@google.com>
7590
7591 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7592 global symbol map.
7593 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7594 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7595 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7596 relocations.
7597 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7598 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7599 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7600 * incremental.h
7601 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7602 function.
7603 (Incremental_binary::apply_incremental_relocs): New function.
7604 (Incremental_binary::do_apply_incremental_relocs): New function.
7605 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7606 data member.
7607 (Sized_incremental_binary::add_global_symbol): New function.
7608 (Sized_incremental_binary::global_symbol): New function.
7609 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7610 (Sized_incremental_binary::symbol_map_): New data member.
7611 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7612 * target.h (Sized_target::apply_relocation): New function.
7613 * target-reloc.h (apply_relocation): New function.
7614 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7615
c87e4302
DK
76162011-04-22 Doug Kwan <dougkwan@google.com>
7617
7618 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7619 flag of a SHT_ARM_EXIDX section.
2e702c99 7620 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7621 * testsuite/Makefile.in: Regenerate.
7622 * testsuite/arm_exidx_test.s: New file.
7623 * testsuite/arm_exidx_test.sh: Same.
7624
e7782cf6
CC
76252011-04-20 Cary Coutant <ccoutant@google.com>
7626
7627 PR gold/12689
7628 * archive.h (Incremental_archive_entry::Archive_member):
7629 Initialize arg_serial_ (second constructor).
7630
308ecdc7
ILT
76312011-04-17 Ian Lance Taylor <iant@google.com>
7632
7633 * object.cc (Relocate_info::location): Simplify location string.
7634 * errors.cc (Errors::error_at_location): Don't print program
7635 name.
7636 (Errors::warning_at_location): Likewise.
7637 (Errors::undefined_symbol): Likewise.
7638 * testsuite/debug_msg.sh: Update accordingly.
7639
bec5b579
CC
76402011-04-14 Cary Coutant <ccoutant@google.com>
7641
7642 * gold/layout.cc (Layout::symtab_section_offset): New function.
7643 * gold/layout.h (Layout::symtab_section_offset): New function.
7644 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7645
88597d34
ILT
76462011-04-12 Ian Lance Taylor <iant@google.com>
7647
7648 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7649 with MREMAP_MAYMOVE.
7650 * output.h (class Output_file): Add map_is_allocated_ field.
7651 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7652 not available, provide stubs. If mremap is not available, #define
7653 it to gold_mremap.
7654 (MREMAP_MAYMOVE): Define if not defined.
7655 (Output_file::Output_file): Initialize map_is_allocated_.
7656 (Output_file::resize): Check map_is_allocated_.
7657 (Output_file::map_anonymous): If mmap fails, use malloc.
7658 (Output_file::unmap): Don't do anything for an anonymous map.
7659 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7660 is not available, provide stubs.
7661 (File_read::View::~View): Use free rather than delete[].
7662 (File_read::make_view): Use malloc rather than new[]. If mmap
7663 fails, use malloc.
7664 (File_read::find_or_make_view): Use malloc rather than new[].
7665 * gold.h: Remove HAVE_REMAP code.
7666 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7667 exists. Rename mremap to gold_mremap. If mmap is not available
7668 don't do anything.
7669 * configure, config.in: Rebuild.
7670
11e361bc
ILT
76712011-04-11 Ian Lance Taylor <iant@google.com>
7672
7673 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7674 initialize local variable v.
7675
cdc29364
CC
76762011-04-11 Cary Coutant <ccoutant@google.com>
7677
7678 * archive.cc (Archive::include_member): Adjust call to
7679 report_object.
7680 (Add_archive_symbols::run): Track argument serial numbers.
7681 (Lib_group::include_member): Likewise.
7682 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7683 * archive.h (Incremental_archive_entry::Archive_member):
7684 Initialize arg_serial_.
7685 (Archive_member::arg_serial_): New data member.
7686 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7687 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7688 incremental link.
7689 (Sized_dynobj::do_for_all_local_got_entries): New function.
7690 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7691 function.
7692 * fileread.cc (get_mtime): New function.
7693 * fileread.h (get_mtime): New function.
7694 * gold.cc (queue_initial_tasks): Check for incremental update.
7695 (process_incremental_input): New function.
7696 (queue_middle_tasks): Don't force valid target for incremental
7697 update.
7698 * incremental-dump.cc (find_input_containing_global): Adjust
7699 size of symbol info entry.
7700 (dump_incremental_inputs): Dump argument serial number and
7701 in_system_directory flag; bias shndx by 1; print symbol names
7702 when dumping per-file symbol lists; use new symbol info readers.
7703 * incremental.cc
7704 (Output_section_incremental_inputs:update_data_size): New function.
7705 (Sized_incremental_binary::setup_readers): Setup input readers
7706 for each input file; build maps for files added from libraries
7707 and scripts.
7708 (Sized_incremental_binary::check_input_args): New function.
7709 (Sized_incremental_binary::do_check_inputs): Build map of argument
7710 serial numbers to input arguments.
7711 (Sized_incremental_binary::do_file_has_changed): Rename
7712 do_file_is_unchanged to this; compare file modification times.
7713 (Sized_incremental_binary::do_init_layout): New function.
7714 (Sized_incremental_binary::do_reserve_layout): New function.
7715 (Sized_incremental_binary::do_get_input_reader): Remove.
7716 (Sized_incremental_binary::get_symtab_view): New function.
7717 (Incremental_checker::can_incrementally_link_output_file): Remove.
7718 (Incremental_inputs::report_command_line): Exclude --debug options.
7719 (Incremental_inputs::report_archive_begin): Add parameter; track
7720 argument serial numbers; don't put input file entry for archive
7721 before archive members.
7722 (Incremental_inputs::report_archive_end): Put input file entry
7723 for archive after archive members.
7724 (Incremental_inputs::report_object): Add parameter; track argument
7725 serial numbers and in_system_directory flag.
7726 (Incremental_inputs::report_script): Add parameter; track argument
7727 serial numbers.
7728 (Output_section_incremental_inputs::set_final_data_size): Adjust
7729 size of symbol info entry; check for forwarding symbols.
7730 (Output_section_incremental_inputs::write_input_files): Write
7731 in_system_directory flag and argument serial number.
7732 (Output_section_incremental_inputs::write_info_blocks): Map section
7733 indices between incremental info and original input file; store
7734 input section index for each symbol.
7735 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7736 change operator() to visit().
7737 (class Global_got_offset_visitor): Likewise.
7738 (class Global_symbol_visitor_got_plt):
7739 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7740 classes.
7741 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7742 (Sized_incr_relobj::do_read_symbols): New function.
7743 (Sized_incr_relobj::do_layout): New function.
7744 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7745 (Sized_incr_relobj::do_add_symbols): New function.
7746 (Sized_incr_relobj::do_should_include_member): New function.
7747 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7748 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7749 (Sized_incr_relobj::do_section_size): New function.
7750 (Sized_incr_relobj::do_section_name): New function.
7751 (Sized_incr_relobj::do_section_contents): New function.
7752 (Sized_incr_relobj::do_section_flags): New function.
7753 (Sized_incr_relobj::do_section_entsize): New function.
7754 (Sized_incr_relobj::do_section_address): New function.
7755 (Sized_incr_relobj::do_section_type): New function.
7756 (Sized_incr_relobj::do_section_link): New function.
7757 (Sized_incr_relobj::do_section_info): New function.
7758 (Sized_incr_relobj::do_section_addralign): New function.
7759 (Sized_incr_relobj::do_initialize_xindex): New function.
7760 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7761 (Sized_incr_relobj::do_read_relocs): New function.
7762 (Sized_incr_relobj::do_gc_process_relocs): New function.
7763 (Sized_incr_relobj::do_scan_relocs): New function.
7764 (Sized_incr_relobj::do_count_local_symbols): New function.
7765 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7766 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7767 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7768 (Sized_incr_relobj::do_relocate): New function.
7769 (Sized_incr_relobj::do_set_section_offset): New function.
7770 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7771 (Sized_incr_dynobj::do_read_symbols): New function.
7772 (Sized_incr_dynobj::do_layout): New function.
7773 (Sized_incr_dynobj::do_add_symbols): New function.
7774 (Sized_incr_dynobj::do_should_include_member): New function.
7775 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7776 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7777 (Sized_incr_dynobj::do_section_size): New function.
7778 (Sized_incr_dynobj::do_section_name): New function.
7779 (Sized_incr_dynobj::do_section_contents): New function.
7780 (Sized_incr_dynobj::do_section_flags): New function.
7781 (Sized_incr_dynobj::do_section_entsize): New function.
7782 (Sized_incr_dynobj::do_section_address): New function.
7783 (Sized_incr_dynobj::do_section_type): New function.
7784 (Sized_incr_dynobj::do_section_link): New function.
7785 (Sized_incr_dynobj::do_section_info): New function.
7786 (Sized_incr_dynobj::do_section_addralign): New function.
7787 (Sized_incr_dynobj::do_initialize_xindex): New function.
7788 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7789 (make_sized_incremental_object): New function.
7790 (Incremental_library::copy_unused_symbols): New function.
7791 (Incremental_library::do_for_all_unused_symbols): New function.
7792 * incremental.h (enum Incremental_input_flags): New type.
7793 (class Incremental_checker): Remove.
7794 (Incremental_input_entry::Incremental_input_entry): Add argument
7795 serial number.
7796 (Incremental_input_entry::arg_serial): New function.
7797 (Incremental_input_entry::set_is_in_system_directory): New function.
7798 (Incremental_input_entry::is_in_system_directory): New function.
7799 (Incremental_input_entry::arg_serial_): New data member.
7800 (Incremental_input_entry::is_in_system_directory_): New data member.
7801 (class Script_info): Move here from script.h.
7802 (Script_info::Script_info): Add filename parameter.
7803 (Script_info::filename): New function.
7804 (Script_info::filename_): New data member.
7805 (Incremental_script_entry::Incremental_script_entry): Add argument
7806 serial number.
7807 (Incremental_object_entry::Incremental_object_entry): Likewise.
7808 (Incremental_object_entry::add_input_section): Build list of input
7809 sections with map to original shndx.
7810 (Incremental_object_entry::get_input_section_index): New function.
7811 (Incremental_object_entry::shndx_): New data member.
7812 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7813 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7814 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7815 serial number.
7816 (Incremental_inputs::report_archive_begin): Likewise.
7817 (Incremental_inputs::report_object): Likewise.
7818 (Incremental_inputs::report_script): Likewise.
7819 (class Incremental_global_symbol_reader): New class.
7820 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7821 and store flags and input file type.
7822 (Incremental_input_entry_reader::arg_serial): New function.
7823 (Incremental_input_entry_reader::type): Extract type from flags.
7824 (Incremental_input_entry_reader::is_in_system_directory): New function.
7825 (Incremental_input_entry_reader::get_input_section_count): Call
7826 accessor function for type.
7827 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7828 function for type; adjust size of global symbol entry.
7829 (Incremental_input_entry_reader::get_global_symbol_count): Call
7830 accessor function for type.
7831 (Incremental_input_entry_reader::get_object_count): Likewise.
7832 (Incremental_input_entry_reader::get_object_offset): Likewise.
7833 (Incremental_input_entry_reader::get_member_count): Likewise.
7834 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7835 (Incremental_input_entry_reader::get_member_offset): Likewise.
7836 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7837 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7838 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7839 (Incremental_input_entry_reader::get_global_symbol_reader): New
7840 function.
7841 (Incremental_input_entry_reader::get_output_symbol_index): New
7842 function.
7843 (Incremental_input_entry_reader::type_): Remove.
7844 (Incremental_input_entry_reader::flags_): New data member.
7845 (Incremental_inputs_reader::input_file_offset): New function.
7846 (Incremental_inputs_reader::input_file_index): New function.
7847 (Incremental_inputs_reader::input_file): Call input_file_offset.
7848 (Incremental_inputs_reader::input_file_at_offset): New function.
7849 (Incremental_relocs_reader::get_r_type): Reformat.
7850 (Incremental_relocs_reader::get_r_shndx): Reformat.
7851 (Incremental_relocs_reader::get_r_offset): Reformat.
7852 (Incremental_relocs_reader::data): New function.
7853 (Incremental_binary::Incremental_binary): Initialize new data members.
7854 (Incremental_binary::check_inputs): Add cmdline parameter.
7855 (Incremental_binary::file_is_unchanged): Remove.
7856 (Input_reader::arg_serial): New function.
7857 (Input_reader::get_unused_symbol_count): New function.
7858 (Input_reader::get_unused_symbol): New function.
7859 (Input_reader::do_arg_serial): New function.
7860 (Input_reader::do_get_unused_symbol_count): New function.
7861 (Input_reader::do_get_unused_symbol): New function.
7862 (Incremental_binary::input_file_count): New function.
7863 (Incremental_binary::get_input_reader): Change signature to use
7864 index instead of filename.
7865 (Incremental_binary::file_has_changed): New function.
7866 (Incremental_binary::get_input_argument): New function.
7867 (Incremental_binary::get_library): New function.
7868 (Incremental_binary::get_script_info): New function.
7869 (Incremental_binary::init_layout): New function.
7870 (Incremental_binary::reserve_layout): New function.
7871 (Incremental_binary::output_file): New function.
7872 (Incremental_binary::do_check_inputs): New function.
7873 (Incremental_binary::do_file_is_unchanged): Remove.
7874 (Incremental_binary::do_file_has_changed): New function.
7875 (Incremental_binary::do_init_layout): New function.
7876 (Incremental_binary::do_reserve_layout): New function.
7877 (Incremental_binary::do_input_file_count): New function.
7878 (Incremental_binary::do_get_input_reader): Change signature.
7879 (Incremental_binary::input_args_map_): New data member.
7880 (Incremental_binary::library_map_): New data member.
7881 (Incremental_binary::script_map_): New data member.
7882 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7883 new data members.
7884 (Sized_incremental_binary::output_section): New function.
7885 (Sized_incremental_binary::inputs_reader): Add const.
7886 (Sized_incremental_binary::symtab_reader): Add const.
7887 (Sized_incremental_binary::relocs_reader): Add const.
7888 (Sized_incremental_binary::got_plt_reader): Add const.
7889 (Sized_incremental_binary::get_symtab_view): New function.
7890 (Sized_incremental_binary::Inputs_reader): New typedef.
7891 (Sized_incremental_binary::Input_entry_reader): New typedef.
7892 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7893 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7894 (Sized_incremental_binary::do_file_has_changed): New function.
7895 (Sized_incremental_binary::do_init_layout): New function.
7896 (Sized_incremental_binary::do_reserve_layout): New function.
7897 (Sized_input_reader::Inputs_reader): Remove.
7898 (Sized_input_reader::Input_entry_reader): Remove.
7899 (Sized_input_reader::do_arg_serial): New function.
7900 (Sized_input_reader::do_get_unused_symbol_count): New function.
7901 (Sized_input_reader::do_get_unused_symbol): New function.
7902 (Sized_incremental_binary::do_input_file_count): New function.
7903 (Sized_incremental_binary::do_get_input_reader): Change signature;
7904 use index instead of filename.
7905 (Sized_incremental_binary::section_map_): New data member.
7906 (Sized_incremental_binary::input_entry_readers_): New data member.
7907 (class Sized_incr_relobj): New class.
7908 (class Sized_incr_dynobj): New class.
7909 (make_sized_incremental_object): New function.
7910 (class Incremental_library): New class.
7911 * layout.cc (Free_list::num_lists): New static data member.
7912 (Free_list::num_nodes): New static data member.
7913 (Free_list::num_removes): New static data member.
7914 (Free_list::num_remove_visits): New static data member.
7915 (Free_list::num_allocates): New static data member.
7916 (Free_list::num_allocate_visits): New static data member.
7917 (Free_list::init): New function.
7918 (Free_list::remove): New function.
7919 (Free_list::allocate): New function.
7920 (Free_list::dump): New function.
7921 (Free_list::print_stats): New function.
7922 (Layout_task_runner::run): Resize output file for incremental updates.
7923 (Layout::Layout): Initialize new data members.
7924 (Layout::set_incremental_base): New function.
7925 (Layout::init_fixed_output_section): New function.
7926 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7927 incremental updates.
7928 (Layout::create_gold_note): Do not create gold note section for
7929 incremental updates.
7930 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7931 for incremental updates.
7932 (Layout::set_section_offsets): For incremental updates, allocate space
7933 from free list.
7934 (Layout::create_symtab_sections): Layout with offsets relative to
7935 start of section; for incremental updates, allocate space from free
7936 list.
7937 (Layout::create_shdrs): For incremental updates, allocate space from
7938 free list.
7939 (Layout::finish_dynamic_section): For incremental updates, do not
7940 check --as-needed (fixed in subsequent patch).
7941 * layout.h (class Free_list): New class.
7942 (Layout::set_incremental_base): New function.
7943 (Layout::incremental_base): New function.
7944 (Layout::init_fixed_output_section): New function.
7945 (Layout::allocate): New function.
7946 (Layout::incremental_base_): New data member.
7947 (Layout::free_list_): New data member.
7948 * main.cc (main): Print Free_list statistics.
7949 * object.cc (Relobj::finalize_incremental_relocs): Add
7950 clear_counts parameter; clear counts only when clear_counts is set.
7951 (Sized_relobj::Sized_relobj): Initialize new base class.
7952 (Sized_relobj::do_layout): Don't report special sections.
7953 (Sized_relobj::do_for_all_local_got_entries): New function.
7954 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7955 symtab_off to all symbol table offsets.
7956 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7957 * object.h (class Got_offset_list): Move to top of file.
7958 (Object::Object): Allow case where input_file == NULL.
7959 (Object::~Object): Likewise.
7960 (Object::input_file): Assert that input_file != NULL.
7961 (Object::lock): Allow case where input_file == NULL.
7962 (Object::unlock): Likewise.
7963 (Object::is_locked): Likewise.
7964 (Object::token): Likewise.
7965 (Object::release): Likewise.
7966 (Object::is_incremental): New function.
7967 (Object::get_mtime): New function.
7968 (Object::for_all_local_got_entries): New function.
7969 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7970 (Object::set_is_in_system_directory): New function.
7971 (Object::is_in_system_directory): New function.
7972 (Object::do_is_incremental): New function.
7973 (Object::do_get_mtime): New function.
7974 (Object::do_for_all_local_got_entries): New function.
7975 (Object::is_in_system_directory_): New data member.
7976 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7977 (class Sized_relobj_base): New class.
7978 (class Sized_relobj): Derive from Sized_relobj_base.
7979 (class Sized_relobj::Symbols): Redeclare from base class.
7980 (class Sized_relobj::local_got_offset_list): Remove.
7981 (class Sized_relobj::Output_sections): Redeclare from base class.
7982 (class Sized_relobj::do_for_all_local_got_entries): New function.
7983 (class Sized_relobj::write_local_symbols): Add offset parameter.
7984 (class Sized_relobj::local_symbol_offset_): Update comment.
7985 (class Sized_relobj::local_dynsym_offset_): Update comment.
7986 * options.cc (Input_arguments::add_file): Remove const.
7987 * options.h (Input_file_argument::Input_file_argument):
7988 Initialize arg_serial_ (all constructors).
7989 (Input_file_argument::set_arg_serial): New function.
7990 (Input_file_argument::arg_serial): New function.
7991 (Input_file_argument::arg_serial_): New data member.
7992 (Input_arguments::Input_arguments): Initialize file_count_.
7993 (Input_arguments::add_file): Remove const.
7994 (Input_arguments::number_of_input_files): New function.
7995 (Input_arguments::file_count_): New data member.
7996 (Command_line::number_of_input_files): Call
7997 Input_arguments::number_of_input_files.
7998 * output.cc (Output_segment_headers::Output_segment_headers):
7999 Set current size.
8000 (Output_section::Input_section::current_data_size): New function.
8001 (Output_section::Output_section): Initialize new data members.
8002 (Output_section::add_input_section): Don't do merge sections for
8003 an incremental link; allocate space from free list for an
8004 incremental update.
8005 (Output_section::add_output_section_data): Allocate space from
8006 free list for an incremental update.
8007 (Output_section::update_data_size): New function.
8008 (Output_section::set_fixed_layout): New function.
8009 (Output_section::reserve): New function.
8010 (Output_segment::set_section_addresses): Remove const.
8011 (Output_segment::set_section_list_addresses): Remove const; allocate
8012 space from free list for an incremental update.
8013 (Output_segment::set_offset): Adjust size of RELRO segment for an
8014 incremental update.
8015 * output.h (Output_data::current_data_size): Move here from
8016 child classes.
8017 (Output_data::pre_finalize_data_size): New function.
8018 (Output_data::update_data_size): New function.
8019 (Output_section_headers::update_data_size): new function.
8020 (Output_section_data_build::current_data_size): Move to Output_data.
8021 (Output_data_strtab::update_data_size): New function.
8022 (Output_section::current_data_size): Move to Output_data.
8023 (Output_section::set_fixed_layout): New function.
8024 (Output_section::has_fixed_layout): New function.
8025 (Output_section::reserve): New function.
8026 (Output_section::update_data_size): New function.
8027 (Output_section::has_fixed_layout_): New data member.
8028 (Output_section::free_list_): New data member.
8029 (Output_segment::set_section_addresses): Remove const.
8030 (Output_segment::set_section_list_addresses): Remove const.
8031 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8032 New function.
8033 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8034 New function.
8035 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8036 parameter when calling Add_symbols constructor; store argument
8037 serial number for members of a lib group.
8038 (Add_symbols::locks): Allow case where token == NULL.
8039 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8040 (Read_member::~Read_member): New function.
8041 (Read_member::is_runnable): New function.
8042 (Read_member::locks): New function.
8043 (Read_member::run): New function.
8044 (Check_script::~Check_script): New function.
8045 (Check_script::is_runnable): New function.
8046 (Check_script::locks): New function.
8047 (Check_script::run): New function.
8048 (Check_library::~Check_library): New function.
8049 (Check_library::is_runnable): New function.
8050 (Check_library::locks): New function.
8051 (Check_library::run): New function.
8052 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8053 (Add_symbols::library_): New data member.
8054 (class Read_member): New class.
8055 (class Check_script): New class.
8056 (class Check_library): New class.
8057 * reloc.cc (Read_relocs::is_runnable): Allow case where
8058 token == NULL.
8059 (Read_relocs::locks): Likewise.
8060 (Scan_relocs::locks): Likewise.
8061 (Relocate_task::locks): Likewise.
8062 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8063 to clear counters.
8064 (Sized_relobj::incremental_relocs_scan): Fix comment.
8065 (Sized_relobj::do_relocate): Pass output file offset to
8066 write_local_symbols.
8067 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8068 from class declaration.
8069 * script.cc (read_input_script): Allocate Script_info; pass
8070 argument serial number to report_script.
8071 * script.h (class Script_info): Move to incremental.h.
8072 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8073 * symtab.h (Symbol_table::add_from_incrobj): New function.
8074 (Symbol_table::set_file_offset): New function.
8075
b961d0d7
CC
80762011-04-05 Cary Coutant <ccoutant@google.com>
8077
8078 * incremental-dump.cc (dump_incremental_inputs): Change signature
8079 to take a Sized_incremental_binary; change caller. Use readers
8080 in Sized_incremental_binary.
8081 * incremental.cc
8082 (Sized_incremental_binary::find_incremental_inputs_sections):
8083 Rename do_find_incremental_inputs_sections to this.
8084 (Sized_incremental_binary::setup_readers): New function.
8085 (Sized_incremental_binary::do_check_inputs): Check
8086 has_incremental_info_ flag; move setup code to setup_readers;
8087 use input readers.
8088 (Sized_incremental_binary::do_file_is_unchanged): New function.
8089 (Sized_incremental_binary::do_get_input_reader): New function.
8090 * incremental.h (class Incremental_binary): Move to end of file.
8091 (Incremental_binary::file_is_unchanged): New function.
8092 (Incremental_binary::do_file_is_unchanged): New function.
8093 (Incremental_binary::Input_reader): New class.
8094 (Incremental_binary::get_input_reader): New function.
8095 (class Sized_incremental_binary): Move to end of file.
8096 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8097 input section reader classes.
8098 (Sized_incremental_binary::has_incremental_info): New function.
8099 (Sized_incremental_binary::inputs_reader): New function.
8100 (Sized_incremental_binary::symtab_reader): New function.
8101 (Sized_incremental_binary::relocs_reader): New function.
8102 (Sized_incremental_binary::got_plt_reader): New function.
8103 (Sized_incremental_binary::do_file_is_unchanged): New function.
8104 (Sized_incremental_binary::Sized_input_reader): New class.
8105 (Sized_incremental_binary::get_input_reader): New function.
8106 (Sized_incremental_binary::find_incremental_inputs_sections):
8107 Rename do_find_incremental_inputs_sections to this.
8108 (Sized_incremental_binary::setup_readers): New function.
8109 (Sized_incremental_binary::has_incremental_info_): New data member.
8110 (Sized_incremental_binary::inputs_reader_): New data member.
8111 (Sized_incremental_binary::symtab_reader_): New data member.
8112 (Sized_incremental_binary::relocs_reader_): New data member.
8113 (Sized_incremental_binary::got_plt_reader_): New data member.
8114 (Sized_incremental_binary::current_input_file_): New data member.
8115
a869183f
PP
81162011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8117
8118 PR gold/12640
8119 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8120 violation.
8121
81222011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8123
8124 * archive.cc (Archive::include_member): Adjust call to report_object.
8125 (Add_archive_symbols::run): Add script_info to call to
8126 report_archive_begin.
8127 (Lib_group::include_member): Adjust call to report_object.
8128 (Add_lib_group_symbols::run): Adjust call to report_object.
8129 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8130 blocks. Add object count for script input files.
8131 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8132 script_info parameter; change all callers.
8133 (Incremental_inputs::report_object): Add script_info parameter;
8134 change all callers.
8135 (Incremental_inputs::report_script): Store backpointer to
8136 incremental info entry.
8137 (Output_section_incremental_inputs::set_final_data_size): Record
8138 additional information for scripts.
8139 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8140 * incremental.h (Incremental_script_entry::add_object): New function.
8141 (Incremental_script_entry::get_object_count): New function.
8142 (Incremental_script_entry::get_object): New function.
8143 (Incremental_script_entry::objects_): New data member; adjust
8144 constructor.
8145 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8146 (Incremental_inputs::report_object): Add script_info parameter.
8147 (Incremental_inputs_reader::get_object_count): New function.
8148 (Incremental_inputs_reader::get_object_offset): New function.
8149 * options.cc (Input_arguments::add_file): Return reference to
8150 new input argument.
8151 * options.h (Input_argument::set_script_info): New function.
8152 (Input_argument::script_info): New function.
8153 (Input_argument::script_info_): New data member; adjust all
8154 constructors.
8155 (Input_file_group::add_file): Return reference to new input argument.
8156 (Input_file_lib::add_file): Likewise.
8157 (Input_arguments::add_file): Likewise.
8158 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8159 * script.cc (Parser_closure::Parser_closure): Add script_info
8160 parameter; adjust all callers.
8161 (Parser_closure::script_info): New function.
8162 (Parser_closure::script_info_): New data member.
8163 (read_input_script): Report scripts earlier to incremental info.
8164 (script_add_file): Set script_info in Input_argument.
8165 (script_add_library): Likewise.
8166 * script.h (Script_options::Script_info): Rewrite class.
8167
a869183f 81682011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8169
8170 * archive.cc (Library_base::should_include_member): Move
8171 method here from class Archive.
8172 (Archive::Archive): Initialize base class.
8173 (Archive::should_include_member): Move to base class.
8174 (Archive::do_for_all_unused_symbols): New function.
8175 (Add_archive_symbols::run): Remove redundant access to
8176 incremental_inputs.
8177 (Lib_group::Lib_group): Initialize base class.
8178 (Lib_group::do_filename): New function.
8179 (Lib_group::include_member): Pass pointer to Lib_group to
8180 report_object.
8181 (Lib_group::do_for_all_unused_symbols): New function.
8182 (Add_lib_group_symbols::run): Report archive information for
8183 incremental links.
8184 * archive.h (class Library_base): New base class.
8185 (class Archive): Derive from Library_base.
8186 (Archive::filename): Move to base class.
8187 (Archive::set_incremental_info): Likewise.
8188 (Archive::incremental_info): Likewise.
8189 (Archive::Should_include): Likewise.
8190 (Archive::should_include_member): Likewise.
8191 (Archive::Armap_entry): Remove.
8192 (Archive::Unused_symbol_iterator): Remove.
8193 (Archive::unused_symbols_begin): Remove.
8194 (Archive::unused_symbols_end): Remove.
8195 (Archive::do_filename): New function.
8196 (Archive::do_get_mtime): New function.
8197 (Archive::do_for_all_unused_symbols): New function.
8198 (Archive::task_): Move to base class.
8199 (Archive::incremental_info_): Likewise.
8200 (class Lib_group): Derive from Library_base.
8201 (Lib_group::do_filename): New function.
8202 (Lib_group::do_get_mtime): New function.
8203 (Lib_group::do_for_all_unused_symbols): New function.
8204 (Lib_group::task_): Move to base class.
8205 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8206 function.
8207 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8208 function.
8209 * incremental.cc (Incremental_inputs::report_archive_begin):
8210 Use Library_base; call library's get_mtime; add incremental inputs
8211 entry before members.
8212 (class Unused_symbol_visitor): New class.
8213 (Incremental_inputs::report_archive_end): Use Library_base; use
8214 visitor class to record unused symbols; don't add incremental inputs
8215 entry after members.
8216 (Incremental_inputs::report_object): Use Library_base.
8217 * incremental.h
8218 (Incremental_archive_entry::Incremental_archive_entry): Remove
8219 unused Archive parameter.
8220 (Incremental_inputs::report_archive_begin): Use Library_base.
8221 (Incremental_inputs::report_archive_end): Likewise.
8222 (Incremental_inputs::report_object): Likewise.
8223 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8224 function.
8225 * object.h (Object::for_all_global_symbols): New function.
8226 (Object::do_for_all_global_symbols): New function.
8227 (Sized_relobj::do_for_all_global_symbols): New function.
8228 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8229 function.
8230 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8231 function.
8232
61ab3e40
ILT
82332011-03-27 Ian Lance Taylor <iant@google.com>
8234
8235 * archive.cc (Archive::interpret_header): Return -1 if something
8236 goes wrong. Change callers accordingly.
8237
30e1f9e6
CC
82382011-03-25 Cary Coutant <ccoutant@google.com>
8239
8240 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8241 * testsuite/Makefile.in: Regenerate.
8242
9370ce59 82432011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8244
8245 * plugin.cc (get_view): New.
8246 (Plugin::load): Pass get_view to the plugin.
8247 (Plugin_manager::get_view): New.
8248
9312bb0a
ILT
82492011-03-21 Ian Lance Taylor <iant@google.com>
8250
8251 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8252 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8253
7e12ba9e
ST
82542011-03-21 Sriraman Tallam <tmsriram@google.com>
8255
8256 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8257 Change == to -eq.
8258 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8259 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8260 Change == to -eq.
8261 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8262 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8263
fd7a005d
ILT
82642011-03-14 Ian Lance Taylor <iant@google.com>
8265
8266 * script-sections.cc (Sort_output_sections::script_compare):
8267 Rename from is_before, change return type.
8268 (Sort_output_sections::operator()): Adjust accordingly.
8269
ed16fd1b
ILT
82702011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8271
8272 PR gold/12572
8273 * testsuite/odr_violation2.cc: Add comment to make all error line
8274 numbers double digits.
8275 * testsuite/debug_msg.sh: Adjust expected errors.
8276
71ff8986
ILT
82772011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8278
8279 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8280 but mark earlier ones as non-canonical
8281 (offset_to_iterator): Update search target and example
8282 (do_addr2line): Return extra lines in a vector*
8283 (format_file_lineno): Extract from do_addr2line
8284 (one_addr2line): Add vector* out-param
8285 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8286 when a lineno entry appeared last for its instruction
8287 (Dwarf_line_info): Add vector* out-param
8288 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8289 * symtab.cc (Odr_violation_compare): Include the lineno in the
8290 comparison again.
8291 (linenos_from_loc): New. Combine the canonical line for an
8292 address with its other lines.
8293 (True_if_intersect): New. Helper functor to make
8294 std::set_intersection a query.
8295 (detect_odr_violations): Compare sets of lines instead of just
8296 one line for each function. This became less deterministic, but
8297 has fewer false positives.
8298 * symtab.h: Declarations.
8299 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8300 mix an optimized and non-optimized object in the same binary
8301 (odr_violation2.so): Same.
8302 * testsuite/Makefile.in: Regenerate from Makefile.am.
8303 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8304 * testsuite/debug_msg.sh: Update line numbers and add
8305 assertions.
8306 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8307 non-optimized context.
8308 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8309 isn't inlined, and use OdrDerived in an optimized context.
8310 * testsuite/odr_header1.h: Defines OdrDerived, where
8311 optimization will change the
8312 first-instruction-in-the-destructor's file and line number.
8313 * testsuite/odr_header2.h: Defines OdrBase.
8314
a19fefdc
ILT
83152011-03-09 Ian Lance Taylor <iant@google.com>
8316
8317 * fileread.cc (File_read::clear_views): Don't delete the whole
8318 file view.
8319
ecb351e9
ILT
83202011-03-08 Ian Lance Taylor <iant@google.com>
8321
8322 PR gold/12525
8323 * fileread.cc: #include <climits>.
8324 (GOLD_IOV_MAX): Define.
8325 (File_read::read_multiple): Limit number of entries by iov_max.
8326 * fileread.h (class File_read): Always set max_readv_entries to
8327 128.
8328
b821d13c
ILT
83292011-03-07 Ian Lance Taylor <iant@google.com>
8330
8331 PR gold/12525
8332 * options.h (class General_options): Add -dy and -dn.
8333
89243142
CC
83342011-03-02 Cary Coutant <ccoutant@google.com>
8335
8336 * testsuite/script_test_9.t: Add TLS segment.
8337
d0773f31
ILT
83382011-03-02 Simon Baldwin <simonb@google.com>
8339
8340 * configure.ac: Add check for gnu_indirect_function support in
8341 the toolchain building binutils.
8342 * configure: Rebuild.
8343
9370ce59 83442011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8345
8346 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8347 plugin only symbols.
8348 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8349 in plugin files as not needed in the symbol table.
8350
4cf7a849
ST
83512011-02-11 Sriraman Tallam <tmsriram@google.com>
8352
8353 * output.cc (Output_section::add_input_section): Delay fill
8354 generation for section ordering.
8355
b578bd7d
ILT
83562011-02-09 Ian Lance Taylor <iant@google.com>
8357
8358 PR gold/12316
8359 * object.h (class Sized_relobj): Remove clear_local_symbols.
8360 * reloc.cc (Sized_relobj::do_relocate): Don't call
8361 clear_local_symbols.
8362
9370ce59 83632011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8364
8365 * plugin.cc (is_visible_from_outside): Return true for symbols
8366 in the -u option.
8367
55382fb7
ILT
83682011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8369
8370 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8371 filename.
8372
4e271fff
ST
83732011-02-02 Sriraman Tallam <tmsriram@google.com>
8374
8375 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8376 to std::string.
4e271fff 8377 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8378 section_name to be std::string.
4e271fff
ST
8379 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8380
d433c3ac
ILT
83812011-01-25 Ian Lance Taylor <iant@google.com>
8382
8383 * script.cc (script_add_extern): Rewrite to use
8384 add_symbol_reference.
8385
880473a6
DK
83862011-01-25 Doug Kwan <dougkwan@google.com>
8387
d433c3ac 8388 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8389
f30f86fa
ILT
83902011-01-24 Ian Lance Taylor <iant@google.com>
8391
8392 * options.h (class General_options): Accept
8393 --no-detect-odr-violations.
8394
8e51a0b9
ILT
83952011-01-24 Ian Lance Taylor <iant@google.com>
8396
8397 * version.cc (version_string): Bump to 1.11.
8398
0f3b89d8
ILT
83992011-01-24 Ian Lance Taylor <iant@google.com>
8400
8401 * plugin.cc (class Plugin_rescan): Define new class.
8402 (Plugin_manager::claim_file): Set any_claimed_.
8403 (Plugin_manager::save_archive): New function.
8404 (Plugin_manager::save_input_group): New function.
8405 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8406 necessary.
8407 (Plugin_manager::new_undefined_symbol): New function.
8408 (Plugin_manager::rescan): New function.
8409 (Plugin_manager::rescannable_defines): New function.
8410 (Plugin_manager::add_input_file): Set any_added_.
8411 * plugin.h (class Plugin_manager): define new fields rescannable_,
8412 undefined_symbols_, any_claimed_, and any_added_. Declare
8413 Plugin_rescan as friend. Declare new functions.
8414 (Plugin_manager::Rescannable): Define type.
8415 (Plugin_manager::Rescannable_list): Define type.
8416 (Plugin_manager::Undefined_symbol_list): Define type.
8417 (Plugin_manager::Plugin_manager): Initialize new fields.
8418 * archive.cc (Archive::defines_symbol): New function.
8419 (Add_archive_symbols::run): Pass archive to plugins if any.
8420 * archive.h (class Archive): Declare defines_symbol.
8421 * readsyms.cc (Input_group::~Input_group): New function.
8422 (Finish_group::run): Pass input_group to plugins if any.
8423 * readsyms.h (class Input_group): Declare destructor.
8424 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8425 any.
8426
3bb951e5
ILT
84272011-01-10 Ian Lance Taylor <iant@google.com>
8428
8429 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8430 section as relro.
8431 (Layout::set_segment_offsets): Reset increase_relro before calling
8432 set_section_addresses a second time.
8433
0aa45fac
CC
84342011-01-04 Cary Coutant <ccoutant@google.com>
8435
8436 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8437 sections before NOBITS sections.
8438
0db46eb4
L
84392011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8440
8441 * version.cc (print_version): Update copyright to 2011.
8442
829c9745
CC
84432010-12-23 Cary Coutant <ccoutant@google.com>
8444
8445 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8446 of OS to this->add. Add OD parameter to second form of the function.
8447
7500420b
ILT
84482010-12-20 Ian Lance Taylor <iant@google.com>
8449
8450 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8451 second of two consecutive entries with same offset.
8452
f8e9a930
RW
84532010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8454
8455 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8456 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8457 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8458 to avoid unneeded links against $(LDADD).
8459 * testsuite/Makefile.in: Regenerate.
8460
2fbb4320
ILT
84612010-12-15 Ian Lance Taylor <iant@google.com>
8462
8463 PR gold/12324
8464 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8465 for R_X86_64_32 and R_X86_64_PC32.
8466 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8467 ver_matching_def_pic.o.
8468 (ver_matching_def_pic.o): New target.
8469
fedb228d
RW
84702010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8471
8472 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8473 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8474 Move definition before File_read::View member definitions.
8475 (File_read::View::~View): Initialize and hold lock before
8476 updating current_mapped_bytes.
8477
9b547ce6
RW
84782010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8479
8480 * dwarf_reader.cc: Remove outdated comment.
8481 * gold-threads.cc: Fix typo in error message.
8482 * archive.cc: Fix typos in comments.
8483 * archive.h: Likewise.
8484 * arm-reloc-property.cc: Likewise.
8485 * arm-reloc-property.h: Likewise.
8486 * arm-reloc.def: Likewise.
8487 * arm.cc: Likewise.
8488 * attributes.h: Likewise.
8489 * cref.cc: Likewise.
8490 * ehframe.cc: Likewise.
8491 * fileread.h: Likewise.
8492 * gold.h: Likewise.
8493 * i386.cc: Likewise.
8494 * icf.cc: Likewise.
8495 * incremental.h: Likewise.
8496 * int_encoding.cc: Likewise.
8497 * layout.h: Likewise.
8498 * main.cc: Likewise.
8499 * merge.h: Likewise.
8500 * object.cc: Likewise.
8501 * object.h: Likewise.
8502 * options.cc: Likewise.
8503 * readsyms.cc: Likewise.
8504 * reduced_debug_output.cc: Likewise.
8505 * reloc.cc: Likewise.
8506 * script-sections.cc: Likewise.
8507 * sparc.cc: Likewise.
8508 * symtab.h: Likewise.
8509 * target-reloc.h: Likewise.
8510 * target.cc: Likewise.
8511 * target.h: Likewise.
8512 * timer.cc: Likewise.
8513 * timer.h: Likewise.
8514 * x86_64.cc: Likewise.
8515
83e17bd5
CC
85162010-12-09 Cary Coutant <ccoutant@google.com>
8517
8518 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8519 stack.
8520 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8521 parameter; change all callers.
8522 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8523 * options.h (warn_execstack): New option.
8524
017257f8
DK
85252010-12-07 Doug Kwan <dougkwan@google.com>
8526
8527 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8528 like function call relocations.
8529
c20cbc06
ILT
85302010-12-07 Ian Lance Taylor <iant@google.com>
8531
8532 * archive.cc (Archive::get_elf_object_for_member): Permit
8533 punconfigured to be NULL.
8534 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8535 (Archive::include_member): Pass NULL to get_elf_object_for_member
8536 if we searched for the archive and this is the first included
8537 object.
8538
4dbfafcc
ILT
85392010-12-01 Ian Lance Taylor <iant@google.com>
8540
8541 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8542 track_relocs_type_ field.
8543 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8544 Set track_relocs_type_.
8545 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8546 contents when using RELA relocs.
8547 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8548 reloc_map_.
8549 * reloc.cc (Track_relocs::next_addend): New function.
8550 * reloc.h (class Track_relocs): Declare next_addend.
8551
e5e19edd
ILT
85522010-12-01 Ian Lance Taylor <iant@google.com>
8553
8554 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8555 virtual destructor.
8556
9a5ce24c
ILT
85572010-12-01 Ian Lance Taylor <iant@google.com>
8558
8559 * README: Update compilers known to work and fail.
8560
c7791212
NC
85612010-11-23 Matthias Klose <doko@ubuntu.com>
8562
8563 * configure.in: For --enable-gold, handle value `default' instead of
8564 `both*'. Always install ld as ld.bfd, install as ld if gold is
8565 not the default.
8566 * configure: Regenerate.
8567
0ad220c9
DK
85682010-11-18 Doug Kwan <dougkwan@google.com>
8569
8570 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8571 and right_alignment to be zero. Store result alignment only if it is
8572 greater than existing alignment.
8573
ab8056e0
CC
85742010-11-16 Cary Coutant <ccoutant@google.com>
8575
8576 PR gold/12220
8577 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8578 Check for ".zdebug_line".
8579
fd064a5b
CC
85802010-11-16 Doug Kwan <dougkwan@google.com>
8581 Cary Coutant <ccoutant@google.com>
8582
8583 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8584 by reference; adjust all callers.
8585 * output.cc (Output_segment::set_section_addresses): Adjust references
8586 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8587 list is empty.
8588 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8589 end at page boundary.
8590
6fc6ea19
CC
85912010-11-16 Cary Coutant <ccoutant@google.com>
8592
8593 PR gold/12220
8594 * layout.cc (Layout::choose_output_section): Transform names of
8595 compressed sections even when using a script with a SECTIONS clause.
8596 (Layout::output_section_name): Remove code to transform
8597 compressed debug section names.
8598 * output.cc (Output_section::add_input_section): Use uncompressed
8599 section size when tracking input sections.
8600
95a2c8d6
RS
86012010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8602
8603 * symtab.h (Symbol::NON_PIC_REF): Remove.
8604 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8605 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8606 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8607 (Symbol::use_plt_offset): Take a flags argument and pass it
8608 directly to needs_dynamic_reloc. Restrict check for undefined
8609 weak symbols to function calls.
8610 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8611 (Target_arm::Scan::global): Use it.
8612 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8613 (Target_arm::Relocate::relocate): Likewise.
8614 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8615 parameter with an r_type parameter. Use get_reference_flags
8616 to get the flags.
8617 (Target_arm::Relocate::relocate): Update accordingly.
8618 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8619 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8620 (Target_i386::Scan::global): Likewise.
8621 (Target_i386::Relocate::relocate): Likewise.
8622 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8623 parameter with an r_type parameter. Use get_reference_flags
8624 to get the flags.
8625 (Target_i386::Relocate::relocate): Update accordingly.
8626 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8627 (Target_powerpc::Scan::global): Use it.
8628 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8629 (Target_powerpc::Relocate::relocate): Likewise.
8630 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8631 (Target_sparc::Scan::global): Use it.
8632 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8633 (Target_sparc::Relocate::relocate): Likewise.
8634 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8635 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8636 (Target_x86_64::Scan::global): Likewise.
8637 (Target_x86_64::Relocate::relocate): Likewise.
8638
f625ae50
DK
86392010-11-08 Doug Kwan <dougkwan@google.com>
8640 Cary Coutant <ccoutant@google.com>
8641
8642 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8643 (Arm_exidx_merge_section::section_contents_): New data member.
8644 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8645 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8646 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8647 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8648 in parameters instead of calling Object::section_contents without
8649 locking.
8650 (Arm_output_section::group_section): New parameter TASK. Pass it
8651 to callees that need locking objects.
8652 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8653 to lock EXIDX input sections. Fix a formatting issue. Call
8654 Arm_exidx_merged_section::build_contents to create merged section
8655 contents.
8656 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8657 to lock object of stub table owner.
8658 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8659 TEXT_SIZE to initialize data member TEXT_SIZE_.
8660 (Arm_exidx_input_section::addralign): Fix typo in comment.
8661 (Arm_exidx_input_section::text_size): New method.
8662 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8663 that require locking objects. Lock objects before scanning for stubs
8664 and updating local symbols.
8665 (Arm_input_section<big_endian>::init): Copy contents of original
8666 input section.
2e702c99 8667 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8668 original input section instead of calling Object::section_contents
8669 without locking.
8670 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8671 size without calling Object::section_size().
8672 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8673 for size. Allocate a buffer for merged EXIDX entries.
8674 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8675 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8676 building code to Arm_exidx_merged_section::build_contetns. Write
8677 out contetns in buffer instead of building it on the fly.
8678 (Arm_relobj::make_exidx_input_section): Also pass text section size
8679 to Arm_exidx_input_section constructor.
8680 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8681 (Arm_dynobj::do_read_symbols): Fix memory leak.
8682 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8683 * target.h: (class Task): Add forward declaration.
8684 (Target::relax): Add new parameter TASK and pass it to
8685 Target::do_relax().
8686 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8687
5f9bcf58
CC
86882010-11-05 Cary Coutant <ccoutant@google.com>
8689
8690 PR gold/10708
8691 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8692 object when reading from the file.
8693 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8694 second layout pass.
8695 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8696 when reading section contents.
8697 (get_section_contents): Likewise.
8698 (icf::find_identical_sections): Likewise.
8699 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8700 object when reading from the file.
8701 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8702 the object when doing deferred section layout.
8703
e597fa08
NC
87042010-11-03 Nick Clifton <nickc@redhat.com>
8705
8706 PR gold/12001
8707 * script.h (class Symbol_assignment: name): New member. Returns
8708 the name of the symbol.
8709 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8710 Returns true if the given symbol name is on the list of
8711 assignments wating to be processed.
8712 * archive.cc (should_incldue_member): If the symbol is undefined,
8713 check to see if it is on the list of symbols pending assignment.
8714
3f9a3278
ILT
87152010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8716
8717 * script-sections.cc (Script_sections::find_memory_region): Check
8718 for a NULL output section pointer.
8719
d06fb4d1
DK
87202010-10-29 Doug Kwan <dougkwan@google.com>
8721
8722 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8723 Output_section::add_relaxed_input_section.
8724 * output.cc (Output_section::add_relaxed_input_section): Add new
8725 arguments LAYOUT and NAME. Set section order index.
8726 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8727 Copy section order index.
8728 * output.h (Output_section::add_relaxed_input_section): Add new
8729 arguments LAYOUT and NAME.
8730
90e24de5
ILT
87312010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8732
8733 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8734 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8735 * testsuite/Makefile.in: Regenerate.
8736
c9484ea5
DK
87372010-10-20 Doug Kwan <dougkwan@google.com>
8738
8739 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8740 without SHF_LINK_ORDER flags.
8741 * layout.cc (Layout::choose_output_section): Do not filter
8742 SHF_LINK_ORDER flag in a relocatable link.
8743
5bc2f5be
CC
87442010-10-17 Cary Coutant <ccoutant@google.com>
8745
8746 * output.h (Output_segment::set_section_addresses): Change function
8747 signature. Update all callers.
8748 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8749 sections.
8750 (Output_segment::set_section_addresses): Align after last TLS
8751 section. Add padding before last relro section instead of after.
8752
0c91cf04
DK
87532010-10-17 Doug Kwan <dougkwan@google.com>
8754
8755 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8756 GOT output section to be writable.
8757
8c21d9d3
CC
87582010-10-14 Cary Coutant <ccoutant@google.com>
8759
8760 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8761 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8762 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8763 mode.
8764 * incremental.cc (report_command_line): Ignore all forms of
8765 --incremental.
8766 * layout.cc (Layout::Layout): Check parameters for incremental link
8767 mode.
8768 * options.cc (General_options::parse_incremental): New function.
8769 (General_options::parse_no_incremental): New function.
8770 (General_options::parse_incremental_full): New function.
8771 (General_options::parse_incremental_update): New function.
8772 (General_options::incremental_mode_): New data member.
8773 (General_options::finalize): Check incremental_mode_.
8774 * options.h (General_options): Update help text for --incremental.
8775 Add --no-incremental, --incremental-full, --incremental-update.
8776 (General_options::Incremental_mode): New enum type.
8777 (General_options::incremental_mode): New function.
8778 (General_options::incremental_mode_): New data member.
8779 * parameters.cc (Parameters::incremental_mode_): New data member.
8780 (Parameters::set_options): Set incremental_mode_.
8781 (Parameters::set_incremental_full): New function.
8782 (Parameters::incremental): New function.
8783 (Parameters::incremental_update): New function.
8784 (set_parameters_incremental_full): New function.
8785 * parameters.h (Parameters::set_incremental_full): New function.
8786 (Parameters::incremental): New function.
8787 (Parameters::incremental_update): New function.
8788 (Parameters::incremental_mode_): New data member.
8789 (set_parameters_incremental_full): New function.
8790 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8791 incremental link mode.
8792 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8793 (Sized_relobj::do_relocate_sections): Likewise.
8794 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8795 option.
8796 * testsuite/Makefile.in: Regenerate.
8797 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8798
bb32aa18 87992010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8800
8801 * script-sections.h (class Script_sections): Make
8802 Sections_elements typedef public.
8803 * script-sections.cc (class Sort_output_sections): Add elements_
8804 field. Add constructor which sets it; change all callers.
8805 (Sort_output_sections::is_before): New function.
8806 (Sort_output_sections::operator()): Call is_before.
8807 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8808 conditional.
8809 * testsuite/script_test_10.sh: New test. Test script section
8810 order.
8811 * testsuite/script_test_10.t: Likewise.
8812 * testsuite/script_test_10.s: Likewise.
8813 * testsuite/Makefile.am: Wrap the cross linker tests and the
8814 common tests into NATIVE_OR_CROSS_LINKER.
8815 (check_SCRIPTS): Add script_test_10.sh.
8816 (check_DATA): Add script_test_10.stdout.
8817 (script_test_10.o, script_test_10): New targets.
8818 (script_test_10.stdout): New target.
8819 * configure, testsuite/Makefile.in: Regenerate.
8820
3cef7179
ILT
88212010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8822
8823 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8824 error for the deprecated relocations.
8825 (Target_arm::Scan::global): Likewise.
8826 (Target_arm::Relocate::relocate): Likewise.
8827
7411e9a8
RS
88282010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8829
8830 * fileread.cc (Input_file::find_file): Initialize *found_name
8831 and *namep when using the fallback search for case 4.
8832
6a9da32a
CC
88332010-10-11 Cary Coutant <ccoutant@google.com>
8834
8835 * options.h (class General_options): Redefine -z lazy as an alias for
8836 the negation of -z now.
8837
ac897c20
ILT
88382010-10-11 Ian Lance Taylor <iant@google.com>
8839
8840 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8841 binding.
8842
ea5cae92
NC
88432010-10-06 Nick Clifton <nickc@redhat.com>
8844
8845 * script-sections.cc(class Memory_region): Remove
8846 current_lma_offset_ field. Rename current_vma_offset_ to
8847 current_offset_. Add last_section_ field.
8848 (Memory_region::get_current_vma_address): Rename to
8849 get_current_address.
8850 (Memory_region::get_current_lma_address): Delete.
8851 (Memory_region::increment_vma_offset): Rename to
8852 increment_offset.
8853 (Memory_region::increment_lma_offset): Delete.
8854 (Memory_region::attributes_compatible): New method. Returns
8855 true if the provided section is compatible with the region.
8856 (Memory_region::get_last_section): New method. Returns the last
8857 section to use the region.
8858 (Memory_region::set_last_section): New method. Stores the last
8859 section to use the region.
8860 (Script_sections::block_in_region): New method. Returns true if
8861 a block of memory is contained within a region.
8862 (Script_sections::find_memory_region): New method. Locates a
8863 memory region to be used to set a VMA or LMA address.
8864 (Output_section_definition::set_section_addresses): Add code to
8865 check for addresses set by memory regions.
8866 (Output_segment::set_section_addresses): Remove memory region
8867 walking code.
8868 (Script_sections::create_segment): Add a warning if a header
8869 segment is created outside of any region.
8870 * script-sections.h (class Script_sections): Add prototypes for
8871 find_memory_region and block_in_region methods.
8872 * testsuite/memory_test.s: Use .long instead of .word.
8873 * testsuite/memory_test.t: Add some more output sections.
8874 * testsuite/memory_test.sh: Update expected output.
8875
a9bfd952
DK
88762010-10-02 Doug Kwan <dougkwan@google.com>
8877
8878 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8879 defintion to symtab.h
8880 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8881 declaration to defintion.
8882
bacff3ab
NC
88832010-10-01 Nick Clifton <nickc@redhat.com>
8884
8885 * expression.cc (eval): Replace dummy argument with NULL.
8886 (eval_maybe_dot): Check for a NULL result section pointer.
8887 (Symbol_expression::value): Likewise.
8888 (Dot_expression::value): Likewise.
8889 (BINARY_EXPRESSION): Likewise.
8890 (Max_expression::value): Likewise.
8891 (Min_expression::value): Likewise.
8892 (Absolute_expression::value): Likewise.
8893 (Addr_expression::value_from_output_section): Likewise.
8894 (Loaddddr_expression::value_from_output_section): Likewise.
8895 (Segment_start_expression::value): Likewise.
8896 * script-sections.cc
8897 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8898 argument with NULL.
8899 (Sections_elememt_dot_assignment::set_section_addresses):
8900 Likewise.
8901 (Output_data_expression::do_write_to_buffer): Likewise.
8902 (Output_section_definition::finalize_symbols): Likewise.
8903 (Output_section_definition::set_section_addresses): Likewise.
8904
f81bc8b5
DK
89052010-09-30 Doug Kwan <dougkwan@google.com>
8906
8907 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8908
c95e9f27
ST
89092010-09-28 Sriraman Tallam <tmsriram@google.com>
8910
8911 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8912 function.
c95e9f27
ST
8913 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8914 virtual function.
8915 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8916 virtual function.
8917 * icf.cc (get_section_contents): Inline merge sections only when
8918 target allows it.
8919
3cac54d2
RW
89202010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8921
8922 * configure: Regenerate.
8923
2904037a
ILT
89242010-09-17 Ian Lance Taylor <iant@google.com>
8925
8926 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8927 * testsuite/Makefile.am (memory_test.o): New target.
8928 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8929 memory_test.t.
8930 * testsuite/Makefile.in: Rebuild.
2904037a 8931
bca7fb63
DK
89322010-09-17 Doug Kwan <dougkwan@google.com>
8933
8934 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8935 defintion if relocation uses GOT entries of the symbol.
8936 * testsuite/icf_safe_test.sh: Fix test.
8937 * testsuite/icf_safe_so_test.sh: Fix test.
8938
4ef28648
CC
89392010-09-16 Cary Coutant <ccoutant@google.com>
8940
8941 * script_sections.cc (class Memory_region): Remove "NULL" from
8942 vector initializations.
8943
793990de
CC
89442010-09-15 Cary Coutant <ccoutant@google.com>
8945
8946 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8947 Resolve forwarding symbols.
8948
81e015e2
DK
89492010-09-15 Doug Kwan <dougkwan@google.com>
8950
8951 * gold/testsuite/script_test_3.t: Add ARM special sections.
8952 * gold/testsuite/script_test_4.t: Same.
8953 * gold/testsuite/script_test_5.t: Same.
8954 * gold/testsuite/script_test_6.t: Same.
8955 * gold/testsuite/script_test_7.t: Same.
8956 * gold/testsuite/script_test_7.t: Same.
8957 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8958
36171d64
CC
89592010-09-14 Cary Coutant <ccoutant@google.com>
8960
8961 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8962 (Target_x86_64::Relocate::relocate_tls): Replace check for
8963 saw_tls_block_reloc_ with test for executable section.
8964
d89051bd
CC
89652010-09-12 Cary Coutant <ccoutant@google.com>
8966
8967 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8968 position-independent executables to shared libraries need dynamic
8969 relocations.
8970 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8971 position-independent executables.
8972 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8973 * testsuite/Makefile.in: Regenerate.
8974
fca41f0f
NC
89752010-09-10 Nick Clifton <nickc@redhat.com>
8976
8977 PR gold/11997
8978 * testsuite/memory_test.t: Discard any sections that are not
8979 needed.
8980
6695e4b3
L
89812010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8982
8983 PR gold/11996
8984 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8985 "This::" to work around a bug in gcc 4.2.
8986
8987 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8988
0f72bf6f
RÁE
89892010-09-09 Rafael Espindola <espindola@google.com>
8990
8991 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8992 sections with different PF_X flags in the same segment.
8993 (Layout::find_first_load_seg): Search all segments to find the first
8994 one.
8995 * options.h (rosegment): New.
8996
89972010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8998
05a79166 8999 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 9000
aa98ff75
DK
90012010-09-08 Doug Kwan <dougkwan@google.com>
9002
9003 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9004 (Arm_relobj::do_relocate_sections): Add new parameter for output
9005 file to match the parent.
9006 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9007 of local symbols instead of input values. Update code to track
9008 changes in gold::relocate_section.
9009 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9010 (Sized_relobj::compute_final_local_value_internal): New methods.
9011 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9012 body into private version of Sized_relobj::compute_final_local_value.
9013 Call the inline method.
9014 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9015 merged symbol value if there is one.
9016 (Symbol_value::has_output_value): New method defintiion.
9017 (Sized_relobj::Compute_final_local_value_status): New enum type.
9018 (Sized_relobj::compute_final_local_value): New methods.
9019 (Sized_relobj::compute_final_local_value_internal): New methods.
9020 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9021 and arm_cortex_a8.sh.
9022 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9023 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9024 New tests.
9025 * Makefile.in: Regenerate.
9026 * testsuite/arm_bl_out_of_range.s: Update test.
9027 * testsuite/thumb_bl_out_of_range.s: Ditto.
9028 * testsuite/thumb_blx_out_of_range.s: Ditto.
9029 * testsuite/arm_branch_out_of_range.sh: New file.
9030 * testsuite/arm_cortex_a8.sh: Ditto.
9031 * testsuite/arm_cortex_a8_b.s: Ditto.
9032 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9033 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9034 * testsuite/arm_cortex_a8_bl.s: Ditto.
9035 * testsuite/arm_cortex_a8_blx.s: Ditto.
9036 * testsuite/arm_cortex_a8_local.s: Ditto.
9037 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9038 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9039
05a79166
L
90402010-09-08 Rafael Espindola <espindola@google.com>
9041
9042 * Makefile.am (memory_test.stdout): Run readelf with -W.
9043 * Makefile.in: Regenerate.
9044 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9045 64 bit output.
9046
33dbc701
RÁE
90472010-09-08 Rafael Espindola <espindola@google.com>
9048
9049 * script-sections.cc (Script_sections::add_memory_region): Convert
9050 field precision to int.
9051 * script.cc (script_set_section_region, script_set_section_region):
9052 Convert field precision to int.
9053
731ca54a
RÁE
90542010-09-08 Rafael Espindola <espindola@google.com>
9055
9056 * arm.cc (do_finalize_sections): Create the __exidx_start and
9057 __exdix_end symbols even when the section is missing.
9058
7f8cd844
NC
90592010-09-08 Nick Clifton <nickc@redhat.com>
9060
9061 * README: Remove claim that MEMORY is not supported.
9062 * expression.cc (script_exp_function_origin)
9063 (script_exp_function_length): Move from here to ...
9064 * script.cc: ... here.
9065 (script_set_section_region, script_add_memory)
9066 (script_parse_memory_attr, script_include_directive): New
9067 functions.
9068 * script-sections.cc
9069 (class Memory_region): New class.
9070 (class Output_section_definition): Add set_memory_region,
9071 set_section_vma, set_section_lma and get_section_name methods.
9072 (class Script_Sections): Add add_memory_region,
9073 find_memory_region, find_memory_region_origin,
9074 find_memory_region_length and set_memory_region methods.
9075 Have set_section_addresses method walk the list of set memory
9076 regions.
9077 Extend the print methos to display memory regions.
9078 * script-sections.h: Add prototypes for new methods.
9079 Add enum for MEMORY region attributes.
9080 * yyscript.y: Add support for parsing MEMORY regions.
9081 * script-c.h: Add prototypes for new functions.
9082 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9083 * testsuite/Makefile.in: Regenerate.
9084 * testsuite/memory_test.sh: New script.
9085 * testsuite/memory_test.s: New assembler source file.
9086 * testsuite/memory_test.t: New linker script.
9087
a4649286
DK
90882010-08-27 Doug Kwan <dougkwan@google.com>
9089
9090 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9091 reference override an existing dynamic weak reference.
9092 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9093 * testsuite/Makefile.in: Regenerate.
9094 * testsuite/dyn_weak_ref.sh: New file.
9095 * testsuite/dyn_weak_ref_1.c: Ditto.
9096 * testsuite/dyn_weak_ref_2.c: Ditto.
9097
b56648ad
ILT
90982010-08-27 Ian Lance Taylor <iant@google.com>
9099
9100 * incremental.h (class Incremental_input_entry): Add virtual
9101 destructor.
9102
809313cb
ILT
91032010-08-27 Ian Lance Taylor <iant@google.com>
9104
9105 * testsuite/start_lib_test_3.c: Mark t3 as used.
9106
11e32464
NC
91072010-08-27 Nick Clifton <nickc@redhat.com>
9108
9109 * options.cc (version_script): Fix small typo in previous
9110 whitespace tidyup.
9111
ca09d69a
NC
91122010-08-25 Nick Clifton <nickc@redhat.com>
9113
9114 * archive.cc: Formatting fixes: Remove whitespace between
9115 typename and following asterisk. Remove whitespace between
9116 function name and opening parenthesis.
9117 * archive.h: Likewise.
9118 * arm.cc: Likewise.
9119 * attributes.cc: Likewise.
9120 * attributes.h: Likewise.
9121 * common.cc: Likewise.
9122 * copy-relocs.cc: Likewise.
9123 * dirsearch.h: Likewise.
9124 * dynobj.cc: Likewise.
9125 * ehframe.cc: Likewise.
9126 * ehframe.h: Likewise.
9127 * expression.cc: Likewise.
9128 * fileread.cc: Likewise.
9129 * fileread.h: Likewise.
9130 * gc.h: Likewise.
9131 * gold-threads.cc: Likewise.
9132 * gold.cc: Likewise.
9133 * i386.cc: Likewise.
9134 * icf.h: Likewise.
9135 * incremental-dump.cc: Likewise.
9136 * incremental.cc: Likewise.
9137 * layout.cc: Likewise.
9138 * layout.h: Likewise.
9139 * main.cc: Likewise.
9140 * merge.cc: Likewise.
9141 * merge.h: Likewise.
9142 * object.cc: Likewise.
9143 * object.h: Likewise.
9144 * options.cc: Likewise.
9145 * options.h: Likewise.
9146 * output.cc: Likewise.
9147 * output.h: Likewise.
9148 * plugin.cc: Likewise.
9149 * plugin.h: Likewise.
9150 * powerpc.cc: Likewise.
9151 * reloc.cc: Likewise.
9152 * script-c.h: Likewise.
9153 * script-sections.cc: Likewise.
9154 * script.cc: Likewise.
9155 * stringpool.cc: Likewise.
9156 * symtab.cc: Likewise.
9157 * symtab.h: Likewise.
9158 * target.cc: Likewise.
9159 * timer.cc: Likewise.
9160 * timer.h: Likewise.
9161 * version.cc: Likewise.
9162 * x86_64.cc: Likewise.
9163
b8fa8750
NC
91642010-08-24 Nick Clifton <nickc@redhat.com>
9165
9166 PR 11899
9167 * layout.cc (segment_precedes): Sort segments by their physical
9168 addresses, if they have been set.
9169
9919d93b
CC
91702010-08-23 Cary Coutant <ccoutant@google.com>
9171
9172 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9173 symbols data.
9174 (Lib_group::include_member): Unlock object after deleting its
9175 symbols data.
9176 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9177 the bug fixed here.
9178
97b4be1c
CC
91792010-08-19 Neil Vachharajani <nvachhar@google.com>
9180 Cary Coutant <ccoutant@google.com>
9181
9182 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9183 constructor, and set_blocker.
9184 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9185 readsyms_blocker_.
9186 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9187 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9188 * testsuite/Makefile.am (start_lib_test): New test case.
9189 * testsuite/Makefile.in: Regenerate.
9190 * testsuite/start_lib_test_main.c: New file.
9191 * testsuite/start_lib_test_1.c: New file.
9192 * testsuite/start_lib_test_2.c: New file.
9193 * testsuite/start_lib_test_3.c: New file.
9194
dd0b1884
ILT
91952010-08-19 Ian Lance Taylor <iant@google.com>
9196
9197 * Makefile.in: Rebuild with automake 1.11.1.
9198 * aclocal.m4: Likewise.
9199 * testsuite/Makefile.in: Likewise.
9200
7223e9ca
ILT
92012010-08-19 Ian Lance Taylor <iant@google.com>
9202
9203 PR 10893
9204 * i386.cc (class Output_data_plt_i386): Update declarations.
9205 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9206 local_ifuncs_ fields.
9207 (Target_i386::do_plt_section_for_global): New function.
9208 (Target_i386::do_plt_section_for_local): New function.
9209 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9210 parameter; change all callers. Initialize global_ifuncs_ and
9211 local_ifuncs_. If doing a static link define __rel_iplt_start and
9212 __rel_iplt_end.
9213 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9214 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9215 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9216 symbols.
9217 (Target_i386::make_plt_section): New function, broken out of
9218 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9219 (Target_i386::make_plt_entry): Call make_plt_section.
9220 (Target_i386::make_local_ifunc_plt_entry): New function.
9221 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9222 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9223 R_386_IRELATIVE to switch.
9224 (Target_i386::Scan::global): Likewise.
9225 (Target_i386::Relocate::relocate): Likewise.
9226 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9227 switch.
9228 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9229 (Target_x86_64::do_plt_section_for_global): New function.
9230 (Target_x86_64::do_plt_section_for_local): New function.
9231 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9232 parameter; change all callers. If doing a static link define
9233 __rela_iplt_start and __rela_iplt_end.
9234 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9235 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9236 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9237 to point to .plt.
9238 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9239 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9240 switch.
9241 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9242 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9243 R_X86_64_IRELATIVE to switch.
9244 (Target_x86_64::Scan::global): Likewise.
9245 (Target_x86_64::Relocate::relocate): Likewise.
9246 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9247 switch.
9248 * target.h (class Target): Add plt_section_for_global and
9249 plt_section_for_local functions. Add do_plt_section_for_global
9250 and do_plt_section_for_local virtual functions.
9251 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9252 clarifying comments.
9253 (Symbol::use_plt_offset): Handle IFUNC symbol.
9254 * object.cc (Sized_relobj::Sized_relobj): Initialize
9255 local_plt_offsets_.
9256 (Sized_relobj::local_has_plt_offset): New function.
9257 (Sized_relobj::local_plt_offset): New function.
9258 (Sized_relobj::set_local_plt_offset): New function.
9259 (Sized_relobj::do_count): Handle IFUNC symbol.
9260 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9261 a bit away from input_shndx_ field. Add set_is_func_symbol and
9262 is_ifunc_symbol functions.
9263 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9264 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9265 local_plt_offsets_ field.
9266 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9267 * output.h (class Output_section_data): Add non-const
9268 output_section function.
9269 (class Output_data_got): Update declarations.
9270 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9271 Add use_plt_offset parameter to global and local constructors.
9272 Change all callers. Change local_sym_index_ field to 31 bits.
9273 Change GSYM_CODE and CONSTANT_CODE accordingly.
9274 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9275 doing a static link don't set sh_link field.
9276 (Output_data_got::Got_entry::write): Use PLT offset if
9277 appropriate.
9278 (Output_data_got::add_global_plt): New function.
9279 (Output_data_got::add_local_plt): New function.
9280 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9281 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9282 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9283 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9284 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9285 IFUNC conditional.
9286 * testsuite/ifunc-sel.h: New file.
9287 * testsuite/ifuncmain1.c: New file.
9288 * testsuite/ifuncmain1vis.c: New file.
9289 * testsuite/ifuncmod1.c: New file.
9290 * testsuite/ifuncdep2.c: New file.
9291 * testsuite/ifuncmain2.c: New file.
9292 * testsuite/ifuncmain3.c: New file.
9293 * testsuite/ifuncmod3.c: New file.
9294 * testsuite/ifuncmain4.c: New file.
9295 * testsuite/ifuncmain5.c: New file.
9296 * testsuite/ifuncmod5.c: New file.
9297 * testsuite/ifuncmain6pie.c: New file.
9298 * testsuite/ifuncmod6.c: New file.
9299 * testsuite/ifuncmain7.c: New file.
9300 * configure, testsuite/Makefile.in: Rebuild.
9301
56f75c03
ILT
93022010-08-18 Ian Lance Taylor <iant@google.com>
9303
9304 * incremental.cc
9305 (Output_section_incremental_inputs::write_input_files): Add cast
9306 to avoid signed/unsigned comparison warning.
9307 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9308
55455f89
CC
93092010-08-12 Cary Coutant <ccoutant@google.com>
9310
9311 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9312
e2054bcb
ILT
93132010-08-13 Ian Lance Taylor <iant@google.com>
9314
9315 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9316
74f67560
DK
93172010-08-12 Cary Coutant <ccoutant@google.com>
9318 Doug Kwan <dougkwan@google.com>
9319
9320 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9321 defintion overrides non-weak undef, remember that the original undef
9322 is not weak.
9323 * symtab.cc (Symbol_table::sized_write_global): For undef without
9324 an original weak binding, set binding to global in output.
9325 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9326 * testsuite/Makefile.in: Regenerate.
9327 * testsuite/strong_ref_weak_def.sh: New file.
9328 * testsuite/strong_ref_weak_def_1.c: Ditto.
9329 * testsuite/strong_ref_weak_def_2.c: Ditto.
9330
d1238d12
CC
93312010-08-12 Cary Coutant <ccoutant@google.com>
9332
9333 * testsuite/incremental_test.sh: Rewrite.
9334 * testsuite/incremental_test_1.c: Rewrite.
9335 * testsuite/incremental_test_2.c: Rewrite.
9336
0e70b911
CC
93372010-08-12 Cary Coutant <ccoutant@google.com>
9338
9339 * arm.cc (Target_arm::got_size): Add const.
9340 (Target_arm::got_entry_count): New function.
9341 (Target_arm::plt_entry_count): New function.
9342 (Target_arm::first_plt_entry_offset): New function.
9343 (Target_arm::plt_entry_size): New function.
9344 (Output_data_plt_arm::entry_count): New function.
9345 (Output_data_plt_arm::first_plt_entry_offset): New function.
9346 (Output_data_plt_arm::get_plt_entry_size): New function.
9347 * i386.cc (Target_i386::got_size): Add const.
9348 (Target_i386::got_entry_count): New function.
9349 (Target_i386::plt_entry_count): New function.
9350 (Target_i386::first_plt_entry_offset): New function.
9351 (Target_i386::plt_entry_size): New function.
9352 (Output_data_plt_i386::entry_count): New function.
9353 (Output_data_plt_i386::first_plt_entry_offset): New function.
9354 (Output_data_plt_i386::get_plt_entry_size): New function.
9355 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9356 find_incremental_inputs_sections. Dump incremental_got_plt section.
9357 * incremental.cc: Include target.h.
9358 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9359 parameter. Adjust all callers. Find incremental_got_plt section.
9360 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9361 section.
9362 (Output_section_incremental_inputs::set_final_data_size): Calculate
9363 size of incremental_got_plt section.
9364 (Output_section_incremental_inputs::do_write): Write the
9365 incremental_got_plt section.
9366 (Got_plt_view_info): New struct.
9367 (Local_got_offset_visitor): New class.
9368 (Global_got_offset_visitor): New class.
9369 (Global_symbol_visitor_got_plt): New class.
9370 (Output_section_incremental_inputs::write_got_plt): New function.
9371 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9372 Add parameter. Adjust all callers.
9373 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9374 (Incremental_inputs::got_plt_section): New function.
9375 (Incremental_inputs::got_plt_section_): New data member.
9376 (Incremental_got_plt_reader): New class.
9377 * layout.cc (Layout::create_incremental_info_sections): Add the
9378 incremental_got_plt section.
9379 * object.h (Got_offset_list::get_list): New function.
9380 (Got offset_list::for_all_got_offsets): New function.
9381 (Sized_relobj::local_got_offset_list): New function.
9382 * powerpc.cc (Target_powerpc::got_size): Add const.
9383 (Target_powerpc::got_entry_count): New function.
9384 (Target_powerpc::plt_entry_count): New function.
9385 (Target_powerpc::first_plt_entry_offset): New function.
9386 (Target_powerpc::plt_entry_size): New function.
9387 (Output_data_plt_powerpc::entry_count): New function.
9388 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9389 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9390 * sparc.cc (Target_sparc::got_size): Add const.
9391 (Target_sparc::got_entry_count): New function.
9392 (Target_sparc::plt_entry_count): New function.
9393 (Target_sparc::first_plt_entry_offset): New function.
9394 (Target_sparc::plt_entry_size): New function.
9395 (Output_data_plt_sparc::entry_count): New function.
9396 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9397 (Output_data_plt_sparc::get_plt_entry_size): New function.
9398 * symtab.h (Symbol::got_offset_list): New function.
9399 (Symbol_table::for_all_symbols): New function.
9400 * target.h (Sized_target::got_entry_count): New function.
9401 (Sized_target::plt_entry_count): New function.
9402 (Sized_target::plt_entry_size): New function.
9403 * x86_64.cc (Target_x86_64::got_size): Add const.
9404 (Target_x86_64::got_entry_count): New function.
9405 (Target_x86_64::plt_entry_count): New function.
9406 (Target_x86_64::first_plt_entry_offset): New function.
9407 (Target_x86_64::plt_entry_size): New function.
9408 (Output_data_plt_x86_64::entry_count): New function.
9409 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9410 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9411
09ec0418
CC
94122010-08-12 Cary Coutant <ccoutant@google.com>
9413
9414 * archive.cc: Include incremental.h.
9415 (Archive::Archive): Initialize incremental_info_.
9416 (Archive::include_member): Record archive members in incremental info.
9417 (Add_archive_symbols::run): Record begin and end of an archive in
9418 incremental info.
9419 (Lib_group::include_member): Record objects in incremental info.
9420 * archive.h (Incremental_archive_entry): Forward declaration.
9421 (Archive::set_incremental_info): New member function.
9422 (Archive::incremental_info): New member function.
9423 (Archive::Unused_symbol_iterator): New class.
9424 (Archive::unused_symbols_begin): New member function.
9425 (Archive::unused_symbols_end): New member function.
9426 (Archive::incremental_info_): New data member.
9427 * incremental-dump.cc (find_input_containing_global): New function.
9428 (dump_incremental_inputs): Dump new incremental info sections.
9429 * incremental.cc: Include symtab.h.
9430 (Output_section_incremental_inputs): New class.
9431 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9432 new incremental info sections.
9433 (Sized_incremental_binary::do_check_inputs): Likewise.
9434 (Incremental_inputs::report_archive): Remove.
9435 (Incremental_inputs::report_archive_begin): New function.
9436 (Incremental_inputs::report_archive_end): New function.
9437 (Incremental_inputs::report_object): New function.
9438 (Incremental_inputs::finalize_inputs): Remove.
9439 (Incremental_inputs::report_input_section): New function.
9440 (Incremental_inputs::report_script): Rewrite.
9441 (Incremental_inputs::finalize): Do nothing but finalize string table.
9442 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9443 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9444 (Incremental_inputs::create_data_sections): New function.
9445 (Incremental_inputs::relocs_entsize): New function.
9446 (Output_section_incremental_inputs::set_final_data_size): New function.
9447 (Output_section_incremental_inputs::do_write): New function.
9448 (Output_section_incremental_inputs::write_header): New function.
9449 (Output_section_incremental_inputs::write_input_files): New function.
9450 (Output_section_incremental_inputs::write_info_blocks): New function.
9451 (Output_section_incremental_inputs::write_symtab): New function.
9452 * incremental.h (Incremental_script_entry): Forward declaration.
9453 (Incremental_object_entry): Forward declaration.
9454 (Incremental_archive_entry): Forward declaration.
9455 (Incremental_inputs): Forward declaration.
9456 (Incremental_inputs_header_data): Remove.
9457 (Incremental_inputs_header): Remove.
9458 (Incremental_inputs_header_write): Remove.
9459 (Incremental_inputs_entry_data): Remove.
9460 (Incremental_inputs_entry): Remove.
9461 (Incremental_inputs_entry_write): Remove.
9462 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9463 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9464 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9465 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9466 Likewise.
9467 (Incremental_input_entry): New class.
9468 (Incremental_script_entry): New class.
9469 (Incremental_object_entry): New class.
9470 (Incremental_archive_entry): New class.
9471 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9472 (Incremental_inputs::report_inputs): Remove.
9473 (Incremental_inputs::report_archive): Remove.
9474 (Incremental_inputs::report_archive_begin): New function.
9475 (Incremental_inputs::report_archive_end): New function.
9476 (Incremental_inputs::report_object): Change prototype.
9477 (Incremental_inputs::report_input_section): New function.
9478 (Incremental_inputs::report_script): Change prototype.
9479 (Incremental_inputs::get_reloc_count): New function.
9480 (Incremental_inputs::set_reloc_count): New function.
9481 (Incremental_inputs::create_data_sections): New function.
9482 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9483 (Incremental_inputs::inputs_section): New function.
9484 (Incremental_inputs::symtab_section): New function.
9485 (Incremental_inputs::relocs_section): New function.
9486 (Incremental_inputs::get_stringpool): Add const.
9487 (Incremental_inputs::command_line): Add const.
9488 (Incremental_inputs::inputs): Remove.
9489 (Incremental_inputs::command_line_key): New function.
9490 (Incremental_inputs::input_file_count): New function.
9491 (Incremental_inputs::input_files): New function.
9492 (Incremental_inputs::relocs_entsize): New function.
9493 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9494 (Incremental_inputs::finalize_inputs): Remove.
9495 (Incremental_inputs::Input_info): Remove.
9496 (Incremental_inputs::lock_): Remove.
9497 (Incremental_inputs::inputs_): Change type.
9498 (Incremental_inputs::inputs_map_): Remove.
9499 (Incremental_inputs::current_object_entry_): New data member.
9500 (Incremental_inputs::inputs_section_): New data member.
9501 (Incremental_inputs::symtab_section_): New data member.
9502 (Incremental_inputs::relocs_section_): New data member.
9503 (Incremental_inputs::reloc_count_): New data member.
9504 (Incremental_inputs_reader): New class.
9505 (Incremental_symtab_reader): New class.
9506 (Incremental_relocs_reader): New class.
9507 * layout.cc (Layout::finalize): Move finalization of incremental info
9508 and creation of incremental info sections to follow finalization of
9509 symbol table. Set offsets for postprocessing sections.
9510 (Layout::create_incremental_info_sections): Call
9511 Incremental_inputs::create_data_sections. Add incremental symtab
9512 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9513 sections to layout after input sections.
9514 * layout.h (struct Timespec): Forward declaration.
9515 (Layout::incremental_inputs): Add const.
9516 (Layout::create_incremental_info_sections): Add parameter.
9517 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9518 * object.cc: Include incremental.h.
9519 (Relobj::finalize_incremental_relocs): New function.
9520 (Sized_relobj::do_layout): Record input sections in incremental info.
9521 * object.h (Object::output_section): New function.
9522 (Object::output_section_offset): Moved from Relobj.
9523 (Object::get_incremental_reloc_base): New function.
9524 (Object::get_incremental_reloc_count): New function.
9525 (Object::do_output_section): New function.
9526 (Object::do_output_section_offset): Moved from Relobj.
9527 (Object::do_get_incremental_reloc_base): New function.
9528 (Object::do_get_incremental_reloc_count): New function.
9529 (Object::Object): Initialize new data members.
9530 (Relobj::output_section): Renamed do_output_section and moved to
9531 protected.
9532 (Relobj::output_section_offset): Moved to Object.
9533 (Relobj::do_get_incremental_reloc_base): New function.
9534 (Relobj::do_get_incremental_reloc_count): New function.
9535 (Relobj::allocate_incremental_reloc_counts): New function.
9536 (Relobj::count_incremental_reloc): New function.
9537 (Relobj::finalize_incremental_relocs): New function.
9538 (Relobj::next_incremental_reloc_index): New function.
9539 (Relobj::reloc_counts_): New data member.
9540 (Relobj::reloc_bases_): New data member.
9541 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9542 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9543 (Sized_relobj::incremental_relocs_scan): New function.
9544 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9545 (Sized_relobj::incremental_relocs_write): New function.
9546 (Sized_relobj::incremental_relocs_write_reltype): New function.
9547 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9548 incremental link.
9549 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9550 archives and object files elsewhere.
9551 (Add_symbols::run): Report object files here.
9552 (Finish_group::run): Report end of archive at end of group.
9553 * reloc.cc: Include layout.h, incremental.h.
9554 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9555 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9556 (Sized_relobj::incremental_relocs_scan): New function.
9557 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9558 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9559 (Sized_relobj::incremental_relocs_write): New function.
9560 (Sized_relobj::incremental_relocs_write_reltype): New function.
9561 * script.cc (read_input_script): Rewrite test for incremental link.
9562 Change call to Incremental_inputs::report_script.
9563 * symtab.h (Symbol_table::first_global_index): New function.
9564 (Symbol_table::output_count): New function.
9565
ce0d1972
DK
95662010-08-12 Doug Kwan <dougkwan@google.com>
9567
9568 * arm.cc (Target_arm::merge_object_attributes): Check command line
9569 options --no-wchar-size-warning and --no-enum-size-warning.
9570 * options.h (General_options): Add ld-compatible options
9571 --no-enum-size-warning and --no-wchar-size-warning.
9572
6e5710ce
ILT
95732010-08-04 Ian Lance Taylor <iant@google.com>
9574
9575 * x86_64.cc (Target_x86_64::Scan::local): Use
9576 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9577 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9578 (Target_x86_64::Scan::global): Likewise.
9579 (Target_x86_64::Relocate::relocate): Likewise.
9580 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9581 Likewise.
9582
fef830db
CC
95832010-08-03 Cary Coutant <ccoutant@google.com>
9584
9585 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9586 to reserve space in merged_strings vector. Keep total input size
9587 for stats.
9588 (Output_merge_string::do_print_merge_stats): Print total input size.
9589 * merge.h (Output_merge_string): Add input_size_ field.
9590 * stringpool.cc (Stringpool_template::string_length): Move
9591 implementations out of Stringpool_template class and place in
9592 stringpool.h.
9593 * stringpool.h (string_length): Move out of Stringpool_template.
9594
1e3811b0
ILT
95952010-08-03 Ian Lance Taylor <iant@google.com>
9596
9597 PR 11712
9598 * layout.cc (relaxation_loop_body): If address of load segment is
9599 set, adjust address to include headers if possible.
9600
7af0c620
ILT
96012010-08-03 Ian Lance Taylor <iant@google.com>
9602
9603 * version.cc (version_string): Bump to 1.10.
9604
22f0da72
ILT
96052010-08-03 Ian Lance Taylor <iant@google.com>
9606
9607 PR 11805
9608 * layout.h (enum Output_section_order): Define.
9609 (class Layout): Update declarations.
9610 * layout.cc (Layout::get_output_section): Add order parameter.
9611 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9612 is_first_non_relro parameters. Change all callers.
9613 (Layout::choose_output_section): Likewise.
9614 (Layout::add_output_section_data): Likewise.
9615 (Layout::make_output_section): Likewise. Set order.
9616 (Layout::default_section_order): New function.
9617 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9618 * output.cc (Output_section::Output_section): Initialize order_.
9619 Don't initialize deleted fields.
9620 (Output_segment::Output_segment): Don't initialize deleted
9621 fields.
9622 (Output_segment::add_output_section_to_load): New function
9623 replacing add_output_section. Change all callers to call this or
9624 add_output_section_to_nonload.
9625 (Output_segment::add_output_section_to_nonload): New function.
9626 (Output_segment::remove_output_section): Rewrite.
9627 (Output_segment::add_initial_output_data): Likewise.
9628 (Output_segment::has_any_data_sections): Likewise.
9629 (Output_segment::is_first_section_relro): Likewise.
9630 (Output_segment::maximum_alignment): Likewise.
9631 (Output_segment::has_dynamic_reloc): New function replacing
9632 dynamic_reloc_count. Change all callers.
9633 (Output_segment::has_dynamic_reloc_list): New function replacing
9634 dynamic_reloc_count_list. Change all callers.
9635 (Output_segment::set_section_addresses): Rewrite.
9636 (Output_segment::set_offset): Rewrite.
9637 (Output_segment::find_first_and_last_list): Remove.
9638 (Output_segment::set_tls_offsets): Rewrite.
9639 (Output_segment::first_section_load_address): Likewise.
9640 (Output_segment::output_section_count): Likewise.
9641 (Output_segment::section_with_lowest_load_address): Likewise.
9642 (Output_segment::write_section_headers): Likewise.
9643 (Output_segment::print_sections_to_map): Likewise.
9644 * output.h (class Output_data): Remove dynamic_reloc_count_
9645 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9646 (Output_data::add_dynamic_reloc): Rewrite.
9647 (Output_data::has_dynamic_reloc): New function.
9648 (Output_data::dynamic_reloc_count): Remove.
9649 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9650 is_last_relro_, is_first_non_relro_, is_interp_,
9651 is_dynamic_linker_section_ fields. Add order and set_order
9652 functions. Remove is_relro_local, set_is_relro_local,
9653 is_last_relro, set_is_last_relro, is_first_non_relro,
9654 set_is_first_non_relro functions, is_interp, set_is_interp,
9655 is_dynamic_linker_section, and set_is_dynamic_linker_section
9656 functions.
9657 (class Output_segment): Change Output_data_list from std::list to
9658 std:;vector. Add output_lists_ field. Remove output_data_ and
9659 output_bss_ fields. Update declarations.
9660
3ff2ccb0
ILT
96612010-08-02 Ian Lance Taylor <iant@google.com>
9662
9663 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9664 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9665 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9666
88a4108b
ILT
96672010-08-02 Ian Lance Taylor <iant@google.com>
9668
9669 PR 11855
9670 * script.cc (Script_options::Script_options): Initialize
9671 symbol_definitions_ and symbol_references_.
9672 (Script_options::add_symbol_assignment): Update
9673 symbol_definitions_ and symbol_references_.
9674 (Script_options::add_symbol_reference): New function.
9675 (script_symbol): New function.
9676 * script.h (class Script_options): Add symbol_definitions_ and
9677 symbol_references_ fields.
9678 (Script_options::referenced_const_iterator): New type.
9679 (Script_options::referenced_begin): New function.
9680 (Script_options::referenced_end): New function.
9681 (Script_options::is_referenced): New function.
9682 (Script_options::any_unreferenced): New function.
9683 * script-c.h (script_symbol): Declare.
9684 * yyscript.y (exp): Call script_symbol.
9685 * symtab.cc: Include "script.h".
9686 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9687 Change all callers. Check symbols referenced by scripts.
9688 (Symbol_table::add_undefined_symbols_from_command_line): Add
9689 layout parameter. Change all callers.
9690 (Symbol_table::do_add_undefined_symbols_from_command_line):
9691 Likewise. Break out loop body. Check symbols referenced by
9692 scripts.
9693 (Symbol_table::add_undefined_symbol_from_command_line): New
9694 function broken out of
9695 do_add_undefined_symbols_from_command_line.
9696 * symtab.h (class Symbol_table): Update declarations.
9697 * archive.cc: Include "layout.h".
9698 (Archive::should_include_member): Add layout parameter. Change
9699 all callers. Check for symbol mentioned in expression.
9700 * archive.h (class Archive): Update declaration.
9701 * object.cc (Sized_relobj::do_should_include_member): Add layout
9702 parameter.
9703 * object.h (Object::should_include_member): Add layout parameter.
9704 Change all callers.
9705 (Object::do_should_include_member): Add layout parameter.
9706 (class Sized_relobj): Update declaration.
9707 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9708 parameter.
9709 * dynobj.h (class Sized_dynobj): Update declaration.
9710 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9711 layout parameter.
9712 * plugin.h (class Sized_pluginobj): Update declaration.
9713
5f1ab67a
ILT
97142010-08-02 Ian Lance Taylor <iant@google.com>
9715
9716 PR 11866
9717 * output.cc (Output_segment::set_offset): Search for the first and
9718 last sections rather than assuming that the list is in order.
9719 (Output_segment::find_first_and_last_list): New function.
9720 * output.h (class Output_segment): Update declarations.
9721 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9722 (relro_strip_test_SOURCES): New variable.
9723 (relro_strip_test_DEPENDENCIES): New variable.
9724 (relro_strip_test_LDFLAGS): New variable.
9725 (relro_strip_test_LDADD): New variable.
9726 (relro_strip_test.so): New target.
9727
a8df5856
ILT
97282010-08-02 Ian Lance Taylor <iant@google.com>
9729
9730 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9731 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9732 (Target_i386::got_tlsdesc_section): New function.
9733 (Target_i386::got_section): Create space for GOT entries for
9734 TLSDESC relocations.
9735 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9736 R_386_TLS_GOTDESC.
9737 (Target_i386::Scan::global): Likewise.
9738 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9739 using TLSDESC GOT.
9740 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9741 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9742 (Target_x86_64::got_tlsdesc_section): New function.
9743 (Target_x86_64::got_section): Create space for GOT entries for
9744 TLSDESC relocations.
9745 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9746 R_386_TLS_GOTDESC.
9747 (Target_x86_64::Scan::global): Likewise.
9748 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9749 using TLSDESC GOT.
9750
0c10a0a6
ILT
97512010-08-02 Ian Lance Taylor <iant@google.com>
9752
9753 * testsuite/final_layout.sh: Use dc to convert from hex to
9754 decimal.
9755
41cbeecc
ST
97562010-07-29 Sriraman Tallam <tmsriram@google.com>
9757
9758 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9759 paramter to the call to gold::gc_process_relocs.
9760 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9761 paramter to the call to gold::gc_process_relocs.
9762 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9763 parameter to the call to gold::gc_process_relocs.
9764 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9765 template parameter to the call to gold::gc_process_relocs.
9766 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9767 paramter to the call to gold::gc_process_relocs.
9768 * gc.h (get_embedded_addend_size): New function.
9769 (gc_process_relocs): Save the size of the reloc for use by ICF.
9770 * icf.cc (get_section_contents): Get the addend from the text section
9771 for SHT_REL relocation sections.
9772 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9773 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9774 * int_encoding.h (read_from_pointer): New overloaded function.
9775 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9776 * testsuite/icf_sht_rel_addend_test.sh: New file.
9777 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9778 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9779
6ea55b82
RW
97802010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9781
9782 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9783 * Makefile.in: Regenerate.
9784 * testsuite/Makefile.in: Regenerate.
9785
9691462b
ILT
97862010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9787
9788 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9789 * gold/testsuite/debug_msg.cc: Likewise.
9790 * gold/testsuite/odr_violation1.cc
9791 * gold/testsuite/odr_violation2.cc
9792
76897331
CC
97932010-07-21 Cary Coutant <ccoutant@google.com>
9794
9795 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9796 string, and length fields.
9797 (Output_merge_string::Merged_strings_list): New type.
9798 (Output_merge_string::Merged_strings_lists): New typedef.
9799 (Output_merge_string): Replace merged_strings_ with
9800 merged_strings_lists_.
9801 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9802 Merged_strings_list per input object and section. Don't store pointer
9803 to the string. Don't store length with each merged string entry.
9804 (Output_merge_string::finalize_merged_data): Loop over list of merged
9805 strings lists. Recompute length of each merged string.
9806
78384e8f
CC
98072010-07-15 Cary Coutant <ccoutant@google.com>
9808
9809 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9810 here.
9811
783659f9
ILT
98122010-07-14 Ian Lance Taylor <iant@google.com>
9813
9814 * descriptors.cc (Descriptors::open): Report correct name in error
9815 message.
9816
131687b4
DK
98172010-07-13 Doug Kwan <dougkwan@google.com>
9818
9819 * arm.cc (Arm_input_section::Arm_input_section): For a
9820 SHT_ARM_EXIDX section, always keeps the input sections.
9821 (Arm_input_section::set_exidx_section_link): New method.
9822 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9823 has_errors_ to false.
9824 (Arm_exidx_input_section::has_errors,
9825 Arm_exidx_input_section::set_has_errors): New methods.
9826 (Arm_exidx_input_section::has_errors_): New data member.
9827 (Arm_relobj::get_exidx_shndx_list): New method.
9828 (Arm_output_section::append_text_sections_to_list): Do not skip
9829 section without SHF_EXECINSTR.
9830 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9831 errors.
2e702c99 9832 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9833 section header. Make error messages more verbose. Check for
9834 a non-executable section linked to an EXIDX section.
9835 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9836 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9837 check that there is no deferred EXIDX section if we exit early.
9838 Instead of not making an EXIDX section in case of an error, make one
9839 and set the has_errors flag of it.
9840 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9841 in a relocatable link.
9842 (Target_arm::do_relax): Look for the EXIDX output section instead of
9843 assuming that it is called .ARM.exidx.
2e702c99 9844 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9845 section list. Do not check for SHF_EXECINSTR section flags but
9846 skip any input section with errors.
9847 * output.cc (Output_section::Output_section): Initialize
9848 always_keeps_input_sections_ to false.
9849 (Output_section::add_input_section): Check for
9850 always_keeps_input_sections_.
9851 * output.h (Output_section::always_keeps_input_sections,
9852 Output_section::set_always_keeps_input_sections): New methods.
9853 (Output_section::always_keeps_input_sections): New data member.
9854
69517287
RÁE
98552010-07-13 Rafael Espindola <espindola@google.com>
9856
9857 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9858 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9859
82742395
ILT
98602010-07-13 Philip Herron <herron.philip@googlemail.com>
9861 Ian Lance Taylor <iant@google.com>
9862
9863 * output.h (Output_section_lookup_maps::add_merge_section):
9864 Correct check of whether value was inserted.
9865 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9866 (Output_section_lookup_maps::add_relaxed_input_section):
9867 Likewise.
9868 * arm.cc (Target_arm::got_section): Remove used local os.
9869 * i386.cc (Target_i386::got_section): Likewise.
9870 * x86_64.cc (Target_x86_64::got_section): Likewise.
9871 * sparc.cc (Target_sparc::got_section): Likewise.
9872 (Target_sparc::relocate): Remove unused local have_got_offset.
9873 * powerpc.cc (Target_powerpc::relocate): Likewise.
9874
f2d707b5
ILT
98752010-07-13 Ian Lance Taylor <iant@google.com>
9876
241531d6
ILT
9877 * compressed_output.cc (zlib_decompress): Fix signature in
9878 !HAVE_ZLIB_H case.
9879
f2d707b5
ILT
9880 * archive.cc (Archive::include_member): Unlock an external member
9881 of a thin archive. Don't bother to delete an object we know is
9882 NULL.
9883
a2e47362
CC
98842010-07-12 Cary Coutant <ccoutant@google.com>
9885
9886 * compressed_output.cc (zlib_decompress): New function.
9887 (get_uncompressed_size): New function.
9888 (decompress_input_section): New function.
9889 * compressed_output.h (get_uncompressed_size): New function.
9890 (decompress_input_section): New function.
9891 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9892 Handle compressed debug sections.
9893 * layout.cc (is_compressed_debug_section): New function.
9894 (Layout::output_section_name): Map compressed section names to
9895 canonical names.
9896 * layout.h (is_compressed_debug_section): New function.
9897 (is_debug_info_section): Recognize compressed debug sections.
9898 * merge.cc: Include compressed_output.h.
9899 (Output_merge_data::do_add_input_section): Handle compressed
9900 debug sections.
9901 (Output_merge_string::do_add_input_section): Handle compressed
9902 debug sections.
9903 * object.cc: Include compressed_output.h.
9904 (Sized_relobj::Sized_relobj): Initialize new data members.
9905 (build_compressed_section_map): New function.
9906 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9907 * object.h (Object::section_is_compressed): New method.
9908 (Object::do_section_is_compressed): New method.
9909 (Sized_relobj::Compressed_section_map): New type.
9910 (Sized_relobj::do_section_is_compressed): New method.
9911 (Sized_relobj::compressed_sections_): New data member.
9912 * output.cc (Output_section::add_input_section): Handle compressed
9913 debug sections.
9914 * reloc.cc: Include compressed_output.h.
9915 (Sized_relobj::write_sections): Handle compressed debug sections.
9916
ce279a62
CC
99172010-07-08 Cary Coutant <ccoutant@google.com>
9918
9919 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9920 weak when resolving to a dynamic def.
9921 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9922 for weak undef/dynamic def cases. Adjust callers.
9923 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9924 undef_binding_weak_.
9925 (Symbol_table::sized_write_globals): Adjust symbol binding.
9926 (Symbol_table::sized_write_symbol): Add binding parameter.
9927 * symtab.h (Symbol::set_undef_binding): New method.
9928 (Symbol::is_undef_binding_weak): New method.
9929 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9930 (Symbol_table::should_override): Add new parameter.
9931 (Symbol_table::sized_write_symbol): Add new parameter.
9932
9933 * testsuite/weak_undef_file1.cc: Add new test case.
9934 * testsuite/weak_undef_file2.cc: Fix header comment.
9935 * testsuite/weak_undef_test.cc: Add new test case.
9936
b2286c10
DK
99372010-06-29 Doug Kwan <dougkwan@google.com>
9938
9939 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9940 Initialize USE_SYMBOL_.
9941 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9942 definition.
9943 (Arm_reloc_property::uses_symbol_): New data member declaration.
9944 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9945 uses symbol value and symbol is undefined but not weakly undefined.
9946
4802450a
RÁE
99472010-06-28 Rafael Espindola <espindola@google.com>
9948
9949 * plugin.cc (Plugin::load): Use dlerror.
9950
e5ca47ba
ILT
99512010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9952
9953 * symtab.cc (detect_odr_violations): When reporting an ODR
9954 violation, report an object where the symbol is defined.
9955
8a75a161
DK
99562010-06-25 Doug Kwan <dougkwan@google.com>
9957
9958 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9959 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9960 definition.
9961 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9962 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9963 target hook to detect function points.
9964 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9965 * icf.h (Icf::check_section_for_function_pointers): Change type of
9966 parameter SECTION_NAME to const reference to std::string. Use
9967 target hook to determine if section may have unsafe pointers.
9968 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9969 method definition.
9970
42218b9f
RÁE
99712010-06-21 Rafael Espindola <espindola@google.com>
9972
9973 * fileread.cc (Input_file::find_fie): New
9974 (Input_file::open): Use Input_file::find_fie.
9975 * fileread.h (Input_file::find_fie): New
9976 * plugin.cc (set_extra_library_path): New.
9977 (Plugin::load): Add set_extra_library_path to the transfer vector.
9978 (Plugin_manager::set_extra_library_path): New.
9979 (Plugin_manager::add_input_file): Use the extra search path if set.
9980 (set_extra_library_path(): New.
9981 * plugin.h (Plugin_manager): Add set_extra_library_path and
9982 extra_search_path_.
9983
a0506cca
CC
99842010-06-19 Cary Coutant <ccoutant@google.com>
9985
9986 * layout.cc (gdb_sections): Add .debug_types.
9987 (lines_only_debug_sections): Likewise.
9988
6508b958
RÁE
99892010-06-18 Rafael Espindola <espindola@google.com>
9990
9991 * plugin.cc (add_input_file,add_input_library)
9992 (Plugin_manager::add_input_file): Make filename arguments const.
9993 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9994 const.
9995
3e235302
DK
99962010-06-16 Doug Kwan <dougkwan@google.com>
9997
9998 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9999 .ARM.attributes section if we have not merged any input
10000 attributes sections.
10001
106e8a6c
DK
100022010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10003
10004 * arm.cc: Allow combining objects with no EABI version
10005 information.
10006
91ff43fe
RÁE
100072010-06-15 Rafael Espindola <espindola@google.com>
10008
10009 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10010
68ed838c
ILT
100112010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10012
10013 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10014 (struct iovec): Correct !HAVE_READV definition.
10015
f3a2388f
CC
100162010-06-10 Cary Coutant <ccoutant@google.com>
10017
10018 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10019 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10020 reloc sections.
10021 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10022
10023 PR 11683
10024 * symtab.h (Symbol::is_placeholder): New member function.
10025 * target-reloc.h (relocate_section): Check for placeholder symbols.
10026
10027 * testsuite/Makefile.am (plugin_test_8): New test.
10028 (plugin_test_9): New test.
10029 * testsuite/Makefile.in: Regenerate.
10030
e1df38aa
NC
100312010-06-09 Nick Clifton <nickc@redhat.com>
10032
10033 * yyscript.y (input_list_element): Allow strings prefixed with
10034 the '-' character. Treat these as libraries.
10035 * script.cc (script_add_library): New function. Adds a library
10036 specified by "-l<name>" found in an input script.
10037 * script-c.h: Add prototype for script_add_library.
10038
25bbe950
DK
100392010-06-07 Doug Kwan <dougkwan@google.com>
10040
10041 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10042 Restrict stub-group size to be within long conditional branch
10043 range when working around cortex-A8 erratum.
10044
0f32ea4c
ILT
100452010-06-07 Damien Diederen <dd@crosstwine.com>
10046
10047 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10048 #ifdef typo.
10049
8fe2a369
ST
100502010-06-03 Sriraman Tallam <tmsriram@google.com>
10051
10052 PR gold/11658
10053 * output.cc
10054 (Output_section::Input_section_sort_entry::compare_section_ordering):
10055 Change to return non-zero correctly.
10056 (Output_section::Input_section_sort_section_order_index_compare
10057 ::operator()): Change to fix ambiguity in comparisons.
10058
6e9ba2ca
ST
100592010-06-01 Sriraman Tallam <tmsriram@google.com>
10060
10061 * gold.h (is_wildcard_string): New function.
10062 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10063 (Layout::layout_eh_frame): Ditto.
10064 (Layout::find_section_order_index): New method.
10065 (Layout::read_layout_from_file): New method.
10066 * layout.h (Layout::find_section_order_index): New method.
10067 (Layout::read_layout_from_file): New method.
10068 (Layout::input_section_position_): New private member.
10069 (Layout::input_section_glob_): New private member.
10070 * main.cc (main): Call read_layout_from_file here.
10071 * options.h (--section-ordering-file): New option.
10072 * output.cc (Output_section::input_section_order_specified_): New
10073 member.
10074 (Output_section::Output_section): Initialize new member.
10075 (Output_section::add_input_section): Add new parameter.
10076 Keep input sections when --section-ordering-file is used.
10077 (Output_section::set_final_data_size): Sort input sections when
10078 section ordering file is specified.
10079 (Output_section::Input_section_sort_entry): Add new parameter.
10080 Check sorting type.
10081 (Output_section::Input_section_sort_entry::compare_section_ordering):
10082 New method.
10083 (Output_section::Input_section_sort_compare::operator()): Change to
10084 consider section_order_index.
10085 (Output_section::Input_section_sort_init_fini_compare::operator()):
10086 Change to consider section_order_index.
10087 (Output_section::Input_section_sort_section_order_index_compare
10088 ::operator()): New method.
10089 (Output_section::sort_attached_input_sections): Change to sort
10090 according to section order when specified.
e1df38aa
NC
10091 (Output_section::add_input_section<32, true>): Add new parameter.
10092 (Output_section::add_input_section<64, true>): Add new parameter.
10093 (Output_section::add_input_section<32, false>): Add new parameter.
10094 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10095 * output.h (Output_section::add_input_section): Add new parameter.
10096 (Output_section::input_section_order_specified): New
10097 method.
10098 (Output_section::set_input_section_order_specified): New method.
10099 (Input_section::Input_section): Initialize section_order_index_.
10100 (Input_section::section_order_index): New method.
10101 (Input_section::set_section_order_index): New method.
10102 (Input_section::section_order_index_): New member.
10103 (Input_section::Input_section_sort_section_order_index_compare): New
10104 struct.
10105 (Output_section::input_section_order_specified_): New member.
10106 * script-sections.cc (is_wildcard_string): Delete and move modified
10107 method to gold.h.
10108 (Output_section_element_input::Output_section_element_input): Modify
10109 call to is_wildcard_string.
10110 (Output_section_element_input::Input_section_pattern
10111 ::Input_section_pattern): Ditto.
10112 (Output_section_element_input::Output_section_element_input): Ditto.
10113 * testsuite/Makefile.am (final_layout): New test case.
10114 * testsuite/Makefile.in: Regenerate.
10115 * testsuite/final_layout.cc: New file.
10116 * testsuite/final_layout.sh: New file.
10117
3537c84b
RÁE
101182010-06-01 Rafael Espindola <espindola@google.com>
10119
10120 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10121
105b6afd
RÁE
101222010-06-01 Rafael Espindola <espindola@google.com>
10123
10124 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10125 visibility of symbols.
10126
29e11421
DK
101272010-05-27 Doug Kwan <dougkwan@google.com>
10128
10129 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10130 from start of output section instead of address for a local symbol
10131 in a merged or relaxed section when doing a relocatable link.
10132
5e0f337e
RÁE
101332010-05-26 Rafael Espindola <espindola@google.com>
10134
703d02da 10135 PR 11604
5e0f337e
RÁE
10136 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10137 adding sections the garbage collector removed.
10138 * gold/testsuite/Makefile.am: Add test.
10139 * gold/testsuite/Makefile.in: Regenerate.
10140 * gold/testsuite/plugin_test_7.sh: New.
10141 * gold/testsuite/plugin_test_7_1.c: New.
10142 * gold/testsuite/plugin_test_7_2.c: New.
10143
f4187277
RÁE
101442010-05-26 Rafael Espindola <espindola@google.com>
10145
10146 * script-sections.cc (Output_section_definition::set_section_addresses):
10147 Check for --section-start.
10148
5c388529
DK
101492010-05-26 Doug Kwan <dougkwan@google.com>
10150
10151 * arm.cc (Arm_scan_relocatable_relocs): New class.
10152 (Target_arm::relocate_special_relocatable): New method.
10153 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10154 (Arm_relocate_functions::thumb_branch_common): Same.
10155 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10156 instead of Default_scan_relocatable_relocs.
10157 * target-reloc.h (relocate_for_relocatable): Let target handle
10158 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10159 * target.h (Sized_target::relocate_special_relocatable): New method.
10160
bca1c3ae
ILT
101612010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10162
10163 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10164
0439c796
DK
101652010-05-23 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10168 instead of a cast.
10169 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10170 with a direct branch, not a conditional branch, to a stub.
10171 * merge.cc (Output_merge_base::record_input_section): New method
10172 defintion.
10173 (Output_merge_data::do_add_input_section): Record input section if
10174 keeps-input-sections flag is set.
10175 (Output_merge_string::do_add_input_section): Ditto.
10176 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10177 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10178 INPUT_SECTIONS_.
10179 (Output_merge_base::keeps_input_sections,
10180 Output_merge_base::set_keeps_input_sections,
10181 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10182 method definitions.
10183 (Output_merge_base::Input_sections): New type declaration.
10184 (Output_merge_base::input_sections_begin,
10185 Output_merge_base::input_sections_end,
10186 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10187 (Output_merge_base::bool keeps_input_sections_,
10188 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10189 Output_merge_base::input_sections_): New data members.
10190 (Output_merge_data::do_set_keeps_input_sections): New method
10191 defintion.
10192 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10193 * output.cc (Output_section::Input_section::relobj): Move method
10194 defintion from class declaration to here and handle merge sections.
10195 (Output_section::Input_section::shndx): Ditto.
10196 (Output_section::Output_section): Remove initializations of removed
10197 data members and initialize new data member LOOKUP_MAPS_.
10198 (Output_section::add_input_section): Set keeps-input-sections flag
10199 for a newly created merge output section as appropriate. Adjust code
10200 to use Output_section_lookup_maps class.
10201 (Output_section::add_relaxed_input_section): Adjst code for lookup
10202 maps code refactoring.
2e702c99 10203 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10204 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10205 class. If adding input section to a newly created merge output
10206 section fails, remove the new merge section.
10207 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10208 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10209 (Output_section::find_merge_section): Ditto.
0439c796 10210 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10211 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10212 Output_section_lookup_maps class.
10213 (Output_section::get_input_sections): Export merge sections. Adjust
10214 code to use Output_section_lookup_maps class.
10215 (Output_section:::add_script_input_section): Adjust code to use
10216 Output_section_lookup_maps class. Update lookup maps for merge
10217 sections also.
10218 (Output_section::discard_states): Use Output_section_lookup_maps.
10219 (Output_section::restore_states): Same.
10220 * output.h (Merge_section_properties): Move class defintion out of
10221 Output_section.
10222 (Output_section_lookup_maps): New class.
10223 (Output_section::Input_section::is_merge_section): New method
10224 defintion.
10225 (Output_section::Input_section::relobj): Move defintion out of class
10226 defintion. Declare method only.
10227 (Output_section::Input_section::shndx): Ditto.
10228 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10229 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10230 (Output_section::Merge_section_by_properties_map,
10231 Output_section::Output_section_data_by_input_section_map,
10232 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10233 Remove types.
2e702c99 10234 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10235 KEEPS_INPUT_SECTIONS.
10236 (Output_section::build_lookup_maps): New method declaration.
10237 (Output_section::merge_section_map_,
10238 Output_section::merge_section_by_properties_map_,
10239 Output_section::relaxed_input_section_map_,
10240 Output_section::is_relaxed_input_section_map_valid_): Remove data
10241 members.
10242 (Output_section::lookup_maps_): New data member.
10243
76295588
L
102442010-05-21 Doug Kwan <dougkwan@google.com>
10245
10246 PR gold/11619
10247 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10248 avoid a compilation error.
10249
d103a984
RÁE
102502010-05-19 Rafael Espindola <espindola@google.com>
10251
10252 * script-sections.cc (Output_section_definition::allocate_to_segment):
10253 Update the phdrs_list even when the output section is NULL.
10254 * testsuite/Makefile.am: Add test.
10255 * testsuite/Makefile.in: Regenerate.
10256 * testsuite/script_test_9.cc: New.
10257 * testsuite/script_test_9.sh: New.
10258 * testsuite/script_test_9.t: New.
10259
6625d24e
DK
102602010-05-19 Doug Kwan <dougkwan@google.com>
10261
10262 * arm.cc (Arm_input_section::original_size): New method.
10263 (Arm_input_section::do_addralign): Add a cast.
10264 (Arm_input_section::do_output_offset): Remove static cast.
10265 (Arm_input_section::original_addralign,
10266 Arm_input_section::original_size_): Change type to uint32_t.
10267 (Arm_input_section::init): Add safe casts for section alignment
10268 and size.
10269 (Arm_input_section::set_final_data_size): Do not set address and
10270 offset of stub table.
10271 (Arm_output_section::fix_exidx_coverage): Change use of of
10272 Output_section::Simple_input_section to that of
10273 Output_section::Input_section.
10274 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10275 except for the first pass.
10276 * output.cc (Output_section::get_input_sections): Change type of
10277 input_sections to std::list<Input_section>.
10278 (Output_section::add_script_input_section): Rename from
10279 Output_section::add_simple_input_section. Change type of SIS
10280 parameter from Simple_input_section to Input_section.
10281 * output.h (Output_section::Simple_input_section): Remove class.
10282 (Output_section::Input_section): Change class visibility to public.
10283 (Output_section::Input_section::addralign): Use stored alignments
10284 for special input sections if set.
10285 (Output_section::Input_section::set_addralign): New method.
10286 (Output_section::get_input_sections): Change parameter type from
10287 list of Simple_input_section to list of Input_section.
10288 (Output_section::add_script_input_section): Rename from
10289 Output_section::add_simple_input_section. Change first parameter's
10290 type from Simple_input_section to Input_section and remove the
10291 second and third parameters.
10292 * script-sections.cc (Input_section::Input_section_list): Change
10293 type to list of Output_section::Input_section/
10294 (Input_section_info::Input_section_info): Change parameter type of
10295 INPUT_SECTION to Output_section::Input_section.
10296 (Input_section_info::input_section): Change return type.
10297 (Input_section_info::input_section_): Change type to
10298 Output_section::Input_section.
10299 (Output_section_element_input::set_section_addresses): Adjust code
10300 to use Output_section::Input_section instead of
10301 Output_section::Simple_input_section. Adjust code for renaming
10302 of Output_section::add_simple_input_section.
10303 (Orphan_output_section::set_section_addresses): Ditto.
10304
e1e82ea4
RW
103052010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10306
10307 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10308 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10309
91e75c8a
RÁE
103102010-05-18 Rafael Espindola <espindola@google.com>
10311
10312 * options.cc (General_options::finalize): Handle -nostdlib.
10313 * options.h (nostdlib): New option.
10314 * script.cc (script_add_search_dir): Handle -nostdlib.
10315
da59ad79
DK
103162010-05-12 Doug Kwan <dougkwan@google.com>
10317
10318 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10319 attributes section only if there no attributes section after merging.
10320 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10321 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10322 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10323 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10324 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10325 and arm_attr_merge_7.stdout.
10326 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10327 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10328 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10329 arm_attr_merge_7b.o): New rules.
10330 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10331 arm_attr_merge_7
10332 * testsuite/Makefile.in: Regenerate.
10333 * testsuite/arm_attr_merge.sh: New file.
10334 * testsuite/arm_attr_merge_[67][ab].s: Same.
10335
3e01a7fd
NC
103362010-05-05 Nick Clifton <nickc@redhat.com>
10337
10338 * po/es.po: Updated Spanish translation.
10339
7ad2014a
L
103402010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10341
10342 * Makefile.am (install-exec-local): Properly install gold as
10343 default cross linker.
10344 * Makefile.in: Regenerated.
10345
4fda8867
NC
103462010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10347 Nick Clifton <nickc@redhat.com>
10348
10349 * configure.ac (install_as_default): Define and set to false
10350 unless --enable-gold or --enable-gold=both/gold has been
10351 specified.
10352 * configure: Regenerate.
10353
10354 * Makefile.am (install-exec-local): Install the executable as
10355 'ld.gold'. If install_as_default is true then also install it as
10356 'ld'.
10357 * Makefile.in: Regenerated.
10358
bd288ea2
ILT
103592010-04-24 Ian Lance Taylor <iant@google.com>
10360
10361 * layout.cc (Layout::layout_reloc): In relocatable link don't
10362 combine reloc sections for grouped sections.
10363
ef38fd8a
ST
103642010-04-23 Sriraman Tallam <tmsriram@google.com>
10365
10366 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10367 sections that are not ordinary to icf.
10368 * icf.cc (get_section_contents): Handle relocation pointing to section
10369 with no object or shndx information.
10370 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10371 * testsuite/Makefile.in: Regenerate.
10372 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10373 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10374
f6973bdc
ILT
103752010-04-22 Ian Lance Taylor <iant@google.com>
10376
10377 * expression.cc (Expression::Expression_eval_info): Add
10378 result_alignment_pointer field.
10379 (Expression::eval_with_dot): Add result_alignment_pointer
10380 parameter. Change all callers.
10381 (Expression::eval_maybe_dot): Likewise.
10382 (class Binary_expression): Add alignment_pointer parameter to
10383 left_value and right_value. Change all callers.
10384 (BINARY_EXPRESSION): Set result alignment.
10385 (class Trinary_expression): Add alignment_pointer parameter to
10386 arg2_value and arg3_value. Change all callers.
10387 (Trinary_cond::value): Set result alignment.
10388 (Max_expression::value, Min_expression::value): Likewise.
10389 (Align_expression::value): Likewise.
10390 * script-sections.cc (class Sections_element): Add dot_alignment
10391 parameter to set_section_addresses virtual function. Update
10392 instantiations.
10393 (class Output_section_element): Likewise.
10394 (Script_sections::create_segments): Add dot_alignment parameter.
10395 Change all callers.
10396 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10397 (Script_sections::set_phdrs_clause_addresses): Likewise.
10398 * script-sections.h: Update declarations.
10399 * script.h: Update declarations.
10400 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10401 min_p_align.
10402 * testsuite/script_test_3.t: Set large alignment.
10403 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10404 segment has expected alignment.
10405
9c9c98a5
NC
104062010-04-22 Nick Clifton <nickc@redhat.com>
10407
10408 * po/gold.pot: Updated by the Translation project.
10409 * po/vi.po: Updated Vietnamese translation.
10410
2253bfba
L
104112010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10412
10413 * testsuite/Makefile.am (check_PROGRAMS): Add
10414 icf_virtual_function_folding_test.
10415 * testsuite/Makefile.in: Regenerated.
10416
85fdf906
AH
104172010-04-15 Andrew Haley <aph@redhat.com>
10418
10419 * options.h (merge_exidx_entries): New option.
10420 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10421 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10422 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10423 (Target_arm::merge_exidx_entries): New function.
10424 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10425 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10426 to Arm_exidx_fixup constructor.
10427 Add new arg, merge_exidx_entries.
10428 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10429 Arm_output_section::fix_exidx_coverage.
10430
ce97fa81
ST
104312010-04-18 Sriraman Tallam <tmsriram@google.com>
10432
10433 * icf.cc (get_section_contents): Check for preemptible functions.
10434 Ignore addend when appropriate.
10435 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10436 section folded.
10437 (add_from_relobj): Check for section folded.
10438 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10439 * symtab.h (should_add_dynsym_entry): Add new parameter.
10440 * target-reloc.h (scan_relocs): Check for section folded.
10441 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10442 Check reloc types for function pointers in shared objects.
10443 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10444 case.
10445 (icf_preemptible_functions_test): New test case.
10446 (icf_string_merge_test): New test case.
10447 * testsuite.Makefile.in: Regenerate.
10448 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10449 bar_glob. Refactor code.
10450 * testsuite/icf_preemptible_functions_test.cc: New file.
10451 * testsuite/icf_preemptible_functions_test.sh: New file.
10452 * testsuite/icf_string_merge_test.cc: New file.
10453 * testsuite/icf_string_merge_test.sh: New file.
10454 * testsuite/icf_virtual_function_folding_test.cc: New file.
10455 * testsuite/icf_virtual_function_folding_test.sh: New file.
10456
04ceb17c
DK
104572010-04-14 Doug Kwan <dougkwan@google.com>
10458
10459 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10460 for local symbol recounting if we remove a section due to ICF.
10461 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10462 there are no regular objects in input.
10463
153e7da4
DK
104642010-04-13 Doug Kwan <dougkwan@google.com>
10465
10466 * arm.cc (Arm_input_section::set_final_data_size): Compute
10467 accurate final data size instead of using current data size.
10468
4dbd9faf
DK
104692010-04-09 Doug Kwan <dougkwan@google.com>
10470
10471 * layout.cc (Layout::choose_output_section): Handle script section
10472 types.
10473 (Layout::make_output_section_for_script): Add section type parameter.
10474 Handle script section types.
10475 * layout.h (Layout::make_output_section_for_script): Add section
10476 type parameter.
10477 * output.cc (Output_section::Output_section): Initialize data member
10478 is_noload_.
10479 (Output_section::do_reset_address_and_file_offset): Do not set address
10480 to 0 if section is a NOLOAD section.
10481 * output.h (Output_section::is_noload): New method.
10482 (Output_section::set_is_noload): Ditto.
10483 (Output_section::is_noload_): New data member.
10484 * script-c.h (Script_section_type): New enum type.
10485 (struct Parser_output_section_header): Add new file section_type.
10486 * script-sections.cc (Sections_element::output_section_name): Add
10487 parameter for returning script section type.
10488 (Output_section_definition::output_section_name): Ditto.
10489 (Output_section_definition::section_type)P; New method.
10490 (Output_section_definiton::script_section_type_name): Ditto.
10491 (Output_section_definition::script_section_type_): New data member.
10492 (Output_section_definition::Output_section_definition): Initialize
10493 data member Output_section_definition::script_section_type_.
10494 (Output_section_definition::create_sections): Pass script section type
10495 to Layout::make_output_section_for_script.
10496 (Output_section_definition::output_section_name): Return script
10497 section type to caller.
10498 (Output_section_definition::set_section_address): Do not advance
10499 dot value and load address if section type is NOLOAD. Set address
10500 of NOLOAD sections regardless of section flags.
10501 (Output_section_definition::print): Print section type if it is
10502 not SCRIPT_SECTION_TYPE_NONE.
10503 (Output_section_definition::section_type): New method.
10504 (Output_section_definition::script_section_type_name): Ditto.
10505 (Script_sections::output_section_name): Add new parameter
10506 PSECTION_TYPE for returning script section type. Pass it to
10507 section elements. Handle discard sections.
10508 (Sort_output_sections::operator()): Handle NOLOAD sections.
10509 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10510 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10511 returning script section type.
10512 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10513 INFO and NOLOAD.
10514 * yyscript.y (union): Add new field SECTION_TYPE.
10515 (COPY, DSECT, INFO, NOLOAD): New tokens.
10516 (opt_address_and_section_type): Change type to output_section_header.
10517 (section_type): New non-terminal
10518 (section_header): Handle section type.
2253bfba 10519 (opt_address_and_section_type): Return section type value.
4dbd9faf 10520
721ea635
L
105212010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10522
10523 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10524 * testsuite/plugin_common_test_2.c (foo): Likewise.
10525
6bf924b0
DK
105262010-04-08 Doug Kwan <dougkwan@google.com>
10527
10528 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10529 Output_merge_data.
10530 * output.cc (Output_section::add_merge_input_section): Simplify
10531 code and return status of Output_merge_base::add_input_section.
e1df38aa 10532 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10533 returns true.
10534
24af6f92
DK
105352010-04-07 Doug Kwan <dougkwan@google.com>
10536
10537 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10538 if section is marked as containing instructions but has no mapping
10539 symbols.
10540 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10541 correct section index.
10542 (Arm_relobj::find_linked_text_section): Ditto.
10543
00698fc5
CC
105442010-04-07 Cary Coutant <ccoutant@google.com>
10545
10546 * archive.cc (include_member): Destroy Read_symbols_data object before
10547 releasing file.
10548 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10549 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10550 (Read_symbols_data::~Read_symbols_data) New destructor.
10551 (Section_relocs::Section_relocs) New constructor.
10552 (Section_relocs::~Section_relocs) New destructor.
10553 (Read_relocs_data::Read_relocs_data) New constructor.
10554 (Read_relocs_data::~Read_relocs_data) New destructor.
10555 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10556 pointers to NULL after deleting.
10557
7296d933
DK
105582010-04-07 Doug Kwan <dougkwan@google.com>
10559
10560 * arm.cc: Replace "endianity" with "endianness" in comments.
10561 (Arm_exidx_cantunwind): Ditto.
10562 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10563 (Arm_relobj::merge_flags_and_attributes): New method.
10564 (Arm_relobj::merge_flags_and_attributes_): New data member.
10565 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10566 (Arm_relobj::scan_sections_for_stubs): Ditto.
10567 (Arm_relobj::do_read_symbols): Check to see if we really want to
10568 merge processor-specific flags and attributes. Exit early if
10569 an object is empty except for section names and the undefined symbol.
10570 (Target_arm::do_finalize_sections): Move check for ELF format to
10571 Arm_relobj::do_read_symbols. Merge processor specific flags and
10572 attributes from a regular object only when we have determined that
10573 it is aapropriate. Do not create an .ARM.attributes section in
10574 output if there is no regular input object.
10575 (Target_arm::merge_processor_specific_flags): Check
10576 --warn-mismatch before printing any error.
10577 (Target_arm::merge_object_attributes): Ditto.
10578 * gold.cc (queue_middle_tasks): Handle the case in which there is
10579 no regular object in input.
10580 * options.cc (General_options::parse_EB): New method.
10581 (General_options::parse_EL): Same.
10582 (General_options::General_options): Initialize endianness_.
10583 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10584 New options.
10585 (General_options::Endianness): New enum.
10586 (General_options::endianness): New method.
10587 (General_options::endianness_): New data member.
10588 * parameters.cc (Parameters::set_options): Check target endianness.
10589 (Parameters::set_target_once): Ditto.
10590 (Parameters::check_target_endianness): New method.
10591 (parameters_force_valid_target): If either -EL or -EB is specified,
10592 use it to define endianness of default target.
10593 * parameters.h (Parameters::check_target_endianness): New method
10594 declaration.
10595 * target.h (class Target): Change "endianity" to "endianness"
10596 in comments.
10597
efc8d4f2
RW
105982010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10599
10600 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10601 * configure: Regenerate.
10602 * Makefile.in: Regenerate.
10603 * testsuite/Makefile.in: Regenerate.
10604
be234d88
CC
106052010-04-06 Cary Coutant <ccoutant@google.com>
10606
10607 gcc PR lto/42757
10608 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10609 prevailing definitions of common symbols.
10610 * testsuite/plugin_test_6.sh: New test case.
10611 * testsuite/plugin_common_test_1.c: New test case.
10612 * testsuite/plugin_common_test_2.c: New test case.
10613 * testsuite/Makefile.am (plugin_test_6): New test case.
10614 * testsuite/Makefile.in: Regenerate.
10615
bd32c6bd
NC
106162010-04-06 Nick Clifton <nickc@redhat.com>
10617
10618 * po/vi.po: New Vietnamese translation.
10619
323c532f
DK
106202010-03-30 Doug Kwan <dougkwan@google.com>
10621
10622 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10623
4fcd97eb
DK
106242010-03-25 Doug Kwan <dougkwan@google.com>
10625
10626 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10627 to avoid a conversion warning on a 32-bit host.
10628
4ebf39db
ILT
106292010-03-24 Ian Lance Taylor <iant@google.com>
10630
10631 * testsuite/script_test_3.t: Add a TLS segment.
10632 * testsuite/Makefile.am (check_PROGRAMS): Add
10633 tls_phdrs_script_test.
10634 (tls_phdrs_script_test_SOURCES): Define.
10635 (tls_phdrs_script_test_DEPENDENCIES): Define.
10636 (tls_phdrs_script_test_LDFLAGS): Define.
10637 (tls_phdrs_script_test_LDADD): Define.
10638 * testsuite/Makefile.in: Rebuild.
10639
4a599bdd
CC
106402010-03-23 Cary Coutant <ccoutant@google.com>
10641
10642 * fileread.cc (find_or_make_view): Fix comment.
10643
6c93b22c
ILT
106442010-03-23 Ian Lance Taylor <iant@google.com>
10645
10646 * script-sections.cc (class Orphan_section_placement): Define
10647 PLACE_TLS and PLACE_TLS_BSS.
10648 (Orphan_section_placement::Orphan_section_placement): Initialize
10649 new places.
10650 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10651 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10652 (tls_script_test_SOURCES): Define.
10653 (tls_script_test_DEPENDENCIES): Define.
10654 (tls_script_test_LDFLAGS): Define.
10655 (tls_script_test_LDADD): Define.
10656 * testsuite/Makefile.in: Rebuild.
10657
a2c7281b
DK
106582010-03-22 Doug Kwan <dougkwan@google.com>
10659
10660 * arm.cc (Arm_relocate_functions::abs8,
10661 Arm_relocate_functions::abs16): Use correct check for overflow
10662 specified in the ARM ELF specs.
10663 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10664 target of a BLX instruction specially.
10665 (Reloc_stub::stub_type_for_reloc): Ditto.
10666 (Relocate::relocate): Use symbolic names instead of numeric relocation
10667 codes to report error.
10668 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10669 workaround.
10670 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10671 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10672 thumb2_blx_out_of_range.stdout
10673 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10674 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10675 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10676 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10677 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10678 thumb2_blx_in_range, thumb2_blx_in_range.o,
10679 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10680 thumb2_blx_out_of_range.o): New rules.
2e702c99 10681 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10682 thumb2_blx_in_range and thumb2_blx_out_of_range.
10683 * testsuite/Makefile.in: Regenerate.
10684 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10685 * testsuite/thumb_blx_in_range.s: New file.
10686 * testsuite/thumb_blx_out_of_range.s: New file.
10687
b0193076
RÁE
106882010-03-22 Rafael Espindola <espindola@google.com>
10689
10690 * archive.cc (Should_include): Move to archive.h.
10691 (should_include_member): Make it a member of Archive.
10692 (Lib_group): New.
10693 (Add_lib_group_symbols): New.
10694 * archive.h: Include options.h.
10695 (Archive_member): Moved from Archive.
10696 (Should_include): Moved from archive.cc.
10697 (Lib_group): New.
10698 (Add_lib_group_symbols): New.
10699 * dynobj.cc (do_should_include_member): New.
10700 * dynobj.h (do_should_include_member): New.
10701 * gold.cc (queue_initial_tasks): Update call to queue.
10702 * main.cc (main): Print lib group stats.
10703 * object.cc (do_should_include_member): New.
10704 * object.h: Include archive.h.
10705 (Object::should_include_member): New.
10706 (Object::do_should_include_member): New.
10707 (Sized_relobj::do_should_include_member): New.
10708 * options.cc (General_options::parse_start_lib): New.
10709 (General_options::parse_end_lib): New.
10710 (Input_arguments::add_file): Handle lib groups.
10711 (Input_arguments::start_group): Check we are not in a lib.
10712 (Input_arguments::start_lib): New.
10713 (Input_arguments::end_lib): New.
10714 * options.h (General_options): Add start_lib and end_lib.
10715 (Input_argument::lib_): New.
10716 (Input_argument::lib): New.
10717 (Input_argument::is_lib): New.
10718 (Input_file_lib): New.
10719 (Input_arguments::in_lib_): New.
10720 (Input_arguments::in_lib): New.
10721 (Input_arguments::start_lib): New.
10722 (Input_arguments::end_lib_): New.
10723 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10724 in unused members as preempted.
10725 (Sized_pluginobj::do_should_include_member): New.
10726 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10727 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10728 return the blocker.
10729 (Read_symbols::do_whole_lib_group): New.
10730 (Read_symbols::do_lib_group): New.
10731 (Read_symbols::do_read_symbols): Handle lib groups.
10732 (Read_symbols::get_name): Handle lib groups.
10733 * readsyms.h (Read_symbols): Add an archive member pointer.
10734 (Read_symbols::do_whole_lib_group): New.
10735 (Read_symbols::do_lib_group): New.
10736 (Read_symbols::member_): New.
10737 * script.cc (read_input_script): Update call to queue_soon.
10738
d099120c
DK
107392010-03-19 Doug Kwan <dougkwan@google.com>
10740
10741 * arm.cc (Stub_table::Stub_table): Initialize new data members
10742 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10743 (Stub_table::add_reloc_stub): Assign stub offset and update
10744 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10745 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10746 New data members.
2e702c99 10747 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10748 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10749 instead of going over all reloc stubs.
2e702c99 10750 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10751 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10752 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10753 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10754 Stringpool_template::offset_.
10755 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10756 Stringpool_template::offset_ to zero.
10757
1aa37384
DK
107582010-03-15 Doug Kwan <dougkwan@google.com>
10759
10760 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10761 offset_.
10762 (Stringpool_template::new_key_offset): New method.
10763 (Stringpool_template::add_string): Assign offsets when adding new
10764 strings.
10765 (Stringpool_template::set_string_offsets): Do not set string offsets
10766 when not optimizing.
10767 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10768 member size_.
2e702c99
RM
10769 (Chunked_vector::clear): Clear size_.
10770 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10771 (Chunked_vector::size): Return size_.
10772 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10773 (Chunked_vector::size_): New data member.
1aa37384
DK
10774 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10775 (Stringpool_template::new_key_offset): New method declaration.
10776 (Stringpool_template::offset_): New data member.
10777
b672b057
RÁE
107782010-03-15 Rafael Espindola <espindola@google.com>
10779
10780 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10781 Add_symbols' constructor.
10782 * readsyms.h (Add_symbols): Remove the input_group member.
10783
b6848d3c
ILT
107842010-03-10 Ian Lance Taylor <iant@google.com>
10785
10786 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10787 target to ask whether a reference to a symbol requires a stack
10788 split.
10789 * target.h (Target::is_call_to_non_split): New function.
10790 (Target::do_is_call_to_non_split): Declare virtual function.
10791 * target.cc: Include "symtab.h".
10792 (Target::do_is_call_to_non_split): New function.
10793 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10794
a2a5469e
CC
107952010-03-10 Cary Coutant <ccoutant@google.com>
10796
10797 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10798 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10799 (File_read::open[2]): Add whole_file_view_ to list of views.
10800 (File_read::make_view): Remove test of whole_file_view_.
10801 (File_read::find_or_make_view): Create whole_file_view_ if
10802 necessary.
10803 (File_read::clear_views): Replace bool parameter with enum;
10804 adjust all callers. Don't delete views with permanent data;
10805 do delete cached views and views from archives if
10806 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10807 if clearing the corresponding view.
10808 * fileread.h (File_read::Clear_views_mode): New enum.
10809 (File_read::View::is_permanent_view): New method.
10810 (File_read::clear_views): Replace bool parameter
10811 with enum; adjust all callers.
10812 * options.h (General_options): Change keep_files_mapped option;
10813 add map_whole_files.
10814 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10815 releasing the file.
10816 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10817 the file.
10818
8861f32b
DM
108192010-03-10 David S. Miller <davem@davemloft.net>
10820
10821 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10822
d62d0f5f
ST
108232010-03-09 Sriraman Tallam <tmsriram@google.com>
10824
10825 * icf.cc (get_section_contents): Add '@' marker after processing the
10826 merge reloc.
10827
9177756d
DK
108282010-03-08 Doug Kwan <dougkwan@google.com>
10829
10830 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10831 due to a conversion warning.
10832 (Arm_relobj::update_output_local_symbol_count): Check for local
10833 symbol with unset output index.
10834
9e9e071b
ILT
108352010-03-05 Ian Lance Taylor <iant@google.com>
10836
10837 * options.h (class General_options): Add --spare-dynamic-tags.
10838 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10839 --spare-dynamic-tags.
10840
a81ee015
ILT
108412010-03-05 Ian Lance Taylor <iant@google.com>
10842
10843 * incremental.cc: Include "libiberty.h".
10844
44ec90b9
RO
108452010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10846
10847 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10848 function, is_info_ member.
10849 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10850 (Versions::Versions): Update caller.
10851 (Versions::define_base_version): Likewise.
10852 (Versions::add_def): Likewise.
10853
0897ed3b
ST
108542010-03-03 Sriraman Tallam <tmsriram@google.com>
10855
10856 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10857 (Scan::possible_function_pointer_reloc): New function.
10858 (Scan::local_reloc_may_be_function_pointer): Change to call
10859 possible_function_pointer_reloc.
10860 (Scan::global_reloc_may_be_function_pointer): Ditto.
10861 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10862 relocations in ".data.rel.ro._ZTV" section.
10863 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10864 * testsuite/icf_safe_so_test.cc: Ditto.
10865 * testsuite/icf_safe_test.cc: Ditto.
10866 * testsuite/icf_safe_test.sh: Ditto.
10867
d3bbad62
ILT
108682010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10869 Ian Lance Taylor <iant@google.com>
10870
10871 * target-reloc.h (relocate_section): Check the symbol table index
10872 for -1U before setting the local symbol index.
10873 (scan_relocatable_relocs): If copying the relocation, record that
10874 the local symbol is required.
10875 * object.h (Symbol_value::is_output_symtab_index_set): New
10876 function.
10877 (Symbol_value::may_be_discarded_from_output_symtab): New
10878 function.
10879 (Symbol_value::has_output_symtab_entry): New function.
10880 (Symbol_value::needs_output_symtab_entry): Remove.
10881 (Symbol_value::output_symtab_index): Make sure the symbol index is
10882 set.
10883 (Symbol_value::set_output_symtab_index): Make sure the symbol
10884 index is not set. Make sure the new index is valid.
10885 (Symbol_value::set_must_have_output_symtab_entry): New function.
10886 (Symbol_value::has_output_dynsym_entry): New function.
10887 (Symbol_value::set_output_dynsym_index): Make sure the new index
10888 is valid.
10889 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10890 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10891 local symbol if permitted.
10892 (Sized_relobj::do_finalize_local_symbols): Call
10893 is_output_symtab_index_set rather than needs_output_symtab_entry.
10894 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10895 rather than needs_output_symtab_entry. Call
10896 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10897 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10898 is_output_symtab_index_set rather than needs_output_symtab_entry.
10899 * testsuite/discard_locals_relocatable_test.c: New file.
10900 * testsuite/discard_locals_test.sh: Test -r.
10901 * testsuite/Makefile.am (check_DATA): Add
10902 discard_locals_relocatable_test1.syms,
10903 discard_local_relocatable_test2.syms.
10904 (MOSTLYCLEANFILES): Likewise. Also add
10905 discard_locals_relocatable_test1.lout and
10906 discard_locals_relocatable_test2.out.
10907 (discard_locals_relocatable_test1.syms): New target.
10908 (discard_locals_relocatable_test.o): New target.
10909 (discard_locals_relocatable_test1.out): New target.
10910 (discard_locals_relocatable_test2.syms): New target.
10911 (discard_locals_relocatable_test2.out): New target.
10912 (various): Add missing ../ld-new dependencies.
10913 * testsuite/Makefile.in: Rebuild.
10914
7e8ccf26
NC
109152010-03-03 Nick Clifton <nickc@redhat.com>
10916
10917 * po/fi.po: New Finnish translation.
10918
2a0ff005
DK
109192010-03-01 Doug Kwan <dougkwan@google.com>
10920
10921 * layout.cc (Layout::Layout): Force section types of .init_array*,
10922 .preinit_array* and .fini_array* sections.
10923 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10924 Fix check of return value of std::string::find.().
10925 (Output_section::Input_section_sort_compare::operator()): Remove
10926 comment about .init_array.
10927 (Output_section::Input_section_sort_init_fini_compare::operator()):
10928 New method.
10929 (Output_section::sort_attached_input_sections): Handle .init_array
10930 and .fini_array specially.
10931 * output.h (Output_section::Inut_section_sort_compare): Update
10932 comment.
10933 (Output_section::Input_section_sort_init_fini_compare): New struct.
10934
c3e4ae29
DK
109352010-02-26 Doug Kwan <dougkwan@google.com>
10936
10937 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10938 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10939 * testsuite/debug_msg.sh: Avoid matching source line number for
10940 use of global variable undef_int.
10941
2fd9ae7a
DK
109422010-02-26 Doug Kwan <dougkwan@google.com>
10943
10944 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10945 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10946 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10947 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10948 * options.cc (General_options::General_options): Initialize member
10949 fix_v4bx_.
10950 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10951 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10952 and rm_no_fix_v4bx.stdout
10953 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10954 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10955 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10956 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10957 and arm_no_fix_v4bx.
10958 * Makefile.in: Regenerate.
10959 * testsuite/arm_fix_v4bx.s: New file.
10960 * testsuite/arm_fix_v4bx.sh: Ditto.
10961
67ec7d0b
DK
109622010-02-24 Doug Kwan <dougkwan@google.com>
10963
10964 * arm.cc (Target_arm::got_section): Make the .got section the first
10965 non RELRO section in the data segment.
10966 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10967 suffixes of section names.
10968
10165461
DK
109692010-02-24 Doug Kwan <dougkwan@google.com>
10970
10971 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10972 flags and attributes merging if an input file is a binary file.
10973 * fileread.cc (Input_file::open): Record format of original file.
10974 * fileread.h (Input_file::Format): New enum type.
2e702c99 10975 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10976 (Input_file::format): New method definition.
10977 (Input_file::format_):: New data member.
10978
4a54abbb
DK
109792010-02-24 Doug Kwan <dougkwan@google.com>
10980
10981 * arm.cc (Arm_output_data_got): New class.
10982 (ARM_TCB_SIZE): New constant
10983 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10984 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10985 If user uses a script with a SECTIONS clause, issue only a warning
10986 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10987 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10988 garbage collection.
10989 (Target_arm::got_mode_index_entry): Handle static linking.
10990 (Target_arm::Scan::local): Ditto.
10991 (Target_arm::Scan::global): Ditto.
10992 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10993 all incorrectly implemented relocations.
e1df38aa 10994 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10995 Arm_output_section::fix_exidx_coverage.
10996 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10997 from ".ARM.exidx." and ".ARM.extab.".
10998
ca419a6f
ILT
109992010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11000
11001 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11002 section if it does not already exist.
11003 * attributes.cc (Attributes_section_data::Attributes_section_data):
11004 Don't crash if size is zero.
11005
135b9c78
ILT
110062010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11007 Ian Lance Taylor <iant@google.com>
11008
11009 * gold.cc (queue_middle_tasks): If no input files were opened,
11010 exit.
11011 * workqueue.h (Task_function::Task_function): Assert that there is
11012 a blocker.
11013
bb0bfe4f
DK
110142010-02-22 Doug Kwan <dougkwan@google.com>
11015
11016 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11017 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11018 types to avoid warnings due to different uint64_t implementations
11019 on different hosts.
11020
2a2b6d42
DK
110212010-02-21 Doug Kwan <dougkwan@google.com>
11022
11023 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11024 handling of the maximum backward branch offset.
2e702c99 11025 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11026 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11027 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11028 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11029 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11030 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11031 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11032 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11033 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11034 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11035 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11036 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11037 thumb2_bl_out_of_range.o): New rules.
11038 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11039 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11040 thumb2_bl_out_of_range
11041 * testsuite/Makefile.in: Regenerate.
11042 * testsuite/arm_bl_in_range.s: New file.
11043 * testsuite/arm_bl_out_of_range.s: Ditto.
11044 * testsuite/arm_branch_in_range.sh: Ditto.
11045 * testsuite/arm_branch_range.t: Ditto.
11046 * testsuite/thumb2_branch_range.t: Ditto.
11047 * testsuite/thumb_bl_in_range.s: Ditto.
11048 * testsuite/thumb_bl_out_of_range.s: Ditto.
11049 * testsuite/thumb_branch_range.t: Ditto.
11050
b487ad64
ST
110512010-02-20 Sriraman Tallam <tmsriram@google.com>
11052
11053 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11054 Add reloc offset information.
11055 * icf.cc (get_section_contents): Change iterators to point to the new
11056 vectors. Add reloc offset information to the contents.
11057 * icf.h (Icf::Sections_reachable_info): New typedef.
11058 (Icf::Sections_reachable_list): New typedef.
11059 (Icf::Offset_info): New typedef.
11060 (Icf::Reloc_info): New struct typedef.
11061 (Icf::Reloc_info_list): New typedef.
11062 (Icf::symbol_reloc_list): Delete method.
11063 (Icf::addend_reloc_list): Delete method.
11064 (Icf::section_reloc_list): Delete method.
11065 (Icf::reloc_info_list): New method.
11066 (Icf::reloc_info_list_): New member.
11067
f96accdf
DK
110682010-02-19 Doug Kwan <dougkwan@google.com>
11069
11070 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11071 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11072 * arm.cc (Arm_relocation_functions): New forward declaration.
11073 (Target_arm::Target_arm): Initialize new data members
11074 got_mod_index_offset_ and tls_base_symbol_defined_.
11075 (Target_arm::Relocate::relocate_tls): New method.
11076 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11077 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11078 New methods.
2e702c99 11079 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11080 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11081 (Target_arm::got_mod_index_offset_,
11082 Target_arm::tls_base_symbol_defined_): New data members.
11083 (Target_arm::Scan::local, Target::Scan::global,
11084 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11085 relocations.
11086
c8761b9a
DK
110872010-02-18 Doug Kwan <dougkwan@google.com>
11088
11089 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11090 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11091 text section as a parameter becuase some broken tools may not set
11092 the link in section header.
11093 (Target_arm::has_got_section): New method.
11094 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11095 without any mapping symbol as data only. Remove warning.
11096 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11097 link in its section header, try to discover the link by inspecting the
11098 REL31 relocation at the beginning of the section.
11099 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11100 in error message.
11101 (Target_arm::Scan::global): Treat any reference to the symbol
11102 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11103
21bb3914
ST
111042010-02-12 Sriraman Tallam <tmsriram@google.com>
11105
11106 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11107 (Scan::global_reloc_may_be_function_pointer): New function.
11108 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11109 (Scan::global_reloc_may_be_function_pointer): New function.
11110 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11111 (Scan::global_reloc_may_be_function_pointer): New function.
11112 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11113 (Scan::global_reloc_may_be_function_pointer): New function.
11114 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11115 (Scan::global_reloc_may_be_function_pointer): New function.
11116 (Scan::possible_function_pointer_reloc): New function.
11117 (Target_x86_64::can_check_for_function_pointers): New function.
11118 * gc.h (gc_process_relocs): Scan relocation types to determine if
11119 function pointers were taken for targets that support it.
11120 * icf.cc (Icf::find_identical_sections): Include functions for
11121 folding in safe ICF whose pointer is not taken.
11122 * icf.h (Secn_fptr_taken_set): New typedef.
11123 (fptr_section_id_): New member.
11124 (section_has_function_pointers): New function.
11125 (set_section_has_function_pointers): New function.
11126 (check_section_for_function_pointers): New function.
11127 * options.h: Fix comment for safe ICF option.
11128 * target.h (can_check_for_function_pointers): New function.
11129 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11130 Modify icf_safe_test for X86-64.
11131 * testsuite/Makefile.in: Regenerate.
11132 * testsuite/icf_safe_so_test.cc: New file.
11133 * testsuite/icf_safe_so_test.sh: New file.
11134 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11135 (main): Change to take pointer to function kept_func_3.
11136 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11137 folding is done correctly for X86-64.
11138
0da6fa6c
DM
111392010-02-12 David S. Miller <davem@davemloft.net>
11140
11141 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11142 is_symbolless parameter.
11143 (Output_reloc<SHT_REL>::is_symbolless): New.
11144 (Output_reloc<SHT_REL>::is_symbolless_): New.
11145 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11146 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11147 (Output_reloc<SHT_RELA>::is_symbolless): New.
11148 (Output_data_reloc::add_global): Handle is_symbolless.
11149 (Output_data_reloc::add_global_relative): Likewise.
11150 (Output_data_reloc::add_local): Likewise.
11151 (Output_data_reloc::add_local_relative): Likewise.
11152 (Output_data_reloc::add_symbolless_global_addend): New.
11153 (Output_data_reloc::add_symbolless_local_addend): New.
11154 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11155 is_symbolless.
11156 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11157 instead of ->is_relative_
11158 (Output_reloc::write): Likewise.
11159 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11160 (Output_reloc::write_rel): Simplify.
11161
11162 * sparc.cc (Target_sparc::Scan::local): Use
11163 ->add_symbolless_local_addend as needed.
11164 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11165 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11166 based upon relocation offset.
11167
e4782e83
DK
111682010-02-11 Doug Kwan <dougkwan@google.com>
11169
11170 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11171 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11172 beginning of function.
11173 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11174 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11175 parameter is_32bit in calls to should_apply_static_reloc.
11176 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11177 (check_DATA): Add arm_abs_global.stdout.
11178 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11179 arm_abs_global.stdout): New rules.
11180 (MOSTLLYCLEANFILES): Add arm_abs_global
11181 * Makefile.in: Regenerate.
11182 * testsuite/arm_abs_global.s: New file.
11183 * testsuite/arm_abs_global.sh: Ditto.
11184 * testsuite/arm_abs_lib.s: Ditto.
11185
93ceb764
ILT
111862010-02-11 Ian Lance Taylor <iant@google.com>
11187
11188 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11189 Read_relocs task.
11190 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11191 Allocate_commons_task first.
11192 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11193 task, rather than symtab_lock_.
11194 (Gc_process_relocs::~Gc_process_relocs): New function.
11195 (Gc_process_relocs::is_runnable): Check this_blocker_.
11196 (Gc_process_relocs::locks): Use next_blocker_ rather than
11197 blocker_.
11198 (Scan_relocs::~Scan_relocs): New function.
11199 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11200 symtab_lock_.
11201 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11202 next_blocker_.
11203 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11204 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11205 constructor accordingly.
11206 (class Gc_process_relocs): Likewise.
11207 (class Scan_relocs): Likewise.
11208 * common.h (class Allocate_commons_task): Remove symtab_lock_
11209 field, and corresponding constructor parameter.
11210 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11211 symtab_lock_.
11212 (Allocate_commons_task::locks): Likewise.
11213
114dfbe1
ILT
112142010-02-11 Ian Lance Taylor <iant@google.com>
11215
11216 * gold-threads.h (class Once): Define.
11217 (class Initialize_lock): Rewrite as child of Once.
11218 * gold-threads.cc (class Once_initialize): Define.
11219 (once_pointer_control): New static variable.
11220 (once_pointer, once_arg): New static variables.
11221 (c_run_once): New static function.
11222 (Once::Once, Once::run_once, Once::internal_run): New functions.
11223 (class Initialize_lock_once): Remove.
11224 (initialize_lock_control): Remove.
11225 (initialize_lock_pointer): Remove.
11226 (initialize_lock_once): Remove.
11227 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11228 (Initialize_lock::initialize): Rewrite.
11229 (Initialize_lock::do_run_once): New function.
11230 * archive.cc (Archive::interpret_header): Only clear name if it is
11231 not already empty.
11232 * fileread.cc: Include "gold-threads.h"
11233 (file_counts_lock): New static variable.
11234 (file_counts_initialize_lock): Likewise.
11235 (File_read::release): Only increment counts when using --stats.
11236 Use a lock around the increment.
11237 * parameters.cc (class Set_parameters_target_once): Define.
11238 (set_parameters_target_once): New static variable.
11239 (Parameters::Parameters): Move here from parameters.h.
11240 (Parameters::set_target): Rewrite.
11241 (Parameters::set_target_once): New function.
11242 (Parameters::clear_target): Move here and rewrite.
11243 * parameters.h (class Parameters): Update declarations. Add
11244 set_parameters_target_once_ field.
11245 (Parameters::Parameters): Move to parameters.cc.
11246 (Parameters::clear_target): Likewise.
11247 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11248 task.
11249 (Start_group::~Start_group): New function.
11250 (Start_group::is_runnable): New function.
11251 (Start_group::locks, Start_group::run): New functions.
11252 (Finish_group::run): Change saw_undefined to size_t.
11253 * readsyms.h (class Start_group): Define.
11254 (class Finish_group): Change saw_undefined_ field to size_t.
11255 (Finish_group::Finish_group): Remove saw_undefined and
11256 this_blocker parameters. Change all callers.
11257 (Finish_group::set_saw_undefined): New function.
11258 (Finish_group::set_blocker): New function.
11259 * symtab.h (class Symbol_table): Change saw_undefined to return
11260 size_t. Change saw_undefined_ field to size_t.
11261 * target-select.cc (Set_target_once::do_run_once): New function.
11262 (Target_selector::Target_selector): Initialize set_target_once_
11263 field. Don't initialize lock_ and initialize_lock_ fields.
11264 (Target_selector::instantiate_target): Rewrite.
11265 (Target_selector::set_target): New function.
11266 * target-select.h (class Set_target_once): Define.
11267 (class Target_selector): Update declarations. Make
11268 Set_target_once a friend. Remove lock_ and initialize_lock_
11269 fields. Add set_target_once_ field.
11270
fa17a3f4
ILT
112712010-02-10 Ian Lance Taylor <iant@google.com>
11272
11273 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11274 queueing any tasks.
11275 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11276 (queue_middle_tasks): Add all blockers before queueing any tasks.
11277 (queue_final_tasks): Likewise.
11278 * token.h (Task_token::add_blockers): New function.
11279 * object.h (Input_objects::number_of_relobjs): New function.
11280
c7177d31
ILT
112812010-02-10 Ian Lance Taylor <iant@google.com>
11282
5de0e392
ILT
11283 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11284 shared, not if not position independent.
11285 * x86_64.cc (Relocate::relocate_tls): Likewise.
11286 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11287 (tls_pie_pic_test): New target.
11288 * testsuite/Makefile.in: Rebuild.
11289
c7177d31
ILT
11290 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11291 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11292 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11293 * testsuite/Makefile.in: Rebuild.
11294
684b268a
DM
112952010-02-09 David S. Miller <davem@davemloft.net>
11296
11297 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11298 R_SPARC_RELATIVE using ->add_local_relative().
11299 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11300
612a8d3d
DM
11301 * output.h (Output_data_dynamic::add_section_size): New method
11302 that takes two Output_data objects.
11303 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11304 entry param. Handle it in initializers.
11305 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11306 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11307 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11308 arg.
11309 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11310 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11311 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11312 for dynrel_includes_plt.
11313 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11314 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11315 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11316 before .rela.plt
11317 (Target_sparc::do_finalize_sections): Update to pass true for
11318 dynrel_includes_plt.
11319 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11320 output before .rela.plt
11321 (Target_powerpc::do_finalize_sections): Update to pass true for
11322 dynrel_includes_plt when 32-bit.
11323
cb1be87e
DK
113242010-02-08 Doug Kwan <dougkwan@google.com>
11325
11326 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11327 method.
11328 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11329 Arm_relobj::scan_section_for_cortex_a8_stubs,
11330 Arm_relobj::do_relocation_section): Instead of calling
11331 Output_section::output_address, use faster
11332 Arm_relobj::simple_input_section_output_address.
11333
705b5121
DM
113342010-02-08 David S. Miller <davem@davemloft.net>
11335
11336 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11337 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11338 relocation helper function.
11339
024c4466
DM
11340 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11341 just like R_SPARC_GOT{10,13,22}.
11342 (Target_sparc::Scan::local): Likewise.
11343 (Target_sparc::Relocate:relocate): Likewise.
11344
9109c078
ILT
113452010-02-06 Ian Lance Taylor <iant@google.com>
11346
11347 * configure.ac: Rewrite targetobjs duplicate removal code to use
11348 only shell constructs.
11349 * configure: Rebuild.
11350
cf846138
DK
113512010-02-05 Doug Kwan <dougkwan@google.com>
11352
11353 PR 11247
11354 * arm.cc (Arm_relobj::section_is_scannable): New method.
11355 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11356 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11357
6cfaf60b
DK
113582010-02-04 Doug Kwan <dougkwan@google.com>
11359
11360 PR 11247
11361 * arm-reloc-property.cc (cstdio): Include.
11362 * configure.ac (targetobjs): Remove duplicates.
11363 * configure: Regenerate.
11364 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11365 big and little endian version for a given address size.
11366
5c57f1be
DK
113672010-02-03 Doug Kwan <dougkwan@google.com>
11368
11369 * arm-reloc-property.cc
11370 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11371 definition.
11372 * arm-reloc-property.h
11373 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11374 New method definition.
11375 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11376 declaration.
11377 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11378 overflow to N.
11379 (GOT_PREL): Change implemented to Y.
11380 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11381 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11382 (Arm_relocate_functions::movw_abs_nc): Remove method.
11383 (Arm_relocate_functions::movt_abs): Ditto.
11384 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11385 (Arm_relocate_functions::thm_movt_abs): Ditto.
11386 (Arm_relocate_functions::movw_rel_nc): Ditto.
11387 (Arm_relocate_functions::movw_rel): Ditto.
11388 (Arm_relocate_functions::movt_rel): Ditto.
11389 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11390 (Arm_relocate_functions:thm_movw_rel): Ditto.
11391 (Arm_relocate_functions:thm_movt_rel): Ditto.
11392 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11393 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11394 New method definitions.
11395 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11396 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11397 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11398 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11399 (Target_arm::Relocate::relocate): Check for non-static or
11400 unimplemented relocation code and exit early. Change calls to
11401 Target_arm::reloc_uses_thumb_bit and
11402 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11403 instead. Refactor code to handle similar relocations to increase
11404 code sharing. Remove check for unsupported relocation code in switch
11405 statement.
11406 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11407 relocation property table to find out size. Change error message to
11408 print out the name of a relocation code instead of the numeric value.
11409 (Target_arm::scan_reloc_for_stub): Use relocation property table
11410 instead of calling Target_arm::reloc_uses_thumb_bit().
11411
218c5831
DK
114122010-02-02 Doug Kwan <dougkwan@google.com>
11413
11414 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11415 types of relaxed input section.
11416
0d31c79d
DK
114172010-02-02 Doug Kwan <dougkwan@google.com>
11418
11419 * Makefile.am (HFILES): Add arm-reloc-property.h.
11420 (DEFFILES): New.
2e702c99
RM
11421 (TARGETSOURCES): Add arm-reloc-property.cc
11422 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11423 (libgold_a_SOURCES): $(DEFFILES)
11424 * Makefile.in: Regenerate.
11425 * arm-reloc-property.cc: New file.
11426 * arm-reloc-property.h: New file.
11427 * arm-reloc.def: New file.
11428 * arm.cc: Update comments.
11429 (arm-reloc-property.h): New included header.
11430 (arm_reloc_property_table): New global variable.
11431 (Target_arm::do_select_as_default_target): New method definition.
11432 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11433 arm-reloc-property to targ_extra_obj.
11434 * parameters.cc (set_parameters_target): Call
11435 Target::select_as_default_target().
11436 * target.h (Target::select_as_default_target): New method definition.
11437 (Target::do_select_as_default_target): Same.
11438
546c7457
DK
114392010-02-01 Doug Kwan <dougkwan@google.com>
11440
11441 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11442 first_output_text_section_.
11443 (Arm_exidx_fixup::first_output_text_section): New method definition.
11444 (Arm_exidx_fixup::first_output_text_section_): New data member.
11445 (Arm_exidx_fixup::process_exidx_section): Record the first text
11446 output section seen.
11447 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11448 and entsize in output section header.
11449
11b861d5
DK
114502010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11451
11452 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11453 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11454 (Arm_relocate_functions::thm_alu11): New Method.
11455 (Arm_relocate_functions::thm_pc8): New Method.
11456 (Arm_relocate_functions::thm_pc12): New Method.
11457 (Target_arm::Scan::local): Handle the relocations.
11458 (Target_arm::Scan::global): Likewise.
11459 (Target_arm::Relocate::relocate): Likewise.
11460 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11461
c9a2c125
DK
114622010-01-29 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11465 of relocation types as ld.
11466
1521477a
DK
114672010-01-29 Doug Kwan <dougkwan@google.com>
11468
11469 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11470 to public.
11471 (Arm_relocate_functions::thumb_branch_common): Ditto.
11472 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11473 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11474 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11475 Arm_relocate_functions::jump24): Remove.
11476 (Target_arm::Relocate::relocate): Adjust code to call
11477 Arm_relocation_functions::arm_branch_common and
11478 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11479 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11480
e7eca48c
DK
114812010-01-29 Doug Kwan <dougkwan@google.com>
11482
11483 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11484 output_local_symbol_count_needs_update_.
11485 (Arm_relobj::output_local_symbol_count_needs_update,
11486 Arm_relobj::set_output_local_symbol_count_needs_update,
11487 Arm_relobj::update_output_local_symbol_count): New methods.
11488 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11489 member.
11490 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11491 of pointed function as in a R_ARM_PREL31 relocation.
11492 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11493 for output local symbol count updating.
11494 (Target_arm::do_relax): Update output local symbol counts in objects
11495 if necessary.
11496 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11497
02961d7e
ILT
114982010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11499
11500 * arm.cc: Added support for the ARM relocations:
11501 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11502 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11503 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11504 movw_prel_nc).
11505 (Arm_relocate_functions::movw_rel): New method.
11506 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11507 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11508 thm_movw_prel_nc).
11509 (Arm_relocate_functions::thm_movw_rel): New method.
11510 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11511 thm_movt_prel).
11512 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11513 relocations.
11514 (Target_arm::Scan::global): Likewise.
11515 (Target_arm::Relocate::relocate): Likewise.
11516 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11517 Likewise.
11518
b10d2873
ILT
115192010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11520
11521 * arm.cc: Added support for ARM group relocations.
11522 (Target_arm::reloc_needs_sym_origin): New method.
11523 (Arm_relocate_functions::calc_grp_kn): New method.
11524 (Arm_relocate_functions::calc_grp_residual): New method.
11525 (Arm_relocate_functions::calc_grp_gn): New method.
11526 (Arm_relocate_functions::arm_grp_alu): New Method.
11527 (Arm_relocate_functions::arm_grp_ldr): New Method.
11528 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11529 (Arm_relocate_functions::arm_grp_ldc): New Method.
11530 (Target_arm::Scan::local): Handle the ARM group relocations.
11531 (Target_arm::Scan::global): Likewise.
11532 (Target_arm::Relocate::relocate): Likewise.
11533 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11534 Likewise.
11535
2b328d4e
DK
115362010-01-26 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc (set): Include.
11539 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11540 pointer type.
2e702c99 11541 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11542 (Arm_output_section::append_text_sections_to_list): New method.
11543 (Arm_output_section::fix_exidx_coverage): Ditto.
11544 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11545 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11546 Relobj::set_section_offset() instead of
11547 Sized_relobj::invalidate_section_offset().
2e702c99 11548 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11549 parameter for section headers. Ignore relocation sections for
11550 unallocated sections and EXIDX sections.
11551 (Target_arm::fix_exidx_coverage): New method.
11552 (Target_arm::output_section_address_less_than): New type.
11553 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11554 linked text section instead of the EXIDX section.
11555 (Arm_output_section::create_stub_group): Add an assertion to check
11556 that this is not an EXIDX output section.
11557 (Arm_output_section::append_text_sections_to_list): New method.
11558 (Arm_output_section::fix_exidx_coverage): Ditto.
11559 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11560 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11561 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11562 first pass.
11563 (Target_arm::fix_exidx_coverage): New method.
11564 * object.h (Relobj::set_output_section): New method.
11565 (Sized_relobj::invalidate_section_offset): Remove method.
11566 (Sized_relobj::do_invalidate_section_offset): Remove method.
11567 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11568
c7f3c371
DK
115692010-01-25 Doug Kwan <dougkwan@google.com>
11570
11571 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11572 Fix warning due to signed and unsigned comparison on a 32-bit host.
11573
8923b24c
DK
115742010-01-22 Doug Kwan <dougkwan@google.com>
11575
11576 * arm.cc (Target_arm::do_relax): Record an output section for section
11577 offset adjustment it contains any stub table that has changed.
11578 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11579 offsets in an output section if necessary.
11580 * output.cc (Output_section::Output_section): Initialize
11581 section_offsets_need_adjustments_.
11582 (Output_section::add_input_section_for_script): Renamed to
11583 Output_section::add_simple_input_section.
11584 (Output_section::save_states): Add a comment.
11585 (Output_section::discard_states): New method defintion.
11586 (Output_section::adjust_section_offsets): Same.
11587 * output.h (Output_section::add_input_section_for_script): Renamed to
11588 Output_section::add_simple_input_section.
11589 (Output_section::discard_states): New method declaration.
11590 (Output_section::adjust_section_offsets): Same.
11591 (Output_section::section_offsets_need_adjustment,
11592 Output_section::set_section_offsets_need_adjustment): New method
11593 definitions.
11594 (Output_section::section_offsets_need_adjustment_): New data member.
11595 * script-sections.cc
11596 (Output_section_element_input::set_section_address): Adjust code for
11597 renaming of Output_section::add_input_section_for_script.
11598 (Orphan_output_section::set_section_address): Same.
11599
9b2fd367
DK
116002010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11601
11602 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11603 Fix_v4bx enum values .
11604 * gold/options.h (General_options): New option definitions.
11605 (General_options::fix_v4bx): New method.
11606 (General_options::Fix_v4bx): New enum.
11607 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11608 (General_options::parse_fix_v4bx_interworking): New method.
11609
80d0d023
DK
116102010-01-22 Doug Kwan <dougkwan@google.com>
11611
11612 * arm.cc (Arm_exidx_fixup): New class.
11613
af2cdeae
DK
116142010-01-21 Doug Kwan <dougkwan@google.com>
11615
11616 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11617 classes.
11618 (Arm_exidx_section_offset_map): New type.
11619
993d07c1
DK
116202010-01-21 Doug Kwan <dougkwan@google.com>
11621
11622 * arm.cc (Arm_exidx_input_section): New class.
11623 (Arm_relobj::exidx_input_section_by_link,
11624 Arm_relobj::exidx_input_section_by_shndx,
11625 Arm_relobj::make_exidx_input_section): New methods.
11626 (read_arm_attributes_section): Remove.
11627 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11628 information about them.
11629 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11630 to here.
11631
5ac169d4
DK
116322010-01-20 Doug Kwan <dougkwan@google.com>
11633
11634 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11635 Input_section_specifier to Section_id.
11636 (Target_arm::new_arm_input_section: Adjust code for change of key
11637 type.
11638 (Target_arm::find_arm_input_section): Ditto.
11639 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11640 (Section_id): Remove.
11641 (Garbage_collection::Section_id_hash): Remove.
11642 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11643 (Section_id): Remove.
11644 (Icf::Section_id_hash): Remove.
11645 * object.h (Section_id, Const_section_id, Section_id_hash,
11646 Const_section_id_hash): New type definitions.
11647 * output.cc (Output_section::add_relaxed_input_section): Change to
11648 use Const_section_id instead of Input_section_specifier as key type.
11649 (Output_section::add_merge_input_section): Ditto.
11650 (Output_section::build_relaxation_map): Change to use Section_id
11651 instead of Input_section_specifier as key type.
2e702c99 11652 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11653 Ditto.
11654 (Output_section::convert_input_sections_to_relaxed_sections): Change
11655 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11656 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11657 (Output_section::find_relaxed_input_section): Ditto.
11658 * output.h (Input_section_specifier): Remove class.
11659 (Output_section::Output_section_data_by_input_section_map): Change
11660 key type to Const_section_id.
11661 (Output_section::Output_relaxed_input_section_by_input_section_map):
11662 Ditto.
11663 (Output_section::Relaxation_map): Change key type to Section_id.
11664
a2162063
ILT
116652010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11666
11667 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11668 (class Arm_v4bx_stub): New class.
11669 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11670 (Stub_factory::make_arm_v4bx_stub): New method.
11671 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11672 (Stub_table::empty): Handle v4bx stubs.
11673 (Stub_table::add_arm_v4bx_stub): New method.
11674 (Stub_table::find_arm_v4bx_stub): New method.
11675 (Arm_relocate_functions::v4bx): New method.
11676 (Target_arm::fix_v4bx): New method.
11677 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11678 (Stub_table::relocate_stubs): Likewise.
11679 (Stub_table::do_write): Likewise.
11680 (Stub_table::update_data_size_and_addralign): Likewise.
11681 (Stub_table::finalize_stubs): Likewise.
11682 (Target_arm::Scan::local): Likewise.
11683 (Target_arm::Scan::global): Likewise.
11684 (Target_arm::do_finalize_sections): Likewise.
11685 (Target_arm::Relocate::relocate): Likewise.
11686 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11687 Likewise.
11688 (Target_arm::scan_reloc_for_stub): Likewise.
11689 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11690
5696ab0b
ILT
116912010-01-19 Ian Lance Taylor <iant@google.com>
11692
11693 * output.cc (Output_section_headers::do_sized_write): Write large
11694 segment count to sh_info field.
11695 (Output_file_header::do_sized_write): For large segment count,
11696 write PN_XNUM to e_phnum field.
11697
800d0f56
ILT
116982010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11699
11700 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11701 (Arm_relocate_functions::thm_jump8): New function.
11702 (Arm_relocate_functions::thm_jump11): New function.
11703 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11704 R_ARM_THM_JUMP11.
11705 (Target_arm::Scan::global): Likewise.
11706 (Target_arm::Relocate::relocate): Likewise.
11707 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11708 Likewise.
11709
41263c05
DK
117102010-01-14 Doug Kwan <dougkwan@google.com>
11711
11712 * arm.cc (map, utility): Include headers.
11713 (Target_arm::apply_cortex_a8_workaround): New method.
11714 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11715 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11716 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11717 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11718 the --[no-]fix-cortex-a8 command line options.
11719 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11720 (Target_arm::relocate_stub): Use addend in instruction template.
11721 * options.h (DEFINE_bool): Set the user-set flag.
11722 (General_options): Add --[no-]-fix-cortex options.
11723 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11724 : Update fast look-up map after conversion.
41263c05 11725
459e9b03
ST
117262010-01-14 Sriraman Tallam <tmsriram@google.com>
11727
11728 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11729 in the first pass of do_layout.
11730
b521dfe4
DK
117312010-01-13 Doug Kwan <dougkwan@google.com>
11732
11733 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11734 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11735 apparent compiler problem of not folding static constant integral
11736 data members of elfcpp::Elf_sizes<32>.
11737
44272192
DK
117382010-01-13 Doug Kwan <dougkwan@google.com>
11739
11740 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11741 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11742 Arm_relobj::scan_section_for_cortex_a8_erratum,
11743 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11744 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11745 sections to scan for relocation stubs into a new method
11746 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11747 relocation and Cortex-A8 stub scanning.
11748 (Target_arm::do_relax): Force stubs to be after stubbed sections
11749 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11750 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11751 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11752
44b71ece
ILT
117532010-01-12 Ian Lance Taylor <iant@google.com>
11754
11755 * target-reloc.h (visibility_error): New inline function.
11756 (relocate_section): Call visibility_error.
11757 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11758 (MOSTLYCLEANFILES): Likewise.
11759 (protected_4_pic.o, protected_3.err): New targets.
11760 * testsuite/protected_4.cc: New file.
11761
a120bc7f
DK
117622010-01-12 Doug Kwan <dougkwan@google.com>
11763
11764 * arm.cc (Cortex_a8_reloc): New class.
11765 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11766 and cortex_a8_relocs_info_.
11767 (Target_arm::fix_cortex_a8): New method definition.
11768 (Target_arm::Cortex_a8_relocs_info): New type.
11769 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11770 New data member declarations.
11771 (Target_arm::scan_reloc_for_stub): Record information about
11772 relocations for THUMB branches that might be exempted from the
11773 Cortex-A8 workaround.
11774 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11775 at the beginning of a relaxation pass.
11776
20138696
DK
117772010-01-12 Doug Kwan <dougkwan@google.com>
11778
11779 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11780 (Arm_relobj::Mapping_symbol_position,
11781 Arm_reloj::Mapping_symbol_position_less,
11782 Arm_relobj::Mapping_symbols_info): New types.
11783 (Target_arm::is_mapping_symbol_name): New method definition.
11784 (Arm_relobj::do_count_local_symbols): Save information about mapping
11785 symbols.
11786
089d69dc
DK
117872010-01-11 Doug Kwan <dougkwan@google.com>
11788
11789 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11790 Arm_relocate_functions::thumb32_branch_upper,
11791 Arm_relocate_functions::thumb32_branch_lower,
11792 Arm_relocate_functions::thumb32_cond_branch_offset,
11793 Arm_relocate_functions::thumb32_cond_branch_upper,
11794 Arm_relocate_functions::thumb32_cond_branch_lower,
11795 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11796 branch offset encoding.
11797 (Arm_relocate_functions::thumb_branch_common): Use new branch
11798 offset encoding methods to avoid code duplication.
11799 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11800 (Stub_addend_reader::operator()): Use new branch encoding method
11801 to avoid code duplication.
11802
99e5bff2
DK
118032010-01-11 Doug Kwan <dougkwan@google.com>
11804
11805 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11806 (Target_arm::do_finalize_sections): Define special EXIDX section
11807 symbols only if referenced.
11808 * gc.h (Garbage_collection::add_reference): New method.
11809 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11810 code duplication.
11811
98e090bd
ILT
118122010-01-11 Ian Lance Taylor <iant@google.com>
11813
d0a91bd8
ILT
11814 * script.cc (Version_script_info::build_expression_list_lookup):
11815 Change complaing about duplicate wildcard match from error to
11816 warning.
11817
98e090bd
ILT
11818 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11819 of 2009-12-30.
11820 (Version_script_info::Version_script_info): Initialize globs_,
11821 default_version_, default_is_global_, and exact_. Don't
11822 initialize globals_ or locals_.
11823 (Version_script_info::build_lookup_tables): Build local symbols
11824 first.
11825 (Version_script_info::unquote): New function.
11826 (Version_script_info::add_exact_match): New function.
11827 (Version_script_info::build_expression_list_lookup): Remove lookup
11828 parameter. Add is_global parameter. Change all callers. Handle
11829 wildcard pattern specially. Unquote pattern. Call
11830 add_exact_match.
11831 (Version_script_info::get_name_to_match): New function.
11832 (Version_script_info::get_symbol_version): New function.
11833 (Version_script_info::get_symbol_version_helper): Remove.
11834 (Version_script_info::check_unmatched_names): Call unquote.
11835 * script.h (class Version_script_info): Change get_symbol_version
11836 to be non-inline and add is_global parameter; change all callers.
11837 Rewrite symbol_is_local. Update declarations. Define struct
11838 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11839 Remove globals_ and locals_ members. Add exact_, globs_,
11840 default_version_, is_global_.
11841 (Version_script_info::Glob): Remove pattern, add expression and
11842 is_global. Update constructor. Change all callers.
11843 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11844 default version.
11845 (Versions::symbol_section_contents): If a symbol is undefined, or
11846 defined in a dynamic object, set the version index to
11847 VER_NDX_LOCAL.
11848 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11849 symbol_is_local.
11850 (Symbol_table::add_from_pluginobj): Likewise.
11851 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11852
d56962d3
DK
118532010-01-11 Doug Kwan <dougkwan@google.com>
11854
11855 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11856 (incremental_dump_LDADD): Add linking option for libintl.
11857 * Makefile.in: Regenerate.
11858
94e6ee91
L
118592010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11860
11861 PR gold/11144
11862 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11863 instead of -Ds.
11864 * testsuite/Makefile.in: Regenerated.
11865
e96c574b
DK
118662010-01-10 Doug Kwan <dougkwan@google.com>
11867
11868 * options.h (DEFINE_var): Use parentheses around argument varname__
11869 in macro body to avoid any unintended subsequent substitutions.
11870
7198066b
ILT
118712010-01-10 Ian Lance Taylor <iant@google.com>
11872
ba4d53bf
ILT
11873 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11874 candidates before doing symbol resolution.
11875
7198066b
ILT
11876 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11877 ODR candidates if only one is weak.
11878
a2beed37
ILT
118792010-01-08 Ian Lance Taylor <iant@google.com>
11880
11881 * script.cc (Version_script_info::build_expression_list_lookup):
11882 Don't warn about ambiguous version, just record the ambiguity.
11883 (Version_script_info::get_symbol_version_helper): Give error if
11884 version is ambiguous.
11885
2fb7225c
DK
118862010-01-08 Doug Kwan <dougkwan@google.com>
11887
11888 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11889 prev_data_size_ and prev_addralign_. Remove initializer for
11890 deleted data member has_been_changed_.
11891 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11892 to determine if the table is empty.
11893 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11894 Remove.
11895 (Stub_table::add_reloc_stub): Define method in class definition
11896 instead of just declaring it there.
11897 (Stub_table::add_cortex_a8_stub): New method definition.
11898 (Stub_table::update_data_size_and_addralign): Ditto.
11899 (Stub_table::finalize_stubs): Ditto.
11900 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11901 (Stub_table::do_addralign_): Return address alignment in the
11902 (Stub_table::do_reset_address_and_file_offset): Define method in
11903 class definition instead of declaring it there. Set current data
11904 size to be the data size of the previous pass.
11905 (Stub_table::set_final_data_size): Use current data size as the
11906 final data size.
11907 (Stub_table::relocate_stub): Change parameter type of stub from
11908 Reloc_stub pointer to Stub pointer.
11909 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11910 (Stub_table::Cortex_a8_stub_list): New typedef.
11911 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11912 Stub_table::prev_addralign_): New data member.
11913 (Arm_relobj::Arm_relobj): Initialize data member
11914 section_has_cortex_a8_workaround_.
11915 (Arm_relobj::section_has_cortex_a8_workaround,
11916 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11917 definitions.
11918 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11919 declarations.
11920 (Target_arm::relocate_stub): Change parameter type of stub from
11921 Reloc_stub pointer to Stub pointer.
11922 (Insn_template::size, Insn_template::alignment): Handle
11923 THUMB16_SPECIAL_TYPE.
11924 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11925 Stub_table::update_data_size_and_addralign,
11926 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11927 definitions.
11928 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11929 (Stub_table::do_write): Ditto.
11930 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11931
880cd20d
ILT
119322010-01-08 Ian Lance Taylor <iant@google.com>
11933
11934 PR 11108
11935 * symtab.h (class Symbol): Remove fields is_target_special_ and
11936 has_plt_offset_. Add field is_defined_in_discarded_section_.
11937 (Symbol::is_defined_in_discarded_section): New function.
11938 (Symbol::set_is_defined_in_discarded_section): New function.
11939 (Symbol::has_plt_offset): Rewrite.
11940 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11941 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11942 Don't initialize is_target_special_ or has_plt_offset_.
11943 Initialize is_defined_in_discarded_section_.
11944 (Symbol_table::add_from_relobj): If appropriate, set
11945 is_defined_in_discarded_section.
11946 * resolve.cc (Symbol::override_base_with_special): Don't test
11947 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11948 * target-reloc.h (relocate_section): Do special handling for
11949 symbols defined in discarded sections for global symbols as well
11950 as local symbols.
11951
2703e3eb
ILT
119522010-01-08 Ian Lance Taylor <iant@google.com>
11953
11954 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11955 the SHT_SYMTAB case.
11956
339d40a3
ILT
119572010-01-08 Ian Lance Taylor <iant@google.com>
11958
11959 * object.cc (Sized_relobj::do_layout): Don't get confused if
11960 layout_eh_frame returns NULL.
11961
abecea76
ILT
119622010-01-08 Ian Lance Taylor <iant@google.com>
11963
11964 PR 11084
11965 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11966 dynamic symbol table, use the normal symbol table.
11967 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11968 symbol table.
11969
6b7dd3f3
ILT
119702010-01-08 Ian Lance Taylor <iant@google.com>
11971
11972 PR 11072
11973 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11974 sections.
11975
36c50e63
L
119762010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11977
11978 * version.cc (print_version): Change to "Copyright 2010".
11979
e291e7b9
ILT
119802010-01-08 Ian Lance Taylor <iant@google.com>
11981
11982 PR 10287
11983 PR 11063
11984 * i386.cc (class Target_i386): Change return type of plt_section
11985 to be non-const.
11986 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11987 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11988 tls_desc_rel_ field.
11989 (Output_data_plt_i386::rel_tls_desc): New function.
11990 (Target_i386::rel_tls_desc_section): New function.
11991 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11992 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11993 R_386_TLS_DESC reloc in rel_tls_desc_section.
11994 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11995 Define struct Tlsdesc_info.
11996 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11997 (Target_x86_64::do_reloc_symbol_index): New function.
11998 (Target_x86_64::add_tlsdesc_info): New function.
11999 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12000 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12001 tlsdesc_rel_ field.
12002 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12003 all callers.
12004 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12005 (Target_x86_64::rela_tlsdesc_section): New function.
12006 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12007 handling.
12008 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12009 (Target_x86_64::do_reloc_addend): New function.
12010 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12011 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12012 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12013 (Output_reloc::type): New function.
12014 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12015 (Output_reloc::is_target_specific): New function.
12016 (Output_reloc::target_arg): New function.
12017 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12018 absolute relocs and target specific relocs.
12019 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12020 add_target_specific.
12021 (class Output_data_reloc) [SHT_RELA]: Likewise.
12022 * output.cc (Output_reloc::Output_reloc): Add four new versions
12023 for absolute relocs and target specific relocs.
12024 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12025 (Output_reloc::get_symbol_index): Likewise.
12026 (Output_reloc::local_section_offset): Check that local_sym_index_
12027 is not TARGET_CODE or 0.
12028 (Output_reloc::symbol_value): Likewise.
12029 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12030 reloc.
12031 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12032 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12033 functions.
12034 * layout.cc (add_target_dynamic_tags): Use output section for
12035 DT_PLTRELSZ and DT_JMPREL.
12036
3a44184e
ILT
120372010-01-07 Ian Lance Taylor <iant@google.com>
12038
12039 PR 11061
12040 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12041 function.
12042 (class Output_data_reloc_generic): Define.
12043 (class Output_data_reloc_base): Change base class to
12044 Output_data_reloc_generic. Change add() method to call
12045 bump_relative_reloc_count for a relative reloc. Remove
12046 sort_relocs_ field.
12047 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12048 to sort_relocs().
12049 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12050 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12051 appropriate.
12052 * layout.h (class Layout): Update declaration.
12053
ea715a34
ILT
120542010-01-07 Ian Lance Taylor <iant@google.com>
12055
12056 * output.h (class Output_data): Add const version of
12057 output_section and do_output_section.
12058 (class Output_section_data): Add const version of
12059 do_output_section.
12060 (class Output_section): Likewise.
12061 * layout.cc (Layout::add_target_dynamic_tags): New function.
12062 * layout.h (class Layout): Update declarations.
12063 * arm.cc (Target_arm::do_finalize_sections): Use
12064 add_target_dynamic_tags.
12065 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12066 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12067 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12068 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12069
659948a4
ILT
120702010-01-07 Ian Lance Taylor <iant@google.com>
12071
12072 PR 11042
12073 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12074 object as needed.
12075
9d3b86f6
ILT
120762010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12077 Ian Lance Taylor <iant@google.com>
12078
12079 PR 11019
12080 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12081 Xindex::read_symtab_xindex.
12082
bb0d3eb0
DK
120832010-01-07 Doug Kwan <dougkwan@google.com>
12084
12085 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12086 (Insn_template::thumb16_bcond_insn): New method declaration.
12087 (Insn_template): Fix spelling.
12088 (Stub::thumb16_special): New method declaration.
12089 (Stub::do_write): Define virtual method which was previously pure
12090 virtual.
12091 (Stub::do_thumb16_special): New method declaration.
12092 (Stub::do_fixed_endian_write): New template member.
12093 (Reloc_stub::do_write): Remove.
12094 (Reloc_stub::do_fixed_endian_write): Remove.
12095 (Cortex_a8_stub): New class definition.
12096 (Stub_factory::make_cortex_a8_stub): New method definition.
12097 (Stub_factory::Stub_factory): Add missing static storage class
12098 qualifier for elf32_arm_stub_a8_veneer_blx.
12099
ffeef7df
ILT
121002010-01-07 Ian Lance Taylor <iant@google.com>
12101
dc3f80fe
ILT
12102 PR 10980
12103 * options.h (class General_options): Add --warn-unresolved-symbols
12104 and --error-unresolved-symbols.
12105 * errors.cc (Errors::undefined_symbol): Implement
12106 --warn-unresolved-symbols.
12107
ffeef7df
ILT
12108 * options.h (class General_options): Add -z text and -z textoff.
12109 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12110
f1ec9ded
ST
121112010-01-06 Sriraman Tallam <tmsriram@google.com>
12112
12113 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12114 (Garbage_collection::cident_sections): New function.
12115 (Garbage_collection::add_cident_section): New function.
12116 (Garbage_collection::cident_sections_): New member.
12117 (gc_process_relocs): Add references to sections whose names are C
12118 identifiers.
12119 * gold.h (cident_section_start_prefix): New constant.
12120 (cident_section_stop_prefix): New constant.
12121 (is_cident): New function.
12122 * layout.cc (Layout::define_section_symbols): Replace string constants
12123 with the newly defined constants.
12124 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12125 C identifiers.
12126 * testsuite/Makefile.am: Add gc_orphan_section_test.
12127 * testsuite/Makefile.in: Regenerate.
12128 * testsuite/gc_orphan_section_test.cc: New file.
12129 * testsuite/gc_orphan_section_test.sh: New file.
12130
6eda8c29
ILT
121312010-01-06 Ian Lance Taylor <iant@google.com>
12132
b9674e17
ILT
12133 PR 10980
12134 * options.h (class General_options): Add --warn-shared-textrel.
12135 * layout.cc (Layout::finish_dynamic_section): Implement
12136 --warn-shared-textrel.
12137
6eda8c29
ILT
12138 PR 10980
12139 * options.h (class General_options): Add --warn-multiple-gp.
12140
32dcd44e
ILT
121412010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12142
12143 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12144 $(THREADSLIB) and $(LIBDL).
12145 * Makefile.in: Rebuild.
12146
a192ba05
ILT
121472010-01-06 Ian Lance Taylor <iant@google.com>
12148
12149 PR 10980
12150 * options.cc (General_options::parse_section_start): New function.
12151 (General_options::section_start): New function.
12152 (General_options::General_options): Initialize all members.
12153 * options.h: Include <map>
12154 (class General_options): Add --section-start. Add section_starts_
12155 member.
12156 * layout.cc (Layout::attach_allocated_section_to_segment): If
12157 --section-start was used, set the address of the segment. Remove
12158 local sort_sections.
12159 (Layout::relaxation_loop_body): If the address of the load segment
12160 has been set by --section-start, don't use it.
12161 * output.h (Output_segment::update_flags_for_output_section): New
12162 function.
12163 * output.cc (Output_segment::add_output_section): Call
12164 update_flags_for_output_section.
12165
dde3f402
ILT
121662010-01-05 Ian Lance Taylor <iant@google.com>
12167
62dfdd4d
ILT
12168 PR 10980
12169 * options.h (class General_options): Add --undefined-version.
12170 * script.cc (struct Version_expression): Add was_matched_by_symbol
12171 field.
12172 (Version_script_info::matched_symbol): New function.
12173 (Version_script_info::get_symbol_version_helper): Call
12174 matched_symbol.
12175 (Version_script_info::check_unmatched_names): New function.
12176 * script.h (class Version_script_info): Update declarations.
12177 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12178
9c4ae156
ILT
12179 * options.h (class General_options): Use DEFINE_bool_alias for
12180 allow_multiple_definition.
12181 * resolve.cc (Symbol_table::should_override): Don't test
12182 allow_multiple_definition.
12183
dde3f402
ILT
12184 PR 10980
12185 * options.h (class General_options): Add --cref.
12186 * main.cc (main): Print cref table if --cref. Don't close mapfile
12187 until after printing cref table.
12188 * cref.cc: Include "symtab.h".
12189 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12190 (Cref_table_compare::operator()): New function.
12191 (Cref_inputs::gather_cref): New function.
12192 (filecol): New static const.
12193 (Cref_inputs::print_cref): New function.
12194 (Cref::print_cref): New function.
12195 * cref.h: Include <cstdio>.
12196 (class Cref): Update declarations.
12197 * mapfile.h (Mapfile::file): New function.
12198 * object.h (class Object): Define Symbols. Declare virtual
12199 do_get_global_symbols.
12200 (Object::get_global_symbols): New function.
12201 * object.cc (Input_objects::add_object): Pass object to cref_ if
12202 --cref.
12203 (Input_objects::archive_start): Likewise.
12204 (Input_objects::archive_stop): Likewise.
12205 (Input_objects::print_cref): New function.
12206 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12207 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12208 --cref.
12209 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12210 function.
12211 * plugin.h (class Sized_pluginobj): Update declarations.
12212
8781f709
ILT
122132010-01-05 Ian Lance Taylor <iant@google.com>
12214
12215 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12216 to is_default_version. Rename insdef to insdefault.
12217 (Symbol_table::add_from_relobj): Rename def to is_default_version
12218 and local to is_forced_local.
12219 (Symbol_table::add_from_pluginobj): Likewise.
12220 (Symbol_table::add_from_dynobj): Likewise.
12221 (Symbol_table::define_special_symbol): Rename insdef to
12222 insdefault.
12223
fe35d28d
ILT
122242010-01-04 Ian Lance Taylor <iant@google.com>
12225
30bc8c46
ILT
12226 PR 10980
12227 * options.h (class General_options): Add
12228 --allow-multiple-definition and -z muldefs.
12229 * resolve.cc (Symbol_table::should_override): Don't warn about a
12230 multiple symbol definition if --allow-multiple-definition or -z
12231 muldefs.
12232
7eaea549
ILT
12233 PR 10980
12234 * options.h (class General_options): Add --add-needed and
12235 --copy-dt-needed-entries. Tweak --as-needed help entry.
12236 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12237 error if --copy-dt-needed-entries aka --add-needed is used and
12238 would cause a change in behaviour.
12239
fe35d28d
ILT
12240 PR 10980
12241 * options.h (class General_options): Add -G as a short version of
12242 --shared. Add no-op options -assert, -g, and -i.
12243
55a2bb35
ST
122442010-01-04 Sriraman Tallam <tmsriram@google.com>
12245
12246 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12247 check for .text or .gnu.linkonce.t sections.
12248 * icf.cc (Icf::find_identical_sections): Ditto.
12249 Change the detection for mangled function name within the section
12250 name.
12251 * icf.h (is_section_foldable_candidate): New function.
12252
719328e1
ILT
122532009-12-30 Ian Lance Taylor <iant@google.com>
12254
12255 PR 10980
12256 * options.h (class General_options): Permit two dashes with
12257 --retain-symbols-file.
12258
d7bb5745
ILT
122592009-12-30 Ian Lance Taylor <iant@google.com>
12260
403a15dd
ILT
12261 PR 10979
12262 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12263 don't put the file header and segment headers in the text
12264 segment.
12265
eda294df
ILT
12266 PR 10979
12267 * common.cc (Sort_commons::operator()): Stabilize sort when both
12268 entries are NULL.
12269 (Symbol_table::do_allocate_commons_list): When allocating common
12270 symbols, skip a symbol which is no longer common.
12271 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12272 an object before checking its type.
12273 * testsuite/common_test_2.c: New file.
12274 * testsuite/common_test_3.c: New file.
12275 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12276 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12277 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12278 (common_test_2_pic.o, common_test_2.so): New targets.
12279 (common_test_3_pic.o, common_test_3.so): New targets.
12280 * testsuite/Makefile.in: Rebuild.
12281
d7bb5745
ILT
12282 PR 10979
12283 * script.cc (read_input_script): If we see a new SECTIONS clause,
12284 and we have added an input section, give an error.
12285 * layout.h (class Layout): Add have_added_input_section function.
12286 Add have_added_input_section_ field.
12287 * layout.cc (Layout::Layout): Initialize
12288 have_added_input_section_.
12289 (Layout::layout): Set have_added_input_section_.
12290 (Layout::layout_eh_frame): Likewise.
12291
fc59c572
ILT
122922009-12-30 Ian Lance Taylor <iant@google.com>
12293
12294 PR 10931
12295 * options.h (class General_options): Add --sort-common option.
12296 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12297 * common.cc (Sort_common): Add sort_order parameter to
12298 constructor. Add sort_order_ field.
12299 (Sort_commons::operator): Check sort_order_.
12300 (Symbol_table::allocate_commons): Determine the sort order.
12301 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12302 Change all callers.
12303 (Symbol_table::do_allocate_commons_list): Likewise.
12304
1c74fab0
ILT
123052009-12-30 Ian Lance Taylor <iant@google.com>
12306
12307 PR 10916
12308 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12309 symbols from this object, don't change the visibility of an
12310 undefined symbol.
12311 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12312
6affe781
ILT
123132009-12-30 Ian Lance Taylor <iant@google.com>
12314
12315 PR 10861
12316 * script.h (class Version_script_info): Define Language enum.
12317 Update declarations. Define Glob, Exact, and Lookup types. Add
12318 new fields globals_, locals_, and is_finalized_.
12319 * script.cc: Various formatting fixes.
12320 (class Parser_closure): Change language_stack_ from a vector of
12321 std::string to one of Version_script_info::Language. Adjust all
12322 uses accordingly.
12323 (class Lazy_demangler): Remove.
12324 (struct Version_expression): Change language from std::string to
12325 Version_script_info::Language.
12326 (Version_script_info::Version_script_info): New function.
12327 (Version_script_info::~Version_script_info): Don't call clear.
12328 (Version_script_info::finalize): New function.
12329 (Version_script_info::build_lookup_tables): New function.
12330 (Version_script_info::build_expression_list_lookup): New
12331 function.
12332 (Version_script_info::get_symbol_version_helper): Rewrite to use
12333 lookup tables.
12334 (Version_script_info::print_expression_list): Adjust to use
12335 Version_script_info::Language.
12336 (script_push_lex_into_version_mode): Check that the version script
12337 has not been finalized.
12338 (version_script_push_lang): Change language string to
12339 Version_script_info::Language.
12340 * options.cc (Command_line::version_script): New function.
12341 * options.h (class General_options): Add finalize_dynamic_list
12342 function. Change version_script from declaration to definition.
12343 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12344 * testsuite/version_script.map: Remove duplicate def of foo.
12345 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12346 version_script.map.
12347 * testsuite/Makefile.in: Rebuild.
12348
818bf354
ILT
123492009-12-30 Ian Lance Taylor <iant@google.com>
12350
12351 PR 10843
12352 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12353 if the input symbol index is 0, make the output symbol index 0.
12354
ebcc8304
ILT
123552009-12-30 Ian Lance Taylor <iant@google.com>
12356
12357 PR 10670
12358 * options.h (class General_options): Add -x/--discard-all.
12359 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12360 --discard-all. If the local symbol needs a dynamic entry, check
12361 that before handling --discard-locals.
12362
176fe33f
ILT
123632009-12-30 Ian Lance Taylor <iant@google.com>
12364
bb321bb1
ILT
12365 PR 10450
12366 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12367 flags to PF_R.
12368 (Output_segment::add_output_section): Don't change the flags if
12369 the type is PT_TLS.
12370
176fe33f
ILT
12371 PR 10450
12372 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12373 GNU hash table if they need a dynamic value. Otherwise, don't add
12374 them if they are defined in a dynamic object or are forced local.
12375
e8cd95c7
ILT
123762009-12-29 Ian Lance Taylor <iant@google.com>
12377
1b81fb71
ILT
12378 PR 10450
12379 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12380 .gnu.hash table for a 32-bit target.
12381
8d6d383d
ILT
12382 PR 10450
12383 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12384 regular and a dynamic object only needs a dynamic symbol table
12385 entry if it is externally visible.
12386
e785ec03
ILT
12387 PR 10450
12388 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12389 constructor. Add global_offset_table_ field.
12390 (Target_i386::got_section): Set global_offset_table_.
12391 (Target_i386::do_finalize_sections): Set global_offset_table_
12392 size.
12393 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12394 in constructor. Add global_offset_table_ field.
12395 (Target_x86_64::got_section): Set global_offset_table_.
12396 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12397 size.
12398
1a2dff53
ILT
12399 * layout.cc (Layout::Layout): Initialize increase_relro_.
12400 (Layout::get_output_section): Add is_relro, is_last_relro, and
12401 is_first_non_relro parameters. Change all callers.
12402 (Layout::choose_output_section): Likewise.
12403 (Layout::add_output_section_data): Likewise.
12404 (Layout::make_output_section): Likewise.
12405 (Layout::set_segment_offsets): Clear increase_relro when using a
12406 linker script.
12407 * layout.h (class Layout): Add increase_relro method. Add
12408 increase_relro_ field. Update declarations.
12409 * output.cc (Output_section::Output_section): Initialize
12410 is_last_relro_ and is_first_non_relro_.
12411 (Output_segment::add_output_section): Group relro sections is
12412 do_sort is true. Handle is_last_relro and is_first_non_relro.
12413 (Output_segment::maximum_alignment): Remove relro handling.
12414 (Output_segment::set_section_addresses): Add increase_relro
12415 parameter. Change all callers. Add initial alignment to align
12416 relro sections on separate page. Remove old relro handling.
12417 (Output_segment::set_section_list_addresses): Remove in_relro
12418 parameter. Change all callers.
12419 (Output_segment::set_offset): Add increase parameter. Change all
12420 callers. Remove old relro handling.
12421 * output.h (class Output_section): Add new methods: is_last_relro,
12422 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12423 Add is_last_relro_ and is_first_non_relro_ fields.
12424 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12425 Create separate .got.plt section. Call increase_relro.
12426 * x86_64.cc (Target_x86_64::got_section): Likewise.
12427 * testsuite/relro_script_test.t: Add .got.plt.
12428
f0ba79e2
ILT
12429 PR 10450
12430 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12431 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12432 (Layout::finalize): Call set_dynamic_symbol_size.
12433 (Layout::set_dynamic_symbol_size): New function.
12434 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12435 set_dynamic_symbol_size.
12436
e8cd95c7
ILT
12437 PR 10450
12438 * output.h (class Output_section): Add is_entsize_zero_ field.
12439 * output.cc (Output_section::Output_section): Initialize
12440 is_entsize_zero_.
12441 (Output_section::set_entsize): If two different entsizes are
12442 requested, force it to zero.
12443 (Output_section::add_input_section): Set flags for .debug_str
12444 before updating section flags. Set entsize.
12445 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12446 and SHF_STRING if all input sections have those flags.
12447
3e1b9a8a
RÁE
124482009-12-29 Rafael Espindola <espindola@google.com>
12449
12450 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12451 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12452 reporting.
3e1b9a8a 12453
3dcad376
ST
124542009-12-29 Sriraman Tallam <tmsriram@google.com>
12455
12456 * options.cc (General_options::parse_version): Allow -v to exit
12457 without an error if there is nothing to link.
12458
084e2665
ILT
124592009-12-29 Ian Lance Taylor <iant@google.com>
12460
12461 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12462 using a version of gcc before 4.1.
12463 * configure: Rebuild.
12464
250acde3
CD
124652009-12-28 Chris Demetriou <cgd@google.com>
12466
12467 * attributes.cc (Output_attributes_section_data::do_write): Use
12468 std::vector::front rather than std::vector::data.
12469
99fff23b
ILT
124702009-12-28 Ian Lance Taylor <iant@google.com>
12471
12472 * symtab.h (class Symbol_table): Add enum Defined.
12473 * resolve.cc (Symbol_table::should_override): Add defined
12474 parameter. Change all callers. Test whether object is NULL
12475 before calling a method on it.
12476 (Symbol_table::report_resolve_problem): Add defined parameter.
12477 Change all callers.
12478 (Symbol_table::should_override_with_special): Likewise.
12479 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12480 parameter. Change all callers.
12481 (Symbol_table::do_define_in_output_data): Likewise.
12482 (Symbol_table::define_in_output_segment): Likewise.
12483 (Symbol_table::do_define_in_output_segment): Likewise.
12484 (Symbol_table::define_as_constant): Likewise.
12485 (Symbol_table::do_define_as_constant): Likewise.
12486 * script.h (class Symbol_assignment): Add is_defsym parameter to
12487 constructor; change all callers.
12488 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12489 parameter. Change all callers. Add is_defsym_ field.
12490 (class Parser_closure): Add parsing_defsym parameter to
12491 constructor; change all callers. Add parsing_defsym accessor
12492 function. Add parsing_defsym_ field.
12493
556bd683
ILT
124942009-12-28 Ian Lance Taylor <iant@google.com>
12495
12496 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12497 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12498
1782c879
ILT
124992009-12-23 Ian Lance Taylor <iant@google.com>
12500
12501 * i386.cc (Target_i386::do_calls_non_split): Recognize
12502 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12503 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12504 -fsplit-stack prologue when using %r11.
1782c879 12505
329ca2b1
ST
125062009-12-21 Sriraman Tallam <tmsriram@google.com>
12507
12508 * options.cc (General_options::parse_version): Make -v continue and do
12509 the link like GNU ld does.
12510
d675ff46
RÁE
125112009-12-17 Rafael Avila de Espindola <espindola@google.com>
12512
12513 * Makefile.am (CCFILES): Add timer.cc.
12514 (HFILES): Add timer.h.
12515 * configure.ac: Check for sysconf and times.
12516 * main.cc: include timer.h.
12517 (main): Use Timer instead of get_run_time.
12518 * timer.cc: New.
12519 * timer.h: New.
12520 * workqueue.cc: include timer.h.
12521 (Workqueue::find_and_run_task):
12522 Report user, sys and wall time.
12523 * Makefile.in: Regenerate.
12524 * config.in: Regenerate.
12525 * configure: Regenerate.
12526
d6344fb5
DK
125272009-12-16 Doug Kwan <dougkwan@google.com>
12528
12529 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12530 sections.
12531 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12532 relaxed input sections.
12533 * output.cc (Output_section::find_relaxed_input_section): Change
12534 return type to Output_relaxed_input_section pointer. Adjust code
12535 for new type of relaxed_input_section_map_.
12536 * output.h (Output_section::find_relaxed_input_section): Change
12537 return type to Output_relaxed_input_section pointer.
12538 (Output_section::Output_relaxed_input_section_by_input_section_map):
12539 New type.
12540 (Output_section::relaxed_input_section_map_): Change type to
12541 Output_section::Output_relaxed_input_section_by_input_section_map.
12542 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12543 input section.
12544
0e0d5469
ILT
125452009-12-15 Ian Lance Taylor <iant@google.com>
12546
12547 * layout.cc (Layout::create_shstrtab): Only write out after input
12548 sections if we are compressing debug sections.
12549
0649a889
ILT
125502009-12-15 Ian Lance Taylor <iant@google.com>
12551
12552 * archive.cc (Archive::add_symbols): Only look up a symbol without
12553 a version if there is, in fact, a version.
12554
2ea97941
ILT
125552009-12-14 Ian Lance Taylor <iant@google.com>
12556
12557 Revert -Wshadow changes, all changes from:
12558 2009-12-11 Doug Kwan <dougkwan@google.com>
12559 2009-12-11 Nick Clifton <nickc@redhat.com>
12560 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12561
b0eec2cc
DK
125622009-12-11 Doug Kwan <dougkwan@google.com>
12563
12564 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12565 due to -Wshadow.
12566 * attributes.cc (Object_attribute::size): Ditto.
12567 (Attributes_section_data::size): Ditto.
12568 (Attributes_section_data::Attributes_section_data): Ditto.
12569 (Output_attributes_section_data::do_write): Ditto.
12570 * attributes.h (Object_attribute::set_type): Ditto.
12571 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12572
91d6fa6a
NC
125732009-12-11 Nick Clifton <nickc@redhat.com>
12574
12575 * archive.cc: Fix shadowed variable warnings.
12576 * arm.cc: Likewise.
12577 * compressed_output.cc: Likewise.
12578 * compressed_output.h: Likewise.
12579 * configure: Likewise.
12580 * dwarf_reader.cc: Likewise.
12581 * dynobj.cc: Likewise.
12582 * dynobj.h: Likewise.
12583 * ehframe.cc: Likewise.
12584 * ehframe.h: Likewise.
12585 * errors.cc: Likewise.
12586 * expression.cc: Likewise.
12587 * fileread.cc: Likewise.
12588 * fileread.h: Likewise.
12589 * freebsd.h: Likewise.
12590 * i386.cc: Likewise.
12591 * icf.cc: Likewise.
12592 * incremental.h: Likewise.
12593 * layout.cc: Likewise.
12594 * layout.h: Likewise.
12595 * mapfile.cc: Likewise.
12596 * merge.cc: Likewise.
12597 * merge.h: Likewise.
12598 * object.cc: Likewise.
12599 * object.h: Likewise.
12600 * options.h: Likewise.
12601 * output.cc: Likewise.
12602 * output.h: Likewise.
12603 * parameters.cc: Likewise.
12604 * plugin.cc: Likewise.
12605 * powerpc.cc: Likewise.
12606 * reduced_debug_output.cc: Likewise.
12607 * reduced_debug_output.h: Likewise.
12608 * reloc.cc: Likewise.
12609 * reloc.h: Likewise.
12610 * resolve.cc: Likewise.
12611 * script-sections.cc: Likewise.
12612 * script.cc: Likewise.
12613 * script.h: Likewise.
12614 * sparc.cc: Likewise.
12615 * symtab.cc: Likewise.
12616 * symtab.h: Likewise.
12617 * target-select.cc: Likewise.
12618 * target-select.h: Likewise.
12619 * token.h: Likewise.
12620 * workqueue.cc: Likewise.
12621 * workqueue.h: Likewise.
12622 * x86_64.cc: Likewise.
12623
a0351a69
DK
126242009-12-10 Doug Kwan <dougkwan@google.com>
12625
12626 * arm.cc (attributes.h): New include.
12627 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12628 (Arm_relobj::~Arm_relobj): Delete object pointed by
12629 attributes_section_data_.
12630 (Arm_relobj::attributes_section_data): New method definition.
12631 (Arm_relobj::attributes_section_data_): New data member declaration.
12632 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12633 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12634 attributes_section_data_.
12635 (Arm_dynobj::attributes_section_data): New method definition.
12636 (Arm_dynobj::attributes_section_data_): New data member declaration.
12637 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12638 initialization value of may_use_blx_ to false.
2e702c99 12639 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12640 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12641 object attributes to compute results instead of hard-coding.
12642 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12643 Target_arm::get_secondary_compatible_arch,
12644 Target_arm::set_secondary_compatible_arch
12645 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12646 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12647 New method declarations.
12648 (Target_arm::get_aeabi_object_attribute): New method definition.
12649 (Target_arm::attributes_section_data_): New data member declaration.
12650 (read_arm_attributes_section): New template definition.
12651 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12652 (Arm_dynobj::do_read_symbols): Ditto.
12653 (Target_arm::do_finalize_sections): Merge attributes sections from
12654 input. Check for BLX use after attributes section merging.
12655 Fix __exidx_start and __exidx_end visibility. Create an
12656 .ARM.attributes section if necessary.
12657 (Target_arm::get_secondary_compatible_arch,
12658 Target_arm::set_secondary_compatible_arch,
12659 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12660 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12661 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12662 New method definitions.
12663
b59befec
ILT
126642009-12-09 Ian Lance Taylor <iant@google.com>
12665
12666 * plugin.cc (Plugin::load): Don't cast from void* to a function
12667 pointer.
12668
1276bc89
ILT
126692009-12-09 Ian Lance Taylor <iant@google.com>
12670
12671 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12672 information fields.
12673
2f2de248
L
126742009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12675
12676 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12677 Replace two_file_shared_1.so with two_file_shared_2.so.
12678 * testsuite/Makefile.in: Regenerated.
12679
4f787271
DK
126802009-12-08 Doug Kwan <dougkwan@google.com>
12681
12682 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12683 (HFILES): Add attributes.h and int_encoding.h.
12684 * Makefile.in: Regenerate.
12685 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12686 function definitions to int_encoding.cc
12687 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12688 prototypes to int_encoding.h
12689 * reduced_debug_output.cc (int_encoding.h): New include.
12690 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12691 function definitions to int_encoding.cc
12692 (insert_into_vector, read_from_pointer): Move template definitions to
12693 int_encoding.h
12694 * attributes.cc: New file.
12695 * attributes.h: New file.
12696 * int_encoding.cc: New file.
12697 * int_encoding.h: New file.
12698
20b52f1a
RÁE
126992009-12-07 Rafael Avila de Espindola <espindola@google.com>
12700
12701 PR gold/11055
12702 * incremental-dump.cc (dump_incremental_inputs): New.
12703 (main): Use dump_incremental_inputs.
12704
53d7974c
L
127052009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12706
12707 PR gold/10893
12708 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12709 checking elfcpp::STT_FUNC.
12710 (Target_i386::Relocate::relocate): Likewise.
12711 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12712
12713 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12714 symbols from shared libraries into normal FUNC symbols.
12715
12716 * symtab.h (Symbol): Add is_func and use it.
12717
05a352e6
DK
127182009-12-05 Doug Kwan <dougkwan@google.com>
12719
12720 * arm.cc (Target_arm::arm_info): Initialize new fields
12721 attributes_section and attributes_vendor.
12722 * i386.cc (Target_i386::i386_info): Same.
12723 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12724 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12725 fields attributes_section and attributes_vendor.
53d7974c 12726 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12727 * target.h (Target::attributes_section, Target::attributes_vendor,
12728 Target::is_attributes_section, Target::attribute_arg_type,
12729 Target::attributes_order): New method definitions.
12730 (Target::Target_info::attributes_section,
12731 Target::Target_info::attributes_vendor): New fields.
12732 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12733 virtual method definitions.
12734 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12735 attributes_section and attributes_vendor.
12736 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12737
f4e5969c
DK
127382009-12-05 Doug Kwan <dougkwan@google.com>
12739
12740 * arm.cc: Update comments about interworking and stub generation.
12741 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12742 considered as non-PIC.
12743 (Arm_relocate_functions::base_abs): Fix formatting.
12744 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12745 of function to use GOT entry address instead of offset.
12746 (Target_arm::Scan::global): Issue an error if a symbol would need a
12747 PLT does not get one because it is untyped. Remove code to create
12748 dynamic symbols for relative branches.
12749 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12750 takes unsigned integer instead of boolean.
12751
1abce4a6
L
127522009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12753
12754 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12755 (two_file_test_LDADD): Likewise.
12756 (common_test_1_LDADD): Likewise.
12757 (exception_test_LDADD) Likewise.
12758 (weak_test_LDADD): Likewise.
12759 (many_sections_test_LDADD): Likewise.
12760 (initpri1_LDADD): Likewise.
12761 (script_test_1_LDADD): Likewise.
12762 (script_test_2_LDADD): Likewise.
12763 (justsyms_LDADD): Likewise.
12764 (binary_test_LDADD): Likewise.
12765 (large_LDADD): Likewise.
12766 * testsuite/Makefile.in: Regenerated.
12767
adcf2816 127682009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12769
adcf2816
L
12770 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12771 (Symbol_table::override_with_special): Likewise.
12772 (Symbol_table::add_from_object): Likewise.
12773
28e67f5d
RÁE
127742009-12-04 Rafael Avila de Espindola <espindola@google.com>
12775
12776 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12777 Don't set the data_offset twice.
12778
ae10a101
RÁE
127792009-12-04 Rafael Avila de Espindola <espindola@google.com>
12780
12781 * testsuite/Makefile.in: Regenerate.
12782
f59f41f3
DK
127832009-12-03 Doug Kwan <dougkwan@google.com>
12784
12785 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12786 (Target_arm::do_finalize_sections): Add parameter for symbol table
12787 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12788 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12789 parameter for symbol table pointer.
12790 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12791 an additional parameter for a pointer to symbol table.
12792 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12793 parameter for a symbol table pointer.
12794 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12795 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12796 Ditto.
12797 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12798 parameter for a symbol table pointer.
12799
ca55d848
RÁE
128002009-12-03 Rafael Avila de Espindola <espindola@google.com>
12801
12802 * incremental.cc (Incremental_inputs_header)
12803 (Incremental_inputs_header_write, Incremental_inputs_entry)
12804 (Incremental_inputs_entry_write): Move ...
12805 * incremental.h (Incremental_inputs_header)
12806 (Incremental_inputs_header_write, Incremental_inputs_entry)
12807 (Incremental_inputs_entry_write): here.
12808
3aec4f9c
RÁE
128092009-12-02 Rafael Avila de Espindola <espindola@google.com>
12810
12811 * incremental.cc (make_sized_incremental_binary): Set the target.
12812 Error if it is incompatible.
12813 * output.h (Output_file): Add filename method.
12814
9c0ae74d
RÁE
128152009-12-02 Rafael Avila de Espindola <espindola@google.com>
12816
12817 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12818 from the get_* methods.
12819
a45500ae
RÁE
128202009-12-02 Rafael Avila de Espindola <espindola@google.com>
12821
12822 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12823 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12824 Write 0 for the data_offset of scripts.
12825
325e6408
RÁE
128262009-12-02 Rafael Avila de Espindola <espindola@google.com>
12827
12828 * testsuite/Makefile.am: Add the incremental_test.sh test.
12829 * testsuite/incremental_test.sh: New.
12830 * testsuite/incremental_test_1.c: New.
12831 * testsuite/incremental_test_2.c: New.
12832
954c3e2e
RÁE
128332009-12-01 Rafael Avila de Espindola <espindola@google.com>
12834
703d02da 12835 * incremental-dump.cc (main): Fix typos.
954c3e2e 12836
f8086623
RÁE
128372009-11-27 Rafael Avila de Espindola <espindola@google.com>
12838
12839 PR gold/11025
12840 * incremental-dump.cc (main): Use llu to print 64 bit values.
12841
3b0dd6ac
L
128422009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12843 H.J. Lu <hongjiu.lu@intel.com>
12844
12845 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12846 $(LIBDL).
12847 (incremental_dump_LDADD): Likewise.
12848 * Makefile.in: Regenerated.
12849
a6d1ef57 128502009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12851
a6d1ef57
DK
12852 Revert:
12853
12854 2009-11-25 Doug Kwan <dougkwan@google.com>
12855
12856 * arm.cc (Target_arm::Target_arm): Move method definition
12857 outside of class definition. Add code to handle
12858 --target1-rel, --target1-abs and --target2= options.
12859 (Target_arm::get_reloc_reloc_type): Change method to be
12860 non-static and const.
12861 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12862 New data member declaration.
12863 (Target_arm::Scan::local, Target_arm::Scan::global,
12864 Target_arm::Relocate::relocate,
12865 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12866 Adjust call to Target_arm::get_real_reloc_type.
12867 (Target_arm::get_real_reloc_type): Use command line options
12868 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12869 * options.h (--target1-rel, --target1-abs, --target2): New
12870 ARM-only options.
12871
50aeb7d4
DK
128722009-11-25 Doug Kwan <dougkwan@google.com>
12873
12874 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12875 class definition. Add code to handle --target1-rel, --target1-abs
12876 and --target2= options.
12877 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12878 and const.
12879 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12880 member declaration.
12881 (Target_arm::Scan::local, Target_arm::Scan::global,
12882 Target_arm::Relocate::relocate,
12883 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12884 call to Target_arm::get_real_reloc_type.
12885 (Target_arm::get_real_reloc_type): Use command line options to
12886 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12887 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12888 options.
12889
51938283
DK
128902009-11-25 Doug Kwan <dougkwan@google.com>
12891
12892 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12893 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12894 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12895 formatting.
12896 (Arm_relocate_functions::thm_call): Replace body with a call to
12897 Arm_relocate_functions::thumb_branch_common.
12898 (Arm_relocate_functions::thm_jump24,
12899 Arm_relocate_functions::thm_xpc22): New method definitions.
12900 (Arm_relocate_functions::thumb_branch_common): New method definition.
12901 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12902 operator.
12903 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12904 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12905
e2b8f3c4
RÁE
129062009-11-24 Rafael Avila de Espindola <espindola@google.com>
12907
12908 * Makefile.am: Build incremental-dump
12909 * Makefile.in: Regenerate.
12910 * incremental-dump.cc: New.
12911 * incremental.cc (Incremental_inputs_header_data,
12912 Incremental_inputs_entry_data): Move to incremental.h
12913 * incremental.h: (Incremental_inputs_header_data,
12914 Incremental_inputs_entry_data): Move from incremental.cc
12915
bcba9aec
RÁE
129162009-11-24 Rafael Avila de Espindola <espindola@google.com>
12917
12918 * incremental.cc (Incremental_inputs_header,
12919 Incremental_inputs_header_write, Incremental_inputs_entry,
12920 Incremental_inputs_entry_write): Add a typedef with the data type.
12921
7c3afe08
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): Update comment about which
12927 type has the filed descriptions.
12928
d204b6e9
DK
129292009-11-15 Doug Kwan <dougkwan@google.com>
12930
12931 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12932 (Arm_relocate_functions::arm_branch_common): Change method defintion
12933 in class definition to a method declaration and update list of formal
12934 parameters.
12935 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12936 Arm_relocation_functions::jump24): Adjust call to
12937 Arm_relocate_functions::arm_branch_common. Update list of formal
12938 parameters.
12939 (Arm_relocate_functions::xpc25): New method definition.
12940 (Arm_relocate_functions::arm_branch_common): Move method defintion
12941 out from class definition. Use stubs for mode-switching and extending
12942 branch ranges.
12943 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12944 specially. Change code to enable use of stubs in ARM branches.
12945
43d12afe
DK
129462009-11-10 Doug Kwan <dougkwan@google.com>
12947
12948 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12949 in method declaration.
12950 (Target_arm::relocate_stub): New method declaration.
12951 (Target_arm::default_target): Change to return a pointer instead of
12952 a const reference.
12953 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12954 Target_arm::default_target.
12955 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12956 method definition.
12957 (Target_arm::relocate_section): Adjust view.
12958 (Target_arm::relocate_stub): New method definition.
12959
ac33a407
DK
129602009-11-10 Doug Kwan <dougkwan@google.com>
12961
12962 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12963 a format warning.
12964 * incremental.cc (open_incremental_binary): Initialized local
12965 variables to avoid warnings.
12966 * object.cc (make_elf_object): Ditto.
12967 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12968 a format warning.
e1df38aa 12969
88ee28e9
L
12970009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12971
12972 PR gold/10930
12973 * testsuite/plugin_test.c: Include "config.h".
12974
2daedcd6
DK
129752009-11-09 Doug Kwan <dougkwan@google.com>
12976
12977 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12978 (arm_symbol_value): Remove.
12979 (Arm_relocate_functions::arm_branch_common,
12980 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12981 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12982 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12983 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12984 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12985 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12986 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12987 Arm_relocate_functions::thm_mobw_abs_nc,
12988 Arm_relocate_functions::thm_mov_abs,
12989 Arm_relocate_functions::movw_prel_nc,
12990 Arm_relocate_functions::thm_movt_abs,
12991 Arm_relocate_functions::movt_prel,
12992 Arm_relocate_functions::thm_movw_prel_nc,
12993 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12994 (Target_arm::Relocate::relocate): Only decompose address into two
12995 parts if relocation type uses the thumb-bit and pass the actual
12996 bit instead of a flag indicating that the thumb-bit is used. Adjust
12997 calls to methods in Arm_relocate_functions for this change.
12998
1276bc89 129992009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
13000
13001 PR 10925
13002 * reloc.cc: Instantiate
13003 Sized_relobj::initialize_input_to_output_maps and
13004 Sized_relobj:free_input_to_output_maps.
13005
e53ad1b5
ILT
130062009-11-06 Ian Lance Taylor <iant@google.com>
13007
13008 PR 10876
13009 * defstd.cc (in_segment): Set only_if_ref true for "end".
13010
eb44217c
DK
130112009-11-06 Doug Kwan <dougkwan@google.com>
13012
13013 * arm.cc (class Reloc_stub): Correct a comment.
13014 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13015 (Target_arm::scan_section_for_stubs): New method declaration.
13016 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13017 Change methods from private to protected.
13018 (Target_arm::do_may_relax): New method definition.
13019 (Target_arm::do_relax, Target_arm::group_sections,
13020 Target_arm::scan_reloc_for_stub,
13021 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13022 (Target_arm::arm_input_section_map_): New data member declaration.
13023 (Target_arm::scan_reloc_for_stub,
13024 Target_arm::scan_reloc_section_for_stubs,
13025 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13026 Target_arm::do_relax): New method definitions.
13027
5d329b7d
ILT
130282009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13029
13030 * configure.ac: Check for (struct stat)::st_mtim
13031 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13032 * config.in: Regenerate.
13033 * configure: Regenerate.
13034
96a0d71b
ILT
130352009-11-05 Ian Lance Taylor <iant@google.com>
13036
13037 PR 10910
13038 * output.cc (Output_segment::add_output_section): Add missing
13039 return statement.
13040
594c8e5e
ILT
130412009-11-04 Ian Lance Taylor <iant@google.com>
13042
13043 PR 10880
13044 * object.h (class Object): Add is_needed and set_is_needed
13045 methods. Add is_needed_ field. Make bool fields into bitfields.
13046 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13047 defined in a dynamic object and referenced by a regular object,
13048 set is_needed for the dynamic object.
13049 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13050 if the file is marked with as_needed and it is not needed.
13051
22b127cc
ILT
130522009-11-04 Ian Lance Taylor <iant@google.com>
13053
13054 PR 10887
13055 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13056 tags if data is discarded by linker script.
13057 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13058 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13059 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13060 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13061
f5c870d2
ILT
130622009-11-04 Ian Lance Taylor <iant@google.com>
13063
13064 * layout.cc (Layout::get_output_section): Add is_interp and
13065 is_dynamic_linker_section parameters. Change all callers.
13066 (Layout::choose_output_section): Likewise.
13067 (Layout::make_output_section): Likewise.
13068 (Layout::add_output_section_data): Add is_dynamic_linker_section
13069 parameter. Change all callers.
13070 * layout.h (class Layout): Update declarations.
13071 * output.h (class Output_section): Add is_interp, set_is_interp,
13072 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13073 Add is_interp_, is_dynamic_linker_section_ fields. Change
13074 generate_code_fills_at_write_ to a bitfield.
13075 * output.cc (Output_section::Output_sections): Initialize new
13076 fields.
13077 (Output_segment::add_output_section): Add do_sort parameter.
13078 Change all callers.
13079
1ae4d23b
ILT
130802009-11-03 Ian Lance Taylor <iant@google.com>
13081
13082 PR 10860
13083 * options.h (class General_options): Add --warn-common.
13084 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13085 merging two common symbols.
13086 (Symbol_table::should_override): Handle --warn-common when merging
13087 a common symbol with a defined symbol. Use report_resolve_problem
13088 for multiple definitions.
13089 (Symbol_table::report_resolve_problem): New function.
13090 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13091
55da9579
DK
130922009-11-03 Doug Kwan <dougkwan@google.com>
13093
13094 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13095 stub_factory_.
13096 (Target_arm::stub_factory): New method definition.
13097 (Target_arm::new_arm_input_section,
13098 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13099 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13100 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13101 New type definitions.
13102 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13103 member declarations.
13104 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13105 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13106 New method definitions.
13107
37a9ac43
ILT
131082009-11-03 Ian Lance Taylor <iant@google.com>
13109
13110 * options.h (class General_options): Add --warn_constructors.
13111
b3d6a3d4
ILT
131122009-11-03 Ian Lance Taylor <iant@google.com>
13113
13114 PR 10893
13115 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13116 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13117
934b01dd
ILT
131182009-11-03 Ian Lance Taylor <iant@google.com>
13119
13120 PR 10895
13121 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13122 --msgid-bugs-address.
13123 (install-pdf): New target.
13124 (install-data_yes): Look up one directory to find mkinstalldirs.
13125
03c1939b
L
131262009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13127
13128 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13129 tree.
13130
ebd95253
DK
131312009-10-30 Doug Kwan <dougkwan@google.com>
13132
13133 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13134
e9bbb538
DK
131352009-10-30 Doug Kwan <dougkwan@google.com>
13136
13137 * arm.cc (Stub_addend_reader): New struct template definition
13138 and partial specializations.
13139 (Stub_addend_reader::operator()): New method definition for a
13140 partially specialized template.
13141
d5b40221
DK
131422009-10-30 Doug Kwan <dougkwan@google.com>
13143
13144 * arm.cc (Arm_relobj::processor_specific_flags): New method
13145 definition.
13146 (Arm_relobj::do_read_symbols): New method declaration.
13147 (Arm_relobj::processor_specific_flags_): New data member declaration.
13148 (Arm_dynobj): New class definition.
13149 (Target_arm::do_finalize_sections): Add input_objects parameter.
13150 (Target_arm::do_adjust_elf_header): New method declaration.
13151 (Target_arm::are_eabi_versions_compatible,
13152 (Target_arm::merge_processor_specific_flags): New method declaration.
13153 (Target_arm::do_make_elf_object): New overloaded method definitions
13154 and declaration.
13155 (Arm_relobj::do_read_symbols): New method definition.
13156 (Arm_dynobj::do_read_symbols): Ditto.
13157 (Target_arm::do_finalize_sections): Add input_objects parameters.
13158 Merge processor-specific flags from all input objects.
13159 (Target_arm::are_eabi_versions_compatible,
13160 Target_arm::merge_processor_specific_flags,
13161 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13162 New method definitions.
13163 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13164 Input_objects pointer type parameter.
13165 * layout.cc (Layout::finalize): Pass input objects to target's.
13166 finalize_sections function.
13167 * output.cc (Output_file_header::do_sized_write): Set ELF file
13168 header's processor-specific flags.
13169 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13170 Input_objects pointer type parameter.
13171 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13172 * target.h (Input_objects): New forward class declaration.
13173 (Target::processor_specific_flags,
13174 Target::are_processor_specific_flags_sect): New method definitions.
13175 (Target::finalize_sections): Add input_objects parameter.
13176 (Target::Target): Initialize processor_specific_flags_ and
13177 are_processor_specific_flags_set_.
13178 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13179 parameter.
13180 (Target::set_processor_specific_flags): New method definition.
13181 (Target::processor_specific_flags_,
13182 Target::are_processor_specific_flags_set_): New data member
13183 declarations.
13184 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13185 Input_objects pointer type parameter.
13186
ebabffbd
DK
131872009-10-30 Doug Kwan <dougkwan@google.com>
13188
13189 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13190
ad0f2072
ILT
131912009-10-28 Ian Lance Taylor <iant@google.com>
13192
13193 * object.h (class Relobj): Drop options parameter from
13194 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13195 do_scan_relocs, do_relocate. Change all callers.
13196 (class Sized_relobj): Drop options parameters from
13197 do_gc_process_relocs, do_scan_relocs, do_relocate,
13198 do_relocate_sections, relocate_sections, emit_relocs_scan,
13199 emit_relocs_scan_reltype. Change all callers.
13200 (struct Relocate_info): Remove options field and all references to
13201 it.
13202 * reloc.h (class Read_relocs): Remove options constructor
13203 parameter and options_ field. Change all callers.
13204 (class Gc_process_relocs, class Scan_relocs): Likewise.
13205 (class Relocate_task): Likewise.
13206 * target-reloc.h (scan_relocs): Remove options parameter. Change
13207 all callers.
13208 (scan_relocatable_relocs): Likewise.
13209 * target.h (class Sized_target): Remove options parameter from
13210 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13211 all callers.
13212 * gc.h (gc_process_relocs): Remove options parameter. Change all
13213 callers.
13214 * arm.cc: Update functions to remove options parameters.
13215 * i386.cc: Likewise.
13216 * powerpc.cc: Likewise.
13217 * sparc.cc: Likewise.
13218 * x86_64.cc: Likewise.
13219 * testsuite/testfile.cc: Likewise.
13220
8ffa3667
DK
132212009-10-28 Doug Kwan <dougkwan@google.com>
13222
13223 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13224 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13225 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13226 New method definitions.
13227
40f36857
CC
132282009-10-28 Cary Coutant <ccoutant@google.com>
13229
13230 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13231 (Plugin::cleanup_done_): New member.
13232 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13233 (Plugin_manager::cleanup_done_): Remove.
13234 (Plugin_manager::add_input_file): Edit error message.
13235 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13236 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13237
2c849493
ILT
132382009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13239
13240 * fileread.cc: (File_read::View::~View): Use the new
13241 data_ownership_ filed.
13242 (File_read::~File_read): Dispose the new whole_file_view_.
13243 (File_read::open): Mmap the whole file if needed.
13244 (File_read::open): Use whole_file_view_ instead of contents_.
13245 (File_read::find_view): Use whole_file_view_ if applicable.
13246 (File_read::do_read): Use whole_file_view_ instead of contents_.
13247 (File_read::make_view): Use whole_file_view_ instead of contents_,
13248 update File_read::View::View call.
13249 (File_read::find_or_make_view): Update File_read::View::View
13250 call.
13251 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13252 remove contents_
13253 (File_read::View::Data_ownership): New enum.
13254 (File_read::View::View): Replace bool mapped_ with Data_ownership
13255 argument.
13256 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13257 (File_read::View::data_ownership_): New field.
13258 (File_read::contents_): Remove (replaced by whole_file_view_).
13259 (File_read::whole_file_view_): New field.
13260 * options.h (class General_options): Add --keep-files-mapped.
13261
24998053
CC
132622009-10-27 Cary Coutant <ccoutant@google.com>
13263
13264 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13265 * testsuite/Makefile.am (plugin_test_5): New test case.
13266 * testsuite/Makefile.in: Regenerate.
13267
72adc4fa
DK
132682009-10-25 Doug Kwan <dougkwan@google.com>
13269
13270 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13271 from private to protected to allow access by child class.
13272 (Sized_relobj::do_relocate_sections): New method declaration.
13273 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13274 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13275 Sized_relobj::relocate_sections. Instantiate template explicitly
13276 for different target sizes and endianity.
13277
07f508a2
DK
132782009-10-24 Doug Kwan <dougkwan@google.com>
13279
13280 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13281 (Arm_input_section::as_arm_input_section): New method.
13282 (Arm_output_section): New class definition.
13283 (Arm_output_section::create_stub_group,
13284 Arm_output_section::group_sections): New method definitions.
13285
10ad9fe5
DK
132862009-10-22 Doug Kwan <dougkwan@google.com>
13287
13288 * arm.cc (Arm_input_section): New class definition.
13289 (Arm_input_section::init, Arm_input_section:do_write,
13290 Arm_input_section::set_final_data_size,
13291 Arm_input_section::do_reset_address_and_file_offset): New method
13292 definitions.
13293
56ee5e00
DK
132942009-10-21 Doug Kwan <dougkwan@google.com>
13295
13296 * arm.cc (Stub_table, Arm_input_section): New forward class
13297 declarations.
13298 (Stub_table): New class defintion.
13299 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13300 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13301 New method definition.
13302
b569affa
DK
133032009-10-21 Doug Kwan <dougkwan@google.com>
13304
13305 * arm.cc: Update copyright comments.
13306 (Target_arm): New forward class template declaration.
13307 (Arm_address): New type.
13308 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13309 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13310 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13311 constants.
13312 (Insn_template): Same.
13313 (DEF_STUBS): New macro.
13314 (Stub_type): New enum type.
13315 (Stub_template): New class definition.
13316 (Stub): Same.
13317 (Reloc_stub): Same.
13318 (Stub_factory): Same.
13319 (Target_arm::Target_arm): Initialize may_use_blx_ and
13320 should_force_pic_veneer_.
13321 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13322 Target_arm::should_force_pic_veneer,
13323 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13324 Target_arm::using_thumb_only, Target_arm:;default_target): New
13325 method defintions.
13326 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13327 New data member declarations.
13328 (Insn_template::size, Insn_template::alignment): New method defintions.
13329 (Stub_template::Stub_template): New method definition.
13330 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13331 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13332 (Stub_factory::Stub_factory): New method definition.
13333 * gold.h (string_hash): New template.
13334 * output.h (Input_section_specifier::hash_value): Use
13335 gold::string_hash.
13336 (Input_section_specifier::string_hash): Remove.
13337 * stringpool.cc (Stringpool_template::string_hash): Use
13338 gold::string_hash.
13339
6c172549
DK
133402009-10-20 Doug Kwan <dougkwan@google.com>
13341
13342 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13343 symbols of relaxed input sections.
13344 * output.h (Output_section::find_relaxed_input_section): Make
13345 method public.
13346
c5617f2f
DK
133472009-10-16 Doug Kwan <dougkwan@google.com>
13348
13349 * dynobj.cc (Versions::Versions): Initialize version_script_.
13350 Only insert base version symbol definition for a shared object
13351 if version script defines any version versions.
13352 (Versions::define_base_version): New method definition.
13353 (Versions::add_def): Check that base version is not needed.
13354 (Versions::add_need): Define base version lazily.
13355 * dynobj.h (Versions::define_base_version): New method declaration.
13356 (Versions::needs_base_version_): New data member declaration.
13357 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13358 (check_DATA): Add no_version_test.stdout.
13359 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13360 New make rules.
13361 * testsuite/Makefile.in: Regenerate.
13362 * testsuite/no_version_test.c: New file.
13363 * testsuite/no_version_test.sh: Ditto.
13364
3c12dcdb
DK
133652009-10-16 Doug Kwan <dougkwan@google.com>
13366
13367 * expression.cc (class Segment_start_expression): New class definition.
13368 (Segment_start_expression::value): New method definition.
13369 (script_exp_function_segment_start): Return a new
13370 Segment_start_expression.
13371 * gold/script-c.h (script_saw_segment_start_expression): New function
13372 prototype.
13373 * script-sections.cc (Script_sections::Script_sections): Initialize
13374 SAW_SEGMENT_START_EXPRESSION_ to false.
13375 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13376 and -Tbbs options to specify section addresses if given in
13377 command line and no SEGMENT_START expression is seen in a script.
13378 * script-sections.h (Script_sections::saw_segment_start_expression,
13379 Script_sections::set_saw_segment_start_expression): New method
13380 definition.
13381 (Script_sections::saw_segment_start_expression_): New data member
13382 declaration.
13383 * script.cc (script_saw_segment_start_expression): New function.
13384 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13385 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13386 script_test_7.sh and script_test_8.sh.
13387 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13388 script_test_8.stdout.
13389 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13390 (script_test_6, script_test_6.stdout, script_test_7,
13391 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13392 * Makefile.in: Regenerate.
13393 * testsuite/script_test_6.sh: New file.
13394 * testsuite/script_test_6.t: Same.
13395 * testsuite/script_test_7.sh: Same.
13396 * testsuite/script_test_7.t: Same.
13397 * testsuite/script_test_8.sh: Same.
13398
64b1ae37
DK
133992009-10-16 Doug Kwan <dougkwan@google.com>
13400
13401 * output.cc (Output_segment::set_section_list_address): Cast
13402 expressions to unsigned long long type to avoid format warnings.
13403
661be1e2
ILT
134042009-10-15 Ian Lance Taylor <iant@google.com>
13405
12edd763 13406 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13407 dot assignment to script_sections_.
12edd763
ILT
13408 * script-sections.cc (Script_sections::add_dot_assignment):
13409 Initialize if necessary.
13410
68b6574b
ILT
13411 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13412 program headers with no load segment if there is a linker script.
13413
661be1e2
ILT
13414 * layout.cc (Layout::set_segment_offsets): Align the file offset
13415 to the segment aligment for -N or -n with no load segment.
13416 * output.cc (Output_segment::add_output_section): Don't crash if
13417 the first section is a TLS section.
13418 (Output_segment::set_section_list_addresses): Print an error
13419 message if the address moves backward in a linker script.
13420 * script-sections.cc
13421 (Output_section_element_input::set_section_addresses): Don't
13422 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13423 (Orphan_output_section::set_section_addresses): Likewise.
13424
f15f61a7
DK
134252009-10-15 Doug Kwan <dougkwan@google.com>
13426
13427 * layout.cc (Layout::finish_dynamic_section): Generate tags
13428 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13429 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13430 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13431
82bb573a
ILT
134322009-10-14 Ian Lance Taylor <iant@google.com>
13433
13434 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13435 fields.
13436 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13437 data_shdr fields of relinfo.
13438 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13439 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13440 R_386_TLS_LDO_32, adjust based on section flags.
13441 (Target_i386::Relocate::fix_up_ldo): Remove.
13442
374ad285
ILT
134432009-10-13 Ian Lance Taylor <iant@google.com>
13444
13445 Add support for -pie.
13446 * options.h (class General_options): Add -pie and
13447 --pic-executable.
13448 (General_options::output_is_position_independent): Test -pie.
13449 (General_options::output_is_executable): Return true if not shared
13450 and not relocatable.
13451 (General_options::output_is_pie): Remove.
13452 * options.cc (General_options::finalize): Reject incompatible uses
13453 of -pie.
13454 * gold.cc (queue_middle_tasks): A -pie link is not static.
13455 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13456 * symtab.cc (Symbol::final_value_is_known): Return false if
13457 output_is_position_independent.
13458 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13459 output_is_position_independent.
13460 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13461 output_is_position_independent.
13462 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13463 output_is_position_independent.
13464 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13465 two_file_pie_test.
13466 (basic_pie_test.o, basic_pie_test): New targets.
13467 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13468 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13469 (two_file_pie_test): New target.
13470 * testsuite/Makefile.in: Rebuild.
13471 * README: Remove note saying that -pie is not supported.
13472
c6585162
ILT
134732009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13474
13475 * options.h (class General_options): Add -init and -fini.
13476 * layout.cc (Layout::finish_dynamic_section): Emit
13477 given init and fini functions.
13478
032ce4e9
ST
134792009-10-13 Sriraman Tallam <tmsriram@google.com>
13480
13481 * gc.h (gc_process_relocs): Check if icf is enabled using new
13482 function.
13483 * gold.cc (queue_initial_tasks): Likewise.
13484 (queue_middle_tasks): Likewise.
13485 * object.cc (do_layout): Likewise.
13486 * symtab.cc (is_section_folded): Likewise.
13487 * main.cc (main): Likewise.
13488 * reloc.cc (Read_relocs::run): Likewise.
13489 (Sized_relobj::do_scan_relocs): Likewise.
13490 * icf.cc (is_function_ctor_or_dtor): New function.
13491 (Icf::find_identical_sections): Check if function is ctor or dtor when
13492 safe icf is chosen.
13493 * options.h (General_options::icf): Change option to be an enum.
13494 (Icf_status): New enum.
13495 (icf_enabled): New method.
13496 (icf_safe_folding): New method.
13497 (set_icf_status): New method.
13498 (icf_status_): New variable.
13499 * (options.cc) (General_options::finalize): Set icf_status_.
13500 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13501 icf_test and icf_keep_unique_test to use the --icf enum flag.
13502 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13503 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13504
f345227a
ST
135052009-10-12 Sriraman Tallam <tmsriram@google.com>
13506
13507 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13508 includes to gc.h and icf.h.
13509 * arm.cc: Include gc.h.
13510 * gold.cc: Likewise.
13511 * i386.cc: Likewise.
13512 * powerpc.cc: Likewise.
13513 * sparc.cc: Likewise.
13514 * x86_64.cc: Likewise.
13515 * gc.h: Include icf.h.
13516
1c7814ed
ILT
135172009-10-11 Ian Lance Taylor <iant@google.com>
13518
13519 * plugin.cc: Include "gold.h" before other header files.
13520
ae3b5189
CD
135212009-10-10 Chris Demetriou <cgd@google.com>
13522
13523 * options.h (Input_file_argument::Input_file_type): New enum.
13524 (Input_file_argument::is_lib_): Replace with...
13525 (Input_file_argument::type_): New member.
13526 (Input_file_argument::Input_file_argument): Take Input_file_type
13527 'type' rather than boolean 'is_lib' as second argument.
13528 (Input_file_argument::is_lib): Use type_.
13529 (Input_file_argument::is_searched_file): New function.
13530 (Input_file_argument::may_need_search): Handle is_searched_file.
13531 * options.cc (General_options::parse_library): Support -l:filename.
13532 (General_options::parse_just_symbols): Update for Input_file_argument
13533 changes.
13534 (Command_line::process): Likewise.
13535 * archive.cc (Archive::get_file_and_offset): Likewise.
13536 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13537 * script.cc (read_script_file, script_add_file): Likewise.
13538 * fileread.cc (Input_file::Input_file): Likewise.
13539 (Input_file::will_search_for): Handle is_searched_file.
13540 (Input_file::open): Likewise.
13541 * readsyms.cc (Read_symbols::get_name): Likewise.
13542 * testsuite/Makefile.am (searched_file_test): New test.
13543 * testsuite/Makefile.in: Regenerate.
13544 * testsuite/searched_file_test.cc: New file.
13545 * testsuite/searched_file_test_lib.cc: New file.
13546
f3048a1d
ILT
135472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13548 Ian Lance Taylor <iant@google.com>
13549
13550 * descriptor.cc: Include <cstdio> and "binary-io.h".
13551 (Descriptors::open): Open the files in binary mode always.
13552 * script.cc (Lex::get_token): Treat \r as whitespace.
13553
d4780e57
ILT
135542009-10-09 Ian Lance Taylor <iant@google.com>
13555
13556 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13557
d9a893b8
ILT
135582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13559 Ian Lance Taylor <iant@google.com>
13560
13561 * configure.ac: Check for readv function also.
13562 * fileread.cc (readv): Define if not HAVE_READV.
13563 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13564 does not exist.
13565 * config.in: Regenerate.
13566 * configure: Regenerate.
13567
c0a62865
DK
135682009-10-09 Doug Kwan <dougkwan@google.com>
13569
13570 * layout.cc (Layout::make_output_section): Call target hook to make
13571 ordinary output section.
13572 (Layout::finalize): Adjust parameter list of call the
13573 Target::may_relax().
13574 * layout.h (class Layout::section_list): New method.
13575 * merge.h (Output_merge_base::entsize): Change visibility to public.
13576 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13577 New methods.
13578 (Output_merge_string::do_is_string): New method.
13579 * object.cc (Sized_relobj::do_setup): renamed from
13580 Sized_relobj::set_up.
13581 * object.h (Sized_relobj::adjust_shndx,
13582 Sized_relobj::initializ_input_to_output_maps,
13583 Sized_relobj::free_input_to_output_maps): Change visibilities to
13584 protected.
13585 (Sized_relobj::setup): Virtualize.
13586 (Sized_relobj::do_setup): New method declaration.
13587 (Sized_relobj::invalidate_section_offset,
13588 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13589 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13590 * options.cc (parse_int): New function.
13591 * options.h (parse_int): New declaration.
13592 (DEFINE_int): New macro.
13593 (stub_group_size): New option.
13594 * output.cc (Output_section::Output_section): Initialize memebers
13595 merge_section_map_, merge_section_by_properties_map_,
13596 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13597 (Output_section::add_input_section): Handled deferred code-fill
13598 generation and remove an old comment.
13599 (Output_section::add_relaxed_input_section): New method definition.
13600 (Output_section::add_merge_input_section): Use merge section by
13601 properties map to speed to search. Update merge section maps
13602 as appropriate.
13603 (Output_section::build_relaxation_map): New method definition.
13604 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13605 Same.
13606 (Output_section::relax_input_section): Renamed to
13607 Output_section::convert_input_sections_to_relaxed_sections and change
13608 interface to take a vector of pointers to relaxed sections.
13609 (Output_section::find_merge_section,
13610 Output_section::find_relaxed_input_section): New method definitions.
13611 (Output_section::is_input_address_mapped,
13612 Output_section::output_offset, Output_section::output_address):
13613 Use output section data maps to speed up searching.
13614 (Output_section::find_starting_output_address): Add comments.
13615 (Output_section::do_write,
13616 Output_section::write_to_postprocessing_buffer): Do code-fill
13617 generation as appropriate.
13618 (Output_section::get_input_sections): Invalidate relaxed input section
13619 map.
13620 (Output_section::restore_states): Adjust type of checkpoint .
13621 Invalidate relaxed input section map.
13622 * output.h (Output_merge_base): New class declaration.
13623 (Input_section_specifier): New class defintion.
13624 (class Output_relaxed_input_section) Change base class to
13625 Output_section_data_build.
13626 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13627 base class initializer.
13628 (Output_section::add_relaxed_input_section): New method declaration.
13629 (Output_section::Input_section): Change visibility to protected.
2e702c99 13630 (Output_section::Input_section::relobj,
c0a62865
DK
13631 Output_section::Input_section::shndx): Handle relaxed input sections.
13632 Output_section::input_sections) Change visibility to protected. Also
13633 define overload to return a non-const pointer.
13634 (Output_section::Merge_section_properties): New class defintion.
13635 (Output_section::Merge_section_by_properties_map,
13636 Output_section::Output_section_data_by_input_section_map,
13637 Output_section::Relaxation_map): New types.
13638 (Output_section::relax_input_section): Rename method to
13639 Output_section::convert_input_sections_to_relaxed_sections and change
13640 interface to take a vector of relaxed section pointers.
13641 (Output_section::find_merge_section,
13642 Output_section::find_relaxed_input_section,
13643 Output_section::build_relaxation_map,
13644 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13645 New method declarations.
13646 (Output_section::merge_section_map_
13647 Output_section::merge_section_by_properties_map_,
13648 Output_section::relaxed_input_section_map_,
13649 Output_section::is_relaxed_input_section_map_valid_,
13650 Output_section::generate_code_fills_at_write_): New data members.
13651 * script-sections.cc
13652 (Output_section_element_input::set_section_addresses): Call
13653 current_data_size and addralign methods of relaxed input sections.
13654 (Orphan_output_section::set_section_addresses): Call current_data_size
13655 and addralign methods of relaxed input sections.
13656 * symtab.cc (Symbol_table::compute_final_value): Extract template
13657 from the body of Symbol_table::sized_finalize_symbol.
13658 (Symbol_table::sized_finalized_symbol): Call
13659 Symbol_table::compute_final_value.
13660 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13661 (Symbol_table::compute_final_value): New templated method declaration.
13662 * target.cc (Target::do_make_output_section): New method defintion.
13663 * target.h (Target::make_output_section): New method declaration.
13664 (Target::relax): Add more parameters for input objects, symbol table
13665 and layout. Adjust call to do_relax.
13666 (Target::do_make_output_section): New method declaration.
13667 (Target::do_relax): Add parameters for input objects, symbol table
13668 and layout.
13669
d446d6c4
ILT
136702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13671
13672 * pread.c: Include stdio.h.
13673
bc06c745
ILT
136742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13675
13676 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13677 defined.
13678
75aea3d0
ILT
136792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13680
13681 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13682 Change read_shndx type to unsigned int.
13683 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13684 int.
13685 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13686 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13687 Change read_shndx type to unsigned int.
13688 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13689 int.
13690 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13691 * layout.cc (Layout::create_symtab_sections): Cast the result of
13692 local_symcount * symsize to off_t in the gold_assert.
13693
be8fcb75
ILT
136942009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13695
13696 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13697 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13698 R_ARM_BASE_ABS.
13699 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13700 (Arm_relocate_functions::thm_abs5): New function.
13701 (Arm_relocate_functions::abs12): New function.
13702 (Arm_relocate_functions::abs16): New function.
13703 (Arm_relocate_functions::base_abs): New function.
13704 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13705 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13706 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13707 R_ARM_BASE_ABS.
13708 (Scan::global): Likewise.
13709 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13710 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13711 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13712 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13713 R_ARM_BASE_ABS.
13714
c2a122b6
ILT
137152009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13716
13717 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13718 (Arm_relocate_functions::movt_prel): New function.
13719 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13720 (Arm_relocate_functions::thm_movt_prel): New function.
13721 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13722 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13723 (Scan::global, Relocate::relocate): Likewise.
13724 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13725
c4aa1e2d
ILT
137262009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13727
13728 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13729 Incremental_checker.
13730 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13731 unsigned int.
13732 (class Incremental_inputs_header): New class.
13733 (Incremental_inputs_header_writer): Edit comment.
13734 (Incremental_inputs_entry): New class.
13735 (Incremental_inputs_entry_writer): Edit comment.
13736 (Sized_incremental_binary::do_find_incremental_inputs_section):
13737 Add *strtab_shndx parameter, fill it.
13738 (Sized_incremental_binary::do_check_inputs): New method.
13739 (Incremental_checker::can_incrementally_link_output_file): Use
13740 Sized_incremental_binary::check_inputs.
13741 (Incremental_inputs::report_command_line): Save command line in
13742 command_line_.
13743 * incremental.h:
13744 (Incremental_binary::find_incremental_inputs_section): New
13745 method.
13746 (Incremental_binary::do_find_incremental_inputs_section): Add
13747 strtab_shndx parameter.
13748 (Incremental_binary::do_check_inputs): New pure virtual method.
13749 (Sized_incremental_binary::do_check_inputs): Declare.
13750 (Incremental_checker::Incremental_checker): Add incremental_inputs
13751 parameter, use it to initialize incremental_inputs_.
13752 (Incremental_checker::incremental_inputs_): New field.
13753 (Incremental_checker::command_line): New method.
13754 (Incremental_checker::inputs): New method.
13755 (Incremental_checker::command_line_): New field.
13756
c549a694
ILT
137572009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13758
13759 * incremental.cc: Include <cstdarg> and "target-select.h".
13760 (vexplain_no_incremental): New function.
13761 (explain_no_incremental): New function.
13762 (Incremental_binary::error): New method.
13763 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13764 method.
13765 (make_sized_incremental_binary): New function.
13766 (open_incremental_binary): New function.
13767 (can_incrementally_link_file): Add checks if output is ELF and has
13768 inputs section.
13769 * incremental.h: Include "elfcpp_file.h" and "output.h".
13770 (Incremental_binary): New class.
13771 (Sized_incremental_binary): New class.
13772 (open_incremental_binary): Declare.
13773 * object.cc (is_elf_object): Use
13774 elfcpp::Elf_recognizer::is_elf_file.
13775 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13776 * output.h (Output_file::filesize): New method.
13777
fd3c5f0b
ILT
137782009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13779
13780 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13781 New function.
13782 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13783 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13784 function.
13785 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13786 function.
13787 (Arm_relocate_functions::movw_abs_nc): New function.
13788 (Arm_relocate_functions::movt_abs): New function.
13789 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13790 (Arm_relocate_functions::thm_movt_abs): New function.
13791 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13792 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13793 (Scan::global): Likewise.
13794 (Relocate::relocate): Likewise.
13795 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13796
7f5309a5
ILT
137972009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13798
13799 * arm.cc (Arm_relocate_functions::got_prel) New function.
13800 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13801 (Relocate::relocate): Likewise.
13802 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13803
364c7fa5
ILT
138042009-10-06 Ian Lance Taylor <iant@google.com>
13805
13806 * options.h (class General_options): Define
13807 split_stack_adjust_size parameter.
13808 * object.h (class Object): Add uses_split_stack_ and
13809 has_no_split_stack_ fields. Add uses_split_stack and
13810 has_no_split_stack accessor functions. Declare
13811 handle_split_stack_section.
13812 (class Reloc_symbol_changes): Define.
13813 (class Sized_relobj): Define Function_offsets. Declare
13814 split_stack_adjust, split_stack_adjust_reltype, and
13815 find_functions.
13816 * object.cc (Object::handle_split_stack_section): New function.
13817 (Sized_relobj::do_layout): Call handle_split_stack_section.
13818 * dynobj.cc (Sized_dynobj::do_layout): Call
13819 handle_split_stack_section.
13820 * reloc.cc (Sized_relobj::relocate_sections): Call
13821 split_stack_adjust for executable sections in split_stack
13822 objects. Pass reloc_map to relocate_section.
13823 (Sized_relobj::split_stack_adjust): New function.
13824 (Sized_relobj::split_stack_adjust_reltype): New function.
13825 (Sized_relobj::find_functions): New function.
13826 * target-reloc.h: Include "object.h".
13827 (relocate_section): Add reloc_symbol_changes parameter. Change
13828 all callers.
13829 * target.h (class Target): Add calls_non_split method. Declare
13830 do_calls_non_split virtual method. Declare match_view and
13831 set_view_to_nop.
13832 * target.cc: Include "elfcpp.h".
13833 (Target::do_calls_non_split): New function.
13834 (Target::match_view): New function.
13835 (Target::set_view_to_nop): New function.
13836 * gold.cc (queue_middle_tasks): Give an error if mixing
13837 split-stack and non-split-stack objects with -r.
13838 * i386.cc (Target_i386::relocate_section): Add
13839 reloc_symbol_changes parameter.
13840 (Target_i386::do_calls_non_split): New function.
13841 * x86_64.cc (Target_x86_64::relocate_section): Add
13842 reloc_symbol_changes parameter.
13843 (Target_x86_64::do_calls_non_split): New function.
13844 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13845 parameter.
13846 * powerpc.cc (Target_powerpc::relocate_section): Add
13847 reloc_symbol_changes parameter.
13848 * sparc.cc (Target_sparc::relocate_section): Add
13849 reloc_symbol_changes parameter.
13850 * configure.ac: Call AM_CONDITIONAL for the default target.
13851 * configure: Rebuild.
13852 * testsuite/Makefile.am (TEST_AS): New variable.
13853 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13854 (check_DATA): Add split_i386 and split_x86_64 files.
13855 (SPLIT_DEFSYMS): Define.
13856 (split_i386_[1234n].o): New targets.
13857 (split_i386_[124]): New targets.
13858 (split_i386_[1234r].stdout): New targets.
13859 (split_x86_64_[1234n].o): New targets.
13860 (split_x86_64_[124]): New targets.
13861 (split_x86_64_[1234r].stdout): New targets.
13862 (MOSTLYCLEANFILES): Add new executables.
13863 * testsuite/split_i386.sh: New file.
13864 * testsuite/split_x86_64.sh: New file.
13865 * testsuite/split_i386_1.s: New file.
13866 * testsuite/split_i386_2.s: New file.
13867 * testsuite/split_i386_3.s: New file.
13868 * testsuite/split_i386_4.s: New file.
13869 * testsuite/split_i386_n.s: New file.
13870 * testsuite/split_x86_64_1.s: New file.
13871 * testsuite/split_x86_64_2.s: New file.
13872 * testsuite/split_x86_64_3.s: New file.
13873 * testsuite/split_x86_64_4.s: New file.
13874 * testsuite/split_x86_64_n.s: New file.
13875 * testsuite/testfile.cc (Target_test): Update relocation_section
13876 function.
13877 * testsuite/Makefile.in: Rebuild.
13878
e8a9fcda
ILT
138792009-10-06 Ian Lance Taylor <iant@google.com>
13880
13881 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13882 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13883 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13884 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13885 the address on ldo_addrs_.
13886 (Target_i386::Relocate::fix_up_ldo): New function.
13887
e99daf92
ILT
138882009-10-06 Rafael Espindola <espindola@google.com>
13889
13890 * plugin.cc (add_input_library): New.
13891 (Plugin::load): Add add_input_library to tv.
13892 (Plugin_manager::add_input_file): Add the is_lib argument.
13893 (add_input_file): Update call to Plugin_manager::add_input_file.
13894 (add_input_library): New.
13895 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13896
966d4097
DK
138972009-09-30 Doug Kwan <dougkwan@google.com>
13898
13899 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13900 symbol and call Symbol::may_need_copy_reloc to determine if
13901 a copy reloc is needed.
13902 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13903 nocopyreloc is given in command line.
13904 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13905 given in command line.
13906 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13907 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13908 of the removed Target_i386::may_need_copy_reloc.
13909 * options.h (copyreloc): New option with default value false.
13910 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13911 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13912 instead of the removed Target_powerpc::may_need_copy_reloc.
13913 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13914 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13915 instead of the removed Target_sparc::may_need_copy_reloc.
13916 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13917 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13918 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13919 instead of the removed Target_x86_64::may_need_copy_reloc.
13920
029ba973
ILT
139212009-09-30 Ian Lance Taylor <iant@google.com>
13922
13923 * object.h (class Object): Remove target_ field, and target,
13924 sized_target, and set_target methods.
13925 (Object::sized_target): Remove.
13926 (class Sized_relobj): Update declarations. Remove sized_target.
13927 * object.cc (Sized_relobj::setup): Remove target parameter.
13928 Change all callers.
13929 (Input_objects::add_object): Don't do anything with the target.
13930 (make_elf_sized_object): Add punconfigured parameter. Change all
13931 callers. Set or test parameter target.
13932 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13933 Change all callers.
13934 * parameters.cc (Parameters::set_target): Change parameter type to
13935 be non-const.
13936 (Parameters::default_target): Remove.
13937 (set_parameters_target): Change parameter type to be non-const.
13938 (parameters_force_valid_target): New function.
13939 (parameters_clear_target): New function.
13940 * parameters.h (class Parameters): Update declarations. Remove
13941 default_target method. Add sized_target and clear_target
13942 methods. Change target_ to be non-const.
13943 (set_parameters_target): Update declaration.
13944 (parameters_force_valid_target): Declare.
13945 (parameters_clear_target): Declare.
13946 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13947 as NULL if we aren't searching.
13948 (Add_symbols::run): Don't check for compatible target.
13949 * fileread.cc (Input_file::open_binary): Call
13950 parameters_force_valid_target.
13951 * gold.cc (queue_middle_tasks): Likewise.
13952 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13953 set_target on object.
13954 * dynobj.h (class Sized_dynobj): Update declarations.
13955 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13956 make_elf_object returns NULL.
13957 (Archive::include_member): Don't check whether object target is
13958 compatible.
13959 * output.cc (Output_section::add_input_section): Get target from
13960 parameters.
13961 (Output_section::relax_input_section): Likewise.
13962 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13963 parameters.
13964 (Sized_relobj::do_scan_relocs): Likewise.
13965 (Sized_relobj::relocate_sections): Likewise.
13966 * resolve.cc (Symbol_table::resolve): Likewise.
13967 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13968 parameter. Change all callers.
13969 (Symbol_table::add_from_object): Get target from parameters.
13970 (Symbol_table::add_from_relobj): Don't check object target.
13971 (Symbol_table::add_from_dynobj): Likewise.
13972 (Symbol_table::define_special_symbol): Get target from
13973 parameters.
13974 * symtab.h (class Symbol_table): Update declaration.
13975 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13976 parameter. Change all callers. Clear parameter target.
13977 (Binary_test): Test target here.
13978 * testsuite/object_unittest.cc (gold_testsuite): Remove
13979 target_test_pointer parameter. Change all callers.
13980 (Object_test): Test target here.
13981
a6a22b83
ILT
139822009-09-26 Ian Lance Taylor <iant@google.com>
13983
13984 * testsuite/initpri1.c: Don't try to use constructor priorities if
13985 compiling with gcc before 4.3.
13986
6a8f49fe
ILT
139872009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13988
13989 * testsuite/retain_symbols_file_test.sh (check_present): Change
13990 output file name to retain_symbols_file_test.stdout.
13991 (check_absent): Likewise.
13992
8c604651
CS
139932009-09-18 Craig Silverstein <csilvers@google.com>
13994
13995 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13996 * options.cc: Include <cerrno> and <fstream>.
13997 (General_options::finalize): Parse -retain-symbols-file tag.
13998 * options.h: New flag.
13999 (General_options): New method should_retain_symbol, new
14000 variable symbols_to_retain.
14001 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14002 should_retain_symbol map.
14003 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14004 * testsuite/Makefile.in: Regenerate.
14005 * testsuite/retain_symbols_file_test.sh: New file.
14006
ca58b19f
NC
140072009-09-18 Nick Clifton <nickc@redhat.com>
14008
14009 * po/es.po: Updated Spanish translation.
14010
20e6d0d6
DK
140112009-09-17 Doug Kwan <dougkwan@google.com>
14012
14013 * debug.h (DEBUG_RELAXATION): New constant.
14014 (DEBUG_ALL): Add DEBUG_RELAXATION.
14015 (debug_string_to_enum): Add relaxation debug option.
14016 * layout.cc
14017 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14018 Layout::Relaxation_debug_check::read_sections,
14019 Layout::Relaxation_debug_check::read_sections): New method definitions.
14020 (Layout::Layout): Initialize data members
14021 record_output_section_data_from_scrips_,
14022 script_output_section_data_list_ and relaxation_debug_check_.
14023 (Layout::save_segments, Layout::restore_segments,
14024 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14025 Layout::relaxation_loop_body): New method definitions.
14026 (Layout::finalize): Support relaxation. Move section layout code to
14027 Layout::relaxation_loop_body.
14028 (Layout::set_asection_address_from_script): Move code for orphan
14029 section placement out.
14030 (Layout::place_orphan_sections_in_script): New method definition.
14031 * layout.h (Output_segment_headers, Output_file_header):
14032 New forward class declarations.
14033 (Layout::~Layout): Define.
14034 (Layout::new_output_section_data_from_script): New method definition.
14035 (Layout::place_orphan_sections_in_script): New method declaration.
14036 (Layout::Segment_states): New type declaration.
14037 (Layout::save_segments, Layout::restore_segments,
14038 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14039 Layout::relaxation_loop_body): New method declarations.
14040 (Layout::Output_section_data_list): New type declaration.
14041 (Layout::Relaxation_debug_check): New class definition.
14042 (Layout::record_output_section_data_from_script_,
14043 Layout::script_output_section_data_list_, Layout::segment_states_,
14044 Layout::relaxation_debug_check_): New data members.
14045 * output.cc: (Output_section_headers::do_size): New method definition.
14046 (Output_section_headers::Output_section_headers): Move size
14047 computation to Output_section_headers::do_size.
14048 (Output_segment_headers::do_size): New method definition.
e1df38aa 14049 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14050 Output_file_header::do_size and call it.
14051 (Output_file_header::do_size): New method definition.
14052 (Output_data_group::Output_data_group): Adjust call to
14053 Output_section_data.
14054 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14055 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14056 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14057 RELAXED_INPUT_SECTION_CODE.
14058 (Output_section::Output_section): Initialize data member checkpoint_.
14059 (Output_section::~Output_section): Delete checkpoint object pointed
14060 by checkpoint_.
14061 (Output_section::add_input_section): Always add an Input_section if
14062 relaxing.
14063 (Output_section::add_merge_input_section): Add assert.
14064 (Output_section::relax_input_section): New method definition.
14065 (Output_section::set_final_data_size): Set load address to zero for
14066 an unallocated section.
14067 (Output_section::do_address_and_file_offset_have_reset_values):
14068 New method definition.
14069 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14070 Handle relaxed input section.
14071 (Output_section::sort_attached_input_sections): Checkpoint input
14072 section list lazily.
14073 (Output_section::get_input_sections): Change type of input_sections to
14074 list of Simple_input_section pointers. Checkpoint input section list
14075 lazily. Also handle relaxed input sections.
14076 (Output_section::add_input_section_for_script): Take a reference to
14077 a Simple_input_section object instead of Relobj pointer and section
14078 index as parameter. Handle relaxed input sections.
14079 (Output_section::save_states, Output_section::restore_states): New
14080 method definitions.
14081 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14082 (Output_data::is_data_size_fixed): New method definition.
14083 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14084 if it is fixed.
14085 (Output_data::address_and_file_offset_have_reset_values): New method
14086 definition.
14087 (Output_data::do_address_and_file_offset_have_reset_values): New method
14088 definition.
14089 (Output_data::set_data_size): Check that data size is not fixed.
14090 (Output_data::fix_data_size): New method definition.
14091 (Output_data::is_data_size_fixed_): New data member.
14092 (Output_section_headers::set_final_data_size): New method definition.
14093 (Output_section_headers::do_size): New method declaration.
14094 (Output_segment_headers::set_final_data_size): New method definition.
14095 (Output_segment_headers::do_size): New method declaration.
14096 (Output_file_header::set_final_data_size)::New method definition.
14097 (Output_file_header::do_size)::New method declaration.
14098 (Output_section_data::Output_section_data): Add new parameter
14099 is_data_size_fixed and use it to fix data size.
14100 (Output_data_const::Output_data_const): Adjust call to base class
14101 constructor and fix data size.
14102 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14103 base class constructor and fix data size.
14104 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14105 base class constructor and fix data size.
14106 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14107 class constructor and fix data size.
14108 (Output_data_group::set_final_data_size): New method definition.
14109 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14110 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14111 class constructor and fix data size.
14112 (Output_relaxed_input_section): New class definition.
14113 (Output_section::Simple_input_section): New class definition.
14114 (Output_section::get_input_sections): Adjust parameter list.
14115 (Output_section::add_input_section_for_script): Same.
14116 (Output_section::save_states, Output_section::restore_states,
14117 Output_section::do_address_and_file_offset_have_reset_values,
14118 (Output_section::Input_section::Input_section): Handle
14119 RELAXED_INPUT_SECTION_CODE. Add new overload for
14120 Output_relaxed_input_section.
14121 (Output_section::Input_section::is_input_section,
14122 Output_section::Input_section::set_output_section): Handle relaxed
14123 input section.
14124 (Output_section::Input_section::is_relaxed_input_section,
14125 Output_section::Input_section::output_section_data,
14126 Output_section::Input_section::relaxed_input_section): New method
14127 definitions.
14128 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14129 value.
14130 (Output_section::Input_section::u1_): Update comments.
14131 (Output_section::Input_section::u2_): Add new union member poris.
14132 (Output_section::Checkpoint_output_section): New classs definition.
14133 (Output_section::relax_input_section): New method declaration.
14134 (Output_section::checkpoint_): New data member.
14135 (Output_segment): Update comments.
14136 (Output_segment::Output_segment): Un-privatize copy constructor.
14137 (Output_segment::operator=): Un-privatize.
14138 * script-sections.cc (Output_section_element::Input_section_list):
14139 Change element type to Output_section::Simple_input_section.
14140 (Output_section_element_dot_assignment::set_section_addresses):
14141 Register output section data for relaxation clean up.
14142 (Output_data_exression::Output_data_expression): Adjust call to base
14143 constructor to fix data size.
14144 (Output_section_element_data::set_section_addresses): Register
14145 Output_data_expression object for relaxation clean up.
14146 (struct Input_section_info): Replace Relobj pointer and section index
14147 pair with Output_section::Simple_input_section and Convert struct to a
14148 class.
14149 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14150 Input_section_info data member to use accessors.
20e6d0d6
DK
14151 (Output_section_element_input::set_section_addresses): Use layout
14152 parameter. Adjust code to use Output_section::Simple_input_section
14153 and Input_secction_info classes. Register filler for relaxation
14154 clean up.
14155 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14156 and section index pair with Output_section::Simple_input_section
14157 class. Adjust code accordingly.
14158 (Phdrs_element::release_segment): New method definition.
14159 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14160 segment list.
14161 (Script_sections::release_segments): New method definition.
14162 * gold/script-sections.h (Script_sections::release_segments): New
14163 method declaration.
14164 * gold/target.h (Target::may_relax, Target::relax,
14165 Target::do_may_relax, Target::do_relax): New method definitions.
14166
5e445df6
ILT
141672009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14168
14169 * arm.cc (has_signed_unsigned_overflow): New function.
14170 (Arm_relocate_functions::abs8): New function.
14171 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14172 (Target_arm::Scan::global): Likewise.
14173 (Target_arm::relocate::relocate): Likewise.
14174 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14175 Likewise.
14176
8c604651 141772009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14178
14179 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14180 * testsuite/Makefile.in: Regenerate.
14181
1e9cc1c2
NC
141822009-09-11 Nick Clifton <nickc@redhat.com>
14183
14184 * po/gold.pot: Updated by the Translation project.
14185
6a89f575
CC
141862009-09-08 Cary Coutant <ccoutant@google.com>
14187
14188 * output.cc (Output_file::open): Add execute permission to empty file.
14189 * testsuite/Makefile.am (permission_test): New test.
14190 * testsuite/Makefile.in: Regenerate.
14191
fdcac5af
ILT
141922009-09-02 Ian Lance Taylor <iant@google.com>
14193
14194 * output.cc (Output_file::resize): Call map_no_anonymous rather
14195 than map.
14196
44453f85
ILT
141972009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14198
14199 * gold.cc: Include "incremental.h".
14200 (queue_initial_tasks): Call Incremental_checker methods.
14201 * incremental.cc: Include "output.h".
14202 (Incremental_checker::can_incrementally_link_output_file): New
14203 method.
14204 * incremental.h (Incremental_checker): New class.
14205
14206 * output.cc (Output_file::open_for_modification): New method.
14207 (Output_file::map_anonymous): Changed return type to bool. Record
14208 map in base_ field.
14209 (Output_file::map_no_anonymous): New method, broken out of map.
14210 (Output_file::map): Use map_no_anonymous and map_anonymous.
14211 * output.h (class Output_file): Update declarations.
14212
293c1386
CC
142132009-08-24 Cary Coutant <ccoutant@google.com>
14214
14215 * options.h (Command_line::Pre_options): New class.
14216 (Command_line::pre_options): New member.
14217 * options.cc (gold::options::ready_to_register): New variable.
14218 (One_option::register_option): Do nothing if not registering options.
14219 Assert if same short option registered twice.
14220 (General_options::General_options): Turn off option registration when
14221 done constructing.
14222 (Command_line::Pre_options::Pre_options): New constructor.
14223
f773f3d2
CC
142242009-08-24 Cary Coutant <ccoutant@google.com>
14225
06a73cfe
CC
14226 * options.h (General_options::no_keep_memory): Remove incorrect
14227 short option.
f773f3d2 14228
a15af8e2
RW
142292009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14230
14231 * Makefile.am (am__skiplex, am__skipyacc): New.
14232 * Makefile.in: Regenerate.
14233
c462b41b
RW
142342009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14235
14ec8efd
RW
14236 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14237 (INCLUDES): ... this.
14238 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14239 (AM_CPPFLAGS): Renamed from ...
14240 (INCLUDE): ... this.
14241 * Makefile.in, testsuite/Makefile.in: Regenerate.
14242
81ecdfbb
RW
14243 * Makefile.in: Regenerate.
14244 * aclocal.m4: Likewise.
14245 * config.in: Likewise.
14246 * configure: Likewise.
14247 * testsuite/Makefile.in: Likewise.
14248
c462b41b
RW
14249 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14250 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14251 * Makefile.in: Regenerate.
14252 * testsuite/Makefile.in: Regenerate.
14253
2da73f13
CC
142542009-08-19 Cary Coutant <ccoutant@google.com>
14255
14256 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14257 symbols in shared libraries overridden by hidden or internal symbols
14258 in the main program.
14259
2db70501
CD
142602009-08-19 Chris Demetriou <cgd@google.com>
14261
14262 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14263 checking source file names in error messages.
14264
f733487b
DK
142652009-08-18 Doug Kwan <dougkwan@google.com>
14266
14267 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14268 an elcpp::Ehdr as parameter. Adjust call to set_target.
14269 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14270 an elfcpp::Ehdr as parameter.
14271 * object.cc (Object::set_target): Remove the version that looks up
14272 a target and sets it.
14273 (Sized_relobj::setup): Take a Target object instead of
14274 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14275 (make_elf_sized_object): Find target and ask target to
14276 make an ELF object.
14277 * object.h: (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.
14281 * target.cc: Include dynobj.h.
14282 (Target::do_make_elf_object_implementation): New.
2e702c99 14283 (Target::do_make_elf_object): New.
f733487b
DK
14284 * target.h (Target::make_elf_object): New template declaration.
14285 (Target::do_make_elf_object): New method declarations.
14286 (Target::do_make_elf_object_implementation): New template declaration.
14287
cc70f101
ILT
142882009-08-14 Ian Lance Taylor <iant@google.com>
14289
14290 * gold.h (FUNCTION_NAME): Define.
14291 (gold_unreachable): Use FUNCTION_NAME.
14292
ef5e0cb1
ST
142932009-08-12 Sriraman Tallam <tmsriram@google.com>
14294
14295 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14296 symbol in the --keep-unique list is not found.
14297
48c187ce
ST
142982009-08-12 Sriraman Tallam <tmsriram@google.com>
14299
14300 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14301 been maked as --keep-unique.
14302 (Icf::unfold_section): New function.
14303 * icf.h (Icf::unfold_section): New function.
14304 * options.h (General_options::keep_unique): New option.
14305 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14306 * testsuite/Makefile.in: Regenerate.
14307 * testsuite/icf_keep_unique_test.sh: New file.
14308 * testsuite/icf_keep_unique_test.cc: New file.
14309
645afe0c
CC
143102009-08-12 Cary Coutant <ccoutant@google.com>
14311
14312 PR 10471
14313 * resolve.cc (Symbol_table::resolve): Check for references from
14314 dynamic objects to hidden and internal symbols.
14315 * testsuite/Makefile.am (hidden_test.sh): New test.
14316 * testsuite/Makefile.in: Regenerate.
14317 * testsuite/hidden_test.sh: New script.
14318 * testsuite/hidden_test_1.c: New test source.
14319 * testsuite/hidden_test_main.c: New test source.
14320
11af873f
DK
143212009-08-11 Doug Kwan <dougkwan@google.com>
14322
14323 * arm.cc: Update comments.
14324 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14325 segment to locate the .ARM.exidx section if present.
14326
b9f7d72d
DK
143272009-08-09 Doug Kwan <dougkwan@google.com>
14328
14329 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14330 patch.
14331
ddd3c53c
ST
143322009-08-07 Sriraman Tallam <tmsriram@google.com>
14333 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14334 compiler warnings.
14335
27721062
ST
143362009-08-06 Sriraman Tallam <tmsriram@google.com>
14337
14338 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14339 valid tls_segment only for non-debug-section relocations.
14340 * testsuite/Makefile.am: Add gc_tls_test.
14341 * testsuite/Makefile.in: Regenerate.
14342 * testsuite/gc_tls_test.cc: New file.
14343 * testsuite/gc_tls_test.sh: New file.
14344
ef15dade 143452009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14346
ef15dade
ST
14347 * icf.cc: New file.
14348 * icf.h: New file.
14349 * Makefile.am (CCFILES): Add icf.cc.
14350 (HFILES): Add icf.h
14351 * Makefile.in: Regenerate.
14352 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14353 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14354 section, symbol and addend information for the relocs.
14355 * gold.cc (queue_middle_tasks): Call identical code folding.
14356 * gold.h: Add defines for multimap.
14357 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14358 to the call of finalize_local_symbols.
14359 * main.cc (main): Create object of class Icf.
14360 * object.cc (Sized_relobj::do_layout): Allow this function to be
14361 called twice during icf.
14362 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14363 to sections marked as identical by icf.
14364 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14365 when available.
14366 (Sized_relobj::do_section_entsize): New function.
14367 * object.h (Object::section_entsize): New function.
14368 (Object::do_section_entsize): New pure virtual function.
14369 (Relobj::finalize_local_symbols): Add new parameter.
14370 (Relobj::do_section_entsize): New function.
14371 * options.h (General_options::icf): New option.
14372 (General_options::icf_iterations): New option.
14373 (General_options::print_icf_sections): New option.
14374 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14375 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14376 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14377 icf.
14378 * symtab.cc (Symbol_table::is_section_folded): New function.
14379 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14380 to sections marked as identical by icf.
14381 * symtab.h (Symbol_table::set_icf): New function.
14382 (Symbol_table::icf): New function.
14383 (Symbol_table::is_section_folded): New function.
14384 (Symbol_table::icf_): New data member.
14385 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14386 * testsuite/Makefile.am: Add commands to build icf_test.
14387 * testsuite/Makefile.in: Regenerate.
14388 * testsuite/icf_test.sh: New file.
14389 * testsuite/icf_test.cc: New file.
14390
c3b65ac4
CD
143912009-07-24 Chris Demetriou <cgd@google.com>
14392
14393 * layout.cc (is_compressible_debug_section): Fix incorrect
14394 comment about compressed section names.
14395
1caf2c51
ILT
143962009-07-20 Ian Lance Taylor <ian@airs.com>
14397
14398 PR 10419
14399 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14400
1ef4d87f
ILT
144012009-07-16 Ian Lance Taylor <iant@google.com>
14402
14403 PR 10400
14404 * layout.h: #include <map>.
14405 (class Kept_section): Change from struct to class. Add accessors
14406 and setters. Add section size to Comdat_group mapping. Change
14407 Comdat_group to std::map. Add is_comdat_ field. Add
14408 linkonce_size field in union.
14409 (class Layout): Update declaration of find_or_add_kept_section.
14410 Don't declare find_kept_object.
14411 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14412 parameter. Add object, shndx, is_comdat, and is_group_name
14413 parameters. Change all callers. Adjust for new Kept_section.
14414 (Layout::find_kept_object): Remove.
14415 * object.cc (Sized_relobj::include_section_group): Update use of
14416 Kept_section. Rename secnum to shndx. Only record
14417 Kept_comdat_section if sections are the same size.
14418 (Sized_relobj::include_linkonce_section): Update use of
14419 Kept_section. Only record Kept_comdat_section if sections are the
14420 same size. Set size of linkonce section.
14421 (Sized_relobj::map_to_kept_section): Update call to
14422 get_kept_comdat_section.
14423 * object.h (class Sized_relobj): Rename fields in
14424 Kept_comdat_section to drop trailing underscores; change object
14425 field to Relobj*. Change Kept_comdat_section_table to store
14426 struct rather than pointer.
14427 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14428 Add kept_object and kept_shndx parameters. Change all callers.
14429 (Sized_relobj::get_kept_comdat_section): Change return type to
14430 bool. Add kept_object and kept_shndx parameters. Change all
14431 callers.
14432 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14433 Layout::find_or_add_kept_section.
14434
37c3b7b0
ILT
144352009-07-09 Ian Lance Taylor <iant@google.com>
14436
14437 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14438 Reserve space in the hash table.
14439
98fa85cb
ILT
144402009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14441
14442 * fileread.cc (File_read::get_mtime): New method.
14443 * fileread.h (Timespec): New structure.
14444 (File_read::get_mtime): New method.
14445 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14446 Renamed from timestamp_nsec.
14447 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14448 Elf_Xword.
e1df38aa 14449 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14450 timestamp_nsec.
e1df38aa 14451 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14452 (Incremental_inputs::report_obejct): Save mtime; style fix.
14453 (Incremental_inputs::report_script): Save mtime; style fix.
14454 (Incremental_inputs::finalize_inputs): Style fix.
14455 (Incremental_inputs::finalize): Style fix.
14456 (Incremental_inputs::create_input_section_data): Store inputs
14457 mtime.
14458 * incremental.h (Incremental_inputs::report_script): Add mtime
14459 argument.
14460 (Incremental_inputs::Input_info::Input_info): Intialize only one
14461 union member.
14462 (Incremental_inputs::Input_info::archive): Move to nameless
14463 union.
14464 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14465 (Incremental_inputs::Input_info::script): Move to nameless union.
14466 (Incremental_inputs::mtime): New field.
14467 * script.cc (read_input_script): Pass file mtime to
14468 Incremental_input.
14469 * script.h (Script_info::inputs): Style fix.
14470
c9d70757
ILT
144712009-07-01 Ian Lance Taylor <ian@airs.com>
14472
14473 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14474 instead of 32.
14475
9c547ec3
ILT
144762009-06-24 Ian Lance Taylor <iant@google.com>
14477
14478 PR 10156
14479 * layout.cc (Layout::choose_output_section): If we find an
14480 existing section, update the flags.
14481 (Layout::create_notes): New function, broken out of
14482 Layout::finalize.
14483 (Layout::finalize): Don't create note sections.
14484 (Layout::create_note): Don't crash if linker script discards
14485 section.
14486 (Layout::create_gold_note): Likewise.
14487 (Layout::create_build_id): Likewise. Don't set
14488 after_input_sections on the section.
14489 (Layout::create_executable_stack_info): Remove target parameter.
14490 Change caller.
14491 * layout.h (class Layout): Declare create_notes. Update
14492 declaration of create_executable_stack_info.
14493 * gold.cc (queue_middle_tasks): Call create_notes.
14494 * output.cc (Output_section::update_flags_for_input_section): Move
14495 here from output.h. If SHF_ALLOC flag is newly set, mark address
14496 invalid.
14497 * output.h (Output_data::mark_address_invalid): New function.
14498 (class Output_section): Only declare, not define,
14499 update_flags_for_input_section. Remove set_flags.
14500
55458500
ILT
145012009-06-24 Ian Lance Taylor <iant@google.com>
14502
14503 * script-sections.cc (Output_section_definition::
14504 set_section_addresses): Rename shadowing local load_address to
14505 laddr.
14506
1307d6cd
ILT
145072009-06-24 Ian Lance Taylor <iant@google.com>
14508
14509 PR 10244
14510 * reloc.cc (relocate_sections): Skip empty relocation sections.
14511
ec3f783e
ILT
145122009-06-23 Ian Lance Taylor <iant@google.com>
14513
14514 PR 10156
14515 * layout.cc (Layout::create_note): Use choose_output_section
14516 rather than make_output_section.
14517
459c9f1c
ILT
145182009-06-23 Ian Lance Taylor <iant@google.com>
14519
14520 PR 10237
14521 * options.cc (General_options::parse_V): Set printed_version_.
14522 (General_options::General_options): Initialize printed_version_.
14523 * options.h (class General_options): Add printed_version_ field.
14524 * gold.cc (queue_initial_tasks): If there are no input files,
14525 don't give a fatal error if we printed the version information.
14526 (queue_middle_tasks): If using -r with a shared object, give a
14527 fatal error rather than an ordinary error.
14528
1518dc8f
ILT
145292009-06-23 Ian Lance Taylor <iant@google.com>
14530
14531 PR 10219
14532 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14533 (Layout::make_output_section): Set have_stabstr_section_ if we see
14534 a .stab*str section.
14535 (Layout::finalize): Call link_stabs_sections.
14536 (Layout::link_stabs_sections): New file.
14537 * layout.h (class Layout): Add have_stabstr_section_ field.
14538 Declare link_stabs_sections.
14539
3d857b98
DK
145402009-06-23 Doug Kwan <dougkwan@google.com>
14541
14542 * Makefile.am (libgold_a_LIBADD): New.
14543 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14544 * Makefile.in: Regenerate.
3d857b98
DK
14545 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14546 * configure: Regenerate.
14547 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14548 * fileread.cc: Include sys/state.h
14549 * gold.h: Declare memmem and strndup if found missing.
14550 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14551
0639a6f6
ILT
145522009-06-23 Ian Lance Taylor <iant@google.com>
14553
14554 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14555 * configure: Rebuild.
14556
8d63875c
ILT
145572009-06-23 Ian Lance Taylor <iant@google.com>
14558
14559 PR 10147
14560 * object.cc (Object::section_contents): Don't try to get a view if
14561 the section has length zero.
14562 (Object::handle_gnu_warning_section): If the section is empty, use
14563 the name of the section as the warning.
14564
f7c8a183
ILT
145652009-06-23 Ian Lance Taylor <iant@google.com>
14566
14567 PR 10133
14568 * stringpool.h (class Stringpool_template): Add optimize_ field.
14569 (Stringpool_template::set_optimize): New function.
14570 * stringpool.cc (Stringpool_template::Stringpool_template):
14571 Initialize optimize_ field.
14572 (Stringpool_template::set_string_offsets): Test local optimize
14573 fild rather than parameter.
14574 * layout.cc (Layout::Layout): Call set_optimize on the section
14575 name stringpool.
14576
e6a307ba
ILT
145772009-06-22 Ian Lance Taylor <iant@google.com>
14578
14579 PR 10030
14580 * yyscript.y: Parse TARGET.
14581 * script.cc (script_set_target): New function.
14582 * script-c.h (script_set_target): Declare.
14583 * options.cc (General_options::string_to_object_format): Rename
14584 from string_to_object_format in anonymous namespace. Change
14585 callers.
14586 * options.h (class General_options): Declare
14587 string_to_object_format.
14588
3ee173de
ILT
145892009-06-22 Ian Lance Taylor <iant@google.com>
14590
14591 * script-sections.cc (Script_sections::create_segments): Don't put
14592 program headers in a PT_LOAD segment if -n or -N.
14593
145942009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14595
14596 PR 10141
14597 * options.h (class General_options): Add -z lazy and -z now. Sort
14598 -z options into alphabetical order.
14599 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14600
cd6739a1 146012009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14602
14603 * layout.cc (Layout::make_output_section): Call
14604 Target::new_output_section.
14605 (Layout::attach_allocated_section_to_segment): Put large section
14606 sections in a separate load segment with the large segment flag
14607 set.
14608 (Layout::segment_precedes): Sort large data segments after other
14609 load segments.
14610 (align_file_offset): New static function.
14611 (Layout::set_segment_offsets): Use align_file_offset.
14612 * output.h (class Output_section): Add is_small_section_ and
14613 is_large_section_ fields.
14614 (Output_section::is_small_section): New function.
14615 (Output_section::set_is_small_section): New function.
14616 (Output_section::is_large_section): New function.
14617 (Output_section::set_is_large_section): New function.
14618 (Output_section::is_large_data_section): New function.
14619 (class Output_segment): Add is_large_data_segment_ field.
14620 (Output_segment::is_large_data_segment): New function.
14621 (Output_segment::set_is_large_data_segment): New function.
14622 * output.cc (Output_section::Output_section): Initialize new
14623 fields.
14624 (Output_segment::Output_segment): Likewise.
14625 (Output_segment::add_output_section): Add assertion that large
14626 data sections always go in large data segments. Force small data
14627 sections to the end of the list of data sections. Force small BSS
14628 sections to the start of the list of BSS sections. For large BSS
14629 sections to the end of the list of BSS sections.
14630 * symtab.h (class Symbol): Declare is_common_shndx.
14631 (Symbol::is_defined): Check Symbol::is_common_shndx.
14632 (Symbol::is_common): Likewise.
14633 (class Symbol_table): Define enum Commons_section_type. Update
14634 declarations. Add small_commons_ and large_commons_ fields.
14635 * symtab.cc (Symbol::is_common_shndx): New function.
14636 (Symbol_table::Symbol_table): Initialize new fields.
14637 (Symbol_table::add_from_object): Put small and large common
14638 symbols in the right list.
14639 (Symbol_table::sized_finalized_symbol): Check
14640 Symbol::is_common_shndx.
14641 (Symbol_table::sized_write_globals): Likewise.
14642 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14643 common symbol lists. Don't call do_allocate_commons_list if the
14644 list is empty.
14645 (Symbol_table::do_allocate_commons_list): Remove is_tls
14646 parameter. Add comons_section_type parameter. Change all
14647 callers. Handle small and large common symbols.
14648 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14649 Symbol::is_common_shndx.
14650 * resolve.cc (symbol_to_bits): Likewise.
14651 * target.h (Target::small_common_shndx): New function.
14652 (Target::small_common_section_flags): New function.
14653 (Target::large_common_shndx): New function.
14654 (Target::large_common_section_flags): New function.
14655 (Target::new_output_section): New function.
14656 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14657 small_common_section_flags, and large_common_section_flags
14658 fields.
14659 (Target::do_new_output_section): New virtual function.
14660 * arm.cc (Target_arm::arm_info): Initialize new fields.
14661 * i386.cc (Target_i386::i386_info): Likewise.
14662 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14663 Likewise.
14664 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14665 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14666 (Target_x86_64::do_new_output_section): New function.
14667 * configure.ac: Define conditional MCMODEL_MEDIUM.
14668 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14669 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14670 (large_LDFLAGS): Define.
14671 * testsuite/large.c: New file.
14672 * testsuite/testfile.cc (Target_test::test_target_info):
14673 Initialize new fields.
14674 * configure, testsuite/Makefile.in: Rebuild.
14675
bb04269c
DK
146762009-06-05 Doug Kwan <dougkwan@google.com>
14677
14678 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14679 * Makefile.in: Regenerate.
bb04269c
DK
14680 * i386.cc (class Target_i386): Define new virtual method to
14681 override do_is_local_label_name in parent.
14682 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14683 local symbols if --discard-locals or -X is given.
14684 * options.h (class General_options): Declare new options
14685 '--discard-locals' and '-X' for discarding locals.
14686 * target.h (class Target): Define new methods is_local_label_name.
14687 Declare new virtual method do_is_local_label_name.
14688 * target.cc: New file.
14689 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14690 (check_SCRIPTS): Add discard_locals_test.sh.
14691 (check_DATA): Add discard_local_tests.syms.
14692 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14693 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14694 * testsuite/Makefile.in: Regenerate.
14695 * testsuite/discard_locals_test.c: New file.
14696 * testsuite/discard_locals_test.sh: Same.
14697
805bb01c
DK
146982009-06-05 Doug Kwan <dougkwan@google.com>
14699
14700 * object.cc (Sized_relobj::Sized_relobj): Initialize
14701 discarded_eh_frame_shndx_ to -1U.
14702 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14703 section.
14704 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14705 a discarded .eh_frame section.
14706 (Sized_relobj::do_finalize_local_symbols): Ditto.
14707 * object.h (class Sized_relobj): Declare new member
14708 discarded_eh_frame_shndx_.
14709 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14710 (local_labels_test.o, local_labels_test): New rules.
14711 * testsuite/Makefile.in: Regenerate.
14712
1dcd334d
DK
147132009-06-04 Doug Kwan <dougkwan@google.com>
14714
14715 * layout.cc (Layout::section_name_mapping): Add mapping for
14716 special ARM sections.
14717
96d49306
DK
147182009-06-03 Doug Kwan <dougkwan@google.com>
14719
14720 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14721 (utils::has_overflow): Same.
14722
dff16297
ILT
147232009-06-03 Ian Lance Taylor <iant@google.com>
14724
14725 * layout.cc (Layout::section_name_mapping): New array, replacing
14726 Layout::linkonce_mapping.
14727 (Layout::section_name_mapping_count): New variable, replacing
14728 Layout::linkonce_mapping_count.
14729 (Layout::linkonce_output_name): Remove.
14730 (Layout::output_section_name): Rewrite.
14731 * layout.h (class Layout): Rename Linkonce_mapping to
14732 Section_name_mapping, linkonce_mapping to section_name_mapping,
14733 linkonce_mapping_count to section_name_mapping_count. Don't
14734 declare linkonce_output_name.
14735
c121c671
DK
147362009-06-03 Doug Kwan <dougkwan@google.com>
14737
14738 * gold/arm.cc (namespace utils): New.
14739 (Target_arm::reloc_is_non_pic): Define new method.
14740 (class Arm_relocate_functions): New.
14741 (Target_arm::Relocate::relocate): Handle relocation types used by
14742 Android.
14743
07800fab
ILT
147442009-06-03 Ian Lance Taylor <iant@google.com>
14745
14746 * arm.cc (Target_arm::scan::global): Use || instead of |.
14747
c121c671
DK
147482009-06-02 Doug Kwan <dougkwan@google.com>
14749
14750 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14751 issued_non_pic_error_.
14752 (class Target_arm::Scan): Declare new method check_non_pic.
14753 Define new method symbol_needs_plt_entry.
14754 Declare new data member issued_non_pic_error_.
14755 (class Target_arm::Relocate): Declare new method
14756 should_apply_static_reloc.
14757 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14758 (Target_arm::Scan::check_non_pic): Define new method.
14759 (Target_arm::Scan::local): Handle a small subset of reloc types used
14760 by Android.
14761 (Target_arm::Scan::local): Same.
14762 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14763
b19b0c6d
ILT
147642009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14765
14766 * incremental.cc (Incremental_inputs::report_command_line): Filter
14767 out --incremental-* options.
14768
94cdfcff
DK
147692009-05-29 Doug Kwan <dougkwan@google.com>
14770
14771 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14772 template class.
14773 (class Target_arm): Update comment.
14774 (Target_arm::Target_arm): Initialize new data members GOT_,
14775 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14776 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14777 and Target_arm::rel_dyn_section.
14778 Declare new_enum Target_arm::Got_type.
14779 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14780 and DYNBSS_.
14781 Update commments for member do_dynsym_value.
14782 (Target_arm::got_size, Target_arm::plt_section,
14783 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14784 new methods inside class defintion.
14785 (Target_arm::got_section): Define new method.
14786 (Target_arm::rel_dyn_section): Same.
14787 (Output_data_plt_arm): New template class.
14788 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14789 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14790 (Output_data_plt_arm::add_entry): Same.
14791 (Output_data_plt_arm::first_plt_entry): Define new
14792 static data member for PLT instruction template.
14793 (Output_data_plt_arm::plt_entry): Same.
14794 (Output_data_plt_arm::do_write): Define new method.
14795 (Target_arm::make_plt_entry): Same.
14796 (Target_arm::do_finalize_sections): Same.
14797 (Target_arm::do_dynsym_value): Same.
14798
4a657b0d
DK
147992009-05-28 Doug Kwan <dougkwan@google.com>
14800
14801 * Makefile.am (TARGETSOURCES): Add arm.cc.
14802 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14803 * Makefile.in: Regenerate.
14804 * arm.cc: New file.
14805 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14806
e7ae8c36
DK
148072009-05-26 Doug Kwan <dougkwan@google.com>
14808
14809 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14810 (General_options::check_excluded_libs): Strip off directories in
14811 archive name before matching like GNU ld does.
14812 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14813 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14814 (exclude_libs_test_LDFLAGS): Add linker option
14815 -Wl,--exclude-libs,libexclude_libs_test_3
14816 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14817 an explicit archive without using -l.
14818 (alt/libexclude_libs_test_3.a): New make rule.
14819 * testsuite/Makefile.in: Regenerate.
14820 * testsuite/exclude_libs_test.c : Declare lib3_default().
14821 (main): Call it.
14822 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14823 * exclude_libs_test_3.c: New file.
14824
f12e7348
NC
148252009-05-26 Nick Clifton <nickc@redhat.com>
14826
14827 * po/id.po: New Indonesian translation.
14828 * po/gold.pot: Updated template file.
14829
4daadc0d
ST
148302009-05-22 Sriraman Tallam <tmsriram@google.com>
14831
e1df38aa 14832 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14833 gc_comdat_test files. Add -Wl,--gc-sections to build
14834 gc_comdat_test.
14835 * testsuite/Makefile.in: Regenerate.
14836 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14837
531813ad
ST
148382009-05-21 Sriraman Tallam <tmsriram@google.com>
14839
14840 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14841 kept comdat section was garbage collected.
14842 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14843 * testsuite/Makefile.in: Regenerate.
14844 * testsuite/gc_comdat_test.sh: New file.
14845 * testsuite/gc_comdat_test_1.cc: New file.
14846 * testsuite/gc_comdat_test_2.cc: New file.
14847
65514900
CC
148482009-05-19 Doug Kwan <dougkwan@google.com>
14849
14850 * archive.cc (Archive::Archive): Move constructor from archive.h
14851 to here. Initialize no_export_.
14852 (Archive::get_elf_object_for_member): Set no_export flag of object.
14853 * archive.h (Archive::Archive): Move constructor body to
14854 archive.cc.
14855 (Archive::no_export): New method.
14856 (Archive::no_export_): New field.
14857 * object.h (Object::Object): Initialize no_export_ to false.
14858 (Object::no_export, Object::set_no_export): New methods.
14859 (Object::no_export_): New field.
14860 * options.cc (General_options::parse_exclude_libs): New method.
14861 (General_options::check_excluded_libs) Same.
14862 * options.h (exclude_libs): New option.
14863 (General_options::check_excluded_libs): New method declaration.
14864 (General_options::excluded_libs_): New field.
14865 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14866 default or protected visibility if an object has no-export flag set.
14867 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14868 (check_SCRIPTS): Add exclude_libs_test.sh.
14869 (check_DATA): Add exclude_libs_test.syms.
14870 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14871 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14872 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14873 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14874 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14875 libexclude_libs_test_2.a): New rules.
14876 * testsuite/Makefile.in: Regenerate.
14877 * testsuite/exclude_libs_test.c: New file.
14878 * testsuite/exclude_libs_test.sh: Ditto.
14879 * testsuite/exclude_libs_test_1.c: Ditto.
14880 * testsuite/exclude_libs_test_2.c: Ditto.
14881
1b77ea50
ILT
148822009-05-15 Ian Lance Taylor <iant@google.com>
14883
14884 * configure.ac: Check for declarations for cases where libiberty.h
14885 checks HAVE_DECL_xxx.
14886 * configure, config.in: Rebuild.
14887
072fe7ce
ILT
148882009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14889
14890 * gold.h (Incremental_argument_list): Remove (invalid) forward
14891 declaration.
14892 * incremental.cc (Incremental_inputs::report_achive): New method.
14893 (Incremental_inputs::report_object): New method.
14894 (Incremental_inputs::report_script): New method.
14895 (Incremental_inputs::finalize_inputs): New method.
14896 (Incremental_inputs::finalize): Call finalize_inputs().
14897 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14898 Create inputs entries.
14899 * incremental.h (Incremental_input_type): New enum.
14900 (Incremental_inputs::Incremental_input): Initialize new fields.
14901 (Incremental_inputs::report_inputs): New method.
14902 (Incremental_inputs::report_achive): New method.
14903 (Incremental_inputs::report_object): New method.
14904 (Incremental_inputs::report_script): New method.
14905 (Incremental_inputs::finalize_inputs): New method.
14906 (Incremental_inputs::Input_info): New struct.
14907 (Incremental_inputs::Input_info_map): New typedef.
14908 (Incremental_inputs::lock_): New field.
14909 (Incremental_inputs::Inputs_): New field.
14910 (Incremental_inputs::Inputs_map): New field.
14911 * main.cc (main): Call Incremental_input::report_inputs.
14912 * options.h (Input_argument_list): Typedef moved from
14913 Input_arguments.
14914 (Input_file_group::Files): Remove, use ::Input_argument_list.
14915 (Input_file_group::Input_argument_list): Remove, use
14916 ::Input_argument_list.
14917 * plugin.cc (Plugin_manager::add_input_file): Add error in
14918 incremental build.
14919 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14920 functions.
14921 * script.cc (read_input_script): Call
14922 Incremental_input::report_script.
14923 * script.h (Script_info): New class.
14924
b0481b0b
ILT
149252009-04-27 Ian Lance Taylor <iant@google.com>
14926
14927 * x86_64.cc (do_adjust_output_section): Set entsize to
14928 plt_entry_size.
14929
b22a5a41 149302009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14931
14932 * output.cc (Output_file::close): After short writes, continue
14933 writing from the correct offset in the buffer being written.
14934
40fde488
CD
149352009-04-23 Chris Demetriou <cgd@google.com>
14936
14937 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14938 * configure: Regenerate.
14939 * config.in: Regenerate.
14940 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14941 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14942
3ce2c28e
ILT
149432009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14944
14945 * incremental.cc (Incremental_inputs_header_data): Renamed from
14946 Incremental_input_header_data.
14947 (Incremental_inputs_header_data::data_size): New field.
14948 (Incremental_inputs_header_data::put_input_file_count): Renamed
14949 from input_file_count.
14950 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14951 from command_line_offset.
14952 (Incremental_inputs_header_data::put_reserved): Renamed from
14953 put_reserved.
14954 (Incremental_inputs_entry_data): Renamed from
14955 Incremental_input_entry_data.
14956 (Incremental_inputs_entry_data::data_size): New field.
14957 (Incremental_inputs::report_command_line): New method.
14958 (Incremental_inputs::finalize): New method.
14959 (Incremental_inputs::create_incremental_inputs_data): New method.
14960 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14961 * incremental.h: New file.
14962 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14963 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14964 incremental builds.
703d02da 14965 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14966 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14967 (Layout::create_incremental_info_sections): New method.
14968 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14969 * main.cc (main): Notify Incremental_input of the command line.
14970
e55bde5e
ILT
149712009-04-01 Ian Lance Taylor <iant@google.com>
14972 Mikolaj Zalewski <mikolajz@google.com>
14973
14974 * gold.h (reserve_unordered_map): Define, three versions, one for
14975 each version of Unordered_map.
14976 * layout.cc (Layout::Layout): Remove options parameter. Add
14977 number_of_input_files parameter. Don't initialize options_.
14978 Initialize number_of_input_files_ and resized_signatures_. Move
14979 sections_are_attached_.
14980 (Layout::layout_group): Reserve space for group_signatures_.
14981 (Layout::find_or_add_kept_section): Change name parameter to be a
14982 reference. Resize signatures_ map when it gets large enough.
14983 (Layout::layout_eh_frame): Use parameters->options() instead of
14984 this->options_.
14985 (Layout::make_output_section): Likewise.
14986 (Layout::attach_allocated_section_to_segment): Likewise.
14987 (Layout::finalize, Layout::create_executable_stack): Likewise.
14988 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14989 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14990 * layout.h (class Layout): Update declarations. Remove options_
14991 field. Add number_of_input_files_ and resized_signatures_
14992 fields. Move sections_are_attached_ field.
14993 * main.cc (main): Pass number of input files to Layout
14994 constructor. Don't pass options.
14995
154b857c
ILT
149962009-03-30 Ian Lance Taylor <iant@google.com>
14997
14998 * ffsll.c (ffsll): Correct implementation.
14999
2f35ab9b
ILT
150002009-03-27 Ian Lance Taylor <iant@google.com>
15001
fd03461a
ILT
15002 * ffsll.c: New file.
15003 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15004 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15005 * ftruncate.c (ftruncate): Declare before definition.
15006 * mremap.c (mremap): Likewise.
15007 * pread.c (pread): Likewise.
15008 * configure, Makefile.in, config.in: Rebuild.
15009
2f35ab9b
ILT
15010 * mremap.c: New file.
15011 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15012 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15013 (mremap): Declare if HAVE_MREMAP is not defined.
15014 * configure, Makefile.in, config.in: Rebuild.
15015
33aea2fd
CC
150162009-03-27 Cary Coutant <ccoutant@google.com>
15017
15018 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15019 position independent.
15020 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15021 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15022
6d479619
CC
150232009-03-24 Cary Coutant <ccoutant@google.com>
15024
15025 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15026 an executable.
15027 (needs_dynamic_reloc): Likewise.
15028
afc06bb8
ILT
150292009-03-24 Ian Lance Taylor <iant@google.com>
15030
15031 * yyscript.y (file_cmd): Recognize EXTERN.
15032 (extern_name_list, extern_name_list_body): New nonterminals.
15033 * script.cc (script_add_extern): Define.
15034 * script-c.h (script_add_extern): Declare.
15035
f6060a4d
ILT
150362009-03-24 Rafael Avila de Espindola <espindola@google.com>
15037
15038 * object.cc (is_elf_object): Define.
15039 * object.h (is_elf_object): Declare.
15040 * archive.cc (Archive::get_elf_object_for_member): Call
15041 is_elf_object.
33aea2fd 15042 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15043
26736d8e
ILT
150442009-03-24 Elliott Hughes <enh@google.com>
15045
15046 * output.cc (Output_file::map_anonymous): Define.
15047 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15048 try an anonymous one. Report the size if the mmap fails.
15049 * output.h (class Output_file): Declare map_anonymous.
15050
22fd9730
ILT
150512009-03-24 Ian Lance Taylor <iant@google.com>
15052
15053 * target-select.cc (instantiate_target): Don't acquire the lock if
15054 the instantiated_target_ field has already been set.
15055
cb010894
ILT
150562009-03-23 Ian Lance Taylor <iant@google.com>
15057
7f055c20
ILT
15058 * gold-threads.h (class Initialize_lock): Define.
15059 * gold-threads.cc (class Initialize_lock_once): Define.
15060 (initialize_lock_control): New static variable.
15061 (initialize_lock_pointer): New static variable.
15062 (initialize_lock_once): New static function.
15063 (Initialize_lock::Initialize_lock): Define.
15064 (Initialize_lock::initialize): Define.
15065 * target-select.h: Include "gold-threads.h".
15066 (class Target_selector): Add lock_ and initialize_lock_ fields.
15067 Don't define instantiate_target, just declare it.
15068 * target-select.cc (Target_selector::Target_selector): Initialize
15069 new fields.
15070 (Target_selector::instantiate_target): Define.
15071 * descriptors.h: Include "gold-threads.h".
15072 (class Descriptors): Add initialize_lock_ field.
15073 * descriptors.cc (Descriptors::Descriptors): Initialize new
15074 field.
15075 (Descriptors::open): Use initialize_lock_ field
15076 * errors.h (class Errors): Add initialize_lock_ field.
15077 * errors.cc (Errors::Errors): Initialize new field.
15078 (Errors::initialize_lock): Use initialize_lock_ field.
15079 * powerpc.cc (class Target_selector_powerpc): Remove
15080 instantiated_target_ field. In do_recognize call
15081 instantiate_target rather than do_instantiate_target. In
15082 do_instantiate_target just allocate a new target.
15083 * sparc.cc (class Target_selector_sparc): Likewise.
15084
36959681
ILT
15085 * freebsd.h: New file.
15086 * i386.cc: Include "freebsd.h".
15087 (Target_i386): Derive from Target_freebsd rather than
15088 Sized_target.
15089 (Target_selector_i386): Derive from Target_selector_freebsd rather
15090 than Target_selector.
15091 * x86_64.cc: Include "freebsd.h".
15092 (Target_x86_64): Derive from Target_freebsd rather than
15093 Sized_target.
15094 (Target_selector_x86_64): Derive from Target_selector_freebsd
15095 rather than Target_selector.
15096 * target.h (class Target): Add adjust_elf_header and
15097 do_adjust_elf_header.
15098 * output.cc (Output_file_header:: do_sized_write): Call target
15099 adjust_elf_header routine.
15100 * configure.tgt: Set targ_osabi.
15101 * configure.ac: Define GOLD_DEFAULT_OSABI.
15102 * parameters.cc (Parameters::default_target): Pass
15103 GOLD_DEFAULT_OSABI to select_target.
15104 * target-select.h (class Target_selector): Make instantiate_target
15105 protected rather than private.
15106 * Makefile.am (HFILES): Add freebsd.h.
15107 * configure, Makefile.in, config.in: Rebuild.
15108
cb010894
ILT
15109 * merge.cc (do_add_input_section): Correct pend value. Change
15110 message about last entry not being null terminated from error to
15111 warning.
15112
0e879927
ILT
151132009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15114
15115 * incremental.cc: New file.
15116 * Makefile.am (CCFILES): Add incremental.cc.
15117 * Makefile.in: Rebuild.
15118
41105937
PP
151192009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15120
15121 * layout.cc (Layout::output_section_name): Preserve names
15122 of '.note.' sections.
e1df38aa 15123
60439920
ILT
151242009-03-19 Ian Lance Taylor <iant@google.com>
15125
15126 * descriptors.cc (Descriptors::open): Check that the options are
15127 valid before using them.
15128
0d371ad3
ILT
151292009-03-18 Ian Lance Taylor <iant@google.com>
15130
15131 * script-sections.h: Include <list>.
15132 (class Script_sections): Change Sections_elements from std::vector
15133 to std::list. Typedef public Elements_iterator. Add
15134 orphan_section_placement_, data_segment_align_start_, and
15135 saw_data_segment_align_ fields. Remove data_segment_align_index_
15136 field.
15137 * script-sections.cc (class Orphan_section_placement): New class.
15138 (class Sections_element): Add virtual functions is_relro and
15139 orphan_section_init. Remove virtual function place_orphan_here.
15140 (class Output_section_definition): Add is_relro and
15141 orphan_section_init. Remove place_orphan_here.
15142 (class Orphan_output_section): Likewise.
15143 (Script_sections::Script_sections): Update for field changes.
15144 (Script_sections::data_segment_align): Set saw_data_segment_align_
15145 and data_segment_align_start_, not data_segment_align_index.
15146 (Script_sections::data_segment_relro_end): Check
15147 saw_data_segment_align_. Use data_segment_align_start_ rather
15148 than data_segment_align_index_.
15149 (Script_sections::place_orphan): Rewrite to use
15150 Orphan_section_placement.
15151
9201d894
ILT
151522009-03-17 Ian Lance Taylor <iant@google.com>
15153
9c5b8369
ILT
15154 * archive.cc (Archive::add_symbols): Check for a version attached
15155 to the symbol name in the archive map.
15156 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15157 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15158 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15159 (ver_test_11.a): New target.
15160 * testsuite/Makefile.in: Rebuild.
15161
9201d894
ILT
15162 * configure.ac: Check for chsize and posix_fallocate. Replace
15163 ftruncate.
15164 * ftruncate.c: New file, from gnulib.
15165 * output.cc (posix_fallocate): Define dummy version if not
15166 HAVE_POSIX_FALLOCATE.
15167 (Output_file::map): Call posix_fallocate rather than lseek and
15168 write.
15169 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15170 * configure, Makefile.in, config.in: Rebuild.
15171
ef4ab7a8 151722009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15173
ef4ab7a8
PP
15174 * layout.h (Layout::create_note): Add section_name parameter.
15175 * layout.cc (Layout::create_note): Likewise.
15176 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15177
8c500701
ILT
151782009-03-17 Ian Lance Taylor <iant@google.com>
15179
e85b18e1
ILT
15180 * descriptors.cc: Include "options.h".
15181 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15182 (Descriptors::open): Always use O_CLOEXEC when opening a new
15183 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15184 then set FD_CLOEXEC.
15185
9efe6174
ILT
15186 * sparc.cc (class Target_sparc): Add has_got_section.
15187 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15188 make sure we have a GOT section.
15189
15190 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15191 (Target_sparc::Scan::local): Likewise.
15192 (Target_sparc::Scan::global): Likewise.
15193 (Target_sparc::Relocate::relocate): Likewise.
15194 (Target_sparc::Relocate::relocate_tls): Likewise.
15195
8c500701
ILT
15196 * symtab.cc (Symbol_table::define_default_version): New function,
15197 broken out of add_from_object.
15198 (Symbol_table::add_from_object): Call define_default_version.
15199 (Symbol_table::define_special_symbol): Add resolve_oldsym
15200 parameter. Change all callers. If the version for a symbol comes
15201 from a version script, resolve it with the symbol with the same
15202 name with no version. Also add the symbol without a version if
15203 appropriate.
15204 (do_define_in_output_data): If resolving with oldsym, don't delete
15205 sym.
15206 (do_define_in_output_segment): Likewise.
15207 (do_define_as_constant): Likewise.
15208 * symtab.h (class Symbol_table): Update declarations.
15209
f1ed28fb
ILT
152102009-03-13 Ian Lance Taylor <iant@google.com>
15211
15f8229b
ILT
15212 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15213 (Read_symbols::requeue): New function.
15214 (Read_symbols::do_read_symbols): If make_elf_object fails because
15215 the target type is not configured, and the file was searched for,
15216 issue a warning and retry with the next directory.
15217 (Add_symbols::run): If the file has an incompatible format, and
15218 it was searched for, requeue the Read_symbols task. On error,
15219 release the object.
15220 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15221 dirindex parameter to constructor. Change all callers. Declare
15222 incompatible_warning and requeue.
15223 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15224 input_argument_ and input_group_ fields. Add them to
15225 constructor. Change all callers.
15226 (class Read_script): Add dirindex_ field. Add it to constructor.
15227 Change all callers.
15228 * archive.cc (Archive::setup): Remove input_objects parameter.
15229 Change all callers.
15230 (Archive::get_file_and_offset): Likewise.
15231 (Archive::read_all_symbols): Likewise.
15232 (Archive::read_symbols): Likewise.
15233 (Archive::get_elf_object_for_member): Remove input_objects
15234 parameter. Add punconfigured parameter. Change all callers.
15235 (Archive::add_symbols): Change return type to bool. Check return
15236 value of include_member.
15237 (Archive::include_all_members): Likewise.
15238 (Archive::include_member): Change return type to bool. Return
15239 false if first included object has incompatible target. Set
15240 included_member_ field.
15241 (Add_archive_symbols::run): If add_symbols returns false, requeue
15242 Read_symbols task.
15243 * archive.h (class Archive): Add included_member_ field.
15244 Initialize it in constructor. Add input_file and searched_for
15245 methods. Update declarations.
15246 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15247 input_argument_ fields. Add them to constructor. Change all
15248 callers.
15249 * script.cc: Include "target-select.h".
15250 (class Parser_closure): Add skip_on_incompatible_target_ and
15251 found_incompatible_target_ fields. Add
15252 skip_on_incompatible_target parameter to constructor. Change all
15253 callers. Add methods skip_on_incompatible_target,
15254 clear_skip_on_incompatible_target, found_incompatible_target, and
15255 set_found_incompatible_target.
15256 (read_input_script): Add dirindex parameter. Change all callers.
15257 If parser finds an incompatible target, requeue Read_symbols
15258 task.
15259 (script_set_symbol): Clear skip_on_incompatible_target in
15260 closure.
15261 (script_add_assertion, script_parse_option): Likewise.
15262 (script_start_sections, script_add_phdr): Likewise.
15263 (script_check_output_format): New function.
15264 * script.h (read_input_script): Update declaration.
15265 * script-c.h (script_check_output_format): Declare.
15266 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15267 (ignore_cmd): Remove OUTPUT_FORMAT.
15268 * fileread.cc (Input_file::Input_file): Add explicit this.
15269 (Input_file::will_search_for): New function.
15270 (Input_file::open): Add pindex parameter. Change all callers.
15271 * fileread.h (class Input_file): Add input_file_argument method.
15272 Declare will_search_for. Update declarations.
15273 * object.cc (make_elf_object): Add punconfigured parameter.
15274 Change all callers.
15275 * object.h (class Object): Make input_file public. Add
15276 searched_for method.
15277 (make_elf_object): Update declaration.
15278 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15279 restart search.
15280 * dirsearch.h (class Dirsearch): Update declaration.
15281 * options.h (class General_options): Add --warn-search-mismatch.
15282 * parameters.cc (Parameters::is_compatible_target): New function.
15283 * parameters.h (class Parameters): Declare is_compatible_target.
15284 * workqueue.cc (Workqueue::add_blocker): New function.
15285 * workqueue.h (class Workqueue): Declare add_blocker.
15286
f1ed28fb
ILT
15287 * fileread.cc (Input_file::open): Remove options parameter.
15288 Change all callers.
15289 (Input_file::open_binary): Likewise.
15290 * script.cc (read_input_script): Likewise.
15291 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15292 options parameter from constructor. Change all callers.
15293 (class Read_script): Likewise.
15294 * fileread.h (class Input_file): Update declarations.
15295 * script.h (read_input_script): Update declaration.
15296
34dd024a
NC
152972009-03-10 Nick Clifton <nickc@redhat.com>
15298
15299 * po/es.po: New Spanish translation.
15300
6d71b17c
CC
153012009-03-06 Cary Coutant <ccoutant@google.com>
15302
15303 * options.cc (parse_short_option): Keep dash_z from registering itself.
15304
031cdbed
ILT
153052009-03-03 Ian Lance Taylor <iant@google.com>
15306
15307 PR 9918
15308 * target-reloc.h (relocate_section): Pass output_section to
15309 relocate.
15310 * i386.cc (Target_i386::should_apply_static_reloc): Add
15311 output_section parameter. Change all callers.
15312 (Target_i386::Relocate::relocate): Add output_section parameter.
15313 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15314 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15315 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15316 * testsuite/two_file_shared.sh: New script.
15317 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15318 (check_DATA): Add two_file_shared.dbg.
15319 (two_file_shared.dbg): New target.
15320 * testsuite/Makefile.in: Rebuild.
15321
15d5fa16
ILT
153222009-03-01 Ian Lance Taylor <iant@google.com>
15323
15324 * configure.ac: Check for byteswap.h.
15325 * configure: Rebuild.
15326 * config.in: Rebuild.
15327
8a4c0b0d
ILT
153282009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15329
15330 * layout.cc (Layout::find_or_add_kept_section): New function.
15331 (Layout::add_comdat): Removed.
15332 * layout.h (struct Kept_section): Move out of class Layout.
15333 Remove trailing underscores from field names. Add group_sections
15334 field. Rename group_ field to is_group. Change all uses.
15335 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15336 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15337 comdat_groups_ field.
15338 (Sized_relobj::include_section_group): Use
15339 find_or_add_kept_section and Kept_section::group_sections.
15340 (Sized_relobj::include_linkonce_section): Likewise.
15341 * object.cc (class Sized_relobj): Don't define Comdat_group or
15342 Comdat_group_table. Remove find_comdat_group and
15343 add_comdat_group. Remove comdat_groups_ field.
15344 * plugin.cc (include_comdat_group): Use
15345 Layout::find_or_add_kept_section.
15346
b4ecf66b
ILT
153472009-02-28 Ian Lance Taylor <iant@google.com>
15348
14359ca0
ILT
15349 * README: --gc-sections and map files are now supported. Document
15350 some build requirements.
15351
b4ecf66b
ILT
15352 PR 6992
15353 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15354 relocatable link set the value of the section symbol to zero.
15355 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15356 relocatable link don't include the section address in the local
15357 symbol value.
15358
0602e05a
ILT
153592009-02-27 Ian Lance Taylor <iant@google.com>
15360
fd9d194f
ILT
15361 PR 6811
15362 * options.h (class Search_directory): Add is_system_directory.
15363 (class General_options): Declare is_in_system_directory.
15364 * options.cc (get_relative_sysroot): Make static.
15365 (get_default_sysroot): Make static.
15366 (General_optoins::is_in_system_directory): New function.
15367 * fileread.cc (Input_file::is_in_system_directory): New function.
15368 * fileread.h (class Input_file): Declare is_in_system_directory.
15369 * object.h (class Object): Add is_in_system_directory.
15370 (class Input_objects): Remove system_library_directory_ field.
15371 * object.cc (Input_objects::add_object): Don't set
15372 system_library_directory_.
15373 (input_objects::found_in_system_library_directory): Remove.
15374 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15375 parameter. Change all callers.
15376 (Symbol_table::sized_write_globals): Likewise.
15377 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15378 Call Object::is_in_system_directory.
15379 * symtab.h (class Symbol_table): Update declarations.
15380
61edd21f
ILT
15381 PR 5990
15382 * descriptors.h (Open_descriptor): Add is_on_stack field.
15383 * descriptors.cc (Descriptors::open): If the descriptor is on the
15384 top of the stack, remove it. Initialize is_on_stack field.
15385 (Descriptors::release): Only add pod to stack if it is not on the
15386 stack already.
15387 (Descriptors::close_some_descriptor): Clear stack_next and
15388 is_on_stack fields.
15389
e29e076a
ILT
15390 PR 7091
15391 * output.cc (Output_section::find_starting_output_address): Rename
15392 from starting_output_address; add PADDR parameter; change return
15393 type.
15394 * output.h (class Output_section): Declare
15395 find_starting_output_address instead of starting_output_address.
15396 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15397 section symbol for which we can't find a merge section.
15398
0602e05a
ILT
15399 PR 9836
15400 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15401 hidden or internal, force the symbol to be local.
15402 * resolve.cc (Symbol::override_visibility): Define.
15403 (Symbol::override_base): Use override_visibility.
15404 (Symbol_table::resolve): Likewise.
15405 (Symbol::override_base_with_special): Likewise.
15406 (Symbol_table::override_with_special): If the visibility is hidden
15407 or internal, force the symbol to be local.
15408 * symtab.h (class Symbol): Add set_visibility and
15409 override_visibility.
15410 * testsuite/ver_test_1.sh: New file.
15411 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15412 (check_DATA): Add ver_test_1.syms.
15413 (ver_test_1.syms): New target.
15414 * testsuite/Makefile.in: Rebuild.
15415
401a9a73
CC
154162009-02-25 Cary Coutant <ccoutant@google.com>
15417
15418 * layout.cc (Layout::choose_output_section): Don't rename sections
15419 when using a linker script that has a SECTIONS clause.
15420 * Makefile.in: Regenerate.
15421
15422 * testsuite/Makefile.am (script_test_5.sh): New test case.
15423 * testsuite/Makefile.in: Regenerate.
15424 * testsuite/script_test_5.cc: New file.
15425 * testsuite/script_test_5.sh: New file.
15426 * testsuite/script_test_5.t: New file.
15427
f488e4b0
CC
154282009-02-13 Rafael Avila de Espindola <espindola@google.com>
15429
15430 * archive.cc (Archive::include_member): Update calls to add_symbols.
15431 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15432 the Layout argument.
15433 * dynobj.h (do_add_symbols): Add the Layout argument.
15434 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15435 Layout argument.
15436 * object.h (Object::add_symbols): Add the Layout argument.
15437 (Object::do_add_symbols): Add the Layout argument.
15438 (Sized_relobj::do_add_symbols): Add the Layout argument.
15439 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15440 Unify the two versions.
15441 (Add_plugin_symbols): Remove.
15442 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15443 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15444 (Add_plugin_symbols): Remove.
15445 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15446 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15447 (Add_symbols::run): Make it work with Pulginobj.
15448
89dd1680
ILT
154492009-02-06 Ian Lance Taylor <iant@google.com>
15450
15451 * object.cc (Sized_relobj::do_layout): Make info message start
15452 with lower case letter.
15453
266d0a74
ILT
154542009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15455
602b464e
ILT
15456 * binary.cc: Fix file comment.
15457
266d0a74
ILT
15458 * options.h (enum Incremental_disposition): Define.
15459 (class General_options): Add new options: --incremental,
15460 --incremental_changed, --incremental_unchanged,
15461 --incremental_unknown. Add incremental_disposition_ and
15462 implicit_incremental_ fields.
15463 (General_options::incremental_disposition): New function.
15464 (class Position_dependent_options): Add incremental_disposition
15465 option.
15466 (Position_dependent_options::copy_from_options): Set incremental
15467 dispositions.
15468 * options.cc (General_options::parse_incremental_changed): New
15469 function.
2e702c99
RM
15470 (General_options::parse_incremental_unchanged): New function.
15471 (General_options::parse_incremental_unknown): New function.
15472 (General_options::General_options): Initialize new fields
266d0a74 15473 incremental_disposition_ and implicit_incremental_.
2e702c99 15474 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15475 without --incremental.
15476
f073bbf7
CD
154772009-02-06 Chris Demetriou <cgd@google.com>
15478
15479 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15480 pointer and to report location as the file name associated with
15481 the symbol.
15482 (gold_undefined_symbol_at_location): New function to replace the
15483 old gold_undefined_symbol functionality.
15484 * target-reloc.h (relocate_section): Update to use
15485 gold_undefined_symbol_at_location.
15486 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15487 Call gold_undefined_symbol function rather than gold_error.
15488 * errors.h (Errors::undefined_symbol): Take location as a
15489 string, rather than calculating it from a relocation.
15490 * errors.cc (Errors::fatal): Print "fatal error:" before the
15491 formatted message.
15492 (Errors::error, Errors::error_at_location): Print "error: "
15493 before the formatted message.
15494 (Errors::undefined_symbol): Take location as a string, rather
15495 than calculating it from a relocation.
15496 (gold_undefined_symbol_at_location): New function akin to
15497 old gold_undefined_symbol, calculates location from relocation.
15498 (gold_undefined_symbol): Change to take only a Symbol pointer
15499 and to report location as the file name associated with the symbol.
15500 * testsuite/debug_msg.sh: Update for changed error messages.
15501 * testsuite/undef_symbol.sh: Likewise.
15502
8e94a90c
ILT
155032009-02-04 Duncan Sands <baldrick@free.fr>
15504
15505 PR 9812
15506 * reduced_debug_output.h
15507 (Output_reduced_debug_abbrev_section::failed): Use format for
15508 gold_warning.
15509 (Output_reduced_debug_info_section::faild): Likewise.
15510
88a0e15b
ILT
155112009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15512
15513 * script.cc (Lazy_demangler): New class.
2e702c99 15514 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15515 symbol only once.
15516
5efc7cd2
CC
155172009-01-29 Cary Coutant <ccoutant@google.com>
15518
15519 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15520 to __tls_get_addr.
15521 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15522
e0ebcf42
ILT
155232009-01-28 Ian Lance Taylor <iant@google.com>
15524
5efc7cd2 15525 * version.cc (version_string): Bump to 1.9.
75fe7426 15526
e0ebcf42
ILT
15527 * gold.h: Include <cstring> and <stdint.h>.
15528 * version.cc: Include <cstdio>.
15529 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15530 warning.
15531 * reduced_debug_output.cc (insert_into_vector): Rename from
15532 Insert_into_vector; change all callers. Use Swap_unaligned to
15533 avoid aliasing issue; remove union since it is unnecessary.
15534
8e2813be 155352009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15536
15537 * Makefile.am (CCFILES): Add gc.cc.
15538 (HFILES): Add gc.h.
15539 * Makefile.in: Regenerate.
15540 * gold.cc (Gc_runner): New class.
15541 (queue_initial_tasks): Call garbage collection related tasks
15542 when corresponding options are invoked.
15543 (queue_middle_gc_tasks): New function.
15544 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15545 processed early before laying out sections during garbage collection.
15546 * gold.h (queue_middle_gc_tasks): New function.
15547 (is_prefix_of): Move from "layout.cc".
15548 * i386.cc (Target_i386::gc_process_relocs): New function.
15549 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15550 * main.cc (main): Create object of class "Garbage_collection".
15551 * object.cc (Relobj::copy_symbols_data): New function.
15552 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15553 (Sized_relobj::do_layout): Allow this function to be called twice
15554 during garbage collection and defer layout of section during the
6d03d481
ST
15555 first call.
15556 * object.h (Relobj::get_symbols_data): New function.
15557 (Relobj::is_section_name_included): New function.
15558 (Relobj::copy_symbols_data): New function.
15559 (Relobj::set_symbols_data): New function.
15560 (Relobj::get_relocs_data): New function.
15561 (Relobj::set_relocs_data): New function.
15562 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15563 (Relobj::gc_process_relocs): New function.
15564 (Relobj::do_gc_process_relocs): New pure virtual function.
15565 (Relobj::sd_): New data member.
15566 (Sized_relobj::is_output_section_offset_invalid): New function.
15567 (Sized_relobj::do_gc_process_relocs): New function.
15568 * options.h (General_options::gc_sections): Modify to not be a no-op.
15569 (General_options::print_gc_sections): New option.
15570 * plugin.cc (Plugin_finish::run): Remove function call to
15571 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15572 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15573 * reloc.cc (Read_relocs::run): Add task to process relocs and
15574 determine unreferenced sections when doing garbage collection.
15575 (Gc_process_relocs): New class.
15576 (Sized_relobj::do_gc_process_relocs): New function.
15577 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15578 sections that are garbage collected.
15579 * reloc.h (Gc_process_relocs): New class.
15580 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15581 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15582 symbols whose corresponding sections are garbage collected.
15583 (Symbol_table::Symbol_table): Add new parameter for the garbage
15584 collection object.
15585 (Symbol_table::gc_mark_undef_symbols): New function.
15586 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15587 (Symbol_table::gc_mark_dyn_syms): New function.
15588 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15589 as garbage.
15590 (Symbol_table::add_from_object): Likewise.
15591 (Symbol_table::add_from_relobj): When building shared objects, do not
15592 treat externally visible symbols as garbage.
15593 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15594 table information for static and relocatable links.
15595 * symtab.h (Symbol_table::set_gc): New function.
15596 (Symbol_table::gc): New function.
15597 (Symbol_table::gc_mark_undef_symbols): New function.
15598 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15599 (Symbol_table::gc_mark_dyn_syms): New function.
15600 (Symbol_table::gc_): New data member.
e1df38aa 15601 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15602 function.
15603 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15604 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15605
3b293544
CF
156062009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15607
15608 * options.h (General_options::gc_sections): Define as a no-op for now.
15609 (General_options::no_keep_memory): Ditto.
15610 (General_options::Bshareable): Define.
15611 * options.cc (General_options::finalize): Honor -Bshareable.
15612
83d22aa8
AS
156132009-01-20 Andreas Schwab <schwab@suse.de>
15614
15615 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15616 read the value in the contents, since we don't use it. Use the
15617 template endianness when writing.
15618 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15619
cd536b21
AS
156202009-01-19 Andreas Schwab <schwab@suse.de>
15621
15622 * configure.tgt (powerpc64-*): Fix targ_obj.
15623
99e9a495
ILT
156242009-01-15 Ian Lance Taylor <iant@google.com>
15625
15626 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15627 local symbols when stripping all symbols.
15628
bbbfea06
CC
156292009-01-14 Cary Coutant <ccoutant@google.com>
15630
99e9a495 15631 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15632
0f7c0701
CC
156332009-01-14 Cary Coutant <ccoutant@google.com>
15634
15635 * archive.cc (Archive::get_elf_object_for_member): Remove call
15636 to File_read::claim_for_plugin.
15637 * descriptors.cc (Descriptors::open): Remove reference to
15638 is_claimed.
15639 (Descriptors::claim_for_plugin): Remove.
15640 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15641 (Descriptors::is_claimed): Remove.
15642 (claim_descriptor_for_plugin): Remove.
15643 * fileread.cc (File_read::claim_for_plugin): Remove.
15644 * fileread.h (File_read::claim_for_plugin): Remove.
15645 (File_read::descriptor): Reopen descriptor if necessary.
15646 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15647 (Plugin_manager::all_symbols_read): Add task parameter. Change
15648 all callers.
15649 (Plugin_manager::get_input_file): New function.
15650 (Plugin_manager::release_input_file): New function.
15651 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15652 corresponding data member.
15653 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15654 and pass to base constructor. Change all callers.
15655 (get_input_file, release_input_file): New functions.
15656 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15657 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15658 (Plugin_manager::all_symbols_read): Add task parameter.
15659 (Plugin_manager::get_input_file): New function.
15660 (Plugin_manager::release_input_file): New function.
15661 (Plugin_manager::task_): New data member.
15662 (Pluginobj::Pluginobj): Add filesize parameter.
15663 (Pluginobj::filename): New function.
15664 (Pluginobj::descriptor): New function.
15665 (Pluginobj::filesize): New function.
15666 (Pluginobj::filesize_): New data member.
15667 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15668 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15669 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15670
15671 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15672 with archive libraries.
15673 * testsuite/Makefile.in: Regenerate.
15674 * testsuite/plugin_test.c (struct sym_info): New type.
15675 (get_input_file, release_input_file): New static variables.
15676 (onload): Capture new transfer vector entries.
15677 (claim_file_hook): Stop reading at end of file according to filesize.
15678 Factor out parsing of readelf output into separate function.
15679 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15680 APIs and get the source file name from the symbol table. Convert
15681 source file name to corresponding object file name. Print info
15682 message when adding new input files.
15683 (parse_readelf_line): New function.
15684 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15685 * testsuite/plugin_test_2.sh: Likewise.
15686 * testsuite/plugin_test_3.sh: Likewise.
15687 * testsuite/plugin_test_4.sh: New test case.
15688
62a6d109
ILT
156892009-01-07 Ian Lance Taylor <iant@google.com>
15690
15691 * version.cc (version_string): Bump to 1.8.
15692
483620e8
CC
156932008-12-23 Cary Coutant <ccoutant@google.com>
15694
15695 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15696 * plugin.cc (Plugin_manager::finish): Rename as
15697 layout_deferred_objects. Move cleanup to separate function.
15698 (Plugin_manager::cleanup): New function.
15699 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15700 separately.
15701 * plugin.h (Plugin_manager::finish): Rename as
15702 layout_deferred_objects.
15703 (Plugin_manager::cleanup): New function.
15704 (Plugin_manager::cleanup_done): New field.
15705
d66a9eb3
CC
157062008-12-23 Cary Coutant <ccoutant@google.com>
15707
15708 * plugin.cc (is_visible_from_outside): New function.
15709 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15710 so we don't return "IR only" status for exported symbols or -r links.
15711
15712 * testsuite/Makefile.am (plugin_test_3): New test case.
15713 * testsuite/Makefile.in: Regenerate.
15714 * testsuite/plugin_test_3.sh: New file.
15715
5995b570
CC
157162008-12-22 Cary Coutant <ccoutant@google.com>
15717
15718 * object.cc (Sized_relobj::layout_section): New function.
15719 (Sized_relobj::do_layout): Defer layout of input sections until after
15720 plugin has provided replacement files.
15721 (Sized_relobj::do_layout_deferred_sections): New function.
15722 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15723 (Relobj::layout_deferred_sections): New function.
15724 (Relobj::do_layout_deferred_sections): New function.
15725 (Sized_relobj::do_layout_deferred_sections): New function.
15726 (Sized_relobj::layout_section): New function.
15727 (Sized_relobj::Deferred_layout): New structure.
15728 (Sized_relobj::deferred_layout_): New field.
15729 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15730 Change all callers. Layout deferred sections.
15731 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15732 references.
15733 (Plugin_hook::run): Move code from do_plugin_hook inline.
15734 (Plugin_hook::do_plugin_hook): Remove.
15735 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15736 (Plugin_manager::finish): Renamed, was cleanup.
15737 (Plugin_manager::should_defer_layout): New function.
15738 (Plugin_manager::add_deferred_layout_object): New function.
15739 (Plugin_manager::Deferred_layout_list): New type.
15740 (Plugin_manager::deferred_layout_objects_): New field.
15741 (Plugin_hook::do_plugin_hook): Remove.
15742
ee769c88
ILT
157432008-12-17 Ian Lance Taylor <iant@google.com>
15744
15745 * options.h (class General_options): Add --no case for
15746 --export-dynamic.
15747
abc8dcba
CC
157482008-12-16 Cary Coutant <ccoutant@google.com>
15749
15750 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15751 vector.
15752 (Plugin_manager::claim_file): Create plugin object even if
15753 plugin did not call the add_symbols callback.
15754 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15755 asking for more symbols than were added.
15756 * testsuite/Makefile.am (plugin_test_1): Add test case with
15757 no global symbols.
15758 (empty.syms): New target.
15759 * testsuite/Makefile.in: Regenerate.
15760 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15761 message. Don't call add_symbols if no globals.
15762 (all_symbols_read_hook): Don't provide replacement for empty
15763 claimed file.
15764
b0074644
ILT
157652008-12-12 Ian Lance Taylor <iant@google.com>
15766
68943102
ILT
15767 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15768 r_type == 0 for a local symbol with r_sym == 0.
15769 (scan_relocatable_relocs): Pass r_sym to
15770 local_non_section_strategy.
15771 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15772 r_sym parameter.
15773
b0074644
ILT
15774 * configure.ac: Update test for TLS descriptors: they are
15775 supported as of glibc 2.9.
15776 * configure: Rebuild.
15777
c2508178
ILT
157782008-12-11 Ian Lance Taylor <iant@google.com>
15779
15780 PR 7091
15781 * target-reloc.h (Default_scan_relocatable_relocs): For each
15782 function, map r_type == 0 to RELOC_DISCARD.
15783
2756a258
CC
157842008-12-10 Cary Coutant <ccoutant@google.com>
15785
15786 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15787 object to override a kept COMDAT group from a plugin object.
15788
bb6f53d3
ILT
157892008-12-09 Ian Lance Taylor <iant@google.com>
15790
fbc558e1
ILT
15791 PR 7088
15792 * yyscript.y (file_cmd): Handle INPUT.
15793
bb6f53d3
ILT
15794 * testsuite/initpri1.c: Change all declarations to be full
15795 prototypes by adding void, to avoid compiler warnings.
15796
4674ecfc
CC
157972008-12-05 Rafael Avila de Espindola <espindola@google.com>
15798
15799 * options.cc (General_options::parse_plugin_opt): New.
15800 (General_options::add_plugin): The argument now is just the filename.
15801 (General_options::add_plugin_option): New.
15802 * options.h (plugin_opt): New.
15803 (add_plugin): Change argument name.
15804 (add_plugin_option): New.
15805 * plugin.cc (Plugin::load): Don't parse the plugin option.
15806 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15807 (Plugin::add_option): New.
15808 (Plugin::args_): Change type.
15809 (Plugin::filename_): New.
15810 (Plugin_manager::add_plugin_option): New.
15811 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15812 * testsuite/Makefile.in: Regenerate.
15813
fd06b4aa
CC
158142008-12-05 Cary Coutant <ccoutant@google.com>
15815
15816 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15817 Handle --strip-lto-sections option.
15818 * options.h (strip_lto_sections): New option.
15819
6c52134c
CC
158202008-12-01 Cary Coutant <ccoutant@google.com>
15821
15822 * plugin.cc (ld_plugin_message): Change format parameter to const.
15823 Fix mismatch between new[] and delete.
15824
a45248e0
CC
158252008-11-14 Cary Coutant <ccoutant@google.com>
15826
15827 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15828 instead of -1U.
15829
c82fbeee
CS
158302008-11-05 Craig Silverstein <csilvers@google.com>
15831
15832 * options.cc (General_options::parse_dynamic_list): New function.
15833 * options.h (General_options): New flags dynamic_list,
15834 dynamic_list_data, dynamic_list_cpp_new, and
15835 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15836 (General_options::in_dynamic_list): New function.
15837 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15838 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15839 (Lex::can_continue_name): Likewise.
15840 (yylex): Likewise.
15841 (read_script_file): New parameter script_options.
15842 (read_dynamic_list): New function.
15843 (Script_options::define_dynamic_list): New function.
15844 (dynamic_list_keyword_parsecodes): New variable.
15845 (dynamic_list_keywords): New variable.
15846 * script.h (Script_options::define_dynamic_list): New function
15847 prototype.
15848 (read_dynamic_list): New function prototype.
15849 * symtab.cc (strprefix): New macro.
15850 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15851 dynamic_list_data, dynamic_list_cpp_new, and
15852 dynamic_list_cpp_typeinfo.
15853 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15854 (dynamic_list_expr): New rule.
15855 (dynamic_list_nodes): Likewise.
15856 (dynamic_list_node): Likewise.
15857 * testsuite/Makefile.am (dynamic_list): New test.
15858 * testsuite/Makefile.in: Regenerated.
15859 * testsuite/dynamic_list.t: New file.
15860 * testsuite/dynamic_list.sh: New file.
15861
e0bb29a5
CS
158622008-11-05 Craig Silverstein <csilvers@google.com>
15863
15864 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15865 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15866 (t11_last): Likewise.
15867 * testsuite/ver_test_6.c (main): Likewise.
15868
4e1e25e0
CC
158692008-10-07 Cary Coutant <ccoutant@google.com>
15870
15871 * options.c (General_options::finalize): Add check for -static and
15872 -shared.
15873 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15874 is not empty.
15875
92f03fcb
CC
158762008-10-02 Cary Coutant <ccoutant@google.com>
15877
15878 * plugin.cc (make_sized_plugin_object): Fix conditional
15879 compilation to work when not all targets are enabled.
15880
fbd8a257
CC
158812008-09-29 Cary Coutant <ccoutant@google.com>
15882
15883 * archive.cc (Archive::get_file_and_offset): Use filename instead
15884 of name to get library path.
15885 (Archive::include_member): Unlock external member of a thin archive.
15886
15887 * testsuite/Makefile.am (TEST_AR): New variable.
15888 (thin_archive_test_1): New test.
15889 (thin_archive_test_2): New test.
81636b3f
CC
15890 * testsuite/Makefile.in: Regenerate.
15891 * testsuite/thin_archive_main.cc: New file.
15892 * testsuite/thin_archive_test_1.cc: New file.
15893 * testsuite/thin_archive_test_2.cc: New file.
15894 * testsuite/thin_archive_test_3.cc: New file.
15895 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15896
eff45813
CC
158972008-09-29 Cary Coutant <ccoutant@google.com>
15898
15899 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15900 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15901 instead of -1U.
15902 (Sized_relobj::do_finalize_local_symbols): Likewise.
15903 (Sized_relobj::map_to_kept_section): Likewise.
15904 * object.h (Sized_relobj::invalid_address): New constant.
15905 (Sized_relobj::do_output_section_offset): Check for invalid_address
15906 and return -1ULL.
15907 * output.cc (Output_reloc::local_section_offset): Use constant
15908 invalid_address instead of -1U.
15909 (Output_reloc::get_address): Likewise.
15910 (Output_section::output_address): Change -1U to -1ULL.
15911 * output.h (Output_reloc::invalid_address): New constant.
15912 * reloc.cc (Sized_relobj::write_sections): Use constant
15913 invalid_address instead of -1U.
15914 (Sized_relobj::relocate_sections): Likewise.
15915 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15916 values for merge sections.
15917 * target-reloc.h (relocate_for_relocatable): Use constant
15918 invalid_address instead of -1U.
15919
89fc3421
CC
159202008-09-19 Cary Coutant <ccoutant@google.com>
15921
15922 Add plugin functionality for link-time optimization (LTO).
15923 * configure.ac (plugins): Add --enable-plugins option.
15924 * configure: Regenerate.
15925 * config.in: Regenerate.
15926 * Makefile.am (LIBDL): New variable.
15927 (CCFILES): Add plugin.cc.
15928 (HFILES): Add plugin.h.
15929 (ldadd_var): Add LIBDL.
15930 * Makefile.in: Regenerate.
15931
15932 * archive.cc: Include "plugin.h".
15933 (Archive::setup): Don't preread archive symbols when using a plugin.
15934 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15935 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15936 files.
15937 (Archive::include_member): Add symbols from plugin objects.
15938 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15939 * descriptors.cc (Descriptors::open): Check for file descriptors
15940 abandoned by plugins.
15941 (Descriptors::claim_for_plugin): New function.
15942 * descriptors.h (Descriptors::claim_for_plugin): New function.
15943 (Open_descriptor::is_claimed): New field.
15944 (claim_descriptor_for_plugin): New function.
15945 * fileread.cc (File_read::claim_for_plugin): New function.
15946 * fileread.h (File_read::claim_for_plugin): New function.
15947 (File_read::descriptor): New function.
15948 * gold.cc: Include "plugin.h".
15949 (queue_initial_tasks): Add task to call plugin hooks for generating
15950 new object files.
15951 * main.cc: Include "plugin.h".
15952 (main): Load plugin libraries.
15953 * object.h (Pluginobj): Declare.
15954 (Object::pluginobj): New function.
15955 (Object::do_pluginobj): New function.
15956 (Object::set_target): New function.
15957 * options.cc: Include "plugin.h".
15958 (General_options::parse_plugin): New function.
15959 (General_options::General_options): Initialize plugins_ field.
15960 (General_options::add_plugin): New function.
15961 * options.h (Plugin_manager): Declare.
15962 (General_options): Add --plugin option.
15963 (General_options::has_plugins): New function.
15964 (General_options::plugins): New function.
15965 (General_options::add_plugin): New function.
15966 (General_options::plugins_): New field.
15967 * plugin.cc: New file.
15968 * plugin.h: New file.
15969 * readsyms.cc: Include "plugin.h".
15970 (Read_symbols::do_read_symbols): Check for archive before checking
15971 for ELF file. Call plugin hooks to claim files.
15972 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15973 from a real object file; force override when processing replacement
15974 files.
15975 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15976 (Symbol::init_base_object): Likewise.
15977 (Symbol::init_base_output_data): Likewise.
15978 (Symbol::init_base_output_segment): Likewise.
15979 (Symbol::init_base_constant): Likewise.
15980 (Symbol::init_base_undefined): Likewise.
15981 (Symbol::output_section): Assert that object is not a plugin.
15982 (Symbol_table::add_from_pluginobj): New function.
15983 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15984 undefined.
15985 (Symbol_table::sized_write_globals): Likewise.
15986 (Symbol_table::add_from_pluginobj): Instantiate template.
15987 * symtab.h (Sized_pluginobj): Declare.
15988 (Symbol::in_real_elf): New function.
15989 (Symbol::set_in_real_elf): New function.
15990 (Symbol::in_real_elf_): New field.
15991 (Symbol_table::add_from_pluginobj): New function.
15992
15993 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15994 (LIBDL): New variable.
15995 (LDADD): Add LIBDL.
15996 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15997 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15998 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15999 (MOSTLYCLEANFILES): Likewise.
16000 * testsuite/Makefile.in: Regenerate.
16001 * testsuite/plugin_test.c: New file.
16002 * testsuite/plugin_test_1.sh: New file.
16003 * testsuite/plugin_test_2.sh: New file.
16004
de31bda5
ILT
160052008-09-16 Ian Lance Taylor <iant@google.com>
16006
9c2d0ef9
ILT
16007 * target-reloc.h (relocate_section): Check whether a symbol is
16008 defined by the ABI before reporting an undefined symbol error.
16009 * target.h (Target::is_defined_by_abi): Make parameter const.
16010 (Target::do_is_defined_by_abi): Likewise.
16011 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16012 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16013 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16014 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16015 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16016 * testsuite/Makefile.in: Rebuild.
16017
de31bda5
ILT
16018 * fileread.cc (make_view): Add casts to avoid warning.
16019
9fa33bee
AO
160202008-09-16 Alexandre Oliva <aoliva@redhat.com>
16021
16022 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16023 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16024
183fd0e3
AO
160252008-09-16 Alexandre Oliva <aoliva@redhat.com>
16026
16027 * options.h (General_options::output_is_executable): New.
16028 (General_options::output_is_pie): New.
16029 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16030 for shared libraries.
16031 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16032
7be8330a
CD
160332008-09-11 Chris Demetriou <cgd@google.com>
16034
16035 * options.h (origin): New -z option.
16036 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16037 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16038 in DT_FLAGS_1.
16039
a9caad02
CC
160402008-09-05 Cary Coutant <ccoutant@google.com>
16041
16042 * fileread.cc (File_read::make_view): Add check for attempt to map
16043 beyond end of file.
16044
ae6dce4d
CC
160452008-09-05 Cary Coutant <ccoutant@google.com>
16046
16047 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16048 explicit instantiations.
16049
d7ab2a47
KVH
160502008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16051
16052 PR gold/6858
16053 * options.cc (General_options::finalize): Allow undefined symbols
16054 in shlibs if linking -shared.
16055
16056 PR gold/6859
16057 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16058 symbols as not needing a dynsym entry.
16059
1e52a9c1
CS
160602008-08-20 Craig Silverstein <csilvers@google.com>
16061
16062 * fileread.cc (File_read::open): Do not lock the file unless it
16063 was successfully opened.
16064
d85c80a3
CC
160652008-08-14 Cary Coutant <ccoutant@google.com>
16066
16067 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16068 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16069 * testsuite/tls_test.cc (struct int128): 128-bit struct
16070 for testing TLS relocs with non-zero addend.
16071 (v12): New TLS variable.
16072 (t12): New test.
16073 (t_last): Add check for v12.
16074 * testsuite/tls_test.h (t12): New function.
16075 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16076
2d924fd9
ILT
160772008-08-13 Ian Lance Taylor <iant@google.com>
16078
16079 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16080 set tls_segment_ or relro_segment_.
16081 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16082 when appropriate.
16083 * output.h (Output_section::clear_is_relro): New function.
16084 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16085 sections specially even when output_data_ is empty.
16086 (Output_segment::maximum_alignment): When first section is relro,
16087 only force alignment for PT_LOAD segments.
16088 * script.cc (script_data_segment_align): New function.
16089 (script_data_segment_relro_end): New function.
16090 * script-c.h (script_data_segment_align): Declare.
16091 (script_data_segment_relro_end): Declare.
16092 * script-sections.h (class Script_sections): Declare
16093 data_segment_align and data_segment_relro_end. Add fields
16094 segment_align_index_ and saw_relro_end_.
16095 * script-sections.cc (class Sections_element): Add set_is_relro
16096 virtual function. Add new bool* parameter to place_orphan_here.
16097 Add get_output_section virtual function.
16098 (class Output_section_definition): Add set_is_relro. Add new
16099 bool* parameter to place_orphan_here. Add get_output_section.
16100 Add is_relro_ field.
16101 (Output_section_definition::Output_section_definition): Initialize
16102 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16103 and is_relro_ fields.
16104 (Output_section_definition::place_orphan_here): Add is_relro
16105 parameter.
16106 (Output_section_definition::set_section_addresses): Set relro for
16107 output section.
16108 (Output_section_definition::alternate_constraint): Likewise.
16109 (class Orphan_output_section): Add new bool* parameter to
16110 place_orphan_here. Add get_output_section.
16111 (Orphan_output_section::place_orphan_here): Add is_relro
16112 parameter.
16113 (Script_sections::Script_sections): Initialize
16114 data_segment_align_index_ and saw_relro_end_.
16115 (Script_sections::data_segment_align): New function.
16116 (Script_sections::data_segment_relro_end): New function.
16117 (Script_sections::place_orphan): Set or clear is_relro.
16118 (Script_sections::set_section_addresses): Force alignment of first
16119 TLS section.
16120 * yyscript.y (exp): Call script_data_segment_align and
16121 script_data_segment_relro_end.
16122 * testsuite/relro_script_test.t: New file.
16123 * testsuite/relro_test.cc (using_script): Declare.
16124 (t1, t2): Test using_script.
16125 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16126 (relro_script_test_SOURCES): Define.
16127 (relro_script_test_DEPENDENCIES): Define.
16128 (relro_script_test_LDFLAGS): Define.
16129 (relro_script_test_LDADD): Define.
16130 (relro_script_test.so): New target.
16131 * testsuite/Makefile.in: Rebuild.
16132
f827c9a9
CC
161332008-08-06 Cary Coutant <ccoutant@google.com>
16134
16135 * archive.cc (Archive::total_archives, Archive::total_members)
16136 (Archive::total_members_loaded): New variables.
16137 (Archive::setup): Add parameter. Add option to preread
16138 archive symbols.
16139 (Archive::read_armap): Add counter.
16140 (Archive::get_file_and_offset): New function.
16141 (Archive::get_elf_object_for_member): New function.
16142 (Archive::read_all_symbols): New function.
16143 (Archive::read_symbols): New function.
16144 (Archive::add_symbols): Add counters.
16145 (Archive::include_all_members): Use armap to find members if it's
16146 already built.
16147 (Archive::include_member): Skip reading symbols if already read.
16148 Factored code into Archive::get_file_and_offset and
16149 Archive::get_elf_object_for_member. Changed call to
16150 Mapfile::report_include_archive_member.
16151 (Archive::print_stats): New function.
16152 * archive.h: Declare Object and Read_symbols_data classes.
16153 (Archive::Archive): Add initializers for new members.
16154 (Archive::setup): Add parameter.
16155 (Archive::print_stats): New function.
16156 (Archive::total_archives, Archive::total_members)
16157 (Archive::total_members_loaded): New variables.
16158 (Archive::get_file_and_offset): New function.
16159 (Archive::get_elf_object_for_member): New function.
16160 (Archive::read_all_symbols): New function.
16161 (Archive::read_symbols): New function.
16162 (Archive::Archive_member): New class.
16163 (Archive::members_): New member.
16164 (Archive::num_members_): New member.
16165 * main.cc: Include archive.h.
16166 (main): Call Archive::print_stats.
16167 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16168 archive parameter; member_name is now the fully-decorated name.
16169 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16170 * options.h: (General_options): Add --preread-archive-symbols option.
16171 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16172 Archive::setup.
16173
de4c45bd
ILT
161742008-08-04 Ian Lance Taylor <iant@google.com>
16175
16176 * symtab.h (Symbol::use_plt_offset): New function.
16177 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16178 * powerpc.cc (Relocate::relocate): Likewise.
16179 * sparc.cc (Relocate::relocate): Likewise.
16180 * x86_64.cc (Relocate::relocate): Likewise.
16181 * testsuite/weak_plt.sh: New test.
16182 * testsuite/weak_plt_main.cc: New test.
16183 * testsuite/weak_plt_shared.cc: New test.
16184 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16185 (check_PROGRAMS): Add weak_plt.
16186 (check_DATA): Add weak_plt_shared.so.
16187 (weak_plt_main_pic.o, weak_plt): New targets.
16188 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16189 * testsuite/Makefile.in: Rebuild.
16190
16191 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16192 gcctestdir/ld.
16193 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16194 * testsuite/Makefile.in: Rebuild.
16195
323ee3f4
AM
161962008-08-04 Alan Modra <amodra@bigpond.net.au>
16197
16198 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16199 * Makefile.in: Regenerate.
16200 * po/POTFILES.in: Regenerate.
16201
7c07ecec
ILT
162022008-07-29 Ian Lance Taylor <iant@google.com>
16203
16204 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16205 symbols before other symbols.
16206 * testsuite/script_test_2.cc (test_addr): Declare.
16207 (test_addr_alias): Declare.
16208 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16209 values.
7c07ecec
ILT
16210 * testsuite/script_test_2.t: Define test_addr_alias and
16211 test_addr.
16212
5778530e
ILT
162132008-07-24 Ian Lance Taylor <iant@google.com>
16214
2a00e4fb
ILT
16215 PR 5990
16216 * descriptors.cc: New file.
16217 * descriptors.h: New file.
16218 * gold-threads.h (class Hold_optional_lock): New class.
16219 * fileread.cc: Include "descriptors.h".
16220 (File_read::~File_read): Release descriptor rather than closing
16221 it.
16222 (File_read::open) [file]: Call open_descriptor rather than open.
16223 Set is_descriptor_opened_.
16224 (File_read::open) [memory]: Assert that descriptor is not open.
16225 (File_read::reopen_descriptor): New function.
16226 (File_read::release): Release descriptor.
16227 (File_read::do_read): Make non-const. Reopen descriptor.
16228 (File_read::read): Make non-const.
16229 (File_read::make_view): Reopen descriptor.
16230 (File_read::do_readv): Likewise.
16231 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16232 Update declarations.
16233 * layout.cc: Include "descriptors.h".
16234 (Layout::create_build_id): Use open_descriptor rather than open.
16235 * output.cc: Include "descriptors.h".
16236 (Output_file::open): Use open_descriptor rather than open.
16237 * archive.cc (Archive::const_iterator): Change Archive to be
16238 non-const.
16239 (Archive::begin, Archive::end): Make non-const.
16240 (Archive::count_members): Likewise.
16241 * archive.h (class Archive): Update declarations.
16242 * object.h (Object::read): Make non-const.
16243 * Makefile.am (CCFILES): Add descriptors.cc.
16244 (HFILES): Add descriptors.h.
16245 * Makefile.in: Rebuild.
16246
801647d1
ILT
16247 PR 6716
16248 * gold.h: Always include <clocale>. Add Solaris workarounds
16249 following code in binutils/sysdep.h.
16250
5edd166e
ILT
16251 PR 6048
16252 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16253 this->eh_frame_hdr_ is NULL before using it.
16254
c89ad728
ILT
16255 * dynobj.cc (Versions::Versions): Update comment.
16256
aa86f06b
ILT
16257 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16258 the base version name.
16259
5778530e
ILT
16260 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16261 array size plus one.
16262 (Stringpool_template::set_string_offsets): Subtract one from key
16263 before using it as an array index.
16264 (Stringpool_template::get_offset_with_length): Likewise.
16265 (Stringpool_template::write_to_buffer): Likewise.
16266 * stringpool.h (Stringpool_template::get_offset_from_key):
16267 Likewise.
16268
057ead22
ILT
162692008-07-23 Ian Lance Taylor <iant@google.com>
16270
7f649c59
ILT
16271 PR 6658
16272 * object.h (Merged_symbol_value::value): Do our best to handle a
16273 negative addend.
16274
057ead22
ILT
16275 PR 6647
16276 * script.cc (Version_script_info::get_versions): Don't add empty
16277 version tag to return value.
16278 (Version_script_info::get_symbol_version_helper): Change return
16279 type to bool. Add pversion parameter. Change all callers.
16280 (script_register_vers_node): Don't require a non-NULL tag.
16281 * script.h (class Version_script_info): Update declarations.
16282 (Version_script_info::get_symbol_version): Change return type to
16283 bool. Add version parameter. Change all callers.
16284 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16285 handling. Handle an empty version from a version script.
16286 (Symbol_table::define_special_symbol): Likewise.
16287 * testsuite/ver_test_10.script: New file.
16288 * testsuite/ver_test_10.sh: New file.
16289 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16290 (check_DATA): Add ver_test_10.syms.
16291 (ver_test_10.syms, ver_test_10.so): New target.
16292 * testsuite/Makefile.in: Rebuild.
16293
58e54ac2
CD
162942008-07-23 Simon Baldwin <simonb@google.com>
16295
16296 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16297 to zero for undefined symbols from dynamic libraries.
16298
95d14cd3
ILT
162992008-07-23 Ian Lance Taylor <iant@google.com>
16300
16301 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16302 Change all callers.
16303 * symtab.h (class Symbol_table): Update declaration.
16304 * testsuite/ver_test_9.cc: New file.
16305 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16306 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16307 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16308 (ver_test_9.so, ver_test_9.o): New targets.
16309 * testsuite/Makefile.in: Rebuild.
16310
92de84a6
ILT
163112008-07-22 Ian Lance Taylor <iant@google.com>
16312
34810851
ILT
16313 * options.h (class General_options): Define --check-sections.
16314 * layout.cc (Layout::set_segment_offsets): Handle
16315 --check-sections.
16316
af6156ef
ILT
16317 * options.h (class General_options): Define -n/--nmagic and
16318 -N/--omagic.
16319 * options.cc (General_options::finalize): For -n/--nmagic or
16320 -N/--omagic, set -static.
16321 * layout.cc (Layout::attach_allocated_section_to_segment): If
16322 -N/--omagic, don't put read-only and read-write sections in
16323 different segments.
16324 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16325 finding a read-only segment.
16326 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16327 don't set the minimum segment alignment to the common page size,
16328 and don't set the file offset to the address modulo the page size.
16329 * script-sections.cc (Script_sections::create_segments): If
16330 -n/--omagic, don't put read-only and read-write sections in
16331 different segments.
16332
92de84a6
ILT
16333 * cref.cc: New file.
16334 * cref.h: New file.
16335 * options.h (class General_options): Add --print-symbol-counts.
16336 * main.cc (main): Issue defined symbol report if requested.
16337 * archive.cc (Archive::interpret_header): Make into a const member
16338 function.
16339 (Archive::add_symbols): Call Input_objects::archive_start and
16340 archive_stop.
16341 (Archive::const_iterator): Define new class.
16342 (Archive::begin, Archive::end): New functions.
16343 (Archive::include_all_members): Rewrite to use iterator.
16344 (Archive::count_members): New function.
16345 * archive.h (class Archive): Update declarations.
16346 (Archive::filename): New function.
16347 * object.cc: Include "cref.h".
16348 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16349 (Sized_relobj::do_get_global_symbol_counts): New function.
16350 (Input_objects::add_object): Add object to cross-referencer.
16351 (Input_objects::archive_start): New function.
16352 (Input_objects::archive_stop): New function.
16353 (Input_objects::print_symbol_counts): New function.
16354 * object.h: Declare Cref and Archive.
16355 (Object::get_global_symbol_counts): New function.
16356 (Object::do_get_global_symbol_counts): New pure virtual function.
16357 (class Sized_relobj): Add defined_count_ field. Update
16358 declarations.
16359 (class Input_objects): Add cref_ field. Update constructor.
16360 Update declarations.
16361 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16362 defined_count_.
16363 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16364 symbol counts.
16365 (Sized_dynobj::do_get_global_symbol_counts): New function.
16366 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16367 defined_count_. Update declarations. Define Symbols typedef.
16368 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16369 parameter. Change all callers.
16370 (Symbol_table::add_from_dynobj): Add sympointers and defined
16371 parameters. Change all callers.
16372 * symtab.h (class Symbol_table): Update declarations.
16373 * Makefile.am (CCFILES): Add cref.cc.
16374 (HFILES): Add cref.h.
16375 * Makefile.in: Rebuild.
16376
3f7c5e1d
CD
163772008-07-22 Simon Baldwin <simonb@google.com>
16378
16379 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16380 to zero when writing undefined symbols.
16381
e0b64032
ILT
163822008-07-22 Ian Lance Taylor <iant@google.com>
16383
16384 * output.cc (Output_section::add_input_section): Don't try to
16385 merge empty merge sections.
16386
096b02cf
CS
163872008-07-21 Craig Silverstein <csilvers@google.com>
16388
16389 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16390 Include symbol version in error message.
cd536b21 16391
1d1f116d
CD
163922008-07-20 Chris Demetriou <cgd@google.com>
16393
cd536b21 16394 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16395 (RANDOM_SEED_CFLAGS): New substituted variable.
16396 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16397 * configure: Rebuild.
16398 * Makefile.in: Likewise.
16399 * testsuite/Makefile.in: Likewise.
16400
a18f591e
ILT
164012008-07-18 Ian Lance Taylor <iant@google.com>
16402
16403 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16404 where we see NAME/NULL and NAME/VERSION as separate symbols.
16405 * testsuite/ver_test_main.cc (main): Call t4.
16406 (t4, t4_2a): Define.
16407 * testsuite/ver_test_2.cc (t4_2): Define.
16408 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16409 * testsuite/ver_test_4.cc (t4_2a): Define.
16410 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16411 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16412
c6e3f6ed
ILT
164132008-07-17 Ian Lance Taylor <iant@google.com>
16414
16415 * dynobj.cc (Versions::add_def): If we give an error about a
16416 missing version, go ahead and create the version anyhow.
16417
ef9beddf
ILT
164182008-07-10 Ian Lance Taylor <iant@google.com>
16419
16420 Handle output sections with more than 0x7fffffff bytes.
16421 * object.h (class Relobj): Change map_to_output_ to
16422 output_sections_, and just keep a section pointer. Change all
16423 uses. Move comdat group support to Sized_relobj.
16424 (Relobj::is_section_specially_mapped): Remove.
16425 (Relobj::output_section): Remove poff parameter. Change all
16426 callers.
16427 (Relobj::output_section_offset): New function.
16428 (Relobj::set_section_offset): Rewrite.
16429 (Relobj::map_to_output): Remove.
16430 (Relobj::output_sections): New function.
16431 (Relobj::do_output_section_offset): New pure virtual function.
16432 (Relobj::do_set_section_offset): Likewise.
16433 (class Sized_relobj): Add section_offsets_ field. Add comdat
16434 group support from Relobj. Update declarations.
16435 (Sized_relobj::get_output_section_offset): New function.
16436 (Sized_relobj::do_output_section_offset): New function.
16437 (Sized_relobj::do_set_section_offset): New function.
16438 * object.cc (Relobj::output_section_address): Remove.
16439 (Sized_relobj::Sized_relobj): Initialize new fields.
16440 (Sized_relobj::include_section_group): Cast find_kept_object to
16441 Sized_relobj.
16442 (Sized_relobj::include_linkonce_section): Likewise.
16443 (Sized_relobj::do_layout): Use separate arrays for output section
16444 and output offset.
16445 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16446 output_sections.
16447 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16448 output_sections and section_offsets.
16449 (Sized_relobj::write_local_symbols): Likewise.
16450 (map_to_kept_section): Compute output address directly.
16451 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16452 output_sections and section_offsets.
16453 (Sized_relobj::write_sections): Likewise.
16454 (Sized_relobj::relocate_sections): Likewise.
16455 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16456 * output.h (class Output_reloc): Update declarations. Change
16457 u2_.relobj to Sized_relobj*.
16458 (class Output_data_reloc): Change add functions to use
16459 Sized_relobj*.
16460 * output.cc (Output_reloc::Output_reloc): Change relobj to
16461 Sized_relobj*.
16462 (Output_reloc::local_section_offset): Change return type to
16463 Elf_Addr. Use get_output_section_offset.
16464 (Output_reloc::get_address): Likewise.
16465 (Output_section::is_input_address_mapped): Don't call
16466 is_section_specially_mapped.
16467 (Output_section::output_offset): Likewise.
16468 (Output_section::output_address): Likewise.
16469 (Output_section::starting_output_address): Likewise.
16470 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16471 parameter to Sized_relobj*.
16472 (Copy_relocs::need_copy_reloc): Likewise.
16473 (Copy_relocs::save): Likewise.
16474 * copy-relocs.h (class Copy_relocs): Update declarations.
16475 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16476 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16477 * target-reloc.h (relocate_for_relocatable): Change
16478 offset_in_output_section type to Elf_Addr. Change code that uses
16479 it as well.
16480 * layout.cc (Layout::layout): Always set *off.
16481 * mapfile.cc (Mapfile::print_input_section): Use
16482 output_section_offset.
16483 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16484 Sized_relobj*.
16485 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16486 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16487 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16488
5cb66f97
ILT
164892008-07-03 Ian Lance Taylor <iant@google.com>
16490
16491 * layout.cc (Layout::include_section): Do not discard unrecognized
16492 SHT_STRTAB sections.
16493
afe47622
CS
164942008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16495
16496 * script.cc (Lex::can_continue_name): Make '?' allowable in
16497 version-script names.
16498 * testsuite/version_script.map: Change glob pattern to use '?'
16499
5adf9721
ILT
165002008-06-30 Manish Singh <yosh@gimp.org>
16501
16502 PR 6585
16503 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16504 Correct typo.
16505
e6fde208
ILT
165062008-06-30 Ian Lance Taylor <iant@google.com>
16507
16508 PR 6660
16509 PR 6682
16510 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16511 versions]: Don't try to read the value in the contents, since we
16512 don't use it. Use the template endianness when writing.
16513
3f2e6a2d
CC
165142008-06-25 Cary Coutant <ccoutant@google.com>
16515
16516 * fileread.cc (File_read::make_view): Assert on zero-length view.
16517 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16518 symbol table when there are no symbols to read.
16519
c43d3a48
CS
165202008-06-23 Craig Silverstein <csilvers@google.com>
16521
16522 * version.cc (version_string): Bump to 1.7
16523
5f494ea0
CS
165242008-06-18 Craig Silverstein <csilvers@google.com>
16525
16526 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16527 constant 0xFFFF to type Valtype.
16528 (Powerpc_relocate_functions::rel16_ha): Likewise.
16529
c42e122e
ILT
165302008-06-17 Ian Lance Taylor <iant@google.com>
16531
f34787f8
ILT
16532 * output.h (Output_section::Input_section): Initialize p2align_ to
16533 zero for Output_section_data constructors.
16534 (Output_section::Input_section::addralign): If not an input
16535 section, return the alignment of the Output_section_data.
16536 * testsuite/copy_test.cc: New file.
16537 * testsuite/copy_test_1.cc: New file.
16538 * testsuite/copy_test_2.cc: New file.
16539 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16540 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16541 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16542 (copy_test_1_pic.o, copy_test_1.so): New targets.
16543 (copy_test_2_pic.o, copy_test_2.so): New targets.
16544 * testsuite/Makefile.in: Rebuild.
16545
c42e122e
ILT
16546 * script-sections.cc (Script_sections::place_orphan): Initialize
16547 local variable exact.
16548
ce3ac18a
DE
165492008-06-13 David Edelsohn <edelsohn@gnu.org>
16550
16551 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16552
42cacb20
DE
165532008-06-12 David Edelsohn <edelsohn@gnu.org>
16554 David S. Miller <davem@davemloft.net>
16555
16556 * powerpc.cc: New file.
16557 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16558 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16559 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16560 * Makefile.in: Rebuild.
16561
7b308235
ILT
165622008-06-09 Ian Lance Taylor <iant@google.com>
16563
16564 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16565 <exception>.
16566 (throwing, orig_terminate): New static variables.
16567 (terminate_handler): New static function.
16568 (t2): Set terminate handler.
16569
f0b886e3
ILT
165702008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16571
16572 PR 6584
cd536b21 16573 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16574 alignment.
16575
3e90f135
CC
165762008-05-30 Cary Coutant <ccoutant@google.com>
16577
16578 * archive.cc (Archive::include_all_members) Correct to step
16579 over symbol table and extended name table in thin archives.
16580
e09ad04a
ILT
165812008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16582
16583 PR 6407
16584 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16585 calculation.
16586
62b01cb5
ILT
165872008-05-28 Caleb Howe <cshowe@google.com>
16588
16589 * reduced_debug_output.cc: New file.
16590 * reduced_debug_output.h: New file.
92de84a6 16591 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16592 * options.cc (General_options::finalize): Add strip_debug_non_line
16593 to the strip heirarchy.
16594 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16595 fields.
16596 * layout.cc: Include "reduced_debug_output.h".
16597 (Layout::Layout): Initialize new fields.
16598 (line_only_debug_sections): New static array.
16599 (is_lines_only_debug_sections): New static inline function.
16600 (Layout::include_section): Handle --strip-debug-non-line.
16601 (Layout::make_output_section): If --strip-debug-non-line, build
16602 new output sections for .debug_abbrev and .debug_info.
16603 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16604 gold. Warn about possible overflow.
16605 (read_signed_LEB_128): Likewise.
16606 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16607 (read_signed_LEB_128): Declare.
16608 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16609 (HFILES): Add reduced_debug_output.h.
16610 * Makefile.in: Rebuild.
16611
7d9e3d98
ILT
166122008-05-21 Ian Lance Taylor <iant@google.com>
16613
16614 * mapfile.cc: New file.
16615 * mapfile.h: New file.
16616 * options.h (class General_options): Add -M/--print-map and -Map.
16617 * options.cc (General_options::finalize): Make -M equivalent to
16618 -Map -.
16619 * main.cc: Include <cstdio> and "mapfile.h".
16620 (main): Open mapfile if requested.
16621 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16622 constructor. Change caller.
16623 (queue_initial_tasks): Add mapfile parameter. Change caller.
16624 (queue_middle_tasks): Likewise.
16625 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16626 declarations.
16627 * archive.cc: Include "mapfile.h".
16628 (Archive::add_symbols): Add mapfile parameter. Change all
16629 callers. Pass mapfile, symbol, and reason to include_member.
16630 (Archive::include_all_members): Add mapfile parameter. Change all
16631 callers.
16632 (Archive::include_member): Add mapfile, sym, and why parameters.
16633 Change all callers. Report inclusion to map file.
16634 * archive.h: Include "fileread.h".
16635 (class Archive): Update declarations.
16636 (Archive::file): New const method.
16637 (class Add_archive_symbols): Add mapfile_ field. Update
16638 constructor. Change all callers.
16639 * readsyms.h (class Read_symbols): Likewise.
16640 (class Finish_group): Likewise.
16641 (class Read_script): Likewise.
16642 * common.cc: Include "mapfile.h".
16643 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16644 all callers.
16645 (Symbol_table::do_allocate_commons): Likewise.
16646 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16647 symbol allocation to mapfile.
16648 * common.h (class Allocate_commons_task): Add mapfile_ field.
16649 Update constructor. Change all callers.
16650 * symtab.h (class Symbol_table): Update declarations.
16651 * layout.cc: Include "mapfile.h".
16652 (Layout_task_runner::run): Print information to mapfile.
16653 (Layout::create_gold_note): Change Output_data_fixed_space to
16654 Output_data_zero_fill.
16655 (Layout::create_build_id): Likewise.
16656 (Layout::print_to_mapfile): New function.
16657 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16658 constructor. Change caller.
16659 (class Layout): Declare print_to_mapfile.
16660 * output.cc (Output_section::Input_section::print_to_mapfile): New
16661 function.
16662 (Output_section::add_input_section): If producing a map, always
16663 add to input_sections_ list.
16664 (Output_section::do_print_to_mapfile): New function.
16665 (Output_segment::print_sections_to_mapfile): New function.
16666 (Output_segment::print_section_list_to_mapfile): New function.
16667 * output.h: Include "mapfile.h".
16668 (Output_data::print_to_mapfile): New function.
16669 (Output_data::do_print_to_mapfile): New virtual function.
16670 (Output_segment_headers::do_print_to_mapfile): New function.
16671 (Output_file_header::do_print_to_mapfile): New function.
16672 (Output_data_const::do_print_to_mapfile): New function.
16673 (class Output_data_const_buffer): Add map_name_ field. Update
16674 constructor. Change all callers. Add do_print_to_mapfile
16675 function.
16676 (class Output_data_fixed_space): Likewise.
16677 (class Output_data_space): Likewise.
16678 (class Output_data_zero_fill): New class.
16679 (Output_data_strtab::do_print_to_mapfile): New function.
16680 (Output_data_reloc_base::do_print_to_mapfile): New function.
16681 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16682 (Output_data_group::do_print_to_mapfile): New function.
16683 (Output_data_got::do_print_to_mapfile): New function.
16684 (Output_data_dynamic::do_print_to_mapfile): New function.
16685 (Output_symtab_xindex::do_print_to_mapfile): New function.
16686 (class Output_section): Declare do_print_to_mapflie. Declare
16687 print_to_mapfile in Input_section.
16688 (class Output_segment): Declare new functions.
16689 * object.h (Sized_relobj::symbol_count): New function.
16690 * script-sections.cc
16691 (Output_section_element_dot_assignment::set_section_addresses):
16692 Change Output_data_fixed_space to Output_data_zero_fill.
16693 (Output_data_expression::do_print_to_mapfile): New function.
16694 * script.cc (read_input_script): Add mapfile parameter. Change
16695 all callers.
16696 * script.h (read_input_script): Update declaration.
16697 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16698 (Eh_frame::do_print_to_mapfile): New function.
16699 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16700 (Output_merge_string::do_print_to_mapfile): New function.
16701 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16702 function.
16703 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16704 function.
16705 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16706 function.
16707 * Makefile.am (CCFILES): Add mapfile.cc.
16708 (HFILES): Add mapfile.h.
16709 * Makefile.in: Rebuild.
16710
9f1d377b
ILT
167112008-05-19 Ian Lance Taylor <iant@google.com>
16712
16713 * options.h (class General_options): Add -z relro.
16714 * layout.cc (Layout::Layout): Initialize relro_segment_.
16715 (Layout::add_output_section_data): Return the output section.
16716 (Layout::make_output_section): Rcognize relro sections and mark
16717 them appropriately.
16718 (Layout::attach_allocated_section_to_segment): Put relro sections
16719 in a PT_GNU_RELRO segment.
16720 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16721 section as relro.
16722 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16723 PT_TLS segments.
16724 (Layout::linkonce_mapping): Map d.rel.ro.local to
16725 .data.rel.ro.local.
16726 (Layout::output_section_name): Us .data.rel.ro.local for any
16727 section which begins with that.
16728 * layout.h (class Layout): Update add_output_section_data
16729 declaration. Add relro_segment_ field.
16730 * output.cc (Output_section::Output_section): Initialize is_relro_
16731 and is_relro_local_ fields.
16732 (Output_segment::add_output_section): Group relro sections.
16733 (Output_segment::is_first_section_relro): New function.
16734 (Output_segment::maximum_alignment): If there is a relro section,
16735 align the segment to the common page size.
16736 (Output_segment::set_section_addresses): Track whether we are
16737 looking at relro sections. If the last section is a relro
16738 section, align to the common page size.
16739 (Output_segment::set_section_list_addresses): Add in_relro
16740 parameter. Change all callers. Align to the page size when
16741 moving from relro to non-relro section.
16742 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16743 segment.
16744 * output.h (class Output_section): Add is_relro_ and
16745 is_relro_local_ fields.
16746 (Output_section::is_relro): New function.
16747 (Output_section::set_is_relro): New function.
16748 (Output_section::is_relro_local): New function.
16749 (Output_section::set_is_relro_local): New function.
16750 (class Output_segment): Update declarations.
16751 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16752 * sparc.cc (Target_sparc::got_section): Likewise.
16753 * x86_64.cc (Target_x86_64::got_section): Likewise.
16754 * testsuite/relro_test_main.cc: New file.
16755 * testsuite/relro_test.cc: New file.
16756 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16757 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16758 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16759 (relro_test.so, relro_test_pic.o): New targets.
16760 * testsuite/Makefile.in: Rebuild.
16761
a984ee1d
ILT
167622008-05-16 Ian Lance Taylor <iant@google.com>
16763
01676dcd
ILT
16764 * output.cc (Output_segment::add_output_section): Remove front
16765 parameter.
16766 * output.h (class Output_segment): Remove
16767 add_initial_output_section and overloaded add_output_section.
16768 Update declaration of remaining add_output_section.
16769 * layout.cc (Layout::create_interp): Call add_output_section
16770 rather than add_initial_output_section.
16771 (Layout::finish_dynamic_section): Likewise.
16772
497897f9
ILT
16773 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16774 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16775 know the dynamic type.
16776 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16777 field. Initialize it in constructor.
16778 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16779 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16780 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16781 reloc.
16782
a984ee1d
ILT
16783 * output.cc (Output_reloc::get_address): Change return type to
16784 Elf_Addr.
16785 * output.h (class Output_reloc): Update get_address declaration.
16786 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16787 for section addresses.
16788
55ba0940
ILT
167892008-05-09 Ian Lance Taylor <iant@google.com>
16790
16791 PR 6493
16792 * gold.cc (gold_nomem): Use return value of write.
16793
75517b77
ILT
167942008-05-08 Ian Lance Taylor <iant@google.com>
16795
16796 * symtab.c (Symbol::init_base_output_data): Add version
16797 parameter. Change all callers.
16798 (Symbol::init_base_output_segment): Likewise.
16799 (Symbol::init_base_constant): Likewise.
16800 (Symbol::init_base_undefined): Likewise.
16801 (Sized_symbol::init_output_data): Likewise.
16802 (Sized_symbol::init_output_segment): Likewise.
16803 (Sized_symbol::init_constant): Likewise.
16804 (Sized_symbol::init_undefined): Likewise.
16805 (Symbol_table::do_define_in_output_data): If the new symbol has a
16806 version, mark it as the default.
16807 (Symbol_table::do_define_in_output_segment): Likewise.
16808 (Symbol_table::do_define_as_constant): Likewise.
16809 * symtab.h (class Symbol): Update declarations.
16810 (class Sized_symbol): Likewise.
16811 * resolve.cc (Symbol::override_version): New function.
c42e122e 16812 (Symbol::override_base): Call override_version.
75517b77
ILT
16813 (Symbol::override_base_with_special): Likewise.
16814 * testsuite/ver_script_8.script: New file.
16815 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16816 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16817 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16818 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16819
f1f70eae
ILT
168202008-05-06 Ian Lance Taylor <iant@google.com>
16821
f3e9c5c5
ILT
16822 PR 6049
16823 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16824 functions.
16825 (class General_options): Remove existing --undefined, and add
16826 --no-undefined instead. Add new --undefined as synonym for -u.
16827 * archive.cc (Archive::add_symbols): Check whether symbol was
16828 named with -u.
16829 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16830 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16831 all uses. Add IS_UNDEFINED. Update declarations to split
16832 different versions of init_base. Declare init_base_undefined.
16833 (Symbol::is_defined): Handle IS_UNDEFINED.
16834 (Symbol::is_undefined): Likewise.
16835 (Symbol::is_weak_undefined): Call is_undefined.
16836 (Symbol::is_absolute): Handle IS_CONSTANT.
16837 (class Sized_symbol): Update declarations to split different
16838 versions of init. Declare init_undefined.
16839 (class Symbol_table): Declare new functions.
16840 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16841 Change all callers.
16842 (Symbol::init_base_output_data): Likewise.
16843 (Symbol::init_base_output_segment): Likewise.
16844 (Symbol::init_base_constant): Likewise.
16845 (Symbol::init_base_undefined): New function.
16846 (Sized_symbol::init_object): Rename from init. Change all
16847 callers.
16848 (Sized_symbol::init_output_data): Likewise.
16849 (Sized_symbol::init_output_segment): Likewise.
16850 (Sized_symbol::init_constant): Likewise.
16851 (Sized_symbol::init_undefined): New function.
16852 (Symbol_table::add_undefined_symbols_from_command_line): New
16853 function.
16854 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16855 function.
16856 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16857 (Symbol::output_section): Likewise.
16858 (Symbol::set_output_section): Likewise.
16859 (Symbol_table::sized_finalize_symbol): Likewise.
16860 (Symbol_table::sized_write_globals): Likewise.
16861 * resolve.cc (Symbol_table::should_override): Likewise.
16862 (Symbol::override_base_with_special): Likewise.
16863
8bdcdf2c
ILT
16864 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16865 symbol, change it to have default visibility.
16866 * testsuite/protected_1.cc: New file.
16867 * testsuite/protected_2.cc: New file.
16868 * testsuite/protected_3.cc: New file.
16869 * testsuite/protected_main_1.cc: New file.
16870 * testsuite/protected_main_2.cc: New file.
16871 * testsuite/protected_main_3.cc: New file.
16872 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16873 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16874 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16875 (protected_1.so): New target.
16876 (protected_1_pic.o, protected_2_pic.o): New targets.
16877 (protected_3_pic.o): New target.
16878 (check_PROGRAMS): Add protected_2.
16879 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16880 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16881 * testsuite/Makefile.in: Rebuild.
16882
2b706932
ILT
16883 * options.h (DEFINE_var): Add set_user_set_##varname__.
16884 (DEFINE_bool_alias): New macro.
16885 (class General_options): Define -Bstatic using DEFINE_bool_alias
16886 rather than DEFINE_special. Add --undefined as an alias for -z
16887 defs.
16888 * options.cc (General_options::parse_Bstatic): Remove.
16889
d82a5bcc
ILT
16890 * options.h (class General_options): Add --fatal-warnings.
16891 * main.cc (main): Implement --fatal-warnings.
16892 * errors.h (Errors::warning_count): New function.
16893
f1f70eae
ILT
16894 * options.h (class General_options): Add -Bsymbolic-functions.
16895 * symtab.h (Symbol::is_preemptible): Check for
16896 -Bsymbolic-functions.
16897
8825ac63
ILT
168982008-05-05 Ian Lance Taylor <iant@google.com>
16899
d98bc257
ILT
16900 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16901 as noVARNAME rather than no-VARNAME.
16902 (class General_options): Add option -z combreloc.
16903 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16904 get_address.
16905 (Output_reloc::sort_before) [SHT_REL]: New function.
16906 (Output_reloc::sort_before) [SHT_RELA]: New function.
16907 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16908 Sort_relocs_comparison.
16909 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16910 parameter. Change all callers.
16911 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16912 sort_relocs parameter. Change all callers.
16913 * output.cc (Output_reloc::get_address): New function, broken out
16914 of write_rel.
16915 (Output_reloc::write_rel): Call it.
16916 (Output_reloc::compare): New function.
16917 (Output_data_reloc_base::do_write): Optionally sort relocs.
16918
60b2b4e7
ILT
16919 * configure.ac: If targ_extra_obj is set, link it in.
16920 * configure.tgt: Initialize all variables.
16921 (x86_64*): Set targ_extra_obj and targ_extra_size.
16922 * configure: Rebuild.
16923
8825ac63
ILT
16924 * object.cc (Sized_relobj::include_section_group): Adjust section
16925 indexes read from group data. Build vector to pass to
16926 layout_group.
16927 * layout.cc (Layout::layout_group): Add flags and shndxes
16928 parameters. Remove contents parameter. Change caller. Update
16929 explicit instantiations.
16930 * layout.h (class Layout): Update layout_group declaration.
16931 * output.cc (Output_data_group::Output_data_group): Add flags and
16932 input_shndxes parameters. Remove contents parameter. Change
16933 caller.
16934 (Output_data_group::do_write): Change input_sections_ to
16935 input_shndxes_.
16936 * output.h (class Output_data_group): Update constructor
16937 declaration. Rename input_sections_ to input_shndxes_.
16938 * testsuite/many_sections_test.cc: Add template.
16939
e94cf127
CC
169402008-04-30 Cary Coutant <ccoutant@google.com>
16941
4418b2d5
CC
16942 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16943
e94cf127
CC
16944 * layout.cc (Layout::include_section): Refactored check for debug
16945 info section.
16946 (Layout::add_comdat): Add new parameters. Change type
16947 of signature parameter. Add object and shndx to signatures table.
16948 (Layout::find_kept_object): New function.
16949 * layout.h: Include <cstring>.
16950 (Layout::is_debug_info_section): New function.
16951 (Layout::add_comdat): Add new parameters.
16952 (Layout::find_kept_object): New function.
16953 (Layout::Kept_section): New struct.
16954 (Layout::Signatures): Change type of map range.
16955 * object.cc (Relobj::output_section_address): New function.
16956 (Sized_relobj::include_section_group): Add new parameters. Change
16957 calls to Layout::add_comdat. Change to build table of kept comdat
16958 groups and table mapping discarded sections to kept sections.
16959 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16960 (Sized_relobj::do_layout): Change calls to include_section_group and
16961 include_linkonce_section.
16962 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16963 value to zero when section is discarded.
16964 (Sized_relobj::map_to_kept_section): New function.
16965 * object.h (Relobj::output_section_address): New function.
16966 (Relobj::Comdat_group): New type.
16967 (Relobj::find_comdat_group): New function.
16968 (Relobj::Comdat_group_table): New type.
16969 (Relobj::Kept_comdat_section): New type.
16970 (Relobj::Kept_comdat_section_table): New type.
16971 (Relobj::add_comdat_group): New function.
16972 (Relobj::set_kept_comdat_section): New function.
16973 (Relobj::get_kept_comdat_section): New function.
16974 (Relobj::comdat_groups_): New field.
16975 (Relobj::kept_comdat_sections_): New field.
16976 (Symbol_value::input_value): Update comment.
16977 (Sized_relobj::map_to_kept_section) New function.
16978 (Sized_relobj::include_linkonce_section): Add new parameter.
16979 * target-reloc.h (Comdat_behavior): New type.
16980 (get_comdat_behavior): New function.
16981 (relocate_section): Add code to map a discarded section to the
16982 corresponding kept section when applying a relocation.
16983
e4e5049b
CS
169842008-04-30 Craig Silverstein <csilvers@google.com>
16985
16986 * dwarf_reader.cc (next_generation_count): New static var.
16987 (Addr2line_cache_entry): New struct.
16988 (addr2line_cache): New static var.
16989 (Dwarf_line_info::one_addr2line): Added caching.
16990 (Dwarf_line_info::clear_addr2line_cache): New function.
16991 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16992 cache-size parameter.
16993 (Dwarf_line_info::one_addr2line_cache): New function.
16994 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16995 new cache-size argument to one_addr2line(), and clear cache.
16996
d09e9154
CC
169972008-04-28 Cary Coutant <ccoutant@google.com>
16998
16999 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17000 R_386_PC8 relocations.
17001
7ef73768
ILT
170022008-04-23 Ian Lance Taylor <iant@google.com>
17003
55438702
ILT
17004 * object.cc (Sized_relobj::include_section_group): Check for
17005 invalid section group.
17006
c165fb93
ILT
17007 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17008 header size.
17009
7ef73768
ILT
17010 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17011 than read for file header.
17012 * archive.cc (Archive::include_member): Likewise.
17013
6194aaab
L
170142008-04-23 Paolo Bonzini <bonzini@gnu.org>
17015
17016 * aclocal.m4: Regenerate.
17017 * configure: Regenerate.
17018
d491d34e
ILT
170192008-04-19 Ian Lance Taylor <iant@google.com>
17020
5ea2bac6
ILT
17021 * version.cc (version_string): Bump to 1.6.
17022
7bc3e21a
ILT
17023 * testsuite/Makefile.am (many_sections_r_test): New target.
17024 (many_sections_r_test_SOURCES): Remove.
17025 (many_sections_r_test_DEPENDENCIES): Remove.
17026 (many_sections_r_test_LDFLAGS): Remove.
17027 (many_sections_r_test_LDADD): Remove.
17028
7fcd3aa9
ILT
17029 * object.cc (Sized_relobj::do_add_symbols): Always pass
17030 local_symbol_count_ to add_from_relobj.
17031
4c94d6ae
ILT
17032 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17033 every thousand variables.
17034 * testsuite/Makefile.in: Rebuild.
17035
d491d34e
ILT
17036 * object.cc (Xindex::initialize_symtab_xindex): New function.
17037 (Xindex::read_symtab_xindex): New function.
17038 (Xindex::sym_xindex_to_shndx): New function.
17039 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17040 available.
17041 (Sized_relobj::do_initialize_xindex): New function.
17042 (Sized_relobj::do_read_symbols): Adjust section links.
17043 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17044 parameter. Change all callers.
17045 (Sized_relobj::include_section_group): Adjust section links and
17046 symbol section indexes.
17047 (Sized_relobj::do_layout): Adjust section links.
17048 (Sized_relobj::do_count_local_symbols): Adjust section links and
17049 symbol section indexes.
17050 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17051 ordinary and special symbols.
17052 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17053 dynsym_xindex parameters. Change all callers. Adjust section
17054 links. Use SHN_XINDEX when needed.
17055 (Sized_relobj::get_symbol_location_info): Adjust section links.
17056 Don't get fooled by special symbols.
17057 * object.h (class Xindex): Define.
17058 (class Object): Add xindex_ parameter. Declare virtual functoin
17059 do_initialize_xindex.
17060 (Object::adjust_sym_shndx): New function.
17061 (Object::set_xindex): New protected function.
17062 (class Symbol_value): Add is_ordinary_shndx_ field.
17063 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17064 (Symbol_value::value): Assert ordinary section.
17065 (Symbol_value::initialize_input_to_output_map): Likewise.
17066 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17067 Change all callers.
17068 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17069 all callers.
17070 (class Sized_relobj): Update declarations.
17071 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17072 parameter. Change all callers.
17073 (Sized_relobj::adjust_shndx): New function.
17074 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17075 field.
17076 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17077 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17078 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17079 (Sized_dynobj::read_dynsym_section): Adjust section links.
17080 (Sized_dynobj::read_dynamic): Likewise.
17081 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17082 section links.
17083 (Sized_dynobj::do_initialize_xindex): New function.
17084 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17085 do_initialize_xindex.
17086 (Sized_dynobj::adjust_shndx): New function.
17087 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17088 dynsym_xindex_ fields.
17089 (Layout::finalize): Add a call to set_section_indexes before
17090 creating the symtab sections.
17091 (Layout::set_section_indexes): Don't do anything if the section
17092 already has a section index.
17093 (Layout::create_symtab_sections): Add shnum parameter. Change
17094 caller. Create .symtab_shndx section if needed.
17095 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17096 caller.
17097 (Layout::allocated_output_section_count): New function.
17098 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17099 needed.
17100 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17101 fields. Update declarations.
17102 (Layout::symtab_xindex): New function.
17103 (Layout::dynsym_xindex): New function.
17104 (class Write_symbols_task): Add layout_ field.
17105 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17106 Change caller.
17107 * output.cc (Output_section_headers::Output_section_headers): Add
17108 shstrtab_section parameter. Change all callers.
17109 (Output_section_headers::do_sized_write): Store overflow values
17110 for section count and section string table section index in
17111 section header zero.
17112 (Output_file_header::do_sized_write): Check for overflow of
17113 section count and section string table section index.
17114 (Output_symtab_xindex::do_write): New function.
17115 (Output_symtab_xindex::endian_do_write): New function.
17116 * output.h (class Output_section_headers): Add shstrtab_section_.
17117 Update declarations.
17118 (class Output_symtab_xindex): Define.
17119 (Output_section::has_out_shndx): New function.
17120 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17121 field.
17122 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17123 Change all callers.
17124 (Sized_symbol::init): Likewise.
17125 (Symbol::output_section): Check for ordinary symbol.
17126 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17127 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17128 callers.
17129 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17130 Change all callers. Simplify handling of symbols from sections
17131 not included in the link.
17132 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17133 distinction.
17134 (Weak_alias_sorter::operator()): Assert that symbols are
17135 ordinary.
17136 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17137 distinction.
17138 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17139 parameters. Change all callers.
17140 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17141 symbol distinction. Use SHN_XINDEX when needed.
17142 (Symbol_table::write_section_symbol): Add symtab_xindex
17143 parameter. Change all callers.
17144 (Symbol_table::sized_write_section_symbol): Likewise. Use
17145 SHN_XINDEX when needed.
17146 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17147 declarations.
17148 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17149 (Symbol::is_defined): Check is_ordinary.
17150 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17151 (Symbol::is_absolute, Symbol::is_common): Likewise.
17152 (class Sized_symbol): Update declarations.
17153 (class Symbol_table): Update declarations.
17154 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17155 parameters. Change all callers.
17156 (Sized_symbol::override): Likewise.
17157 (Symbol_table::override): Likewise.
17158 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17159 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17160 is_ordinary, and orig_st_shndx parameters. Change all callers.
17161 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17162 to be in an ordinary section.
17163 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17164 object and is_ordinary parameters. Change all callers.
17165 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17166 Change all callers. Don't add undefined or non-ordinary symbols
17167 to reloc_map_.
17168 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17169 Change all callers.
17170 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17171 declarations.
17172 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17173 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17174 (Sized_relobj::relocate_sections): Likewise.
17175 * target-reloc.h (scan_relocs): Adjust section symbol index.
17176 (scan_relocatable_relocs): Likewise.
17177 * i386.cc (Scan::local): Check for ordinary symbols.
17178 * sparc.cc (Scan::local): Likewise.
17179 * x86_64.cc (Scan::local): Likewise.
17180 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17181 to symbol_section_and_value.
17182 * testsuite/many_sections_test.cc: New file.
17183 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17184 (check_PROGRAMS): Add many_sections_test.
17185 (many_sections_test_SOURCES): Define.
17186 (many_sections_test_DEPENDENCIES): Define.
17187 (many_sections_test_LDFLAGS): Define.
17188 (BUILT_SOURCES): Add many_sections_define.h.
17189 (many_sections_define.h): New target.
17190 (BUILT_SOURCES): Add many_sections_check.h.
17191 (many_sections_check.h): New target.
17192 (check_PROGRAMS): Add many_sections_r_test.
17193 (many_sections_r_test_SOURCES): Define.
17194 (many_sections_r_test_DEPENDENCIES): Define.
17195 (many_sections_r_test_LDFLAGS): Define.
17196 (many_sections_r_test_LDADD): Define.
17197 (many_sections_r_test.o): New target.
17198 * testsuite/Makefile.in: Rebuild.
17199
c5818ff1
CC
172002008-04-17 Cary Coutant <ccoutant@google.com>
17201
17202 * errors.cc (Errors::info): New function.
17203 (gold_info): New function.
17204 * errors.h (Errors::info): New function.
17205 * gold.h (gold_info): New function.
17206 * object.cc (Input_objects::add_object): Print trace output.
17207 * options.cc (options::parse_set): New function.
17208 (General_options::parse_wrap): Deleted.
17209 (General_options::General_options): Deleted initializer.
17210 * options.h (options::String_set): New typedef.
17211 (options::parse_set): New function.
17212 (DEFINE_set): New macro.
17213 (General_options::wrap): Changed to use DEFINE_set. Changed
17214 callers of any_wrap_symbols and is_wrap_symbol.
17215 (General_options::trace, General_options::trace_symbol):
17216 New options.
17217 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17218 (General_options::wrap_symbols_): Deleted.
17219 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17220
b5be4a7c
DM
172212008-04-17 David S. Miller <davem@davemloft.net>
17222
17223 * options.cc (General_options::parse_V): New function.
17224 * options.h: Add entries for -V and -Qy.
17225
155a0dd7
ILT
172262008-04-17 Ian Lance Taylor <iant@google.com>
17227
17228 * common.cc (Symbol_table::allocate_commons): Remove options
17229 parameter. Change caller.
17230 (Symbol_table::do_allocate_commons): Remove options parameter.
17231 Change caller. Just call do_allocate_commons_list twice.
17232 (Symbol_table::do_allocate_commons_list): New function, broken out
17233 of do_allocate_commons.
17234 * common.h (class Allocate_commons_task): Remove options_ field.
17235 Update constructor.
17236 * symtab.cc (Symbol_table::Symbol_table): Initialize
17237 tls_commons_.
17238 (Symbol_table::add_from_object): Put TLS common symbols on
17239 tls_commons_ list.
17240 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17241 which are IN_OUTPUT_DATA.
17242 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17243 allocate_commons and do_allocate_commons declarations. Declare
17244 do_allocate_commons_list.
17245 * gold.cc (queue_middle_tasks): Update creation of
17246 Allocate_commons_task to not pass options.
17247 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17248 (TLS_TEST_C_FLAGS): New variable.
17249 (tls_test_c_pic.o): New target.
17250 (tls_test_shared.so): Link in tls_test_c_pic.o.
17251 (tls_test_c_pic_ie.o): New target.
17252 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17253 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17254 (tls_test_c.o): New target.
17255 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17256 (tls_pic_test_LDADD): Likewise.
17257 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17258 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17259 (tls_test_c_gnu2.o): New target.
17260 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17261 tls_test_c_gnu2.o.
17262 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17263 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17264 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17265 * testsuite/tls_test.cc: Include "config.h".
17266 (t_last): Call t11_last.
17267 * testsuite/tls_test.h (t11, t11_last): Declare.
17268 * testsuite/tls_test_c.c: New file.
17269 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17270 * configure.ac: Check for OpenMP support.
17271 * configure, config.in, Makefile.in: Rebuild.
17272 * testsuite/Makefile.in: Rebuild.
17273
edfbb029
CC
172742008-04-16 Cary Coutant <ccoutant@google.com>
17275
17276 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17277 (Target_i386::tls_base_symbol_defined_): New field.
17278 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17279 (Target_i386::Scan::global): Likewise.
17280 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17281 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17282 (Target_x86_64::tls_base_symbol_defined_): New field.
17283 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17284 (Target_x86_64::Scan::global): Likewise.
17285
f3c69fca
CC
172862008-04-16 Cary Coutant <ccoutant@google.com>
17287
17288 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17289 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17290 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17291 building shared libraries.
17292 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17293 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17294 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17295 * testsuite/Makefile.in: Rebuild.
17296 * testsuite/weak_undef.h: New file.
17297 * testsuite/weak_undef_file1.cc: Add extra test cases.
17298 * testsuite/weak_undef_file2.cc: Likewise.
17299 * testsuite/weak_undef_test.cc: Likewise.
17300
7c414435
DM
173012008-04-16 David S. Miller <davem@davemloft.net>
17302
32b769e1
DM
17303 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17304 Add issued_non_pic_error_ field. Declare check_non_pic.
17305 (Target_sparc::Scan::check_non_pic): New function.
17306 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17307 (Target_sparc::Scan::global): Likewise.
17308
11936fb1
DM
17309 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17310 * configure: Rebuild.
17311
7c414435
DM
17312 * options.h (DEFINE_enable): New macro.
17313 (new_dtags): New enable option.
17314 (initfirst, interpose, loadfltr, nodefaultlib,
17315 nodelete, nodlopen, nodump): New -z options.
17316 * layout.cc (Layout:finish_dynamic_section): If new
17317 dtags enabled, emit DT_RUNPATH. Also, emit a
17318 DT_FLAGS_1 containing any specified -z flags.
17319
85c7bf8b
ILT
173202008-04-16 Ian Lance Taylor <iant@google.com>
17321
12c0daef
ILT
17322 * copy-relocs.cc: New file.
17323 * copy-relocs.h: New file.
17324 * reloc.cc: Remove Copy_relocs code.
17325 * reloc.h: Likewise.
17326 * reloc-types.h (struct Reloc_types) [both versions]: Add
17327 get_reloc_addend_noerror.
17328 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17329 variants of add_global which take an addend which must be zero.
17330 * i386.cc: Include "copy-relocs.h".
17331 (class Target_i386): Change type of copy_relocs_ to variable,
17332 update initializer.
17333 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17334 Change all callers.
17335 (Target_i386::do_finalize_sections): Change handling of
17336 copy_relocs_.
17337 * sparc.cc: Include "copy-relocs.h".
17338 (class Target_sparc): Change type of copy_relocs_ to variable,
17339 update initializer.
17340 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17341 Change all callers.
17342 (Target_sparc::do_finalize_sections): Change handling of
17343 copy_relocs_.
17344 * x86_64.cc: Include "copy-relocs.h".
17345 (class Target_x86_64): Change type of copy_relocs_ to variable,
17346 update initializer.
17347 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17348 class. Change all callers.
17349 (Target_x86_64::do_finalize_sections): Change handling of
17350 copy_relocs_.
17351 * Makefile.am (CCFILES): Add copy-relocs.cc.
17352 (HFILES): Add copy-relocs.h.
17353
4f4995b6
ILT
17354 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17355
85c7bf8b
ILT
17356 * testsuite/script_test_4.sh: Permit leading zeroes.
17357
4f2a9edd
ILT
173582008-04-15 Ian Lance Taylor <iant@google.com>
17359
e6188289
ILT
17360 * script-sections.cc (Script_sections::create_segments): Use
17361 header_size_adjustment even when there is enough room for the
17362 headers.
17363 * testsuite/script_test_4.sh: New file.
17364 * testsuite/script_test_4.t: New file.
17365 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17366 (check_DATA): Add script_test_4.stdout.
17367 (MOSTLYCLEANFILES): Likewise.
17368 (script_test_4): New target.
17369 (script_test_4.stdout): New target.
17370 * testsuite/Makefile.in: Rebuild.
17371
4f2a9edd
ILT
17372 * sparc.cc: Add definitions for Output_data_plt_sparc class
17373 constants.
17374
f5314dd5
DM
173752008-04-14 David S. Miller <davem@davemloft.net>
17376
17377 * sparc.cc: New file.
17378 * Makefile.am (TARGETSOURCES): Add sparc.cc
17379 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17380 * configure.tgt: Document targ_extra_size and
17381 targ_extra_big_endian. Add entries for sparc-* and
17382 sparc64-*.
17383 * configure.ac: Handle targ_extra_size and
17384 targ_extra_big_endian.
17385 * Makefile.in: Rebuild.
17386 * configure: Likewise.
17387 * po/POTFILES.in: Likewise.
17388 * po/gold.pot: Likewise.
17389
154e0e9a
ILT
173902008-04-14 Ian Lance Taylor <iant@google.com>
17391
17392 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17393 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17394 in the name/type/flags to section mapping. Don't call
17395 allocate_output_section.
17396 (Layout::choose_output_section): Change parameter from adjust_name
17397 to is_input_section. Don't permit input sections after sections
17398 are attached to segments. Don't call allocate_output_section.
17399 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17400 not write_enable_output_section.
17401 (Layout::make_output_section): Don't push to
17402 unattached_section_list_ nor call attach_to_segment. Call
17403 attach_section_to_segment if sections are attached.
17404 (Layout::attach_sections_to_segments): New function.
17405 (Layout::attach_section_to_segment): New function.
17406 (Layout::attach_allocated_section_to_segment): Rename from
17407 attach_to_segment. Remove flags parameter.
17408 (Layout::allocate_output_section): Remove function.
17409 (Layout::write_enable_output_section): Remove function.
17410 * layout.h (class Layout): Update for above changes. Add new
17411 field sections_are_attached_.
17412 * output.h (Output_section::update_flags_for_input_section): New
17413 function.
17414 * output.cc (Output_section::add_input_section): Call
17415 update_flags_for_input_section.
17416 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17417
009a67a2
CC
174182008-04-11 Cary Coutant <ccoutant@google.com>
17419
17420 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17421 thought unnecessary.
17422 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17423
759b1a24
ILT
174242008-04-11 Ian Lance Taylor <iant@google.com>
17425
17426 * output.h (class Output_section_data): Remove inline definition
17427 of set_addralign.
17428 * output.cc (Output_section_data::set_addralign): New function.
17429
c2b45e22
CC
174302008-04-11 Cary Coutant <ccoutant@google.com>
17431
17432 Add support for TLS descriptors for i386 and x86_64.
17433 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17434 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17435 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17436 GOT_TYPE_TLS_DESC.
17437 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17438 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17439 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17440 relocations.
17441 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17442 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17443 Fix problem with initial-exec relocations.
17444 (Target_i386::Relocate::relocate_tls): Likewise.
17445 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17446 relaxation.
17447 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17448 support for section-plus-offset dynamic table entries.
17449 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17450 (Output_data_dynamic::Dynamic_entry): Add support for
17451 section-plus-offset dynamic table entries.
17452 (Output_data_dynamic::Classification): Likewise.
17453 (Output_data_dynamic::classification_): Renamed offset_.
17454 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17455 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17456 (Target_x86_64::make_plt_section): New function.
17457 (Target_x86_64::reserve_tlsdesc_entries): New function.
17458 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17459 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17460 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17461 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17462 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17463 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17464 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17465 add extra PLT entry for TLS descriptors.
17466 (Output_data_plt_x86_64::got_): New field.
17467 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17468 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17469 fields.
17470 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17471 descriptors.
17472 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17473 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17474 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17475 R_386_TLS_DESC_CALL relocations.
17476 (Target_x86_64::Scan::global): Likewise.
17477 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17478 for TLS descriptors.
17479 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17480 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17481 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17482 GD-to-IE relaxation.
17483 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17484 and TLS_DESCRIPTORS.
17485 * Makefile.in: Rebuild.
17486 * configure: Rebuild.
17487 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17488 (tls_test_shared2.so): New target.
17489 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17490 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17491 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17492 (tls_shared_gd_to_ie_test_LDADD): New variable.
17493 (tls_shared_gnu2_gd_to_ie_test): New target.
17494 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17495 New targets.
17496 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17497 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17498 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17499 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17500 (tls_shared_gnu2_test): New target.
17501 (tls_test_gnu2_shared.so): New target.
17502 (tls_shared_gnu2_test_SOURCES): New variable.
17503 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17504 (tls_shared_gnu2_test_LDFLAGS): New variable.
17505 (tls_shared_gnu2_test_LDADD): New variable.
17506 * testsuite/Makefile.in: Rebuild.
17507 * testsuite/Makefile.
17508
83bfb6b7
ILT
175092008-04-11 Ian Lance Taylor <iant@google.com>
17510
17511 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17512 justsyms.t.
17513 * testsuite/Makefile.in: Rebuild.
17514
17515 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17516 long.
17517 * testsuite/script_test_2.cc (main): Adjust test.
17518
706e1f5e
ILT
175192008-04-11 David S. Miller <davem@davemloft.net>
17520 Ian Lance Taylor <iant@google.com>
17521
17522 * options.h (General_options): Add entries for '-Y' and
17523 '-relax'.
17524 * options.cc (General_options:finalize): If -Y was used, add those
17525 entries to the library path instead of the default "/lib" and
17526 "/usr/lib".
17527
7c98e6bb
DM
175282008-04-11 David S. Miller <davem@davemloft.net>
17529
17530 * testsuite/justsyms.t: Start at 0x100.
17531 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17532 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17533 long.
17534 * testsuite/script_test_2.cc: Adjust string and section length
17535 checks.
7c98e6bb 17536
99a37bfd
ILT
175372008-04-09 Ian Lance Taylor <iant@google.com>
17538
2cefc357
ILT
17539 PR gold/5996
17540 * script-sections.cc (Sections_element::allocate_to_segment): Add
17541 orphan parameter.
17542 (Output_section_definition::allocate_to_segment): Likewise.
17543 (Orphan_output_section::allocate_to_segment): Likewise.
17544 (Script_sections::attach_sections_using_phdrs_clause): Don't
17545 propagate non-PT_LOAD segments to orphan sections.
17546 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17547 readelf rather than objdump.
17548 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17549 .interp section and PT_INTERP segment are the same size.
17550 * testsuite/Makefile.in: Rebuild.
17551
99a37bfd
ILT
17552 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17553 aliases for symbols defined in the same object.
17554 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17555 (weak_alias_test_SOURCES): New variable.
17556 (weak_alias_test_DEPENDENCIES): New variable.
17557 (weak_alias_test_LDFLAGS): New variable.
17558 (weak_alias_test_LDADD): New variable.
17559 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17560 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17561 (weak_alias_test_3.o): New target.
17562 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17563 * testsuite/weak_alias_test_main.cc: New file.
17564 * testsuite/weak_alias_test_1.cc: New file.
17565 * testsuite/weak_alias_test_2.cc: New file.
17566 * testsuite/weak_alias_test_3.cc: New file.
17567
780e49c5
ILT
175682008-04-08 Ian Lance Taylor <iant@google.com>
17569
cdb0b8f5
ILT
17570 * options.h (class General_options): Add --noinhibit-exec option.
17571 * main.cc (main): Check --noinhibit-exec.
17572
0864d551
ILT
17573 * options.h (class General_options): Define --wrap as a special
17574 option. Add wrap_symbols_ field.
17575 (General_options::any_wrap_symbols): New function.
17576 (General_options::is_wrap_symbol): New function.
17577 * options.cc (General_options::parse_wrap): New function.
17578 (General_options::General_options): Initialize wrap_symbols_.
17579 * symtab.cc (Symbol_table::wrap_symbol): New function.
17580 (Symbol_table::add_from_object): Handle --wrap.
17581 * symtab.h (class Symbol_table): Declare wrap_symbol.
17582 * target.h (Target::wrap_char): New function.
17583 (Target::Target_info): Add wrap_char field.
17584 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17585 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17586 * testsuite/testfile.cc (Target_test::test_target_info):
17587 Likewise.
17588
789aa6de
ILT
17589 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17590 there is one.
17591
2c38906f
ILT
17592 * layout.h (class Layout): Add added_eh_frame_data_ field.
17593 * layout.cc (Layout::Layout): Initialize new field.
17594 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17595 output section until we find a section we merged successfully.
17596 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17597 that the size be non-zero.
17598
780e49c5
ILT
17599 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17600 qualifier.
17601
7fcd0256
ILT
176022008-04-08 Craig Silverstein <csilvers@google.com>
17603
17604 * configure.ac: Export new conditional variable HAVE_ZLIB.
17605 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17606 on HAVE_ZLIB.
17607 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17608 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17609
6835af53
ILT
176102008-04-07 Ian Lance Taylor <iant@google.com>
17611
e24f324c
ILT
17612 * version.cc (version_string): Set to "1.5".
17613
a036edd8
ILT
17614 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17615 Add issued_non_pic_error_ field. Declare check_non_pic.
17616 (Target_x86_64::Scan::check_non_pic): New function.
17617 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17618 (Target_x86_64::Scan::global): Likewise.
17619
624f8810
ILT
17620 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17621 addend parameter. Change caller. Handle merge sections.
17622 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17623 Address to Addend. Don't add in the result of
17624 local_section_offset, pass down the addend and use the returned
17625 value.
17626 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17627 Update declarations of local_section_offset and symbol_value.
17628 * testsuite/two_file_test_1.cc (t18): New function.
17629 * testsuite/two_file_test_2.cc (f18): New function.
17630 * testsuite/two_file_test_main.cc (main): Call t18.
17631 * testsuite/two_file_test.h (t18, f18): Declare.
17632
6835af53
ILT
17633 * configure.ac: Don't test for objdump, c++filt, or readelf.
17634 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17635 conditionals.
17636 (TEST_READELF): New variable.
17637 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17638 (check_PROGRAMS): Add two_file_strip_test.
17639 (two_file_strip_test): New target.
17640 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17641 (two_file_same_shared_strip_test_SOURCES): New variable.
17642 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17643 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17644 (two_file_same_shared_strip_test_LDADD): New variable.
17645 (two_file_shared_strip.so): New target.
17646 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17647 (ver_test_5.syms, ver_test_7.syms): Likewise.
17648 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17649 (strip_test_3.stdout): Use TEST_OBJDUMP.
17650 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17651
86925eef
CC
176522008-04-04 Cary Coutant <ccoutant@google.com>
17653
17654 * symtab.h (Symbol::is_weak_undefined): New function.
17655 (Symbol::is_strong_undefined): New function.
17656 (Symbol::is_absolute): New function.
17657 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17658 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17659 absolute symbols.
17660 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17661 (weak_undef_test): New target.
17662 * testsuite/Makefile.in: Rebuild.
17663 * testsuite/weak_undef_file1.cc: New file.
17664 * testsuite/weak_undef_file2.cc: New file.
17665 * testsuite/weak_undef_test.cc: New file.
17666
126f3ece
ILT
176672008-04-03 Craig Silverstein <csilvers@google.com>
17668
17669 * compressed_output.h (class Output_compressed_section): Use
17670 unsigned buffer.
17671 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17672 add zlib header.
17673 (zlib_compressed_suffix): Removed.
17674 (Output_compressed_section::set_final_data_size): Use unsigned
17675 buffers.
17676 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17677 Fix linker invocation.
17678 (flagstest_o_specialfile_and_compress_debug_sections):
17679 Likewise.
17680 * testsuite/Makefile.in: Regenerated.
17681
deae2a14
DM
176822008-04-02 David S. Miller <davem@davemloft.net>
17683
17684 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17685 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17686
70752818
ILT
176872008-04-02 Craig Silverstein <csilvers@google.com>
17688
17689 * TODO: New file.
17690
39d0cb0e
ILT
176912008-04-02 Ian Lance Taylor <iant@google.com>
17692
17693 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17694 parameters. Update for new key type to views_. Change all
17695 callers.
17696 (File_read::read): Adjust for byteshift in returned view.
17697 (File_read::add_view): New function, broken out of
17698 find_and_make_view.
17699 (File_read::make_view): New function, broken out of
17700 find_and_make_view.
17701 (File_read::find_or_make_view): Add offset and aligned
17702 parameters. Rewrite accordingly. Change all callers.
17703 (File_read::get_view): Add offset and aligned parameters. Adjust
17704 for byteshift in return value.
17705 (File_read::get_lasting_view): Likewise.
17706 * fileread.h (class File_read): Update declarations.
17707 (class File_read::View): Add byteshift_ field. Add byteshift to
17708 constructor. Add byteshift method.
17709 * archive.h (Archive::clear_uncached_views): New function.
17710 (Archive::get_view): Add aligned parameter. Change all callers.
17711 * object.h (Object::get_view): Add aligned parameter. Change all
17712 callers.
17713 (Object::get_lasting_view): Likewise.
17714
17715 * fileread.cc (File_read::release): Don't call clear_views if
17716 there are multiple objects.
17717 * fileread.h (File_read::clear_uncached_views): New function.
17718 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17719 on the archive.
17720
a1207466
CC
177212008-03-31 Cary Coutant <ccoutant@google.com>
17722
17723 Add thin archive support.
17724 * archive.cc (Archive::armagt): New const.
17725 (Archive::setup): Remove task parameter and calls to unlock.
17726 (Archive::unlock_nested_archives): New function.
17727 (Archive::read_header): Add nested_off parameter. Change
17728 all callers.
17729 (Archive::interpret_header): Likewise.
17730 (Archive::include_all_members): Change to handle thin
17731 archives.
17732 (Archive::include_member): Likewise.
17733 * archive.h (Archive::Archive): Add new parameters and
17734 initializers.
17735 (Archive::armagt): New const.
17736 (Archive::setup): Remove task parameter.
17737 (Archive::unlock_nested_archives): New function.
17738 (Archive::read_header): Add nested_off parameter.
17739 (Archive::interpret_header): Likewise.
17740 (Archive::Nested_archive_table): New typedef.
17741 (Archive::is_thin_archive_): New field.
17742 (Archive::nested_archives_): New field.
17743 (Archive::options_): New field.
17744 (Archive::dirpath_): New field.
17745 (Archive::task_): New field.
17746 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17747 for thin archives. Pass additional parameters to
17748 Archive::Archive. Unlock the archive file after calling
17749 Archive::setup.
cd536b21 17750
479f6503
ILT
177512008-03-29 Ian Lance Taylor <iant@google.com>
17752
686c8caf
ILT
17753 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17754 version symbol to be local.
17755 * testsuite/ver_test_4.sh: New file.
17756 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17757 (check_DATA): Add ver_test_4.syms.
17758 (ver_test_4.syms): New target.
17759 * testsuite/Makefile.in: Rebuild.
17760
ab794b6b
ILT
17761 * output.cc
17762 (Output_section::Input_section_sort_entry::has_priority): New
17763 function.
17764 (Output_section::Input_section_sort_entry::match_file_name): New
17765 function.
17766 (Output_section::Input_section_sort_entry::match_section_name):
17767 Remove.
17768 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17769 Remove.
17770 (Output_section::Input_section_sort_entry::match_section_file):
17771 Remove.
17772 (Output_section::Input_section_sort_compare::operator()): Rewrite
17773 using new Input_section_sort_entry functions. Sort crtbegin and
17774 crtend first. Sort sections with no priority before sections with
17775 a priority.
17776 * testsuite/initpri1.c (d3): Check j != 4.
17777 (cd5): New constructor/destructor function.
17778 (main): Check j != 2.
17779
479f6503
ILT
17780 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17781 new symbol when resolving, don't call set_is_default.
17782 * testsuite/ver_test_7.cc: New file.
17783 * testsuite/ver_test_7.sh: New file.
17784 * testsuite/Makefile.am (ver_test_7.so): New target.
17785 (ver_test_7.o): New target.
17786 (check_SCRIPTS): Add ver_test_7.sh.
17787 (check_DATA): Add ver_test_7.syms.
17788 (ver_test_7.syms): New target.
17789
2fd32231
ILT
177902008-03-28 Ian Lance Taylor <iant@google.com>
17791
17792 * layout.cc (Layout::layout): If we see an input section with a
17793 name that needs sorting, set the must_sort flag for the output
17794 section.
17795 (Layout::make_output_section): If the name of the output section
17796 indicates that it might require sorting, set the may_sort flag.
17797 * output.h (Output_section::may_sort_attached_input_sections): New
17798 function.
17799 (Output_section::set_may_sort_attached_input_sections): New
17800 function.
17801 (Output_section::must_sort_attached_input_sections): New
17802 function.
17803 (Output_section::set_must_sort_attached_input_sections): New
17804 function.
17805 (class Output_section): Declare Input_section_sort_entry. Define
17806 Input_section_sort_compare. Declare
17807 sort_attached_input_sections. Add new fields:
17808 may_sort_attached_input_sections_,
17809 must_sort_attached_input_sections_,
17810 attached_input_sections_are_sorted_.
17811 * output.cc (Output_section::Output_section): Initialize new
17812 fields.
17813 (Output_section::add_input_section): Add an entry to
17814 input_sections_ if may_sort or must_sort are true.
17815 (Output_section::set_final_data_size): Call
17816 sort_attached_input_sections if necessary.
17817 (Output_section::Input_section_sort_entry): Define new class.
17818 (Output_section::Input_section_sort_compare::operator()): New
17819 function.
17820 (Output_section::sort_attached_input_sections): New function.
17821 * configure.ac: Check whether the compiler supports constructor
17822 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17823 * testsuite/initpri1.c: New file.
17824 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17825 CONSTRUCTOR_PRIORITY.
17826 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17827 (initpri1_LDFLAGS): New variable.
17828 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17829
18e6b24e
ILT
178302008-03-27 Ian Lance Taylor <iant@google.com>
17831
49bdd526
ILT
17832 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17833 * testsuite/common_test_1.c: New file.
17834 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17835 (common_test_1_SOURCES): New variable.
17836 (common_test_1_DEPENDENCIES): New variable.
17837 (common_test_1_LDFLAGS): New variable.
17838
18e6b24e
ILT
17839 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17840 and commons_ correctly when NAME/VERSION does not override
17841 NAME/NULL.
17842 * testsuite/ver_test_6.c: New file.
17843 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17844 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17845 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17846
04bf7072
ILT
178472008-03-26 Ian Lance Taylor <iant@google.com>
17848
5871526f
ILT
17849 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17850 of an undefined symbol from a version script.
17851 * testsuite/Makefile.am (ver_test_5.so): New target.
17852 (ver_test_5.o): New target.
17853 (check_SCRIPTS): Add ver_test_5.sh.
17854 (check_DATA): Add ver_test_5.syms.
17855 (ver_test_5.syms): New target.
17856 * testsuite/ver_test_5.cc: New file.
17857 * testsuite/ver_test_5.script: New file.
17858 * testsuite/ver_test_5.sh: New file.
17859 * Makefile.in, testsuite/Makefile.in: Rebuild.
17860
04bf7072
ILT
17861 PR gold/5986
17862 Fix problems building gold with gcc 4.3.0.
17863 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17864 (gold_error_at_location, gold_warning_at_location): Use it.
17865 * configure.ac: Check whether we can compile and use a template
17866 function with a printf attribute.
17867 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17868 when jumping over bytes.
17869 * object.cc: Instantiate Object::read_section_data.
17870 * debug.h: Include <cstring>
17871 * dwarf_reader.cc: Include <algorithm>
17872 * main.cc: Include <cstring>.
17873 * options.cc: Include <cstring>.
17874 * output.cc: Include <cstring>.
17875 * script.cc: Include <cstring>.
17876 * script.h: Include <string>.
17877 * symtab.cc: Include <cstring> and <algorithm>.
17878 * target-select.cc: Include <cstring>.
17879 * version.cc: Include <string>.
17880 * testsuite/testmain.cc: Include <cstdlib>.
17881 * configure, config.in: Rebuild.
17882
874c5b28
ILT
178832008-03-25 Ian Lance Taylor <iant@google.com>
17884
819d6c3a
ILT
17885 * options.cc: Include "../bfd/bfdver.h".
17886 (options::help): Print bug reporting address.
17887
f4b2c6f5
ILT
17888 * version.cc (print_version): Adjust output for current value of
17889 BFD_VERSION_STRING.
17890
17891 * NEWS: New file.
17892
e96caa79
ILT
17893 * options.cc (options::help): Print list of supported targets.
17894 * target-select.h: Include <vector>.
17895 (class Target_selector): Make machine_, size_, and is_big_endian_
17896 fields const. Add bfd_name_ and instantiated_target_ fields.
17897 (Target_selector::Target_selector): Add bfd_name parameter.
17898 (Target_selector::recognize): Make non-virtual, call
17899 do_recognize.
17900 (Target_selector::recognize_by_name): Make non-virtual, call
17901 do_recognize_by_name.
17902 (Target_selector::supported_names): New function.
17903 (Target_selector::bfd_name): New function.
17904 (Target_selector::do_instantiate_target): New pure virtual
17905 function.
17906 (Target_selector::do_recognize): New virtual function.
17907 (Target_selector::do_recognize_by_name): New virtual function.
17908 (Target_selector::instantiate_target): New private function.
17909 (supported_target_names): Declare.
17910 * target-select.cc (Target_selector::Target_selector): Update for
17911 new parameter and fields.
17912 (select_target_by_name): Check that the name matches before
17913 calling recognize_by_name.
17914 (supported_target_names): New function.
17915 * i386.cc (class Target_selector_i386): Update Target_selector
17916 constructor call. Remove recognize and recognize_by_name. Add
17917 do_instantiate_target.
17918 * x86_64.cc (class Target_selector_x86_64): Likewise.
17919 * testsuite/testfile.cc (class Target_selector_test): Update for
17920 changes to Target_selector.
17921
874c5b28
ILT
17922 * README: Rewrite, with some notes on unsupported features.
17923
0a65a3a7
CC
179242008-03-24 Cary Coutant <ccoutant@google.com>
17925
17926 * i386.cc (Target_i386::Got_type): New enum declaration.
17927 (Target_i386::Scan::local): Updated callers of Output_data_got
17928 member functions.
17929 (Target_i386::Scan::global): Likewise.
17930 (Target_i386::Relocate::relocate): Likewise.
17931 (Target_i386::Relocate::relocate_tls): Likewise.
17932 * object.h (Got_offset_list): New class.
17933 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17934 (Sized_relobj::local_got_offset): Likewise.
17935 (Sized_relobj::set_local_got_offset): Likewise.
17936 (Sized_relobj::local_has_tls_got_offset): Removed.
17937 (Sized_relobj::local_tls_got_offset): Removed.
17938 (Sized_relobj::set_local_tls_got_offset): Removed.
17939 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17940 * output.cc (Output_data_got::add_global): Added got_type parameter.
17941 (Output_data_got::add_global_with_rel): Likewise.
17942 (Output_data_got::add_global_with_rela): Likewise.
17943 (Output_data_got::add_global_pair_with_rel): New function.
17944 (Output_data_got::add_global_pair_with_rela): New function.
17945 (Output_data_got::add_local): Added got_type parameter.
17946 (Output_data_got::add_local_with_rel): Likewise.
17947 (Output_data_got::add_local_with_rela): Likewise.
17948 (Output_data_got::add_local_pair_with_rel): New function.
17949 (Output_data_got::add_local_pair_with_rela): New function.
17950 (Output_data_got::add_global_tls): Removed.
17951 (Output_data_got::add_global_tls_with_rel): Removed.
17952 (Output_data_got::add_global_tls_with_rela): Removed.
17953 (Output_data_got::add_local_tls): Removed.
17954 (Output_data_got::add_local_tls_with_rel): Removed.
17955 (Output_data_got::add_local_tls_with_rela): Removed.
17956 * output.h (Output_data_got::add_global): Added got_type parameter.
17957 (Output_data_got::add_global_with_rel): Likewise.
17958 (Output_data_got::add_global_with_rela): Likewise.
17959 (Output_data_got::add_global_pair_with_rel): New function.
17960 (Output_data_got::add_global_pair_with_rela): New function.
17961 (Output_data_got::add_local): Added got_type parameter.
17962 (Output_data_got::add_local_with_rel): Likewise.
17963 (Output_data_got::add_local_with_rela): Likewise.
17964 (Output_data_got::add_local_pair_with_rel): New function.
17965 (Output_data_got::add_local_pair_with_rela): New function.
17966 (Output_data_got::add_global_tls): Removed.
17967 (Output_data_got::add_global_tls_with_rel): Removed.
17968 (Output_data_got::add_global_tls_with_rela): Removed.
17969 (Output_data_got::add_local_tls): Removed.
17970 (Output_data_got::add_local_tls_with_rel): Removed.
17971 (Output_data_got::add_local_tls_with_rela): Removed.
17972 * resolve.cc (Symbol::override_base_with_special): Removed
17973 reference to has_got_offset_ field.
17974 * symtab.cc (Symbol::init_fields): Replaced initialization
17975 of got_offset_ with got_offsets_. Removed initialization
17976 of has_got_offset_
53fcba31 17977 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17978 (Symbol::got_offset): Likewise.
17979 (Symbol::set_got_offset): Likewise.
17980 (Symbol::has_tls_got_offset): Removed.
17981 (Symbol::tls_got_offset): Removed.
17982 (Symbol::set_tls_got_offset): Removed.
17983 (Symbol::got_offset_): Removed.
17984 (Symbol::tls_mod_got_offset_): Removed.
17985 (Symbol::tls_pair_got_offset_): Removed.
17986 (Symbol::got_offsets_): New field.
17987 (Symbol::has_got_offset): Removed.
17988 (Symbol::has_tls_mod_got_offset): Removed.
17989 (Symbol::has_tls_pair_got_offset): Removed.
17990 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17991 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17992 member functions.
17993 (Target_x86_64::Scan::global): Likewise.
17994 (Target_x86_64::Relocate::relocate): Likewise.
17995 (Target_x86_64::Relocate::relocate_tls): Likewise.
17996
bd52eafb
BE
179972008-03-25 Ben Elliston <bje@au.ibm.com>
17998
17999 * yyscript.y: Fix spelling error in comment.
18000
8b105e34
ILT
180012008-03-24 Ian Lance Taylor <iant@google.com>
18002
8ed814a9
ILT
18003 * options.h (class General_options): Define build_id option.
18004 * layout.h (class Layout): Declare write_build_id, create_note,
18005 create_build_id. Add build_id_note_ member.
18006 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18007 "libiberty.h", "md5.h", "sha1.h".
18008 (Layout::Layout): Initialize eh_frame_data_,
18009 eh_frame_hdr_section_, and build_id_note_.
18010 (Layout::finalize): Call create_build_id.
18011 (Layout::create_note): New function, broken out of
18012 Layout::create_gold_note.
18013 (Layout::create_gold_note): Call create_note.
18014 (Layout::create_build_id): New function.
18015 (Layout::write_build_id): New function.
18016 (Close_task_runner::run): Call write_build_id.
18017
8b105e34
ILT
18018 * x86_64.cc: Correct license to GPLv3.
18019
086a1841
ILT
180202008-03-23 Ian Lance Taylor <iant@google.com>
18021
18022 * options.cc: Include "demangle.h".
18023 (parse_optional_string): New function.
18024 (parse_long_option): Handle takes_optional_argument.
18025 (parse_short_option): Update dash_z initializer. Handle
18026 takes_optional_argument.
18027 (General_options::General_options): Initialize do_demangle_.
18028 (General_options::finalize): Set do_demangle_. Handle demangling
18029 style.
18030 * options.h (parse_optional_string): Declare.
18031 (struct One_option): Add optional_arg field. Update constructor.
18032 Update call constructor calls. Add takes_optional_argument
18033 function.
18034 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18035 (DEFINE_optional_string): Define.
18036 (General_options::demangle): Change from DEFINE_bool to
18037 DEFINE_optional_string.
18038 (General_options::no_demangle): New function.
18039 (General_options::do_demangle): New function.
18040 (General_options::set_do_demangle): New function.
18041 (General_options::execstack_status_): Move definition to end of
18042 class definition.
18043 (General_options::static_): Likewise.
18044 (General_options::do_demangle_): New field.
18045 * object.cc (big_endian>::get_symbol_location_info): Call
18046 Options::do_demangle, not Options::demangle.
18047 * symtab.cc (demangle): Likewise.
18048
cbb93e63
ILT
180492008-03-22 Ian Lance Taylor <iant@google.com>
18050
18051 * gold.h: Include <cstddef> and <sys/types.h>
18052 * options.h: Include <cstring>.
18053
ec531623
ILT
180542008-03-21 Ian Lance Taylor <iant@google.com>
18055
18056 * Added source code to GNU binutils.
752937aa 18057\f
b90efa5b 18058Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18059
18060Copying and distribution of this file, with or without modification,
18061are permitted in any medium without royalty provided the copyright
18062notice and this notice are preserved.
18063
18064Local Variables:
18065mode: change-log
18066left-margin: 8
18067fill-column: 74
18068version-control: never
18069End:
This page took 1.2831 seconds and 4 git commands to generate.